Commit 8f0ab78b authored by ppatro's avatar ppatro

Changed by Pragyan on 2-11-12 for Master Packing


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92128 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 69802f77
...@@ -3261,6 +3261,8 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -3261,6 +3261,8 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
double itemWeight = 0.0; double itemWeight = 0.0;
double itemVolume = 0.0; double itemVolume = 0.0;
double packSize = 0.0; double packSize = 0.0;
double caseWeight = 0.0;
double caseVolume = 0.0;
//Changed by sumit on 03/08/12 start. //Changed by sumit on 03/08/12 start.
ArrayList ptcnList = new ArrayList(); ArrayList ptcnList = new ArrayList();
...@@ -3324,7 +3326,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -3324,7 +3326,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
{ {
double totalWeightCurrentshipment = 0.0; double totalWeightCurrentshipment = 0.0;
double totActVolume = 0.0, totActWeight = 0.0; double totActVolume = 0.0,totCaseVolume = 0.0,totCaseWeight = 0.0, totActWeight = 0.0;
//String sorderKey = (String)it.next();; //String sorderKey = (String)it.next();;
String sorderKey = (String)it.next(); String sorderKey = (String)it.next();
ArrayList itemMapList = (ArrayList)saleOrderWiseMap.get(sorderKey); ArrayList itemMapList = (ArrayList)saleOrderWiseMap.get(sorderKey);
...@@ -3370,6 +3372,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -3370,6 +3372,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
for(int i =0;i<itemMapListLen;i++) for(int i =0;i<itemMapListLen;i++)
{ {
double actCount = 0.0; double actCount = 0.0;
double caseCount = 0.0;
HashMap loadMap = (HashMap)itemMapList.get(i); HashMap loadMap = (HashMap)itemMapList.get(i);
itemCode = (String)loadMap.get("item_code"); itemCode = (String)loadMap.get("item_code");
lotNo = (String)loadMap.get("lot_no"); lotNo = (String)loadMap.get("lot_no");
...@@ -3378,7 +3381,9 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -3378,7 +3381,9 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
itemWeight = (Double)dataTempMap.get("ITEM_WEIGHT"); itemWeight = (Double)dataTempMap.get("ITEM_WEIGHT");
itemVolume = (Double)dataTempMap.get("ITEM_SIZE"); itemVolume = (Double)dataTempMap.get("ITEM_SIZE");
packSize = (Double)dataTempMap.get("PACK_SIZE"); packSize = (Double)dataTempMap.get("PACK_SIZE");
System.out.println("current item code"+itemCode+"]quantity["+quantity+"]itemWeight["+itemWeight+"]"); caseWeight = (Double)dataTempMap.get("PACK_WEIGHT");
caseVolume = (Double)dataTempMap.get("LOT_SIZE");
System.out.println("current item code"+itemCode+"]quantity["+quantity+"]itemWeight["+itemWeight+"]caseWeight"+caseWeight+"]caseVolume["+caseVolume+"]");
if(quantity < packSize) if(quantity < packSize)
{ {
actCount = quantity; actCount = quantity;
...@@ -3386,10 +3391,14 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -3386,10 +3391,14 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
else else
{ {
actCount = quantity % packSize; actCount = quantity % packSize;
caseCount = quantity / packSize;
} }
totActWeight = totActWeight + ( actCount * itemWeight ); totActWeight = totActWeight + ( actCount * itemWeight );
totActVolume = totActVolume + ( actCount * itemVolume ); totActVolume = totActVolume + ( actCount * itemVolume );
totCaseVolume = totCaseVolume + ( caseCount * caseVolume );
totCaseWeight = totCaseWeight + ( caseCount * caseWeight );
totalWeightCurrentshipment = totalWeightCurrentshipment + ( itemWeight * quantity); totalWeightCurrentshipment = totalWeightCurrentshipment + ( itemWeight * quantity);
System.out.println("current total weight "+totalWeightCurrentshipment+"]"); System.out.println("current total weight "+totalWeightCurrentshipment+"]");
} }
...@@ -3416,7 +3425,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -3416,7 +3425,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
pstmt = null; pstmt = null;
} }
errString = updatePickOrdPartII(headerDom, detailDom,waveId, siteCode,saleOrder ,xtraParams, itemMapList,ptcnID,transPorterInfoMap,totActVolume,totActWeight, conn); errString = updatePickOrdPartII(headerDom, detailDom,waveId, siteCode,saleOrder ,xtraParams, itemMapList,ptcnID,transPorterInfoMap,totActVolume,totActWeight,totCaseVolume,totCaseWeight, conn);
//System.out.println("replListPSO.size() ["+replListPSO.size()+"] replListDSO.size() ["+replListDSO.size()+"] pickList.size()"+pickList.size()); //System.out.println("replListPSO.size() ["+replListPSO.size()+"] replListDSO.size() ["+replListDSO.size()+"] pickList.size()"+pickList.size());
...@@ -10419,7 +10428,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -10419,7 +10428,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
} }
//Changed by sumit sarkar on 26/08/2011 [ WM1ESUN006 ] update pick_ord_hrd & pick_ord_det table end. //Changed by sumit sarkar on 26/08/2011 [ WM1ESUN006 ] update pick_ord_hrd & pick_ord_det table end.
*/ //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$-PICKING LOGIC CHANGE.START */ //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$-PICKING LOGIC CHANGE.START
private String updatePickOrdPartII(Document headerDom, Document detailDom,String waveID,String siteCode,String saleOrder, String xtraParams, ArrayList dataList,String ptcn,HashMap transportInfoMap,double totActVolume,double totActWeight, Connection conn )throws Exception private String updatePickOrdPartII(Document headerDom, Document detailDom,String waveID,String siteCode,String saleOrder, String xtraParams, ArrayList dataList,String ptcn,HashMap transportInfoMap,double totActVolume,double totActWeight,double totCaseVolume,double totCaseWeight, Connection conn )throws Exception
{ {
String errString = ""; String errString = "";
String sql = ""; String sql = "";
...@@ -10455,13 +10464,16 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -10455,13 +10464,16 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
ArrayList allCasePickList = new ArrayList(); ArrayList allCasePickList = new ArrayList();
ArrayList allActivesList = new ArrayList(); ArrayList allActivesList = new ArrayList();
ArrayList allMasterPackList = new ArrayList(); ArrayList allMasterPackList = new ArrayList();
ArrayList allMasterList = new ArrayList();
ArrayList allStockToDockList = new ArrayList(); ArrayList allStockToDockList = new ArrayList();
ArrayList allItemPickkList = null;
double palletVolume = 0.0; double palletVolume = 0.0;
double palletMaxWeight = 0.0; double palletMaxWeight = 0.0;
double packetMaxVolumeActive = 0.0; double packetMaxVolumeActive = 0.0;
double packetMaxWeightActive = 0.0; double packetMaxWeightActive = 0.0;
double masterPackWeight = 0.0; double masterPackWeight = 0.0;
double masterPackVolume = 0.0;
double masterPackCount = 0.0; double masterPackCount = 0.0;
double masterPackWeightPerOrder = 0.0; double masterPackWeightPerOrder = 0.0;
boolean masterPackAllow = false; boolean masterPackAllow = false;
...@@ -10470,6 +10482,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -10470,6 +10482,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
String isSinglePickMasterPack=""; String isSinglePickMasterPack="";
String docLoc = "", tranCode = "",custCodeDlv = "",maxWeight="",locTypeTransport = "",casePickInv = "",activePickInv = "",partialResrvLoc=""; String docLoc = "", tranCode = "",custCodeDlv = "",maxWeight="",locTypeTransport = "",casePickInv = "",activePickInv = "",partialResrvLoc="";
HashMap mapItemVolume = null; HashMap mapItemVolume = null;
HashMap mapItemPick = new HashMap();
double weightOfmasterPackCount=0.0; double weightOfmasterPackCount=0.0;
double countCasesOfmasterPackWeight=0.0; double countCasesOfmasterPackWeight=0.0;
String locInvStat = ""; String locInvStat = "";
...@@ -10537,6 +10550,31 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -10537,6 +10550,31 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
} }
} }
if(totCaseVolume > 0 && totCaseWeight > 0)
{
if(totCaseWeight < masterPackWeight)
{
masterPackWeight = totCaseWeight;
}
String[] itmWeightVol = new String[3];
String itemVolumeWeight = getPackItemVolumeWeight(masterPackWeight , totCaseVolume, "M", conn);
itmWeightVol = itemVolumeWeight.split(":");
if(Double.parseDouble(itmWeightVol[0]) != 0.0)
{
masterPackWeight = Double.parseDouble(itmWeightVol[0]);
}
if(Double.parseDouble(itmWeightVol[1]) != 0.0)
{
masterPackVolume = Double.parseDouble(itmWeightVol[1]);
}
}
mPackAllow = genericUtility.getColumnValue("master_pack_allow",detailDom); mPackAllow = genericUtility.getColumnValue("master_pack_allow",detailDom);
mPackAllow = (mPackAllow != null && mPackAllow.length() > 0)?mPackAllow:"N"; mPackAllow = (mPackAllow != null && mPackAllow.length() > 0)?mPackAllow:"N";
aPickAllow = genericUtility.getColumnValue("active_pick_allow",detailDom); aPickAllow = genericUtility.getColumnValue("active_pick_allow",detailDom);
...@@ -10590,6 +10628,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -10590,6 +10628,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
ArrayList activeTempPickList = null; ArrayList activeTempPickList = null;
ArrayList caseTempPickList = null; ArrayList caseTempPickList = null;
ArrayList masterTempPackList = null; ArrayList masterTempPackList = null;
ArrayList masterTempList = null;
System.out.println("PACK_SIZE(SHIPPER SIZE)#####["+packSize+"]PER ITEM VOLUME###["+perItemVolume+"]EACH CASE VOLUME#####["+caseVolume+"]"); System.out.println("PACK_SIZE(SHIPPER SIZE)#####["+packSize+"]PER ITEM VOLUME###["+perItemVolume+"]EACH CASE VOLUME#####["+caseVolume+"]");
System.out.println("PER ITEM WEIGHT#####["+itemWeight+"]EACH CASE WEIGHT###["+caseWeight+"]"); System.out.println("PER ITEM WEIGHT#####["+itemWeight+"]EACH CASE WEIGHT###["+caseWeight+"]");
...@@ -10649,192 +10688,552 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -10649,192 +10688,552 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
{ {
if("Y".equalsIgnoreCase(isSinglePickMasterPack)) if("Y".equalsIgnoreCase(isSinglePickMasterPack))
{ {
/*Added by Ashish Sonawane on 7-jul-12 for Master packing with pallet wise [START]*/ /*Added by Ashish Sonawane on 7-jul-12 for Master packing with pallet wise [START]*/
double cashCountPerPallet =Math.floor( (cashCount * caseVolume)/palletVolume); double cashCountPerPallet =Math.floor( (cashCount * caseVolume)/palletVolume);
totalCaseOnPallet = Math.floor(palletVolume/caseVolume); totalCaseOnPallet = Math.floor(palletVolume/caseVolume);
//double renCtr = 0; //double renCtr = 0;
double volumeRmaining = Math.floor(caseVolume * cashCount); double volumeRmaining = Math.floor(caseVolume * cashCount);
if(totalCaseOnPallet > cashCount) if(totalCaseOnPallet > cashCount)
{ {
totalCaseOnPallet = cashCount; totalCaseOnPallet = cashCount;
} }
if(cashCount/cashCountPerPallet != 0)
{
cashCountPerPallet = cashCountPerPallet + 1;
}
System.out.println("CASE COUNT PER PALLET["+cashCountPerPallet+"]");
System.out.println("TOTAL POSSIBLE CASE ON THE PALLET["+totalCaseOnPallet+"]");
do
{
double currentCaseVolume = totalCaseOnPallet * caseVolume; if(cashCount/cashCountPerPallet != 0)
System.out.println("CURRENT CASE VOLUME TO STORE ["+currentCaseVolume+"]");
if(totalCaseOnPallet < 0)
{ {
cashCountPerPallet = cashCountPerPallet + 1;
break;
} }
else System.out.println("CASE COUNT PER PALLET["+cashCountPerPallet+"]");
{ System.out.println("TOTAL POSSIBLE CASE ON THE PALLET["+totalCaseOnPallet+"]");
if(allMasterPackList.size() > 0)
{
int allListLen = allMasterPackList.size(); do
masterTempPackList = (ArrayList)allMasterPackList.get(allListLen -1); {
int innerListLen = masterTempPackList.size();
Map tempMap = (HashMap)masterTempPackList.get(innerListLen -1);
double currentCaseVolume = totalCaseOnPallet * caseVolume;
System.out.println("CURRENT CASE VOLUME TO STORE ["+currentCaseVolume+"]");
if(totalCaseOnPallet < 0)
{
if(tempMap.containsKey("LAST_PACK_VOLUME")) break;
{ }
double lastPackVolume = (Double)tempMap.get("LAST_PACK_VOLUME"); else
double lastPackWeight = (Double)tempMap.get("LAST_PACK_WEIGHT"); {
if(allMasterPackList.size() > 0)
System.out.println("CASE LAST PACK VOLUME***************["+lastPackVolume+"]**********"); {
System.out.println("CASE LAST PACK WEIGHT***************["+lastPackWeight+"]**********"); int allListLen = allMasterPackList.size();
masterTempPackList = (ArrayList)allMasterPackList.get(allListLen -1);
if(lastPackVolume < palletVolume && lastPackWeight < palletMaxWeight) int innerListLen = masterTempPackList.size();
{ Map tempMap = (HashMap)masterTempPackList.get(innerListLen -1);
double remainingVolume = palletVolume - lastPackVolume;
System.out.println("REMAINING VOLUME TO ADJUST["+remainingVolume+"]"); if(tempMap.containsKey("LAST_PACK_VOLUME"))
{
double lastPackVolume = (Double)tempMap.get("LAST_PACK_VOLUME");
double lastPackWeight = (Double)tempMap.get("LAST_PACK_WEIGHT");
if(remainingVolume >= caseVolume) System.out.println("CASE LAST PACK VOLUME***************["+lastPackVolume+"]**********");
System.out.println("CASE LAST PACK WEIGHT***************["+lastPackWeight+"]**********");
if(lastPackVolume < palletVolume && lastPackWeight < palletMaxWeight)
{ {
double remainingVolume = palletVolume - lastPackVolume;
System.out.println("REMAINING VOLUME TO ADJUST["+remainingVolume+"]");
if(remainingVolume >= currentCaseVolume) if(remainingVolume >= caseVolume)
{
System.out.println(">>REMAINING CASE VOLUME GRATER THEN CURRENT CASE VOLUME>>");
HashMap caseTempMap = (HashMap)dataMap.clone();
caseTempMap.put("no_art", ""+totalCaseOnPallet);
caseTempMap.put("alloc_qty", totalCaseOnPallet * packSize );
caseTempMap.put("LAST_PACK_VOLUME", (currentCaseVolume + lastPackVolume));
caseTempMap.put("LAST_PACK_WEIGHT", totalCaseOnPallet * caseWeight);
masterTempPackList.add(caseTempMap);
int updLen = allMasterPackList.size()-1;
allMasterPackList.set(updLen,masterTempPackList);
}
else
{ {
if(remainingVolume >= currentCaseVolume)
double quantityToBeStore = Math.floor(remainingVolume / caseVolume); {
System.out.println("quantityToBeStore["+quantityToBeStore+"]"); System.out.println(">>REMAINING CASE VOLUME GRATER THEN CURRENT CASE VOLUME>>");
System.out.println("Volume To be stored["+(remainingVolume + lastPackVolume)+"]"); HashMap caseTempMap = (HashMap)dataMap.clone();
HashMap caseTempMap = (HashMap)dataMap.clone(); caseTempMap.put("no_art", ""+totalCaseOnPallet);
caseTempMap.put("no_art", ""+quantityToBeStore); caseTempMap.put("alloc_qty", totalCaseOnPallet * packSize );
caseTempMap.put("alloc_qty", quantityToBeStore*packSize); caseTempMap.put("LAST_PACK_VOLUME", (currentCaseVolume + lastPackVolume));
caseTempMap.put("LAST_PACK_VOLUME", (quantityToBeStore * caseVolume) + lastPackVolume); caseTempMap.put("LAST_PACK_WEIGHT", totalCaseOnPallet * caseWeight);
caseTempMap.put("LAST_PACK_WEIGHT", (Math.floor(quantityToBeStore / packSize)) * caseWeight); masterTempPackList.add(caseTempMap);
lastPackVolume = (quantityToBeStore * caseVolume) + lastPackVolume; int updLen = allMasterPackList.size()-1;
masterTempPackList.add(caseTempMap); allMasterPackList.set(updLen,masterTempPackList);
}
else
{
System.out.println("caseTempPickList Values"+masterTempPackList.toString()); double quantityToBeStore = Math.floor(remainingVolume / caseVolume);
double requiredVolumeToStore = currentCaseVolume - (quantityToBeStore * caseVolume); System.out.println("quantityToBeStore["+quantityToBeStore+"]");
masterTempPackList = new ArrayList(); System.out.println("Volume To be stored["+(remainingVolume + lastPackVolume)+"]");
HashMap caseTempMap = (HashMap)dataMap.clone();
caseTempMap.put("no_art", ""+quantityToBeStore);
caseTempMap.put("alloc_qty", quantityToBeStore*packSize);
caseTempMap.put("LAST_PACK_VOLUME", (quantityToBeStore * caseVolume) + lastPackVolume);
caseTempMap.put("LAST_PACK_WEIGHT", (Math.floor(quantityToBeStore / packSize)) * caseWeight);
lastPackVolume = (quantityToBeStore * caseVolume) + lastPackVolume;
masterTempPackList.add(caseTempMap);
System.out.println("caseTempPickList Values"+masterTempPackList.toString());
double requiredVolumeToStore = currentCaseVolume - (quantityToBeStore * caseVolume);
masterTempPackList = new ArrayList();
HashMap caseTempMap1 = (HashMap)dataMap.clone();
quantityToBeStore = Math.floor(requiredVolumeToStore / caseVolume);
System.out.println("avilable quantityToBeStore["+quantityToBeStore+"]");
System.out.println("Avilable requiredVolumeToStore["+requiredVolumeToStore+"]");
System.out.println("Last Volume To be stored["+requiredVolumeToStore+"]");
caseTempMap1.put("no_art", ""+quantityToBeStore);
caseTempMap1.put("alloc_qty", quantityToBeStore*packSize);
if((requiredVolumeToStore + lastPackVolume) > palletVolume)
{
caseTempMap1.put("LAST_PACK_VOLUME", requiredVolumeToStore);
System.out.println("&&&& if After storing 2nd Last Pack Volume Volume ["+requiredVolumeToStore+"]");
}
else
{
caseTempMap1.put("LAST_PACK_VOLUME", requiredVolumeToStore + lastPackVolume);
System.out.println("&&&& else After storing 2nd Last Pack Volume Volume ["+requiredVolumeToStore + lastPackVolume+"]");
}
caseTempMap1.put("LAST_PACK_WEIGHT", (Math.floor(quantityToBeStore / packSize)) * caseWeight);
masterTempPackList.add(caseTempMap1);
int updLen1 = masterTempPackList.size()-1;
allMasterPackList.add(masterTempPackList);
}
}
else
{
HashMap caseTempMap1 = (HashMap)dataMap.clone();
quantityToBeStore = Math.floor(requiredVolumeToStore / caseVolume);
System.out.println("avilable quantityToBeStore["+quantityToBeStore+"]"); masterTempPackList = new ArrayList();
System.out.println("Avilable requiredVolumeToStore["+requiredVolumeToStore+"]"); HashMap caseTempMap = (HashMap)dataMap.clone();
System.out.println("Last Volume To be stored["+requiredVolumeToStore+"]"); caseTempMap.put("no_art", ""+totalCaseOnPallet);
caseTempMap1.put("no_art", ""+quantityToBeStore); caseTempMap.put("alloc_qty", totalCaseOnPallet * packSize );
caseTempMap1.put("alloc_qty", quantityToBeStore*packSize); caseTempMap.put("LAST_PACK_VOLUME", (totalCaseOnPallet * caseVolume));
caseTempMap.put("LAST_PACK_WEIGHT", totalCaseOnPallet * caseWeight);
if((requiredVolumeToStore + lastPackVolume) > palletVolume) masterTempPackList.add(caseTempMap);
{
caseTempMap1.put("LAST_PACK_VOLUME", requiredVolumeToStore);
System.out.println("&&&& if After storing 2nd Last Pack Volume Volume ["+requiredVolumeToStore+"]");
}
else
{
caseTempMap1.put("LAST_PACK_VOLUME", requiredVolumeToStore + lastPackVolume);
System.out.println("&&&& else After storing 2nd Last Pack Volume Volume ["+requiredVolumeToStore + lastPackVolume+"]");
}
caseTempMap1.put("LAST_PACK_WEIGHT", (Math.floor(quantityToBeStore / packSize)) * caseWeight);
masterTempPackList.add(caseTempMap1);
int updLen1 = masterTempPackList.size()-1;
allMasterPackList.add(masterTempPackList); allMasterPackList.add(masterTempPackList);
} }
} }
else else
{ {
System.out.println("---LAST PACK VOLUME FULL ------");
masterTempPackList = new ArrayList(); masterTempPackList = new ArrayList();
HashMap caseTempMap = (HashMap)dataMap.clone(); HashMap caseTempMap = (HashMap)dataMap.clone();
caseTempMap.put("no_art", ""+totalCaseOnPallet); caseTempMap.put("no_art", ""+totalCaseOnPallet);
caseTempMap.put("alloc_qty", totalCaseOnPallet * packSize ); caseTempMap.put("alloc_qty", totalCaseOnPallet * packSize );
caseTempMap.put("LAST_PACK_VOLUME", (totalCaseOnPallet * caseVolume)); caseTempMap.put("LAST_PACK_VOLUME", (totalCaseOnPallet * caseVolume) + lastPackVolume);
caseTempMap.put("LAST_PACK_WEIGHT", totalCaseOnPallet * caseWeight); caseTempMap.put("LAST_PACK_WEIGHT", totalCaseOnPallet * caseWeight);
masterTempPackList.add(caseTempMap); masterTempPackList.add(caseTempMap);
allMasterPackList.add(masterTempPackList); allMasterPackList.add(masterTempPackList);
} }
}
}
else }
{ else
System.out.println("---LAST PACK VOLUME FULL ------"); {
masterTempPackList = new ArrayList(); System.out.println("IN CASE MAP DOES NOT EXIST............");
HashMap caseTempMap = (HashMap)dataMap.clone(); masterTempPackList = new ArrayList();
caseTempMap.put("no_art", ""+totalCaseOnPallet); HashMap caseTempMap = (HashMap)dataMap.clone();
caseTempMap.put("alloc_qty", totalCaseOnPallet * packSize ); caseTempMap.put("no_art", ""+totalCaseOnPallet);
caseTempMap.put("LAST_PACK_VOLUME", (totalCaseOnPallet * caseVolume) + lastPackVolume); caseTempMap.put("alloc_qty", totalCaseOnPallet * packSize );
caseTempMap.put("LAST_PACK_WEIGHT", totalCaseOnPallet * caseWeight); caseTempMap.put("LAST_PACK_VOLUME", (totalCaseOnPallet * caseVolume));
masterTempPackList.add(caseTempMap); caseTempMap.put("LAST_PACK_WEIGHT", totalCaseOnPallet * caseWeight);
allMasterPackList.add(masterTempPackList); masterTempPackList.add(caseTempMap);
allMasterPackList.add(masterTempPackList);
} }
}
volumeRmaining = volumeRmaining - totalCaseOnPallet * caseVolume;
System.out.println("case volumes reamining["+volumeRmaining+"]");
} if(totalCaseOnPallet < (volumeRmaining/caseVolume))
else {
{ }
System.out.println("IN CASE MAP DOES NOT EXIST............"); else
masterTempPackList = new ArrayList(); {
HashMap caseTempMap = (HashMap)dataMap.clone(); totalCaseOnPallet = (volumeRmaining/caseVolume);
caseTempMap.put("no_art", ""+totalCaseOnPallet); }
caseTempMap.put("alloc_qty", totalCaseOnPallet * packSize );
caseTempMap.put("LAST_PACK_VOLUME", (totalCaseOnPallet * caseVolume)); //Changed by Rohan on 24-11-11 [WMIESUN006] For bug Fixing.start
caseTempMap.put("LAST_PACK_WEIGHT", totalCaseOnPallet * caseWeight); if(volumeRmaining == 0.0)
masterTempPackList.add(caseTempMap); {
allMasterPackList.add(masterTempPackList); break;
} }
//Changed by Rohan on 24-11-11 [WMIESUN006] For bug Fixing.end
volumeRmaining = volumeRmaining - totalCaseOnPallet * caseVolume;
System.out.println("case volumes reamining["+volumeRmaining+"]"); }
System.out.println("AFTER CALCULATING CASE ON PALLET["+totalCaseOnPallet+"]");
renCtr ++ ;
}
while(renCtr <= cashCountPerPallet);
//Change by new logic implmented by pragyan for master packing.start>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
/*HashMap dataMap = (HashMap)dataList.get(i);
double cashCount = (Double)dataMap.get("alloc_qty");
double caseWeight = (Double)dataMap.get("case_weight");
double caseVolume = (Double)dataMap.get("case_volume");
double packSize = 10;*/
//Logic stands clear.start
int allMasterListlen = allMasterList.size();
for(int j = 0 ;j < allMasterListlen ; j++)
{
if(totalCaseOnPallet < (volumeRmaining/caseVolume)) ArrayList tempList = (ArrayList)allMasterList.get(j);
System.out.println("Loop============"+j);
System.out.println("Remaining cashCount Count+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ["+cashCount+"]");
if(cashCount > 0)
{ {
HashMap tempMap = (HashMap)tempList.get(tempList.size() -1);
if(cashCount > 0)
{
if(tempMap.containsKey("LAST_PACK_WEIGHT") && tempMap.containsKey("LAST_PACK_VOLUME") && tempMap.containsKey("LAST_PACK_COUNT"))
{
System.out.println("Item Name"+tempMap.get("item"));
System.out.println("Alloc Qty"+tempMap.get("alloc_qty"));
double lastPackWeight = (Double)tempMap.get("LAST_PACK_WEIGHT");
double lastPackVolume = (Double)tempMap.get("LAST_PACK_VOLUME");
double lastPackCount = (Double)tempMap.get("LAST_PACK_COUNT");
System.out.println("Last Pack Volume#############["+tempMap.get("LAST_PACK_VOLUME")+"]");
System.out.println("Last Pack Weight#############["+tempMap.get("LAST_PACK_WEIGHT")+"]");
System.out.println("Last Pack Count#############["+tempMap.get("LAST_PACK_COUNT")+"]");
double remainingWeight = masterPackWeight - lastPackWeight;
double remainingVolume = masterPackVolume - lastPackVolume;
if(remainingWeight >= caseWeight && remainingVolume >= caseVolume && lastPackCount < masterPackCount)
{
double caseToBeStore = Math.floor(remainingWeight / caseWeight);
double caseToBeStore1 = Math.floor(remainingVolume / caseVolume);
if(caseToBeStore > caseToBeStore1)
{
caseToBeStore = caseToBeStore1;
}
if(caseToBeStore > cashCount)
{
caseToBeStore = cashCount;
}
if((lastPackCount + caseToBeStore) <= masterPackCount)
{
HashMap caseTempMap = (HashMap)dataMap.clone();
caseTempMap.put("no_art", ""+caseToBeStore);
caseTempMap.put("alloc_qty", caseToBeStore * packSize);
caseTempMap.put("LAST_PACK_WEIGHT",lastPackWeight + (caseToBeStore * caseWeight));
caseTempMap.put("LAST_PACK_VOLUME", (caseToBeStore * caseVolume) + lastPackVolume);
caseTempMap.put("LAST_PACK_COUNT", (lastPackCount + caseToBeStore));
caseTempMap.put("CASE_VOLUME_TOT", (caseToBeStore * caseVolume));
caseTempMap.put("CASE_WEIGHT_TOT", (caseToBeStore * caseWeight));
tempList.add(caseTempMap);
cashCount = cashCount - caseToBeStore;
allMasterList.set(j,tempList);
}
}
}
}
else
{
break;
}
//}
} }
else else
{
totalCaseOnPallet = (volumeRmaining/caseVolume);
}
//Changed by Rohan on 24-11-11 [WMIESUN006] For bug Fixing.start
if(volumeRmaining == 0.0)
{ {
break; break;
} }
//Changed by Rohan on 24-11-11 [WMIESUN006] For bug Fixing.end }
//Logic stands.end
System.out.println("Now cashCount Count======================================================================= ["+cashCount+"]");
if(cashCount > 0)
{
mPackCounter = Math.floor(cashCount / masterPackCount);
totalCaseOnPallet = masterPackCount;
counter = 0;
if(cashCount/mPackCounter != 0)
{
mPackCounter = mPackCounter + 1;
}
} if(totalCaseOnPallet > cashCount)
System.out.println("AFTER CALCULATING CASE ON PALLET["+totalCaseOnPallet+"]"); {
renCtr ++ ; totalCaseOnPallet = cashCount;
}
System.out.println("mPackCounter["+mPackCounter+"]");
masterPackWeightCount = Math.floor(masterPackWeight/caseWeight);
System.out.println("masterPackWeightCount..............["+masterPackWeightCount+"]");
System.out.println("totalCaseOnPallet["+totalCaseOnPallet+"]");
double masterPackVolumeCount = Math.floor(masterPackVolume/caseVolume);
System.out.println("masterPackVolumeCount--------------["+masterPackVolumeCount+"]");
///New Veraibles Start
//// New Veriables End
if(masterPackWeightCount > masterPackVolumeCount)
{
masterPackWeightCount = masterPackVolumeCount;
}
do
{
double currentCaseCount = totalCaseOnPallet;
System.out.println("totalCaseOnPallet["+totalCaseOnPallet+"]");
double casesWeightCount = Math.floor(currentCaseCount/masterPackWeightCount);
System.out.println("CURRENT CASE COUNT["+currentCaseCount+"]");
double wCounter = 0;
if(masterPackWeightCount > currentCaseCount)
{
System.out.println("masterPackWeightCount---"+masterPackWeightCount);
masterPackWeightCount = currentCaseCount;
}
do
{
if(allMasterList.size() > 0)
{
int allListLen = allMasterList.size();
masterTempList = (ArrayList)allMasterList.get(allListLen -1);
int innerListLen = masterTempList.size();
Map tempMap = (HashMap)masterTempList.get(innerListLen -1);
if(tempMap.containsKey("LAST_PACK_WEIGHT") && tempMap.containsKey("LAST_PACK_VOLUME") && tempMap.containsKey("LAST_PACK_COUNT"))
{
double remainingWeight = 0.0;
double remainingVolume = 0.0;
double lastPackWeight = (Double)tempMap.get("LAST_PACK_WEIGHT");
double lastPackVolume = (Double)tempMap.get("LAST_PACK_VOLUME");
double lastPackCount = (Double)tempMap.get("LAST_PACK_COUNT");
System.out.println("LAST PACK WEIGHT FROM THE MAP["+lastPackWeight+"]");
System.out.println("LAST PACK VOLUME FROM THE MAP>>>>>>>>>>>>["+lastPackVolume+"]");
double currentWeight = masterPackWeightCount * caseWeight;
double currentCaseVolume = masterPackWeightCount * caseVolume;
System.out.println("CURRENT WEIGHT TO STORE["+currentWeight+"]");
System.out.println("CURRENT VOLUME TO STORE["+currentCaseVolume+"]");
if(lastPackWeight < masterPackWeight && lastPackVolume < masterPackVolume && lastPackCount < masterPackCount)
{
remainingWeight = masterPackWeight - lastPackWeight;
remainingVolume = masterPackVolume - lastPackVolume;
System.out.println("REMAINING WEIGHT TO STORE ["+remainingWeight+"]");
System.out.println("REMAINING VOLUME TO STORE ["+remainingVolume+"]");
if(remainingWeight >= caseWeight && remainingVolume >= caseVolume )
{
if(remainingWeight >= currentWeight && remainingVolume >= currentCaseVolume && (lastPackCount + masterPackWeightCount) <= masterPackCount)
{
HashMap caseTempMap = (HashMap)dataMap.clone();
caseTempMap.put("no_art", ""+masterPackWeightCount);
caseTempMap.put("alloc_qty", masterPackWeightCount * packSize );
caseTempMap.put("LAST_PACK_WEIGHT", lastPackWeight + (masterPackWeightCount * caseWeight));
caseTempMap.put("LAST_PACK_VOLUME", (currentCaseVolume + lastPackVolume));
caseTempMap.put("LAST_PACK_COUNT", (lastPackCount + masterPackWeightCount));
caseTempMap.put("CASE_VOLUME_TOT", (masterPackWeightCount * caseVolume));
caseTempMap.put("CASE_WEIGHT_TOT", (masterPackWeightCount * caseWeight));
masterTempList.add(caseTempMap);
int updLen = allMasterList.size()-1;
allMasterList.set(updLen,masterTempList);
}
else
{
double caseToBeStore = Math.floor(remainingWeight / caseWeight);
HashMap caseTempMap = (HashMap)dataMap.clone();
caseTempMap.put("no_art", ""+caseToBeStore);
caseTempMap.put("alloc_qty", caseToBeStore * packSize);
caseTempMap.put("LAST_PACK_WEIGHT",lastPackWeight + (caseToBeStore * caseWeight));
caseTempMap.put("LAST_PACK_VOLUME", (caseToBeStore * caseVolume) + lastPackVolume);
caseTempMap.put("LAST_PACK_COUNT", (lastPackCount + caseToBeStore));
caseTempMap.put("CASE_VOLUME_TOT", (caseToBeStore * caseVolume));
caseTempMap.put("CASE_WEIGHT_TOT", (caseToBeStore * caseWeight));
masterTempList.add(caseTempMap);
lastPackWeight = lastPackWeight + (caseToBeStore * caseWeight);
double requiredVolumeToStore = currentCaseVolume - (caseToBeStore * caseVolume);
double requiredWeightToStore = currentWeight - (caseToBeStore * caseWeight);
masterTempList = new ArrayList();
HashMap caseTempMap1 = (HashMap)dataMap.clone();
caseToBeStore = Math.floor(requiredWeightToStore / caseWeight);
caseTempMap1.put("no_art", ""+caseToBeStore);
caseTempMap1.put("alloc_qty", caseToBeStore * packSize);
if((requiredWeightToStore + lastPackWeight) > masterPackWeight)
{
caseTempMap1.put("LAST_PACK_WEIGHT", requiredWeightToStore);
}
else
{
caseTempMap1.put("LAST_PACK_WEIGHT", (requiredWeightToStore + lastPackWeight));
}
if((requiredVolumeToStore + lastPackVolume) > masterPackVolume)
{
caseTempMap1.put("LAST_PACK_COUNT", (lastPackCount + caseToBeStore));
caseTempMap1.put("LAST_PACK_VOLUME", requiredVolumeToStore);
System.out.println("&&&& if After storing 2nd Last Pack Volume Volume ["+requiredVolumeToStore+"]");
}
else
{
caseTempMap1.put("LAST_PACK_COUNT", (lastPackCount + caseToBeStore));
caseTempMap1.put("LAST_PACK_VOLUME", requiredVolumeToStore + lastPackVolume);
System.out.println("&&&& else After storing 2nd Last Pack Volume Volume ["+requiredVolumeToStore + lastPackVolume+"]");
}
caseTempMap1.put("CASE_VOLUME_TOT", (caseToBeStore * caseVolume));
caseTempMap1.put("CASE_WEIGHT_TOT", (caseToBeStore * caseWeight));
masterTempList.add(caseTempMap1);
int updLen1 = masterTempList.size()-1;
allMasterList.add(masterTempList);
}
}
else
{
masterTempList = new ArrayList();
HashMap caseTempMap = (HashMap)dataMap.clone();
caseTempMap.put("no_art", ""+masterPackWeightCount);
caseTempMap.put("alloc_qty", masterPackWeightCount * packSize );
caseTempMap.put("LAST_PACK_WEIGHT", masterPackWeightCount * caseWeight);
caseTempMap.put("LAST_PACK_VOLUME", (masterPackWeightCount * caseVolume));
caseTempMap.put("CASE_VOLUME_TOT", (masterPackWeightCount * caseVolume));
caseTempMap.put("CASE_WEIGHT_TOT", (masterPackWeightCount * caseWeight));
caseTempMap.put("LAST_PACK_COUNT", masterPackWeightCount);
masterTempList.add(caseTempMap);
allMasterList.add(masterTempList);
}
}
else
{
masterTempList = new ArrayList();
HashMap caseTempMap = (HashMap)dataMap.clone();
caseTempMap.put("no_art", ""+masterPackWeightCount);
caseTempMap.put("alloc_qty", masterPackWeightCount * packSize );
caseTempMap.put("LAST_PACK_WEIGHT", masterPackWeightCount * caseWeight);
caseTempMap.put("LAST_PACK_VOLUME", (masterPackWeightCount * caseVolume));
caseTempMap.put("CASE_VOLUME_TOT", (masterPackWeightCount * caseVolume));
caseTempMap.put("CASE_WEIGHT_TOT", (masterPackWeightCount * caseWeight));
caseTempMap.put("LAST_PACK_COUNT", masterPackWeightCount);
masterTempList.add(caseTempMap);
allMasterList.add(masterTempList);
}
}
}
else
{
System.out.println("### MASTER PACK MAP Doesn't Exist.......");
masterTempList = new ArrayList();
HashMap caseTempMap = (HashMap)dataMap.clone();
caseTempMap.put("no_art", ""+masterPackWeightCount);
caseTempMap.put("alloc_qty", masterPackWeightCount * packSize );
caseTempMap.put("LAST_PACK_WEIGHT", masterPackWeightCount * caseWeight);
caseTempMap.put("LAST_PACK_VOLUME", (masterPackWeightCount * caseVolume));
caseTempMap.put("CASE_VOLUME_TOT", (masterPackWeightCount * caseVolume));
caseTempMap.put("CASE_WEIGHT_TOT", (masterPackWeightCount * caseWeight));
caseTempMap.put("LAST_PACK_COUNT", masterPackWeightCount);
masterTempList.add(caseTempMap);
allMasterList.add(masterTempList);
}
System.out.println("masterPackWeightCount**************["+masterPackWeightCount+"]");
currentCaseCount = currentCaseCount - masterPackWeightCount;
System.out.println("currentCaseCount+++++++++++++++["+currentCaseCount+"]");
if((currentCaseCount /masterPackWeightCount) < 1)
{
System.out.println("masterPackWeightCount**************["+masterPackWeightCount+"]");
masterPackWeightCount = currentCaseCount;
}
if(currentCaseCount <= 0)
{
System.out.println("currentCaseCount===============["+currentCaseCount+"]");
break;
}
if(masterPackWeightCount <= 0)
{
System.out.println("masterPackWeightCount===============["+masterPackWeightCount+"]");
break;
}
System.out.println("MASTER PACK COUNTER["+wCounter+"]MASTER PACK WEIGHT COUNT["+masterPackWeightCount+"]");
wCounter++;
}
while(wCounter <= casesWeightCount);
/////////////////////End Weight Wize
masterPackWeightCount = Math.floor(masterPackWeight/caseWeight);
System.out.println("masterPackWeightCount--new "+masterPackWeightCount);
cashCount = cashCount - totalCaseOnPallet;
if(cashCount / masterPackCount >=1)
{
totalCaseOnPallet = masterPackCount;
}
else
{
totalCaseOnPallet = cashCount;
}
if(totalCaseOnPallet <=0)
{
break;
}
counter++;
System.out.println("REMAINING CASE COUNT["+cashCount+"]");
System.out.println("CURRENT PACKET COUNTER"+mPackCounter+"]COUNT["+counter+"]");
}
while(counter < mPackCounter);
} }
while(renCtr <= cashCountPerPallet);
}
//Change by new logic implmented by pragyan for master packing.end>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
}//if("Y".equalsIgnoreCase(isSinglePickMasterPack))
/*Added by Ashish Sonawane on 7-jul-12 for Master packing with pallet wise [END]*/ /*Added by Ashish Sonawane on 7-jul-12 for Master packing with pallet wise [END]*/
/*commented by Ashish Sonawane on 7-jul-12 as per Manoharan sir [START] */ /*commented by Ashish Sonawane on 7-jul-12 as per Manoharan sir [START] */
else else
...@@ -11588,13 +11987,13 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -11588,13 +11987,13 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
pstmtRplStk.setInt(13, rptr +1); pstmtRplStk.setInt(13, rptr +1);
pstmtRplStk.setString(15,docLoc); pstmtRplStk.setString(15,docLoc);
pstmtRplStk.addBatch(); pstmtRplStk.addBatch();
updateCartonMaster(replRefPNDId, (rptr +1),Double.parseDouble("1"),ptcn,"S-DOC", xtraParams, conn); updateCartonMaster(replRefPNDId, (rptr +1),Double.parseDouble("1"),ptcn,"S-DOC", xtraParams,"", conn);
} }
else else
{ {
pstmtRplStk.setString(15,docLoc); pstmtRplStk.setString(15,docLoc);
pstmtRplStk.addBatch(); pstmtRplStk.addBatch();
updateCartonMaster(replRefDeepId, (rptr +1),Double.parseDouble("1"),ptcn,"S-DOC", xtraParams, conn); updateCartonMaster(replRefDeepId, (rptr +1),Double.parseDouble("1"),ptcn,"S-DOC", xtraParams,"", conn);
} }
// pstmtRplStk.executeUpdate(); // pstmtRplStk.executeUpdate();
...@@ -11860,7 +12259,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -11860,7 +12259,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
updateReplenishmentRecord(itemCode, siteCode, lotNo, lotSl, locCode, quantity, prvReplID,"",9999, 2,casePackSize,false, conn); updateReplenishmentRecord(itemCode, siteCode, lotNo, lotSl, locCode, quantity, prvReplID,"",9999, 2,casePackSize,false, conn);
} }
} }
updateCartonMaster(pickRefId, pickCtr,Double.parseDouble(noArt),ptcn,"C-PICK", xtraParams, conn); updateCartonMaster(pickRefId, pickCtr,Double.parseDouble(noArt),ptcn,"C-PICK", xtraParams,"", conn);
} }
} }
...@@ -12158,7 +12557,32 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -12158,7 +12557,32 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
} }
} }
updateCartonMaster(pickRefId, pickCtr,Double.parseDouble(noArt),ptcn,"M-PICK", xtraParams, conn);//Not Required; if("Y".equalsIgnoreCase(isSinglePickMasterPack))
{
}
HashMap tempPickMap = new HashMap();
tempPickMap.put("pick_order", pickRefId);
tempPickMap.put("line_no_pick", pickCtr);
tempPickMap.put("no_art", Double.parseDouble(noArt));
tempPickMap.put("case_weight", caseWeight);
tempPickMap.put("case_volume", caseVolume);
if(mapItemPick.containsKey(itemCode))
{
allItemPickkList = (ArrayList)mapItemPick.get(itemCode);
allItemPickkList.add(tempPickMap);
mapItemPick.put(itemCode, allItemPickkList);
}
else
{
allItemPickkList = new ArrayList();
allItemPickkList.add(tempPickMap);
mapItemPick.put(itemCode, allItemPickkList);
}
/*updateCartonMaster(pickRefId, pickCtr,Double.parseDouble(noArt),ptcn,"M-PICK", xtraParams, conn);//Not Required;
if("Y".equalsIgnoreCase(isSinglePickMasterPack)) if("Y".equalsIgnoreCase(isSinglePickMasterPack))
{ {
...@@ -12229,7 +12653,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -12229,7 +12653,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
} }
counter++; counter++;
}while(counter < mPackCounter); }while(counter < mPackCounter);
} }*/
} }
if(!("Y".equalsIgnoreCase(isSinglePickMasterPack))) if(!("Y".equalsIgnoreCase(isSinglePickMasterPack)))
{ {
...@@ -12239,6 +12663,65 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -12239,6 +12663,65 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
ctrMaster++; ctrMaster++;
} }
int allMasterListlen = allMasterList.size();
String masterCartonNo = "";
for(int j = 0 ;j < allMasterListlen ; j++)
{
caseWeightTotal = 0.0;
caseVolumeTotal = 0.0;
ArrayList tempList = (ArrayList)allMasterList.get(j);
System.out.println("Loop============"+j);
packRefId = updateWaveTaskDet(waveID,3,saleOrder,"","",ptcn,conn);
updatePacking(waveID,saleOrder,packRefId,pickRefId,ptcn,xtraParams, conn);
for(int ctrM =0 ; ctrM < tempList.size() ; ctrM++)
{ //caseTempMap.put("CASE_VOLUME_TOT", (caseToBeStore * caseWeight));
//caseTempMap.put("CASE_WEIGHT_TOT", (caseToBeStore * caseVolume));
HashMap tempMap = (HashMap)tempList.get(ctrM);
caseWeightTotal = caseWeightTotal + (Double)tempMap.get("CASE_WEIGHT_TOT");
caseVolumeTotal = caseVolumeTotal + (Double)tempMap.get("CASE_VOLUME_TOT");
}
System.out.println("CURRENT CASE WEIGHT TOTAL["+caseWeightTotal+"]");
System.out.println("CURRENT CASE VOLUME TOTAL["+caseVolumeTotal+"]");
masterCartonNo = updateCartonMaster(packRefId, j + 1,Double.parseDouble("1"),ptcn,"M-PACK", xtraParams, conn,caseWeightTotal,caseVolumeTotal,pickType);
for(int k =0 ; k < tempList.size() ; k++)
{
HashMap tempMap = (HashMap)tempList.get(k);
itemCode = (String)tempMap.get("item_code");
noArt = (String)tempMap.get("no_art");
System.out.println("Item Name["+itemCode+"]");
System.out.println("No Of Art["+noArt+"]");
System.out.println("Alloc Qty["+tempMap.get("alloc_qty")+"]");
ArrayList valList = (ArrayList)mapItemPick.get(itemCode);
int valListLen = valList.size();
for(int vCtr = 0; vCtr < valListLen;vCtr++)
{
HashMap vMap = (HashMap)valList.get(vCtr);
double currentnoArt = (Double)vMap.get("no_art");
if(currentnoArt <= 0.0)
{
continue;
}
pickRefId = (String)vMap.get("pick_order");
int pickCtr = (Integer)vMap.get("line_no_pick");
System.out.println("Pick Order["+pickRefId+"]");
System.out.println("Line No Pick["+vMap.get("line_no_pick")+"]");
System.out.println("Total No art["+currentnoArt+"]");
System.out.println("case Weight["+vMap.get("case_weight")+"]");
System.out.println("case Volume["+vMap.get("case_volume")+"]");
updateCartonMaster(pickRefId, pickCtr,Double.parseDouble(noArt),ptcn,"M-PICK", xtraParams,masterCartonNo, conn);
vMap.put("no_art", currentnoArt - Double.parseDouble(noArt));
}
}
}
} }
int allActivesListLen = allActivesList.size(); int allActivesListLen = allActivesList.size();
...@@ -13474,7 +13957,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -13474,7 +13957,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$-PICKING LOGIC CHANGE //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$-PICKING LOGIC CHANGE
//Added new method by Chandni on 06/06/12 -- To generate carton Master when pick order is generated //Added new method by Chandni on 06/06/12 -- To generate carton Master when pick order is generated
private String updateCartonMaster(String pickOrder,int lineNo,Double noArt,String ptcn,String refSeries,String xtraParams,Connection conn)throws Exception private String updateCartonMaster(String pickOrder,int lineNo,Double noArt,String ptcn,String refSeries,String xtraParams,String masterCartonNo,Connection conn)throws Exception
{ {
String errString = ""; String errString = "";
String sql = "",sqlInsert = ""; String sql = "",sqlInsert = "";
...@@ -13519,7 +14002,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -13519,7 +14002,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
pstmt =null; pstmt =null;
keyString = keyString.substring(keyString.indexOf(",")); keyString = keyString.substring(keyString.indexOf(","));
sqlInsert = "INSERT INTO CARTON_MASTER (CARTON_NO, STATUS, CHG_DATE, CHG_USER, CHG_TERM, " + sqlInsert = "INSERT INTO CARTON_MASTER (CARTON_NO, STATUS, CHG_DATE, CHG_USER, CHG_TERM, " +
"PICK_ORDER, LINE_NO__PICK ,PTCN,REF_SER,CARTON_TYPE) VALUES (?,?,?,?,?,?,?,?,?,?) "; "PICK_ORDER, LINE_NO__PICK ,PTCN,REF_SER,CARTON_TYPE,MASTER_CARTON) VALUES (?,?,?,?,?,?,?,?,?,?,?) ";
pstmtInsert = conn.prepareStatement(sqlInsert); pstmtInsert = conn.prepareStatement(sqlInsert);
if(refSeries.startsWith("C")) if(refSeries.startsWith("C"))
{ {
...@@ -13580,6 +14063,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -13580,6 +14063,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
pstmtInsert.setString(8,ptcn); pstmtInsert.setString(8,ptcn);
pstmtInsert.setString(9,refSeries); pstmtInsert.setString(9,refSeries);
pstmtInsert.setString(10,crtnType); pstmtInsert.setString(10,crtnType);
pstmtInsert.setString(11,masterCartonNo);
pstmtInsert.addBatch(); pstmtInsert.addBatch();
pstmtInsert.clearParameters(); pstmtInsert.clearParameters();
...@@ -13870,6 +14354,11 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -13870,6 +14354,11 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
pstmtInsert.close(); pstmtInsert.close();
pstmtInsert = null; pstmtInsert = null;
} }
if(errString == "" && errString.length() <= 0)
{
errString = cartonNumber;
}
} }
catch(Exception e) catch(Exception e)
...@@ -18525,7 +19014,9 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -18525,7 +19014,9 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
saleOrder = rs3.getString("SALE_ORDER"); saleOrder = rs3.getString("SALE_ORDER");
System.out.println("-------@@@@@---------> refSer ["+refSer+"]"); System.out.println("-------@@@@@---------> refSer ["+refSer+"]");
if ("R-DSO".equalsIgnoreCase(refSer) || "R-TASK".equalsIgnoreCase(refSer) || "RS-DSO".equalsIgnoreCase(refSer) ) //Changed by Rohan Bhogale on 1-11-12 to set wave stats c in case of pratial to active replanishment
//if ("R-DSO".equalsIgnoreCase(refSer) || "R-TASK".equalsIgnoreCase(refSer) || "RS-DSO".equalsIgnoreCase(refSer) )
if ("R-DSO".equalsIgnoreCase(refSer) || "R-TASK".equalsIgnoreCase(refSer) || "RS-DSO".equalsIgnoreCase(refSer) || "RP-ACT".equalsIgnoreCase(refSer))
{ {
sql = "UPDATE WAVE_TASK_DET SET WAVE_STATUS = 'C' WHERE REF_ID = ? "; sql = "UPDATE WAVE_TASK_DET SET WAVE_STATUS = 'C' WHERE REF_ID = ? ";
pstmt2 = conn.prepareStatement(sql); pstmt2 = conn.prepareStatement(sql);
......
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