Commit 26892327 authored by rbhogale's avatar rbhogale

Changed by Rohan on 10-07-13 for spilt active repl on basis of disparam configuration


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@93334 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 44dc2597
......@@ -185,6 +185,13 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
String replOrdRSVCpy = "";
//Changed by Rohan on 13-09-12 to generate only one Repalnishmement Header.end
//Changed by Rohan on 04-07-13 for split active replanishment task based on configuration of disparam.start
Set<String> dsoLocationset = null;
Set<String> pndLocationset = null;
Set<String> caspkLocationset = null;
Set<String> psoLocationset = null;
Set<String> prsvLocationset = null;
//Changed by Rohan on 04-07-13 for split active replanishment task based on configuration of disparam.start
public String process() throws RemoteException,ITMException
{
......@@ -1799,6 +1806,14 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
replOrdRSVCpy = "";
//Changed by Rohan on 13-09-12 to generate only one Repalnishmement Header.end
//Changed by Rohan on 04-07-13 for split active replanishment task based on configuration of disparam.start
dsoLocationset = new HashSet<String>();
pndLocationset = new HashSet<String>();
caspkLocationset = new HashSet<String>();
psoLocationset = new HashSet<String>();
prsvLocationset = new HashSet<String>();
//Changed by Rohan on 04-07-13 for split active replanishment task based on configuration of disparam.end
//Changed By Pragyan To store previous location code as blank.
prevsLocCode = "";
//Changed By Pragyan 23/02/13 To store ship type .
......@@ -6896,6 +6911,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
if(activeListItemWizMap.size() > 0)
{
double quantityPerPallet =0.0;
double quantityPerPalletWeight = 0.0;
double totQtyPerPallet = 0.0;
double renCtr = 0;
double volumeRmaining = 0.0;
......@@ -6904,206 +6920,565 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
System.out.println("packetMaxWeightActive:"+packetMaxWeightActive+"packetMaxVolumeActive:"+packetMaxVolumeActive);
for (Iterator actItemsIterator = itemKeySet.iterator();actItemsIterator.hasNext(); )
for (Iterator actItemsIterator = itemKeySet.iterator();actItemsIterator.hasNext(); )
{
itemCode =(String)actItemsIterator.next();
ArrayList<HashMap> tempActList = (ArrayList)activeListItemWizMap.get(itemCode);
int tempActListLen = tempActList.size();
itmVolumeMap = getItemVoumeMap(itemCode,"",conn);
perItemVolume = (Double)itmVolumeMap.get("ITEM_SIZE");
caseVolume = (Double)itmVolumeMap.get("LOT_SIZE");
caseWeight = (Double)itmVolumeMap.get("PACK_WEIGHT");
itemWeight = (Double)itmVolumeMap.get("ITEM_WEIGHT");
for(HashMap actDataMap : tempActList)
{
itemCode =(String)actItemsIterator.next();
ArrayList<HashMap> tempActList = (ArrayList)activeListItemWizMap.get(itemCode);
int tempActListLen = tempActList.size();
itmVolumeMap = getItemVoumeMap(itemCode,"",conn);
perItemVolume = (Double)itmVolumeMap.get("ITEM_SIZE");
caseVolume = (Double)itmVolumeMap.get("LOT_SIZE");
caseWeight = (Double)itmVolumeMap.get("PACK_WEIGHT");
itemWeight = (Double)itmVolumeMap.get("ITEM_WEIGHT");
//Changed by Rohan on 01-07-13 for consderation of active weight and volume.start
/*
quantity = (Double)actDataMap.get("alloc_qty");
lotNo = (String)actDataMap.get("lot_no");
quantityPerPallet = Math.floor( (quantity * perItemVolume)/packetMaxVolumeActive);
totQtyPerPallet = Math.floor(packetMaxVolumeActive/perItemVolume);
renCtr = 0;
volumeRmaining = Math.floor(perItemVolume * quantity);
if(totQtyPerPallet > quantity)
{
totQtyPerPallet = quantity;
}
for(HashMap actDataMap : tempActList)
if(activeCount/quantityPerPallet != 0)
{
quantityPerPallet = quantityPerPallet + 1;
}
do
{
quantity = (Double)actDataMap.get("alloc_qty");
lotNo = (String)actDataMap.get("lot_no");
quantityPerPallet = Math.floor( (quantity * perItemVolume)/packetMaxVolumeActive);
totQtyPerPallet = Math.floor(packetMaxVolumeActive/perItemVolume);
renCtr = 0;
volumeRmaining = Math.floor(perItemVolume * quantity);
if(totQtyPerPallet > quantity)
double currentvolumeActive = totQtyPerPallet * perItemVolume;
if(totQtyPerPallet < 0)
{
totQtyPerPallet = quantity;
break;
}
if(activeCount/quantityPerPallet != 0)
{
quantityPerPallet = quantityPerPallet + 1;
}
do
else
{
double currentvolumeActive = totQtyPerPallet * perItemVolume;
if(totQtyPerPallet < 0)
if(allActivesList.size() > 0)
{
break;
int allActiveListLen = allActivesList.size();
activeTempPickList = (ArrayList)allActivesList.get(allActiveListLen -1);
int activeTempPickListLen = activeTempPickList.size();
Map tempMap = (HashMap)activeTempPickList.get(activeTempPickListLen -1);
if(tempMap.containsKey("LAST_PACK_VOLUME"))
{
double lastPackVolume = (Double)tempMap.get("LAST_PACK_VOLUME");
double lastPackWeight = (Double)tempMap.get("LAST_PACK_WEIGHT");
System.out.println("ON ACTIVE CURRENT VOLUME ACTIVE ["+currentvolumeActive+"]");
System.out.println("ON ACTIVE lastPackVolume ["+lastPackVolume+"]");
System.out.println("ON ACTIVE lastPackWeight ["+lastPackWeight+"]");
if(lastPackVolume < packetMaxVolumeActive && lastPackWeight < packetMaxWeightActive)
{
double remainingVolume = packetMaxVolumeActive - lastPackVolume;
System.out.println("ON ACTIVE remainingVolume ["+remainingVolume+"]");
if(remainingVolume >= perItemVolume)
{
if(remainingVolume >= currentvolumeActive)
{
HashMap activeTempMap = (HashMap)actDataMap.clone();
activeTempMap.put("no_art", "1");
activeTempMap.put("alloc_qty", totQtyPerPallet);
activeTempMap.put("LAST_PACK_VOLUME", lastPackVolume + currentvolumeActive);
activeTempMap.put("LAST_PACK_WEIGHT", totQtyPerPallet * itemWeight);
activeTempPickList.add(activeTempMap);
int updLen = allActivesList.size()-1;
allActivesList.set(updLen, activeTempPickList);
}
else
{
double requiredQuantityToStore = Math.floor(remainingVolume / perItemVolume);
System.out.println("ON ACTIVE requiredQuantityToStore ["+requiredQuantityToStore+"]");
HashMap activeTempMap = (HashMap)actDataMap.clone();
activeTempMap.put("no_art", "1");
activeTempMap.put("alloc_qty", requiredQuantityToStore);
activeTempMap.put("LAST_PACK_VOLUME", lastPackVolume + remainingVolume);
activeTempMap.put("LAST_PACK_WEIGHT", requiredQuantityToStore * itemWeight);
activeTempPickList.add(activeTempMap);
lastPackVolume = lastPackVolume + remainingVolume;
double reqVolumeToStore = currentvolumeActive - (requiredQuantityToStore * perItemVolume);
System.out.println("ON ACTIVE reqVolumeToStore ["+reqVolumeToStore+"]");
//Changed By Pragyan 13-may-13 to round the value up to decimal calculation
//double remain_quantity = Math.floor(reqVolumeToStore/perItemVolume);
double remain_quantity = Math.round(reqVolumeToStore/perItemVolume);
System.out.println("ON ACTIVE remain_quantity ["+remain_quantity+"]");
activeTempPickList = new ArrayList();
HashMap activeTempMap1 = (HashMap)actDataMap.clone();
activeTempMap1.put("no_art", "1");
activeTempMap1.put("alloc_qty", remain_quantity);
//activeTempMap1.put("LAST_PACK_VOLUME", reqVolumeToStore);
if((reqVolumeToStore + lastPackVolume) > packetMaxVolumeActive)
{
activeTempMap1.put("LAST_PACK_VOLUME", reqVolumeToStore);
System.out.println("ON ACTIVE After storing 2nd Last Pack Volume Volume ["+reqVolumeToStore+"]");
}
else
{
activeTempMap1.put("LAST_PACK_VOLUME", reqVolumeToStore + lastPackVolume);
System.out.println("ON ACTIVE After storing 2nd Last Pack Volume Volume ["+reqVolumeToStore + lastPackVolume+"]");
}
activeTempMap1.put("LAST_PACK_WEIGHT", remain_quantity * itemWeight);
activeTempPickList.add(activeTempMap1);
allActivesList.add(activeTempPickList);
}
}
else
{
activeTempPickList = new ArrayList();
HashMap activeTempMap1 = (HashMap)actDataMap.clone();
activeTempMap1.put("no_art", "1");
activeTempMap1.put("alloc_qty", totQtyPerPallet);
activeTempMap1.put("LAST_PACK_VOLUME", currentvolumeActive);
activeTempMap1.put("LAST_PACK_WEIGHT", totQtyPerPallet * itemWeight);
activeTempPickList.add(activeTempMap1);
allActivesList.add(activeTempPickList);
}
}
else
{
activeTempPickList = new ArrayList();
HashMap activeTempMap1 = (HashMap)actDataMap.clone();
activeTempMap1.put("no_art", "1");
activeTempMap1.put("alloc_qty", totQtyPerPallet);
activeTempMap1.put("LAST_PACK_VOLUME", currentvolumeActive);
activeTempMap1.put("LAST_PACK_WEIGHT", totQtyPerPallet * itemWeight);
activeTempPickList.add(activeTempMap1);
allActivesList.add(activeTempPickList);
}
}
}//if(allActivesList.size() > 0)
else
{
activeTempPickList = new ArrayList();
HashMap activeTempMap1 = (HashMap)actDataMap.clone();
activeTempMap1.put("no_art", "1");
activeTempMap1.put("alloc_qty", totQtyPerPallet);
activeTempMap1.put("LAST_PACK_VOLUME", currentvolumeActive);
activeTempMap1.put("LAST_PACK_WEIGHT", totQtyPerPallet * itemWeight);
activeTempPickList.add(activeTempMap1);
allActivesList.add(activeTempPickList);
}
volumeRmaining = volumeRmaining - totQtyPerPallet * perItemVolume;
System.out.println("ON ACTIVE volumeRmaining ["+volumeRmaining+"]totQtyPerPallet"+totQtyPerPallet);
if(totQtyPerPallet < Math.floor((volumeRmaining/perItemVolume)))
{
}
else
{
if(allActivesList.size() > 0)
{
totQtyPerPallet =Math.floor((volumeRmaining/perItemVolume));
System.out.println("After calculating>>>> ["+totQtyPerPallet+"]");
totQtyPerPallet =Math.floor(volumeRmaining/perItemVolume);
System.out.println("To be check after Floor>>>> ["+totQtyPerPallet+"]");
}
if(volumeRmaining == 0.0)
{
break;
}
}
renCtr ++ ;
}
while(renCtr <= quantityPerPallet);
*/
quantity = (Double)actDataMap.get("alloc_qty");
lotNo = (String)actDataMap.get("lot_no");
if(allActivesList.size() > 0)
{
if(quantity > 0)
{
int allActiveListLen = allActivesList.size();
activeTempPickList = (ArrayList)allActivesList.get(allActiveListLen -1);
int activeTempPickListLen = activeTempPickList.size();
Map tempMap = (HashMap)activeTempPickList.get(activeTempPickListLen -1);
if(tempMap.containsKey("LAST_PACK_WEIGHT") && tempMap.containsKey("LAST_PACK_VOLUME"))
{
double lastPackWeight = (Double)tempMap.get("LAST_PACK_WEIGHT");
double lastPackVolume = (Double)tempMap.get("LAST_PACK_VOLUME");
System.out.println("Last Pack Volume#############["+tempMap.get("LAST_PACK_VOLUME")+"]");
System.out.println("Last Pack Weight#############["+tempMap.get("LAST_PACK_WEIGHT")+"]");
double remainingWeight = packetMaxWeightActive - lastPackWeight;
double remainingVolume = packetMaxVolumeActive - lastPackVolume;
System.out.println("remainingWeight"+remainingWeight+"remainingVolume"+remainingVolume);
if(remainingWeight >= itemWeight && remainingVolume >= perItemVolume )//&& lastPackCount < masterPackCount)
{
int allActiveListLen = allActivesList.size();
activeTempPickList = (ArrayList)allActivesList.get(allActiveListLen -1);
int activeTempPickListLen = activeTempPickList.size();
Map tempMap = (HashMap)activeTempPickList.get(activeTempPickListLen -1);
if(tempMap.containsKey("LAST_PACK_VOLUME"))
{
double lastPackVolume = (Double)tempMap.get("LAST_PACK_VOLUME");
double lastPackWeight = (Double)tempMap.get("LAST_PACK_WEIGHT");
System.out.println("ON ACTIVE CURRENT VOLUME ACTIVE ["+currentvolumeActive+"]");
System.out.println("ON ACTIVE lastPackVolume ["+lastPackVolume+"]");
System.out.println("ON ACTIVE lastPackWeight ["+lastPackWeight+"]");
double requiredQuantityToStoreWeight = Math.round(remainingWeight / itemWeight);
double requiredQuantityToStore = Math.round(remainingVolume / perItemVolume);
System.out.println("requiredQuantityToStoreWeight"+requiredQuantityToStoreWeight+"requiredQuantityToStore"+requiredQuantityToStore);
if(requiredQuantityToStoreWeight > requiredQuantityToStore)
{
requiredQuantityToStoreWeight = requiredQuantityToStore;
}
if(lastPackVolume < packetMaxVolumeActive && lastPackWeight < packetMaxWeightActive)
if(requiredQuantityToStoreWeight > quantity)
{
double remainingVolume = packetMaxVolumeActive - lastPackVolume;
System.out.println("ON ACTIVE remainingVolume ["+remainingVolume+"]");
if(remainingVolume >= perItemVolume)
requiredQuantityToStoreWeight = quantity;
}
HashMap activeTempMap = (HashMap)actDataMap.clone();
activeTempMap.put("no_art", "1");
activeTempMap.put("alloc_qty", requiredQuantityToStoreWeight );
activeTempMap.put("LAST_PACK_WEIGHT",lastPackWeight + Math.round((requiredQuantityToStoreWeight * itemWeight)));
activeTempMap.put("LAST_PACK_VOLUME", Math.round((requiredQuantityToStoreWeight * perItemVolume)) + lastPackVolume);
activeTempPickList.add(activeTempMap);
quantity = quantity - requiredQuantityToStoreWeight;
allActivesList.set(allActiveListLen-1,activeTempPickList);
}
}
}
else
{
break;
}
}//ACTIVEQTYqTY> O
if(quantity <= 0)
{
continue;
}
quantityPerPallet = Math.ceil( (quantity * perItemVolume)/packetMaxVolumeActive);
quantityPerPalletWeight = Math.ceil( (quantity * itemWeight)/packetMaxWeightActive);
double totalQtyOnPallet = 0.0;
double activeCounter = 0.0;
int counter = 0;
if(quantityPerPallet < quantityPerPalletWeight)
{
activeCounter = quantityPerPalletWeight;
totalQtyOnPallet = Math.floor(packetMaxWeightActive/itemWeight);
System.out.println("Total qty per pallet weight wise"+totalQtyOnPallet);
}
else
{
activeCounter = quantityPerPallet;
totalQtyOnPallet = Math.floor(packetMaxVolumeActive/perItemVolume);
System.out.println("Total qty per pallet volume wise"+totalQtyOnPallet);
}
if(totalQtyOnPallet > quantity)
{
totalQtyOnPallet = quantity;
}
double packetMaxWeightActiveCount = Math.round((packetMaxWeightActive/itemWeight));
double packetMaxVolumeActiveCount = Math.floor(packetMaxVolumeActive/perItemVolume);
if(packetMaxWeightActiveCount > packetMaxVolumeActiveCount)
{
packetMaxWeightActiveCount = packetMaxVolumeActiveCount;
}
double remainingWeight = 0.0;
double remainingVolume = 0.0;
do
{
double currentActiveCount = totalQtyOnPallet;
System.out.println("totalQtyOnPallet ["+totalQtyOnPallet+"]");
double ActiveWeightCount = Math.round(currentActiveCount/packetMaxWeightActiveCount);
double ActiveVolumeCount = Math.round(currentActiveCount/packetMaxVolumeActiveCount);
if(ActiveWeightCount > ActiveVolumeCount)
{
ActiveWeightCount = ActiveVolumeCount;
}
System.out.println("ActiveWeightCount["+ActiveWeightCount+"]"+"ActiveVolumeCount"+ActiveVolumeCount);
double wCounter = 0;
if(packetMaxWeightActiveCount > currentActiveCount)
{
packetMaxWeightActiveCount = currentActiveCount;
}
do
{
if(allActivesList.size() > 0)
{
int allListLen = allActivesList.size();
activeTempPickList = (ArrayList)allActivesList.get(allListLen -1);
int innerListLen = activeTempPickList.size();
Map tempMap = (HashMap)activeTempPickList.get(innerListLen -1);
if(tempMap.containsKey("LAST_PACK_WEIGHT") && tempMap.containsKey("LAST_PACK_VOLUME"))// && tempMap.containsKey("LAST_PACK_COUNT"))
{
double lastPackWeight = (Double)tempMap.get("LAST_PACK_WEIGHT");
double lastPackVolume = (Double)tempMap.get("LAST_PACK_VOLUME");
System.out.println("LAST PACK WEIGHT FROM THE MAP["+lastPackWeight+"]");
System.out.println("LAST PACK VOLUME FROM THE MAP>>>>>>>>>>>>["+lastPackVolume+"]");
double currentWeight = packetMaxWeightActiveCount * itemWeight;
double currentCaseVolume = packetMaxWeightActiveCount * perItemVolume;
System.out.println("CURRENT WEIGHT TO STORE["+currentWeight+"]");
System.out.println("CURRENT VOLUME TO STORE["+currentCaseVolume+"]");
if(lastPackWeight < packetMaxWeightActive && lastPackVolume < packetMaxVolumeActive )
{
if(remainingVolume >= currentvolumeActive)
{
HashMap activeTempMap = (HashMap)actDataMap.clone();
activeTempMap.put("no_art", "1");
activeTempMap.put("alloc_qty", totQtyPerPallet);
activeTempMap.put("LAST_PACK_VOLUME", lastPackVolume + currentvolumeActive);
activeTempMap.put("LAST_PACK_WEIGHT", totQtyPerPallet * itemWeight);
activeTempPickList.add(activeTempMap);
int updLen = allActivesList.size()-1;
allActivesList.set(updLen, activeTempPickList);
}
else
remainingWeight = packetMaxWeightActive - lastPackWeight;
remainingVolume = packetMaxVolumeActive - lastPackVolume;
System.out.println("REMAINING WEIGHT TO STORE ["+remainingWeight+"]");
System.out.println("REMAINING VOLUME TO STORE ["+remainingVolume+"]");
if(remainingWeight >= itemWeight && remainingVolume >= perItemVolume )
{
double requiredQuantityToStore = Math.floor(remainingVolume / perItemVolume);
System.out.println("ON ACTIVE requiredQuantityToStore ["+requiredQuantityToStore+"]");
HashMap activeTempMap = (HashMap)actDataMap.clone();
activeTempMap.put("no_art", "1");
activeTempMap.put("alloc_qty", requiredQuantityToStore);
activeTempMap.put("LAST_PACK_VOLUME", lastPackVolume + remainingVolume);
activeTempMap.put("LAST_PACK_WEIGHT", requiredQuantityToStore * itemWeight);
activeTempPickList.add(activeTempMap);
lastPackVolume = lastPackVolume + remainingVolume;
double reqVolumeToStore = currentvolumeActive - (requiredQuantityToStore * perItemVolume);
System.out.println("ON ACTIVE reqVolumeToStore ["+reqVolumeToStore+"]");
//Changed By Pragyan 13-may-13 to round the value up to decimal calculation
//double remain_quantity = Math.floor(reqVolumeToStore/perItemVolume);
double remain_quantity = Math.round(reqVolumeToStore/perItemVolume);
System.out.println("ON ACTIVE remain_quantity ["+remain_quantity+"]");
activeTempPickList = new ArrayList();
HashMap activeTempMap1 = (HashMap)actDataMap.clone();
activeTempMap1.put("no_art", "1");
activeTempMap1.put("alloc_qty", remain_quantity);
//activeTempMap1.put("LAST_PACK_VOLUME", reqVolumeToStore);
if((reqVolumeToStore + lastPackVolume) > packetMaxVolumeActive)
if(remainingWeight >= currentWeight && remainingVolume >= currentCaseVolume )//&& (lastPackCount + packetMaxWeightActiveCount) <= masterPackCount)
{
activeTempMap1.put("LAST_PACK_VOLUME", reqVolumeToStore);
System.out.println("ON ACTIVE After storing 2nd Last Pack Volume Volume ["+reqVolumeToStore+"]");
HashMap activeTempMap = (HashMap)actDataMap.clone();
activeTempMap.put("no_art", "1");
activeTempMap.put("alloc_qty", packetMaxWeightActiveCount);
activeTempMap.put("LAST_PACK_WEIGHT", lastPackWeight + Math.round((packetMaxWeightActiveCount * itemWeight)));
activeTempMap.put("LAST_PACK_VOLUME", (currentCaseVolume + lastPackVolume));
activeTempPickList.add(activeTempMap);
int updLen = allActivesList.size()-1;
allActivesList.set(updLen,activeTempPickList);
}
else
{
activeTempMap1.put("LAST_PACK_VOLUME", reqVolumeToStore + lastPackVolume);
System.out.println("ON ACTIVE After storing 2nd Last Pack Volume Volume ["+reqVolumeToStore + lastPackVolume+"]");
}
activeTempMap1.put("LAST_PACK_WEIGHT", remain_quantity * itemWeight);
activeTempPickList.add(activeTempMap1);
double requiredQuantityToStoreWeight = Math.round(remainingWeight / itemWeight);
double requiredQuantityToStore = Math.round(remainingVolume / perItemVolume);
if(requiredQuantityToStoreWeight > requiredQuantityToStore)
{
requiredQuantityToStoreWeight = requiredQuantityToStore;
}
HashMap activeTempMap = (HashMap)actDataMap.clone();
activeTempMap.put("no_art", "1");
activeTempMap.put("alloc_qty", requiredQuantityToStoreWeight);
activeTempMap.put("LAST_PACK_WEIGHT",lastPackWeight + Math.round((requiredQuantityToStoreWeight * itemWeight)));
activeTempMap.put("LAST_PACK_VOLUME", Math.round((requiredQuantityToStoreWeight * perItemVolume)) + lastPackVolume);
activeTempPickList.add(activeTempMap);
lastPackWeight = lastPackWeight + Math.round((requiredQuantityToStoreWeight * itemWeight));
lastPackVolume = lastPackVolume + Math.round((requiredQuantityToStoreWeight * perItemVolume));
double requiredVolumeToStore = currentCaseVolume - Math.round((requiredQuantityToStoreWeight * perItemVolume));
double requiredWeightToStore = currentWeight - Math.round((requiredQuantityToStoreWeight * itemWeight));
if(requiredWeightToStore == 0 || requiredVolumeToStore == 0)
{
requiredQuantityToStoreWeight = packetMaxWeightActiveCount - requiredQuantityToStoreWeight;
}
else
{
System.out.println("Quantity requiredVolumeToStore["+requiredVolumeToStore+"]");
System.out.println("Quantity requiredVolumeToStore["+requiredWeightToStore+"]");
requiredQuantityToStore = Math.round((requiredVolumeToStore /perItemVolume));
requiredQuantityToStoreWeight = Math.round((requiredWeightToStore /itemWeight));
activeTempPickList = new ArrayList();
HashMap activeTempMap1 = (HashMap)actDataMap.clone();
if(requiredQuantityToStore > requiredQuantityToStoreWeight)
{
requiredQuantityToStore = requiredQuantityToStoreWeight;
}
}
HashMap activeTempMap1 = (HashMap)actDataMap.clone();
if(requiredQuantityToStore > 0)
{
activeTempMap1.put("no_art","1");
activeTempMap1.put("alloc_qty", requiredQuantityToStore );
}
System.out.println("Required Volume to be stored %%%%%%%%%%%%%%%%%%%%%%["+requiredVolumeToStore+"]");
System.out.println("Required Weight to be stored %%%%%%%%%%%%%%%%%%%%%%["+requiredWeightToStore+"]");
System.out.println("Quantity Stored as %%%%%%%%%%%%%%%%%%%%%%["+requiredQuantityToStore+"]");
if((requiredWeightToStore + lastPackWeight) > packetMaxWeightActive)
{
activeTempMap1.put("LAST_PACK_WEIGHT", requiredWeightToStore);
}
else
{
activeTempMap1.put("LAST_PACK_WEIGHT", (requiredWeightToStore + lastPackWeight));
}
if((requiredVolumeToStore + lastPackVolume) > packetMaxVolumeActive)
{
activeTempMap1.put("LAST_PACK_VOLUME", requiredVolumeToStore);
}
else
{
activeTempMap1.put("LAST_PACK_VOLUME", requiredVolumeToStore + lastPackVolume);
}
activeTempPickList.add(activeTempMap1);
int updLen1 = activeTempPickList.size()-1;
allActivesList.add(activeTempPickList);
}
}
else
{
activeTempPickList = new ArrayList();
HashMap activeTempMap = (HashMap)actDataMap.clone();
activeTempMap.put("no_art", "1");
activeTempMap.put("alloc_qty", packetMaxWeightActiveCount );
lastPackWeight = Math.round(packetMaxWeightActiveCount * itemWeight);
lastPackVolume = Math.round(packetMaxWeightActiveCount * perItemVolume);
activeTempMap.put("LAST_PACK_WEIGHT", lastPackWeight);
activeTempMap.put("LAST_PACK_VOLUME", lastPackVolume);
activeTempPickList.add(activeTempMap);
allActivesList.add(activeTempPickList);
}
}
else
{
activeTempPickList = new ArrayList();
HashMap activeTempMap1 = (HashMap)actDataMap.clone();
activeTempMap1.put("no_art", "1");
activeTempMap1.put("alloc_qty", totQtyPerPallet);
activeTempMap1.put("LAST_PACK_VOLUME", currentvolumeActive);
activeTempMap1.put("LAST_PACK_WEIGHT", totQtyPerPallet * itemWeight);
activeTempPickList.add(activeTempMap1);
HashMap activeTempMap = (HashMap)actDataMap.clone();
activeTempMap.put("no_art", "1");
activeTempMap.put("alloc_qty", packetMaxWeightActiveCount );
lastPackWeight = Math.round(packetMaxWeightActiveCount * itemWeight);
lastPackVolume = Math.round(packetMaxWeightActiveCount * perItemVolume);
activeTempMap.put("LAST_PACK_VOLUME",lastPackVolume);
activeTempMap.put("LAST_PACK_WEIGHT",lastPackWeight);
activeTempPickList.add(activeTempMap);
allActivesList.add(activeTempPickList);
}
}
else
{
activeTempPickList = new ArrayList();
HashMap activeTempMap1 = (HashMap)actDataMap.clone();
activeTempMap1.put("no_art", "1");
activeTempMap1.put("alloc_qty", totQtyPerPallet);
activeTempMap1.put("LAST_PACK_VOLUME", currentvolumeActive);
activeTempMap1.put("LAST_PACK_WEIGHT", totQtyPerPallet * itemWeight);
activeTempPickList.add(activeTempMap1);
allActivesList.add(activeTempPickList);
}
}
}//if(allActivesList.size() > 0)
else
{
activeTempPickList = new ArrayList();
HashMap activeTempMap1 = (HashMap)actDataMap.clone();
activeTempMap1.put("no_art", "1");
activeTempMap1.put("alloc_qty", totQtyPerPallet);
activeTempMap1.put("LAST_PACK_VOLUME", currentvolumeActive);
activeTempMap1.put("LAST_PACK_WEIGHT", totQtyPerPallet * itemWeight);
activeTempPickList.add(activeTempMap1);
allActivesList.add(activeTempPickList);
}
}
else
{
System.out.println("### Active PICK MAP Doesn't Exist.......");
activeTempPickList = new ArrayList();
HashMap activeTempMap = (HashMap)actDataMap.clone();
activeTempMap.put("no_art", "1");
activeTempMap.put("alloc_qty", packetMaxWeightActiveCount);
double lastPackWeight = Math.round(packetMaxWeightActiveCount * itemWeight);
double lastPackVolume = Math.round(packetMaxWeightActiveCount * perItemVolume);
activeTempMap.put("LAST_PACK_WEIGHT", lastPackWeight);
activeTempMap.put("LAST_PACK_VOLUME", lastPackVolume);
activeTempPickList.add(activeTempMap);
allActivesList.add(activeTempPickList);
}
volumeRmaining = volumeRmaining - totQtyPerPallet * perItemVolume;
System.out.println("ON ACTIVE volumeRmaining ["+volumeRmaining+"]totQtyPerPallet"+totQtyPerPallet);
if(totQtyPerPallet < Math.floor((volumeRmaining/perItemVolume)))
{
}
else
{
totQtyPerPallet =Math.floor((volumeRmaining/perItemVolume));
System.out.println("After calculating>>>> ["+totQtyPerPallet+"]");
totQtyPerPallet =Math.floor(volumeRmaining/perItemVolume);
System.out.println("To be check after Floor>>>> ["+totQtyPerPallet+"]");
}
currentActiveCount = currentActiveCount - packetMaxWeightActiveCount;
if((currentActiveCount /packetMaxWeightActiveCount) < 1)
{
System.out.println("packetMaxWeightActiveCount**************["+packetMaxWeightActiveCount+"]");
if(volumeRmaining == 0.0)
{
break;
}
}
renCtr ++ ;
packetMaxWeightActiveCount = currentActiveCount;
}
if(currentActiveCount <= 0)
{
System.out.println("currentActiveCount===============["+currentActiveCount+"]");
break;
}
if(packetMaxWeightActiveCount <= 0)
{
System.out.println("packetMaxWeightActiveCount===============["+packetMaxWeightActiveCount+"]");
break;
}
wCounter++;
}
while(wCounter <= ActiveWeightCount);
packetMaxWeightActiveCount = Math.floor(packetMaxWeightActive/itemWeight);
packetMaxVolumeActiveCount = Math.floor(packetMaxVolumeActive/perItemVolume);
if(packetMaxWeightActiveCount > packetMaxVolumeActiveCount)
{
totalQtyOnPallet = packetMaxVolumeActiveCount;
}
while(renCtr <= quantityPerPallet);
}
}
}
else
{
totalQtyOnPallet = packetMaxWeightActiveCount;
}
quantity = quantity - totalQtyOnPallet;
if(totalQtyOnPallet > quantity )
{
totalQtyOnPallet = quantity;
}
if(totalQtyOnPallet <=0)
{
break;
}
counter++;
System.out.println("REMAINING CASE COUNT["+quantity+"]"+"totalQtyOnPallet"+totalQtyOnPallet);
System.out.println("CURRENT PACKET COUNTER"+activeCounter+"]COUNT["+counter+"]");
}
while(counter < activeCounter);
}
}
}
sqlHdrPick="INSERT INTO PICK_ORD_HDR(PICK_ORDER, ORDER_DATE, SITE_CODE,"
......@@ -8464,8 +8839,10 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
String replRefPndId ="";
//Changed by Rohan on 24-11-12 to get variable from disparam for active pick case count.start
cartonCount = 0;
pstmtRplHdr.setString(1,replRefDeepId);
//Changed by Rohan on 04-07-13 for split active replanishment task based on configuration of disparam.start
String activeReplSplitCnt = discommon.getDisparams("999999","ACTIVE_REPL_SPILT_COUNT",conn);
//Changed by Rohan on 04-07-13 for split active replanishment task based on configuration of disparam.start
pstmtRplHdr.setString(1,replRefDeepId);
pstmtRplHdr.setDate(2,orderDate);
pstmtRplHdr.setString(3, siteCode);
pstmtRplHdr.setString(4,saleOrder);
......@@ -8499,8 +8876,8 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
siteCode = (String)tempMap.get("site_code");
itemCode = (String)tempMap.get("item_code");
replRefDeepId = "";
System.out.println("Item CODEEEE====>"+itemCode);
locCode = (String)tempMap.get("loc_code");
System.out.println("Item CODEEEE====>"+itemCode+"location code"+locCode);
lotNo = (String)tempMap.get("lot_no");
lotSl = (String)tempMap.get("lot_sl");
noArt = (String)tempMap.get("no_art");
......@@ -8526,8 +8903,6 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
//double itemWeight= Math.floor((Double)mapItemVolume.get("ITEM_WEIGHT"));
itemWeight= Math.floor((Double)mapItemVolume.get("ITEM_WEIGHT"));
packSizeCase = (Double)mapItemVolume.get("PACK_SIZE");
/*double itemVolumeTotal = quantity*itemVolume;
double itemWeightTotal = quantity*itemWeight; */
int refCtr = 1;
......@@ -8726,10 +9101,11 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
pstmtRplDet.setString(1,replRefDeepId);
pstmtRplDet.setInt(2,replCnt);
pstmtRplDet.setString(7,locCodeCase);
//Changed by Rohan on 04-07-13 for split active replanishment task based on configuration of disparam.
caspkLocationset.add(locCodeCase);
//Changed by Rohan on 08-02-13 to insert 1 case into Quantity block
//pstmtRplDet.setDouble(11, pendActQty);
pstmtRplDet.setDouble(11, packSizeCase);
System.out.println("packSizeCase--->>"+packSizeCase);
pstmtRplDet.setString(12,acPrvReplOrder);
pstmtRplDet.setInt(13,Integer.parseInt(acPrvLineNo));
pstmtRplDet.setString(15,locCodeCaseAct);
......@@ -8812,6 +9188,8 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
pstmtRplDet.setInt(2,replCnt);
pstmtRplDet.setString(7,locCodeCase);
//Changed by Rohan on 04-07-13 for split active replanishment task based on configuration of disparam
caspkLocationset.add(locCodeCase);
pstmtRplDet.setDouble(11, casePackSize);
//pstmtRplDet.setString(12,cPReplOrder);
pstmtRplDet.setString(12,cReplOrder);
......@@ -8874,7 +9252,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
}
else
{
System.out.println("Inside tempReplList.. Block Unknown avilable in suggested case pick Location...");
System.out.println("Inside tempReplList.. Block Unknown avilable in suggested case pick Location...>>>>");
//Changed By Pragyan 07/03/13 to check Direct pick location
//if(!locInvStat.equalsIgnoreCase(activePickInv))
if(!locInvStat.equalsIgnoreCase(activePickInv) && !(directPickLoc != null && directPickLoc.length() > 0))
......@@ -8897,6 +9275,9 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
replCnt++;
refCtr = replCnt;
}
//Changed by Rohan on 04-07-13 for split active replanishment task based on configuration of disparam
caspkLocationset.add(locCode);
}
......@@ -8920,6 +9301,9 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
refCtr = rplCntDSO;
System.out.println("Current DSO Line No refCtr ["+refCtr+"]");
}
//Changed by Rohan on 04-07-13 for split active replanishment task based on configuration of disparam
dsoLocationset.add(locCode);
}
if(locInvStat.equalsIgnoreCase(invReserve))
......@@ -8941,6 +9325,9 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
rplCntPSO++;
refCtr = rplCntPSO;
}
//Changed by Rohan on 04-07-13 for split active replanishment task based on configuration of disparam
psoLocationset.add(locCode);
}
if(locInvStat.equalsIgnoreCase(partialResrvLoc))
......@@ -8961,6 +9348,9 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
rplCntRSV++;
refCtr = rplCntRSV;
}
//Changed by Rohan on 04-07-13 for split active replanishment task based on configuration of disparam
prsvLocationset.add(locCode);
}
......@@ -8980,6 +9370,8 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
if(locInvStat.equalsIgnoreCase(invDeepReserve))
{
pndLoc = getAvilablePickLocation("N", conn, itemLocType,locZonePref,locCode,itemCode,siteCode,lotNo,lotSl);
//Changed by Rohan on 04-07-13 for split active replanishment task based on configuration of disparam.
if(pndLoc != null && pndLoc.length() > 0)
{
pstmtRplDet.setString(15,pndLoc);
......@@ -9039,7 +9431,8 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
pstmtRplDet.setInt(13,rplCntDSO);
pstmtRplDet.setString(7,pndLoc);
//Changed by Rohan on 04-07-13 for split active replanishment task based on configuration of disparam
pndLocationset.add(pndLoc);
if(actPkDeepLoc != null && actPkDeepLoc.length() > 0)
{
pstmtRplDet.setString(15,actPkDeepLoc);
......@@ -9242,6 +9635,8 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
//Changed by Rohan on 13-09-12 to generate only one Repalnishmement Header
pstmtRplDet.setInt(2,replCnt);
pstmtRplDet.setString(7,locCodeCase);
//Changed by Rohan on 04-07-13 for split active replanishment task based on configuration of disparam
caspkLocationset.add(locCodeCase);
//Changed by Rohan on 12-09-12 to add pick order as reference of depended Replanishment
//pstmtRplDet.setString(12,pickRefId);
/*pstmtRplDet.setString(12,sReplOrder);
......@@ -9365,6 +9760,8 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
pstmtRplDet.setInt(2,replCnt);
pstmtRplDet.setString(7,locCodeCase);
//Changed by Rohan on 04-07-13 for split active replanishment task based on configuration of disparam
caspkLocationset.add(locCodeCase);
//Changed by Rohan on 11-09-12 to add pick order reference
//pstmtRplDet.setString(12,pickRefId);
/*if(locInvStat.equalsIgnoreCase(invDeepReserve))
......@@ -9464,6 +9861,9 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
replCnt++;
refCtr = replCnt;
}
//Changed by Rohan on 04-07-13 for split active replanishment task based on configuration of disparam
caspkLocationset.add(locCode);
}
......@@ -9487,6 +9887,9 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
refCtr = rplCntDSO;
System.out.println("Current DSO Line No refCtr ["+refCtr+"]");
}
//Changed by Rohan on 04-07-13 for split active replanishment task based on configuration of disparam
dsoLocationset.add(locCode);
}
if(locInvStat.equalsIgnoreCase(invReserve))
......@@ -9508,6 +9911,9 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
rplCntPSO++;
refCtr = rplCntPSO;
}
//Changed by Rohan on 04-07-13 for split active replanishment task based on configuration of disparam
psoLocationset.add(locCode);
}
if(locInvStat.equalsIgnoreCase(partialResrvLoc))
......@@ -9530,6 +9936,9 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
rplCntRSV++;
refCtr = rplCntRSV;
}
//Changed by Rohan on 04-07-13 for split active replanishment task based on configuration of disparam
prsvLocationset.add(locCode);
}
......@@ -9542,7 +9951,6 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
if(locInvStat.equalsIgnoreCase(partialResrvLoc))
{
packSizeCase = stkQty;
System.out.println("packSizeCase::::::::"+packSizeCase);
pstmtRplDet.setDouble(11, stkQty);
}
......@@ -9552,7 +9960,8 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
pndLoc = getAvilablePickLocation("N", conn, itemLocType,locZonePref,locCode,itemCode,siteCode,lotNo,lotSl);
if(pndLoc != null && pndLoc.length() > 0)
{
pstmtRplDet.setString(15,pndLoc);
//Changed by Rohan on 04-07-13 for split active replanishment task based on configuration of disparam.
pstmtRplDet.setString(15,pndLoc);
}
else
{
......@@ -9579,6 +9988,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
}
pstmtRplDet.executeUpdate();
}
......@@ -9609,6 +10019,10 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
pstmtRplDet.setInt(13,rplCntDSO);
pstmtRplDet.setString(7,pndLoc);
//Changed by Rohan on 04-07-13 for split active replanishment task based on configuration of disparam
pndLocationset.add(pndLoc);
//Changed by Rohan on 04-07-13 for split active replanishment task based on configuration of disparam.start
pndLocationset.add(pndLoc);
if(actPkDeepLoc != null && actPkDeepLoc.length() > 0)
{
......@@ -9682,7 +10096,40 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
itemWeightTotal = itemWeightTotal + quantity*itemWeight;
//updateCartonMaster(pickRefId, pickCtr,Double.parseDouble(noArt),ptcn,"A-PICK", xtraParams, conn,itemWeightTotal,itemVolumeTotal,pickType);
}
//Changed by Rohan on 04-07-13 for split active replanishment task based on configuration of disparam.start
if(dsoLocationset.size() >= Integer.parseInt(activeReplSplitCnt))
{
System.out.println("DSO exceed...");
isReplHdrDSO = false;
dsoLocationset.clear();
}
if(pndLocationset.size() >= Integer.parseInt(activeReplSplitCnt))
{
System.out.println("pnd exceed...");
isReplHdrPND = false;
pndLocationset.clear();
}
if(caspkLocationset.size() >= Integer.parseInt(activeReplSplitCnt))
{
System.out.println("caspk exceed....");
isReplHdr = false;
caspkLocationset.clear();
}
if(psoLocationset.size() >= Integer.parseInt(activeReplSplitCnt))
{
System.out.println("pso exceed...");
isReplHdrPSO = false;
psoLocationset.clear();
}
if(prsvLocationset.size() >= Integer.parseInt(activeReplSplitCnt))
{
System.out.println("prsv exceed....");
isReplHdrRSV = false;
prsvLocationset.clear();
}
//Changed by Rohan on 04-07-13 for split active replanishment task based on configuration of disparam.end
}
//////////////////////To add Carton no generation for Actives Hear///////////////////////////////////////
......@@ -9701,8 +10148,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
//Changed by Rohan on 24/11/12 to spilt active pick depending upon cartons.end
}
}
}
//change by rekha on 23-05-13 start
//if(packgeList.length != 0 || packgeList.length > 0)
......
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