Commit 8017d432 authored by ppatro's avatar ppatro

consolidated shipment changes


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92500 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 9048f260
...@@ -3553,6 +3553,8 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -3553,6 +3553,8 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
//Changed by sumit on 03/08/12 start. //Changed by sumit on 03/08/12 start.
ArrayList ptcnList = new ArrayList(); ArrayList ptcnList = new ArrayList();
Set locSet = null; Set locSet = null;
double totalWeightCurrentshipment = 0.0;
double totActVolume = 0.0,totCaseVolume = 0.0,totCaseWeight = 0.0, totActWeight = 0.0,totCaseCount = 0.0;
try try
{ {
...@@ -3608,17 +3610,111 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -3608,17 +3610,111 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
Set sordList = saleOrderWiseMap.keySet(); Set sordList = saleOrderWiseMap.keySet();
Iterator it = sordList.iterator(); Iterator it = sordList.iterator();
//Issue Tracker Point No 96.start
HashMap sorderConsigMap = new HashMap();
HashMap custConsigMap = new HashMap();
HashMap sordMapInfoMap = null;
String currentShipConsGrp = "";
ArrayList tempList = null;
HashMap tempMapOrd = null;
while(it.hasNext())
{
totalWeightCurrentshipment = 0.0;
totActVolume = 0.0;
totCaseVolume = 0.0;
totCaseWeight = 0.0;
totActWeight = 0.0;
totCaseCount = 0.0;
locSet = new TreeSet();
String sorderKey = (String)it.next();
ArrayList itemMapList = (ArrayList)saleOrderWiseMap.get(sorderKey);
saleOrder = sorderKey.substring(0,sorderKey.indexOf(":"));
sordMapInfoMap = getSordInfo(saleOrder, conn);
currentShipConsGrp = (String)sordMapInfoMap.get("SHIP_CONS_GRP");
int itemMapListLen = itemMapList.size();
for(int i =0;i<itemMapListLen;i++)
{
double actCount = 0.0;
double caseCount = 0.0;
HashMap loadMap = (HashMap)itemMapList.get(i);
itemCode = (String)loadMap.get("item_code");
lotNo = (String)loadMap.get("lot_no");
quantity = (Double)loadMap.get("alloc_qty");
locCode = (String)loadMap.get("loc_code");
HashMap dataTempMap = getItemVoumeMap(itemCode, lotNo, conn);
itemWeight = (Double)dataTempMap.get("ITEM_WEIGHT");
itemVolume = (Double)dataTempMap.get("ITEM_SIZE");
packSize = (Double)dataTempMap.get("PACK_SIZE");
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+"]Loc Code["+locCode+"]");
locSet.add(locCode);
if(quantity < packSize)
{
actCount = quantity;
}
else
{
actCount = quantity % packSize;
caseCount = Math.floor(quantity /packSize) ;
totCaseCount = totCaseCount + caseCount;
}
totActWeight = totActWeight + ( actCount * itemWeight );
totActVolume = totActVolume + ( actCount * itemVolume );
totCaseVolume = totCaseVolume + ( caseCount * caseVolume );
totCaseWeight = totCaseWeight + ( caseCount * caseWeight );
System.out.println("current total weight "+totalWeightCurrentshipment+"]");
}
totalWeightCurrentshipment = totActWeight + totCaseWeight;
tempMapOrd = new HashMap();
tempMapOrd.put("sale_order", saleOrder);
tempMapOrd.put("tot_weight_order", totalWeightCurrentshipment);
tempMapOrd.put("no_art_order", totCaseCount);
tempMapOrd.put("tot_case_weight", totCaseWeight);
tempMapOrd.put("tot_case_volume", totCaseVolume);
tempMapOrd.put("tot_act_weight", totActWeight);
tempMapOrd.put("tot_act_volume", totActVolume);
tempMapOrd.put("loc_set", locSet);
sorderConsigMap.put(saleOrder, currentShipConsGrp);
if(currentShipConsGrp != null && currentShipConsGrp.length() > 0)
{
if(custConsigMap.containsKey(currentShipConsGrp))
{
tempList = (ArrayList)custConsigMap.get(currentShipConsGrp);
tempList.add(tempMapOrd);
}
else
{
tempList = new ArrayList();
tempList.add(tempMapOrd);
}
custConsigMap.put(currentShipConsGrp, tempList);
}
}
//Issue Tracker Point No 96.end
it = sordList.iterator();
while(it.hasNext()) while(it.hasNext())
{ {
double totalWeightCurrentshipment = 0.0; totalWeightCurrentshipment = 0.0;
double totActVolume = 0.0,totCaseVolume = 0.0,totCaseWeight = 0.0, totActWeight = 0.0,totCaseCount = 0.0; totActVolume = 0.0;
totCaseVolume = 0.0;
totCaseWeight = 0.0;
totActWeight = 0.0;
totCaseCount = 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);
ArrayList itemSortList = new ArrayList(); ArrayList itemSortList = new ArrayList();
locSet = new TreeSet(); //locSet = new TreeSet();
System.out.println("wave Id :"+waveId); System.out.println("wave Id :"+waveId);
saleOrder = sorderKey.substring(0,sorderKey.indexOf(":")); saleOrder = sorderKey.substring(0,sorderKey.indexOf(":"));
System.out.println("Current sorder No>>>>>>>>>>>>["+saleOrder+"]"); System.out.println("Current sorder No>>>>>>>>>>>>["+saleOrder+"]");
...@@ -3657,7 +3753,7 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -3657,7 +3753,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; double caseCount = 0.0;
...@@ -3693,7 +3789,45 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -3693,7 +3789,45 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
totalWeightCurrentshipment = totalWeightCurrentshipment + ( itemWeight * quantity); totalWeightCurrentshipment = totalWeightCurrentshipment + ( itemWeight * quantity);
System.out.println("current total weight "+totalWeightCurrentshipment+"]"); System.out.println("current total weight "+totalWeightCurrentshipment+"]");
}*/
String shipCons = (String)sorderConsigMap.get(saleOrder);
ArrayList dataList = (ArrayList)custConsigMap.get(shipCons);
int dataListlen = dataList.size();
for(int cCgt = 0;cCgt < dataListlen;cCgt++)
{
HashMap sordMap = (HashMap)dataList.get(cCgt);
System.out.println("totalWeightCurrentshipment BEFORE"+totalWeightCurrentshipment+"]");
System.out.println("totCaseVolume BEFORE"+totCaseVolume+"]");
System.out.println("totActVolume BEFORE"+totActVolume+"]");
System.out.println("totActWeight BEFORE"+totActWeight+"]");
System.out.println("totCaseWeight BEFORE"+totCaseWeight+"]");
System.out.println("totCaseCount BEFORE"+totCaseCount+"]");
totalWeightCurrentshipment = totalWeightCurrentshipment + (Double)sordMap.get("tot_weight_order");
totActVolume = totActVolume + (Double)sordMap.get("tot_act_volume");
totCaseVolume = totCaseVolume + (Double)sordMap.get("tot_case_volume");
totCaseWeight = totCaseWeight + (Double)sordMap.get("tot_case_weight");
totActWeight = totActWeight + (Double)sordMap.get("tot_act_weight");
totCaseCount = totCaseCount + (Double)sordMap.get("no_art_order");
System.out.println("totalWeightCurrentshipment AFTER"+totalWeightCurrentshipment+"]");
System.out.println("totCaseVolume AFTER"+totCaseVolume+"]");
System.out.println("totCaseWeight AFTER"+totCaseWeight+"]");
System.out.println("totActVolume AFTER"+totActVolume+"]");
System.out.println("totActWeight AFTER"+totActWeight+"]");
System.out.println("totCaseCount AFTER"+totCaseCount+"]");
if(((String)sordMap.get("sale_order")).equalsIgnoreCase(saleOrder))
{
locSet = (Set)sordMap.get("loc_set");
}
} }
System.out.println("Current Location Tree["+locSet.toString()+"]"); System.out.println("Current Location Tree["+locSet.toString()+"]");
Iterator itLoc = locSet.iterator(); Iterator itLoc = locSet.iterator();
while(itLoc.hasNext()) while(itLoc.hasNext())
...@@ -3713,13 +3847,18 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -3713,13 +3847,18 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
} }
} }
System.out.println("Final weight for th shipment "+totalWeightCurrentshipment+"]"); System.out.println("Final weight for th shipment "+totalWeightCurrentshipment+"]totCaseWeight"+totCaseWeight+"]totCaseVolume["+totCaseVolume);
//Changed By Pragyan 02/12/12 to pass the total no cases //Changed By Pragyan 02/12/12 to pass the total no cases
//HashMap transPorterInfoMap = getTransportInfo(saleOrder,totalWeightCurrentshipment, conn); //HashMap transPorterInfoMap = getTransportInfo(saleOrder,totalWeightCurrentshipment, conn);
HashMap transPorterInfoMap = getTransportInfo(saleOrder,totalWeightCurrentshipment,totCaseCount, conn); HashMap transPorterInfoMap = getTransportInfo(saleOrder,totalWeightCurrentshipment,totCaseCount, conn);
tranCode = (String)transPorterInfoMap.get("TRAN_CODE"); tranCode = (String)transPorterInfoMap.get("TRAN_CODE");
transMode = (String)transPorterInfoMap.get("TRANS_MODE"); transMode = (String)transPorterInfoMap.get("TRANS_MODE");
if(tranCode == null || tranCode.length() <= 0)
{
errString = getError(saleOrder + " Total Weight["+totalWeightCurrentshipment+"] Total Case Count ["+totCaseCount+"] ", "NVLTRANCOD", conn);
}
//Changed By Pragyan 26/12/12/ To send the List with ordered Location //Changed By Pragyan 26/12/12/ To send the List with ordered Location
// 05/07/12 separate list for PSO and DSO as earlier logic is wrong // 05/07/12 separate list for PSO and DSO as earlier logic is wrong
//if(replList.size() > 0 || pickList.size() > 0) //if(replList.size() > 0 || pickList.size() > 0)
...@@ -16960,13 +17099,16 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -16960,13 +17099,16 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
HashMap sordInfoMap = new HashMap(); HashMap sordInfoMap = new HashMap();
String custCode = "",stanCode = "",siteCodeShip = "",stateCodeDlv = ""; String custCode = "",stanCode = "",siteCodeShip = "",stateCodeDlv = "",shipConsGrp = "";
try try
{ {
//Changed By Pragyan To get customer ship consigee group
sql = "SELECT C.CUST_CODE AS CUST_CODE,C.STAN_CODE AS STAN_CODE,S.SITE_CODE__SHIP AS SHIP_CODE,C.STATE_CODE AS STATE_DLV FROM SORDER S,CUSTOMER C " /*sql = "SELECT C.CUST_CODE AS CUST_CODE,C.STAN_CODE AS STAN_CODE,S.SITE_CODE__SHIP AS SHIP_CODE,C.STATE_CODE AS STATE_DLV FROM SORDER S,CUSTOMER C "
+ " WHERE S.CUST_CODE__DLV = C.CUST_CODE "
+ " AND S.SALE_ORDER = ? ";*/
sql = "SELECT C.CUST_CODE AS CUST_CODE,C.STAN_CODE AS STAN_CODE,S.SITE_CODE__SHIP AS SHIP_CODE,C.STATE_CODE AS STATE_DLV,C.SHIP_CONS_GRP AS SHIP_CONS_GRP FROM SORDER S,CUSTOMER C "
+ " WHERE S.CUST_CODE__DLV = C.CUST_CODE " + " WHERE S.CUST_CODE__DLV = C.CUST_CODE "
+ " AND S.SALE_ORDER = ? "; + " AND S.SALE_ORDER = ? ";
...@@ -16980,12 +17122,14 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -16980,12 +17122,14 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
stanCode = rs.getString("STAN_CODE"); stanCode = rs.getString("STAN_CODE");
siteCodeShip = rs.getString("SHIP_CODE"); siteCodeShip = rs.getString("SHIP_CODE");
stateCodeDlv = rs.getString("STATE_DLV"); stateCodeDlv = rs.getString("STATE_DLV");
shipConsGrp = rs.getString("SHIP_CONS_GRP");
} }
sordInfoMap.put("CUST_CODE", custCode); sordInfoMap.put("CUST_CODE", custCode);
sordInfoMap.put("STAN_CODE", stanCode); sordInfoMap.put("STAN_CODE", stanCode);
sordInfoMap.put("SHIP_CODE", siteCodeShip); sordInfoMap.put("SHIP_CODE", siteCodeShip);
sordInfoMap.put("STATE_DLV", stateCodeDlv); sordInfoMap.put("STATE_DLV", stateCodeDlv);
sordInfoMap.put("SHIP_CONS_GRP", shipConsGrp);
if( rs != null ) if( rs != null )
{ {
......
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