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
ResultSet rs = null,rsStock = null;
HashMap updateRowMap = null;
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
{
updateRowMap = new HashMap() ;
......@@ -225,6 +229,16 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
}
rsStock.close(); rsStock = null;
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("site_code", siteCode);
updateRowMap.put("loc_code", stagingLoc);
......@@ -269,6 +283,20 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
updateRowMap.put("batch_no", batchNo);
updateRowMap.put("batch_size", ""+batchSize);
//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 );
if ( retString != null && retString.trim().length() > 0 )
{
......@@ -541,5 +569,103 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
return updateCount;
}
//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
DistCommon distCommon = new DistCommon();
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
{
......@@ -275,6 +279,16 @@ public class PickIssConf extends ActionHandlerEJB implements PickIssConfLocal, P
lineNoOrd = rs.getInt( "LINE_NO__ORD" );
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
// if allocation against sales order found change allocation to point to loc_code__to
// and deallocate the same for loc_code in stock
......@@ -362,6 +376,20 @@ public class PickIssConf extends ActionHandlerEJB implements PickIssConfLocal, P
updateRowMap.put("batch_size", ""+batchSize);
//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 );
if ( retString != null && retString.trim().length() > 0 )
{
......@@ -786,5 +814,103 @@ public class PickIssConf extends ActionHandlerEJB implements PickIssConfLocal, P
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] */
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;
}
}
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