Commit e3c31633 authored by wansari's avatar wansari

D15GSUN002 updated source to fix Allocate type O and adjustment potency issue.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@101047 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 924b9f93
...@@ -452,17 +452,18 @@ public class WoFirmplanPrc extends ProcessEJB implements WoFirmplanPrcLocal,WoFi ...@@ -452,17 +452,18 @@ public class WoFirmplanPrc extends ProcessEJB implements WoFirmplanPrcLocal,WoFi
try try
{ {
//Changed by wasim on 09-03-2016 to initialize map other wise it is throwing null pointer exception [START]
stockReturnMap.put("BALANCE_QTY","0");
stockReturnMap.put("ERROR_CODE","");
stockReturnMap.put("IS_SUFFICIENT","false");
//Changed by wasim on 09-03-2016 to initialize map other wise it is throwing null pointer exception [END]
//check stock //check stock
if(workOrderBeanList.size() > 0) if(workOrderBeanList.size() > 0)
{ {
for(WorkOrderDetailBean tempWorderObj : workOrderBeanList) for(WorkOrderDetailBean tempWorderObj : workOrderBeanList)
{ {
//Changed by wasim on 09-03-2016 to initialize map other wise it is throwing null pointer exception [START]
stockReturnMap.put("BALANCE_QTY","0");
stockReturnMap.put("ERROR_CODE","");
stockReturnMap.put("IS_SUFFICIENT","false");
//Changed by wasim on 09-03-2016 to initialize map other wise it is throwing null pointer exception [END]
count++; count++;
System.out.println("["+tempWorderObj.getItemCode()+"] item main workorder xml -------------->>"+count + " Exp lev..."+tempWorderObj.getExpLev()); System.out.println("["+tempWorderObj.getItemCode()+"] item main workorder xml -------------->>"+count + " Exp lev..."+tempWorderObj.getExpLev());
sql = "select iss_criteria,controlled_yn from item where item_code = ? "; sql = "select iss_criteria,controlled_yn from item where item_code = ? ";
...@@ -746,27 +747,30 @@ public class WoFirmplanPrc extends ProcessEJB implements WoFirmplanPrcLocal,WoFi ...@@ -746,27 +747,30 @@ public class WoFirmplanPrc extends ProcessEJB implements WoFirmplanPrcLocal,WoFi
//Changed by wasim on 07-03-2016 to check alternate item in other site if main item not found [START] //Changed by wasim on 07-03-2016 to check alternate item in other site if main item not found [START]
else else
{ {
System.out.println("Checking for alternate item in other site becuase Main item not found"); System.out.println("@@Checking for alternate item in other site becuase Main item not found");
stockReturnMap = checkForAlternateItem(detailMap, conn); if(!"O".equalsIgnoreCase(detailMap.get("ALLOCATE_TYPE")) && !isSufficient)
System.out.println("Other site alternate Map return=="+stockReturnMap); {
balanceQty = Double.parseDouble(stockReturnMap.get("BALANCE_QTY")); stockReturnMap = checkForAlternateItem(detailMap, conn);
errorCodeRet = stockReturnMap.get("ERROR_CODE"); System.out.println("Other site alternate Map return=="+stockReturnMap);
isSufficient = Boolean.parseBoolean(stockReturnMap.get("IS_SUFFICIENT")); balanceQty = Double.parseDouble(stockReturnMap.get("BALANCE_QTY"));
if(errorCodeRet.length() > 0) errorCodeRet = stockReturnMap.get("ERROR_CODE");
{ isSufficient = Boolean.parseBoolean(stockReturnMap.get("IS_SUFFICIENT"));
return stockReturnMap; if(errorCodeRet.length() > 0)
} {
if(isSufficient) return stockReturnMap;
{ }
tempWorderObj.setSufficient("Y");//Changed by wasim on 07-03-2016 if(isSufficient)
break; {
} tempWorderObj.setSufficient("Y");//Changed by wasim on 07-03-2016
else break;
{ }
detailMap.put("ITEM_CODE",tempWorderObj.getItemCode()); else
detailMap.put("QUANTITY",String.valueOf(tempWorderObj.getQuantity())); {
} detailMap.put("ITEM_CODE",tempWorderObj.getItemCode());
detailMap.put("QUANTITY",String.valueOf(tempWorderObj.getQuantity()));
}
}
} }
//Changed by wasim on 07-03-2016 to check alternate item in other site if main item not found [END] //Changed by wasim on 07-03-2016 to check alternate item in other site if main item not found [END]
} }
...@@ -2235,14 +2239,45 @@ public class WoFirmplanPrc extends ProcessEJB implements WoFirmplanPrcLocal,WoFi ...@@ -2235,14 +2239,45 @@ public class WoFirmplanPrc extends ProcessEJB implements WoFirmplanPrcLocal,WoFi
} }
else else
{ {
System.out.println("in else of adj_potency null1.................."+requiredStock); System.out.println("in else of adj_potency null1.................."+requiredStock+" Avalialbe Stock="+availableStock);
//directly set upd qty as bill qty //directly set upd qty as bill qty
worderStkBeanObj.setAllocQty(requiredStock); // worderStkBeanObj.setAllocQty(requiredStock); //Commented by wasim on 31-03-2016
worderStkBeanObj.setUpdQty(requiredStock); // worderStkBeanObj.setUpdQty(requiredStock); //Commented by wasim on 31-03-2016
worderStkBeanList.set(index, worderStkBeanObj); worderStkBeanList.set(index, worderStkBeanObj);
/*worderDetailBeanObj.setUpdQty(requiredStock); /*worderDetailBeanObj.setUpdQty(requiredStock);
workOrderBeanList.set(count, worderDetailBeanObj );*/ workOrderBeanList.set(count, worderDetailBeanObj );*/
//Changed by wasim on 31-03-2016 to take care about critical item [START]
Map<String,String> stockAllocMap = new HashMap<String,String>();
if("N".equalsIgnoreCase(worderStkBeanObj.getCritItem()) && (availableStock < requiredStock))
{
System.out.println("Setting quantity as remaining avaialble");
worderStkBeanObj.setUpdQty(availableStock);
worderStkBeanObj.setAllocQty(availableStock);
stockAllocMap.put("ALLOC_QTY",""+availableStock);
}
else
{
worderStkBeanObj.setUpdQty(requiredStock);
worderStkBeanObj.setAllocQty(requiredStock);
stockAllocMap.put("ALLOC_QTY",""+requiredStock);
}
//Changed by wasim on 31-03-2016 to take care about critical item [END]
//Changed by wasim on 31-03-2016 to updated alloc_qty if adj potency is null [START]
System.out.println("Going to allocate stock if potency adj is null");
//stockAllocMap.put("ALLOC_QTY",""+requiredStock);
stockAllocMap.put("LOC_CODE", worderStkBeanObj.getLocCode());
stockAllocMap.put("ITEM_CODE",worderStkBeanObj.getItemCode());
stockAllocMap.put("SITE_CODE",worderStkBeanObj.getSiteCode());
stockAllocMap.put("LOT_NO",worderStkBeanObj.getLotNo());
stockAllocMap.put("LOT_SL",worderStkBeanObj.getLotSl());
String allocRetStr = updateStockAllocQty(stockAllocMap,conn);
System.out.println("Return after allocation="+allocRetStr);
//Changed by wasim on 31-03-2016 to updated alloc_qty if adj potency is null [END]
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment