Commit fa6745d2 authored by manohar's avatar manohar

gross_weight,tare_weight and net_weight passed to stock update


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91942 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 7f0aac2b
...@@ -76,6 +76,10 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT ...@@ -76,6 +76,10 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
ResultSet rs = null,rsStock = null; ResultSet rs = null,rsStock = null;
HashMap updateRowMap = null; HashMap updateRowMap = null;
PickIssConf pickConf = new PickIssConf(); PickIssConf pickConf = new PickIssConf();
// 10/10/12 manoharan
HashMap itmVolumeMap = null;
double shipperSize = 0, itemGrossWeight = 0, caseGrossWeight = 0, itemNetWeight = 0, caseNetWeight = 0;
// end 10/10/12 manoharan
try try
{ {
updateRowMap = new HashMap() ; updateRowMap = new HashMap() ;
...@@ -225,6 +229,16 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT ...@@ -225,6 +229,16 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
} }
rsStock.close(); rsStock = null; rsStock.close(); rsStock = null;
pstmtStock.clearParameters(); pstmtStock.clearParameters();
// 10/10/12 manoharan
itmVolumeMap.clear();
itmVolumeMap = getItemVoumeMap(itemCode,lotNo,conn);
shipperSize = (Double) itmVolumeMap.get("SHIPPER_SIZE");
itemGrossWeight = (Double) itmVolumeMap.get("ITEM_GROSS_WEIGHT");
caseGrossWeight = (Double) itmVolumeMap.get("CASE_GROSS_WEIGHT");
itemNetWeight = (Double) itmVolumeMap.get("ITEM_NET_WEIGHT");
caseNetWeight = (Double) itmVolumeMap.get("CASE_NET_WEIGHT");
// end 10/10/12 manoharan
updateRowMap.put("item_code", itemCode); updateRowMap.put("item_code", itemCode);
updateRowMap.put("site_code", siteCode); updateRowMap.put("site_code", siteCode);
updateRowMap.put("loc_code", stagingLoc); updateRowMap.put("loc_code", stagingLoc);
...@@ -269,6 +283,20 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT ...@@ -269,6 +283,20 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
updateRowMap.put("batch_no", batchNo); updateRowMap.put("batch_no", batchNo);
updateRowMap.put("batch_size", ""+batchSize); updateRowMap.put("batch_size", ""+batchSize);
//End changes by gulzar on 12/24/2011 //End changes by gulzar on 12/24/2011
// 10/10/12 manoharan weight and no_art to be set properly
if("A".equalsIgnoreCase(pickType))
{
noArt = 1;
}
else
{
noArt = Math.floor((quantity) / shipperSize) ;
}
updateRowMap.put("no_art", noArt);
updateRowMap.put("gross_weight", caseGrossWeight * noArt);
updateRowMap.put("net_weight", caseNetWeight * noArt);
updateRowMap.put("tare_weight", (caseGrossWeight - caseNetWeight) * noArt);
// end 10/10/12 manoharan
retString = stkUpdate.updateStock( updateRowMap, xtraParams, conn ); retString = stkUpdate.updateStock( updateRowMap, xtraParams, conn );
if ( retString != null && retString.trim().length() > 0 ) if ( retString != null && retString.trim().length() > 0 )
{ {
...@@ -541,5 +569,103 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT ...@@ -541,5 +569,103 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
return updateCount; return updateCount;
} }
//Changed by sumit on 30/08/12 update wave_status after all task completed for wave_id and sale order end. //Changed by sumit on 30/08/12 update wave_status after all task completed for wave_id and sale order end.
private HashMap getItemVoumeMap(String itemCode,String lotNo,Connection con)throws Exception
{
double shipperSize = 0,itemVolume = 0,caseVolume = 0;
PreparedStatement pstmt = null;
String sql="";
ResultSet rs = null;
double itmLen = 0,itmWidth = 0,itmHeight = 0,itemGrossWeight = 0,lotLen = 0 ,lotHeight = 0,lotWidth = 0,caseGrossWeight = 0,itemNetWeight = 0, caseNetWeight = 0;
HashMap dataVolumeMap = new HashMap();
try {
sql = "SELECT I.LENGTH ITEM_LEN,I.WIDTH ITEM_WID,I.HEIGHT ITEM_HEIGHT,I.GROSS_WEIGHT ITEM_GROSS_WEIGHT,I.NET_WEIGHT ITEM_NET_WEIGHT,"
+" L.LENGTH LITEM_LEN,L.WIDTH LITEM_WID,L.HEIGHT LITEM_HEIGHT,L.SHIPPER_SIZE SHIPSIZE,L.GROSS_WEIGHT CASE_GROSS_WEIGHT,L.NET_WEIGHT CASE_NET_WEIGHT FROM"
+" ITEM I,ITEM_LOT_shipperSize L"
+" WHERE I.ITEM_CODE = L.ITEM_CODE"
+" AND L.LOT_NO__FROM <= ? AND L.LOT_NO__TO >= ?"
+" AND I.ITEM_CODE = ?";
pstmt = con.prepareStatement(sql);
if(lotNo != null && lotNo.length() > 0)
{
pstmt.setString(1, lotNo);
pstmt.setString(2, lotNo);
}
else
{
pstmt.setString(1, "00");
pstmt.setString(2, "ZZ");
}
pstmt.setString(3, itemCode);
rs = pstmt.executeQuery();
if(rs.next())
{
itmLen = rs.getDouble("ITEM_LEN");
itmWidth = rs.getDouble("ITEM_WID");
itmHeight = rs.getDouble("ITEM_HEIGHT");
itemGrossWeight = rs.getDouble("ITEM_GROSS_WEIGHT");
lotLen = rs.getDouble("LITEM_LEN");
lotWidth = rs.getDouble("LITEM_WID");
lotHeight = rs.getDouble("LITEM_HEIGHT");
shipperSize = rs.getDouble("SHIPSIZE");
caseGrossWeight = rs.getDouble("CASE_GROSS_WEIGHT");
itemNetWeight = rs.getDouble("ITEM_NET_WEIGHT");
caseNetWeight = rs.getDouble("CASE_NET_WEIGHT");
}
//shipperSize = (lotHeight * lotWidth * lotLen)/(itmLen * itmWidth * itmHeight);
itemVolume = (itmLen * itmWidth * itmHeight);
caseVolume = (lotHeight * lotWidth * lotLen);
dataVolumeMap.put("SHIPPER_SIZE", shipperSize);
dataVolumeMap.put("ITEM_VOLUME", itemVolume);
dataVolumeMap.put("CASE_VOLUME", caseVolume);
dataVolumeMap.put("ITEM_GROSS_WEIGHT", itemGrossWeight);
dataVolumeMap.put("CASE_GROSS_WEIGHT", caseGrossWeight);
dataVolumeMap.put("ITEM_NET_WEIGHT", itemNetWeight);
dataVolumeMap.put("CASE_NET_WEIGHT", caseNetWeight);
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
} catch (Exception e) {
// TODO: handle exception
throw e;
}
finally
{
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
}
return dataVolumeMap;
}
} }
...@@ -136,6 +136,10 @@ public class PickIssConf extends ActionHandlerEJB implements PickIssConfLocal, P ...@@ -136,6 +136,10 @@ public class PickIssConf extends ActionHandlerEJB implements PickIssConfLocal, P
DistCommon distCommon = new DistCommon(); DistCommon distCommon = new DistCommon();
boolean isUpdatehdr= false; boolean isUpdatehdr= false;
// 10/10/12 manoharan
HashMap itmVolumeMap = null;
double shipperSize = 0, itemGrossWeight = 0, caseGrossWeight = 0, itemNetWeight = 0, caseNetWeight = 0;
// end 10/10/12 manoharan
try try
{ {
...@@ -275,6 +279,16 @@ public class PickIssConf extends ActionHandlerEJB implements PickIssConfLocal, P ...@@ -275,6 +279,16 @@ public class PickIssConf extends ActionHandlerEJB implements PickIssConfLocal, P
lineNoOrd = rs.getInt( "LINE_NO__ORD" ); lineNoOrd = rs.getInt( "LINE_NO__ORD" );
System.out.println("pick type from hdr->> ["+pickType+"]"); System.out.println("pick type from hdr->> ["+pickType+"]");
// 10/10/12 manoharan weight to be set properly
itmVolumeMap.clear();
itmVolumeMap = getItemVoumeMap(itemCode,lotNo,conn);
shipperSize = (Double) itmVolumeMap.get("SHIPPER_SIZE");
itemGrossWeight = (Double) itmVolumeMap.get("ITEM_GROSS_WEIGHT");
caseGrossWeight = (Double) itmVolumeMap.get("CASE_GROSS_WEIGHT");
itemNetWeight = (Double) itmVolumeMap.get("ITEM_NET_WEIGHT");
caseNetWeight = (Double) itmVolumeMap.get("CASE_NET_WEIGHT");
// end 10/10/12 manoharan
// 16/10/11 manoharan check whether allocation against sales order is there // 16/10/11 manoharan check whether allocation against sales order is there
// if allocation against sales order found change allocation to point to loc_code__to // if allocation against sales order found change allocation to point to loc_code__to
// and deallocate the same for loc_code in stock // and deallocate the same for loc_code in stock
...@@ -362,6 +376,20 @@ public class PickIssConf extends ActionHandlerEJB implements PickIssConfLocal, P ...@@ -362,6 +376,20 @@ public class PickIssConf extends ActionHandlerEJB implements PickIssConfLocal, P
updateRowMap.put("batch_size", ""+batchSize); updateRowMap.put("batch_size", ""+batchSize);
//End changes by gulzar on 12/24/2011 //End changes by gulzar on 12/24/2011
//} //}
// 10/10/12 manoharan weight and no_art to be set properly
if("A".equalsIgnoreCase(pickType))
{
noArt = 1;
}
else
{
noArt = Math.floor((quantity) / shipperSize) ;
}
updateRowMap.put("no_art", noArt);
updateRowMap.put("gross_weight", caseGrossWeight * noArt);
updateRowMap.put("net_weight", caseNetWeight * noArt);
updateRowMap.put("tare_weight", (caseGrossWeight - caseNetWeight) * noArt);
// end 10/10/12 manoharan
retString = stkUpdate.updateStock( updateRowMap, xtraParams, conn ); retString = stkUpdate.updateStock( updateRowMap, xtraParams, conn );
if ( retString != null && retString.trim().length() > 0 ) if ( retString != null && retString.trim().length() > 0 )
{ {
...@@ -786,5 +814,103 @@ public class PickIssConf extends ActionHandlerEJB implements PickIssConfLocal, P ...@@ -786,5 +814,103 @@ public class PickIssConf extends ActionHandlerEJB implements PickIssConfLocal, P
return false; return false;
} }
/* Added by Ashish Sonawane on 08-sep-12 for checking all the pick_ord_det record gets close(status) and depend on this closing (status) header from order. [END] */ /* Added by Ashish Sonawane on 08-sep-12 for checking all the pick_ord_det record gets close(status) and depend on this closing (status) header from order. [END] */
private HashMap getItemVoumeMap(String itemCode,String lotNo,Connection con)throws Exception
{
double shipperSize = 0,itemVolume = 0,caseVolume = 0;
PreparedStatement pstmt = null;
String sql="";
ResultSet rs = null;
double itmLen = 0,itmWidth = 0,itmHeight = 0,itemGrossWeight = 0,lotLen = 0 ,lotHeight = 0,lotWidth = 0,caseGrossWeight = 0,itemNetWeight = 0, caseNetWeight = 0;
HashMap dataVolumeMap = new HashMap();
try {
sql = "SELECT I.LENGTH ITEM_LEN,I.WIDTH ITEM_WID,I.HEIGHT ITEM_HEIGHT,I.GROSS_WEIGHT ITEM_GROSS_WEIGHT,I.NET_WEIGHT ITEM_NET_WEIGHT,"
+" L.LENGTH LITEM_LEN,L.WIDTH LITEM_WID,L.HEIGHT LITEM_HEIGHT,L.SHIPPER_SIZE SHIPSIZE,L.GROSS_WEIGHT CASE_GROSS_WEIGHT,L.NET_WEIGHT CASE_NET_WEIGHT FROM"
+" ITEM I,ITEM_LOT_shipperSize L"
+" WHERE I.ITEM_CODE = L.ITEM_CODE"
+" AND L.LOT_NO__FROM <= ? AND L.LOT_NO__TO >= ?"
+" AND I.ITEM_CODE = ?";
pstmt = con.prepareStatement(sql);
if(lotNo != null && lotNo.length() > 0)
{
pstmt.setString(1, lotNo);
pstmt.setString(2, lotNo);
}
else
{
pstmt.setString(1, "00");
pstmt.setString(2, "ZZ");
}
pstmt.setString(3, itemCode);
rs = pstmt.executeQuery();
if(rs.next())
{
itmLen = rs.getDouble("ITEM_LEN");
itmWidth = rs.getDouble("ITEM_WID");
itmHeight = rs.getDouble("ITEM_HEIGHT");
itemGrossWeight = rs.getDouble("ITEM_GROSS_WEIGHT");
lotLen = rs.getDouble("LITEM_LEN");
lotWidth = rs.getDouble("LITEM_WID");
lotHeight = rs.getDouble("LITEM_HEIGHT");
shipperSize = rs.getDouble("SHIPSIZE");
caseGrossWeight = rs.getDouble("CASE_GROSS_WEIGHT");
itemNetWeight = rs.getDouble("ITEM_NET_WEIGHT");
caseNetWeight = rs.getDouble("CASE_NET_WEIGHT");
}
//shipperSize = (lotHeight * lotWidth * lotLen)/(itmLen * itmWidth * itmHeight);
itemVolume = (itmLen * itmWidth * itmHeight);
caseVolume = (lotHeight * lotWidth * lotLen);
dataVolumeMap.put("SHIPPER_SIZE", shipperSize);
dataVolumeMap.put("ITEM_VOLUME", itemVolume);
dataVolumeMap.put("CASE_VOLUME", caseVolume);
dataVolumeMap.put("ITEM_GROSS_WEIGHT", itemGrossWeight);
dataVolumeMap.put("CASE_GROSS_WEIGHT", caseGrossWeight);
dataVolumeMap.put("ITEM_NET_WEIGHT", itemNetWeight);
dataVolumeMap.put("CASE_NET_WEIGHT", caseNetWeight);
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
} catch (Exception e) {
// TODO: handle exception
throw e;
}
finally
{
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
}
return dataVolumeMap;
}
} }
...@@ -102,7 +102,7 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote, ...@@ -102,7 +102,7 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
double quantity = 0.0,pickQty = 0, actualQty = 0; double quantity = 0.0,pickQty = 0, actualQty = 0;
double noArt = 0.0; double noArt = 0.0;
double packSize = 0; double shipperSize = 0,itemGrossWeight = 0, caseGrossWeight = 0, itemNetWeight = 0, caseNetWeight = 0;
int updCnt = 0, lineNo = 0 , lineNoPick = 0 ; int updCnt = 0, lineNo = 0 , lineNoPick = 0 ;
...@@ -236,9 +236,16 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote, ...@@ -236,9 +236,16 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
//Changed by sumit sarkar on 25/07/12 getting actual value from repl_ord_det //Changed by sumit sarkar on 25/07/12 getting actual value from repl_ord_det
actualQty = rs.getInt( "ACTUAL_QTY" ); actualQty = rs.getInt( "ACTUAL_QTY" );
String dExpLev = checkNullAndTrim(rs.getString( "EXP_LEV" )); String dExpLev = checkNullAndTrim(rs.getString( "EXP_LEV" ));
//Changed by sumit on 27/09/12 getting PACK_SIZE //Changed by sumit on 27/09/12 getting SHIPPER_SIZE
itmVolumeMap.clear(); itmVolumeMap.clear();
itmVolumeMap = getItemVoumeMap(itemCode,lotNo,conn); itmVolumeMap = getItemVoumeMap(itemCode,lotNo,conn);
// 10/10/12 manoharan
shipperSize = (Double) itmVolumeMap.get("SHIPPER_SIZE");
itemGrossWeight = (Double) itmVolumeMap.get("ITEM_GROSS_WEIGHT");
caseGrossWeight = (Double) itmVolumeMap.get("CASE_GROSS_WEIGHT");
itemNetWeight = (Double) itmVolumeMap.get("ITEM_NET_WEIGHT");
caseNetWeight = (Double) itmVolumeMap.get("CASE_NET_WEIGHT");
// end 10/10/12 manoharan
// 16/10/11 manoharan check whether allocation against sales order is there // 16/10/11 manoharan check whether allocation against sales order is there
// if allocation against sales order found change allocation to point to loc_code__to // if allocation against sales order found change allocation to point to loc_code__to
// and deallocate the same for loc_code in stock // and deallocate the same for loc_code in stock
...@@ -324,7 +331,7 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote, ...@@ -324,7 +331,7 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
updateRowMap.put("batch_size", ""+batchSize); updateRowMap.put("batch_size", ""+batchSize);
//End changes by gulzar on 12/24/2011 //End changes by gulzar on 12/24/2011
// 24/06/12 manoharan active deallocation should be actual issue should be packsize // 24/06/12 manoharan active deallocation should be actual issue should be shipperSize
//Changed by sumit on 27/07/12 added 'Q' orderType Condition //Changed by sumit on 27/07/12 added 'Q' orderType Condition
//if ("A".equals(orderType) || "E".equals(orderType) || "I".equals(orderType) || "Q".equals(orderType) || "K".equals(orderType) || "J".equals(orderType) ) //if ("A".equals(orderType) || "E".equals(orderType) || "I".equals(orderType) || "Q".equals(orderType) || "K".equals(orderType) || "J".equals(orderType) )
//if ("A".equals(orderType) || "E".equals(orderType) || "I".equals(orderType) || "K".equals(orderType) ) //if ("A".equals(orderType) || "E".equals(orderType) || "I".equals(orderType) || "K".equals(orderType) )
...@@ -367,7 +374,14 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote, ...@@ -367,7 +374,14 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
pstmt1 = null; pstmt1 = null;
rs1.close(); rs1.close();
rs1 = null; rs1 = null;
// 10/10/12 manoharan active quantity will be less than shipper_size set no_art as 1 and weight as one case weight
shipperSize = (Double) itmVolumeMap.get("SHIPPER_SIZE");
noArt = 1;
updateRowMap.put("no_art", noArt);
updateRowMap.put("gross_weight", caseGrossWeight);
updateRowMap.put("net_weight", caseNetWeight);
updateRowMap.put("tare_weight", caseGrossWeight - caseNetWeight);
// end 10/10/12 manoharan
updateRowMap.put("tran_type","ID"); updateRowMap.put("tran_type","ID");
updateRowMap.put("qty_stduom", ""+ pickQty ); updateRowMap.put("qty_stduom", ""+ pickQty );
...@@ -378,6 +392,14 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote, ...@@ -378,6 +392,14 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
isError = true; isError = true;
break; break;
} }
// 10/10/12 manoharan active quantity will be less than shipper_size set no_art as 1 and weight as one case weight
shipperSize = (Double) itmVolumeMap.get("SHIPPER_SIZE");
noArt = Math.floor((quantity - pickQty) / shipperSize) ;
updateRowMap.put("no_art", noArt);
updateRowMap.put("gross_weight", caseGrossWeight * noArt);
updateRowMap.put("net_weight", caseNetWeight * noArt);
updateRowMap.put("tare_weight", (caseGrossWeight - caseNetWeight) * noArt);
// end 10/10/12 manoharan
updateRowMap.put("tran_type","I"); updateRowMap.put("tran_type","I");
updateRowMap.put("qty_stduom", ""+ (quantity - pickQty)); updateRowMap.put("qty_stduom", ""+ (quantity - pickQty));
updateRowMap.put("quantity", ""+(quantity - pickQty)); updateRowMap.put("quantity", ""+(quantity - pickQty));
...@@ -433,13 +455,18 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote, ...@@ -433,13 +455,18 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
updateRowMap.put("tran_type","ID"); updateRowMap.put("tran_type","ID");
updateRowMap.put("qty_stduom", ""+ (quantity - actualQty));//140 updateRowMap.put("qty_stduom", ""+ (quantity - actualQty));//140
updateRowMap.put("quantity", ""+ (quantity - actualQty)); updateRowMap.put("quantity", ""+ (quantity - actualQty));
// 10/10/12 commented by manoharan
//Changed by sumit on 27/09/12 start. ////Changed by sumit on 27/09/12 start.
packSize = (Double) itmVolumeMap.get("PACK_SIZE"); //shipperSize = (Double) itmVolumeMap.get("SHIPPER_SIZE");
noArt = quantity/ packSize; //noArt = quantity/ shipperSize;
updateRowMap.put("no_art", noArt); //updateRowMap.put("no_art", noArt);
//Changed by sumit on 27/09/12 end. ////Changed by sumit on 27/09/12 end.
noArt = Math.floor((quantity - actualQty) / shipperSize) ;
updateRowMap.put("no_art", noArt);
updateRowMap.put("gross_weight", caseGrossWeight * noArt);
updateRowMap.put("net_weight", caseNetWeight * noArt);
updateRowMap.put("tare_weight", (caseGrossWeight - caseNetWeight) * noArt);
// end 10/10/12 manoharan
retString = stkUpdate.updateStock( updateRowMap, xtraParams, conn ); retString = stkUpdate.updateStock( updateRowMap, xtraParams, conn );
if ( retString != null && retString.trim().length() > 0 ) if ( retString != null && retString.trim().length() > 0 )
{ {
...@@ -449,6 +476,13 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote, ...@@ -449,6 +476,13 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
updateRowMap.put("tran_type","I"); updateRowMap.put("tran_type","I");
updateRowMap.put("qty_stduom", ""+ actualQty);//360 updateRowMap.put("qty_stduom", ""+ actualQty);//360
updateRowMap.put("quantity", ""+actualQty); updateRowMap.put("quantity", ""+actualQty);
// 10/10/12 manoharan weight and no_art to be set properly
noArt = Math.floor((actualQty) / shipperSize) ;
updateRowMap.put("no_art", noArt);
updateRowMap.put("gross_weight", caseGrossWeight * noArt);
updateRowMap.put("net_weight", caseNetWeight * noArt);
updateRowMap.put("tare_weight", (caseGrossWeight - caseNetWeight) * noArt);
// end 10/10/12 manoharan
} }
/*else if("J".equals(orderType)) /*else if("J".equals(orderType))
{ {
...@@ -473,14 +507,21 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote, ...@@ -473,14 +507,21 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
updateRowMap.put("tran_type","ID"); updateRowMap.put("tran_type","ID");
updateRowMap.put("qty_stduom", ""+quantity); updateRowMap.put("qty_stduom", ""+quantity);
updateRowMap.put("quantity", ""+quantity); updateRowMap.put("quantity", ""+quantity);
// 10/10/12 manoharan weight and no_art to be set properly
noArt = Math.floor((quantity) / shipperSize) ;
updateRowMap.put("no_art", noArt);
updateRowMap.put("gross_weight", caseGrossWeight * noArt);
updateRowMap.put("net_weight", caseNetWeight * noArt);
updateRowMap.put("tare_weight", (caseGrossWeight - caseNetWeight) * noArt);
// end 10/10/12 manoharan
} }
// end 24/06/12 manoharan // end 24/06/12 manoharan
// 10/10/12 manoharan comented
//Changed by sumit on 27/09/12 start. ////Changed by sumit on 27/09/12 start.
packSize = (Double) itmVolumeMap.get("PACK_SIZE"); //shipperSize = (Double) itmVolumeMap.get("SHIPPER_SIZE");
noArt = quantity/ packSize; //noArt = quantity/ shipperSize;
updateRowMap.put("no_art", noArt); //updateRowMap.put("no_art", noArt);
//Changed by sumit on 27/09/12 end. ////Changed by sumit on 27/09/12 end.
retString = stkUpdate.updateStock( updateRowMap, xtraParams, conn ); retString = stkUpdate.updateStock( updateRowMap, xtraParams, conn );
if ( retString != null && retString.trim().length() > 0 ) if ( retString != null && retString.trim().length() > 0 )
...@@ -497,8 +538,8 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote, ...@@ -497,8 +538,8 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
updateRowMap.put("tran_type", "R");//Creating receipt updateRowMap.put("tran_type", "R");//Creating receipt
//Changed by sumit on 27/09/12 start. //Changed by sumit on 27/09/12 start.
packSize = (Double) itmVolumeMap.get("PACK_SIZE"); shipperSize = (Double) itmVolumeMap.get("SHIPPER_SIZE");
noArt = quantity/ packSize; noArt = quantity/ shipperSize;
updateRowMap.put("no_art", noArt); updateRowMap.put("no_art", noArt);
//Changed by sumit on 27/09/12 end. //Changed by sumit on 27/09/12 end.
...@@ -530,7 +571,7 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote, ...@@ -530,7 +571,7 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
//strAllocate.put("chg_win","w_pick_iss"); //strAllocate.put("chg_win","w_pick_iss");
strAllocate.put("chg_win","w_repl_iss"); strAllocate.put("chg_win","w_repl_iss");
// 24/06/12 manoharan active deallocation should be actual issue should be packsize // 24/06/12 manoharan active deallocation should be actual issue should be shipperSize
//Changed by sumit sarkar on 27/07/12 changing condition //Changed by sumit sarkar on 27/07/12 changing condition
//if ("A".equals(orderType) || "E".equals(orderType) || "I".equals(orderType) ) //if ("A".equals(orderType) || "E".equals(orderType) || "I".equals(orderType) )
//if ("A".equals(orderType) || "E".equals(orderType) || "I".equals(orderType) || "K".equals(orderType) ) //if ("A".equals(orderType) || "E".equals(orderType) || "I".equals(orderType) || "K".equals(orderType) )
...@@ -1061,18 +1102,18 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote, ...@@ -1061,18 +1102,18 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
//Changed by sumit on //Changed by sumit on
private HashMap getItemVoumeMap(String itemCode,String lotNo,Connection con)throws Exception private HashMap getItemVoumeMap(String itemCode,String lotNo,Connection con)throws Exception
{ {
double packSize = 0,itemSize = 0,lotSize = 0; double shipperSize = 0,itemVolume = 0,caseVolume = 0;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
String sql=""; String sql="";
ResultSet rs = null; ResultSet rs = null;
double itmLen = 0,itmWidth = 0,itmHeight = 0,itemWeight = 0,lotLen = 0 ,lotHeight = 0,lotWidth = 0,lotWeight = 0; double itmLen = 0,itmWidth = 0,itmHeight = 0,itemGrossWeight = 0,lotLen = 0 ,lotHeight = 0,lotWidth = 0,caseGrossWeight = 0,itemNetWeight = 0, caseNetWeight = 0;
HashMap dataVolumeMap = new HashMap(); HashMap dataVolumeMap = new HashMap();
try { try {
sql = "SELECT I.LENGTH ITEM_LEN,I.WIDTH ITEM_WID,I.HEIGHT ITEM_HEIGHT,I.GROSS_WEIGHT ITEM_WEIGHT," sql = "SELECT I.LENGTH ITEM_LEN,I.WIDTH ITEM_WID,I.HEIGHT ITEM_HEIGHT,I.GROSS_WEIGHT ITEM_GROSS_WEIGHT,I.NET_WEIGHT ITEM_NET_WEIGHT,"
+" L.LENGTH LITEM_LEN,L.WIDTH LITEM_WID,L.HEIGHT LITEM_HEIGHT,L.SHIPPER_SIZE SHIPSIZE,L.GROSS_WEIGHT LOT_WEIGHT FROM" +" L.LENGTH LITEM_LEN,L.WIDTH LITEM_WID,L.HEIGHT LITEM_HEIGHT,L.SHIPPER_SIZE SHIPSIZE,L.GROSS_WEIGHT CASE_GROSS_WEIGHT,L.NET_WEIGHT CASE_NET_WEIGHT FROM"
+" ITEM I,ITEM_LOT_PACKSIZE L" +" ITEM I,ITEM_LOT_shipperSize L"
+" WHERE I.ITEM_CODE = L.ITEM_CODE" +" WHERE I.ITEM_CODE = L.ITEM_CODE"
+" AND L.LOT_NO__FROM <= ? AND L.LOT_NO__TO >= ?" +" AND L.LOT_NO__FROM <= ? AND L.LOT_NO__TO >= ?"
+" AND I.ITEM_CODE = ?"; +" AND I.ITEM_CODE = ?";
...@@ -1097,23 +1138,27 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote, ...@@ -1097,23 +1138,27 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
itmLen = rs.getDouble("ITEM_LEN"); itmLen = rs.getDouble("ITEM_LEN");
itmWidth = rs.getDouble("ITEM_WID"); itmWidth = rs.getDouble("ITEM_WID");
itmHeight = rs.getDouble("ITEM_HEIGHT"); itmHeight = rs.getDouble("ITEM_HEIGHT");
itemWeight = rs.getDouble("ITEM_WEIGHT"); itemGrossWeight = rs.getDouble("ITEM_GROSS_WEIGHT");
lotLen = rs.getDouble("LITEM_LEN"); lotLen = rs.getDouble("LITEM_LEN");
lotWidth = rs.getDouble("LITEM_WID"); lotWidth = rs.getDouble("LITEM_WID");
lotHeight = rs.getDouble("LITEM_HEIGHT"); lotHeight = rs.getDouble("LITEM_HEIGHT");
packSize = rs.getDouble("SHIPSIZE"); shipperSize = rs.getDouble("SHIPSIZE");
lotWeight = rs.getDouble("LOT_WEIGHT"); caseGrossWeight = rs.getDouble("CASE_GROSS_WEIGHT");
itemNetWeight = rs.getDouble("ITEM_NET_WEIGHT");
caseNetWeight = rs.getDouble("CASE_NET_WEIGHT");
} }
//packSize = (lotHeight * lotWidth * lotLen)/(itmLen * itmWidth * itmHeight); //shipperSize = (lotHeight * lotWidth * lotLen)/(itmLen * itmWidth * itmHeight);
itemSize = (itmLen * itmWidth * itmHeight); itemVolume = (itmLen * itmWidth * itmHeight);
lotSize = (lotHeight * lotWidth * lotLen); caseVolume = (lotHeight * lotWidth * lotLen);
dataVolumeMap.put("PACK_SIZE", packSize); dataVolumeMap.put("SHIPPER_SIZE", shipperSize);
dataVolumeMap.put("ITEM_SIZE", itemSize); dataVolumeMap.put("ITEM_VOLUME", itemVolume);
dataVolumeMap.put("LOT_SIZE", lotSize); dataVolumeMap.put("CASE_VOLUME", caseVolume);
dataVolumeMap.put("ITEM_WEIGHT", itemWeight); dataVolumeMap.put("ITEM_GROSS_WEIGHT", itemGrossWeight);
dataVolumeMap.put("PACK_WEIGHT", lotWeight); dataVolumeMap.put("CASE_GROSS_WEIGHT", caseGrossWeight);
dataVolumeMap.put("ITEM_NET_WEIGHT", itemNetWeight);
dataVolumeMap.put("CASE_NET_WEIGHT", caseNetWeight);
if(pstmt != null) if(pstmt != 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