Commit 54b55b66 authored by pjain's avatar pjain

changed by sankara on 04-09-14 update wavecancelejb and deallocartconf


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@96156 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 2a982221
...@@ -4343,6 +4343,9 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -4343,6 +4343,9 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
String replOrderpnd = ""; String replOrderpnd = "";
int activereplquantity = 0; int activereplquantity = 0;
int repllineNo = 0; int repllineNo = 0;
double shipperSize = 0 ;
double numberofArt = 0;
HashMap itmVolumeMap = new HashMap();
try try
{ {
System.out.println("parentReplOrder["+parentReplOrder+"]"); System.out.println("parentReplOrder["+parentReplOrder+"]");
...@@ -4387,6 +4390,14 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -4387,6 +4390,14 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
System.out.println("locCode["+locCode+"]"); System.out.println("locCode["+locCode+"]");
System.out.println("lotNo["+lotNo+"]"); System.out.println("lotNo["+lotNo+"]");
System.out.println("Lotsl["+Lotsl+"]"); System.out.println("Lotsl["+Lotsl+"]");
itmVolumeMap = getItemVoumeMap(itemCode,lotNo,conn);
shipperSize = (Double) itmVolumeMap.get("SHIPPER_SIZE");
System.out.println("shipperSize["+shipperSize+"]");
numberofArt = activereplquantity / shipperSize ;
System.out.println("numberofArt["+numberofArt+"]");
sql = " SELECT RD.REPL_ORDER, RD.LINE_NO FROM REPL_ORD_DET RD WHERE RD.SITE_CODE = ? AND RD.ITEM_CODE = ? AND RD.LOC_CODE = ? " + sql = " SELECT RD.REPL_ORDER, RD.LINE_NO FROM REPL_ORD_DET RD WHERE RD.SITE_CODE = ? AND RD.ITEM_CODE = ? AND RD.LOC_CODE = ? " +
" AND RD.LOT_NO = ? AND RD.LOT_SL = ? AND (CASE WHEN RD.CANCEL_MODE IS NULL THEN 'N' ELSE RD.CANCEL_MODE END) = 'N' "; " AND RD.LOT_NO = ? AND RD.LOT_SL = ? AND (CASE WHEN RD.CANCEL_MODE IS NULL THEN 'N' ELSE RD.CANCEL_MODE END) = 'N' ";
...@@ -4416,12 +4427,13 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -4416,12 +4427,13 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
if("R-DSO".equalsIgnoreCase(refSeries.trim()) || "R-TASK".equalsIgnoreCase(refSeries.trim())) //DSO Update if("R-DSO".equalsIgnoreCase(refSeries.trim()) || "R-TASK".equalsIgnoreCase(refSeries.trim())) //DSO Update
{ {
sql = " UPDATE REPL_ORD_DET SET QUANTITY = ( QUANTITY + ? ), ACTUAL_QTY = ( ACTUAL_QTY + ? ) WHERE REPL_ORDER = ? AND LINE_NO = ? " ; sql = " UPDATE REPL_ORD_DET SET QUANTITY = ( QUANTITY + ? ), ACTUAL_QTY = ( ACTUAL_QTY + ? ), NO_ART = ( NO_ART + ? ) WHERE REPL_ORDER = ? AND LINE_NO = ? " ;
pstmt2 = conn.prepareStatement(sql); pstmt2 = conn.prepareStatement(sql);
pstmt2.setInt(1, activereplquantity); pstmt2.setInt(1, activereplquantity);
pstmt2.setInt(2, activereplquantity); pstmt2.setInt(2, activereplquantity);
pstmt2.setString(3, replOrder); pstmt2.setDouble(3, numberofArt);
pstmt2.setInt(4, repllineNo); pstmt2.setString(4, replOrder);
pstmt2.setInt(5, repllineNo);
updateCount = pstmt2.executeUpdate(); updateCount = pstmt2.executeUpdate();
if(updateCount > 0) if(updateCount > 0)
{ {
...@@ -4447,11 +4459,12 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -4447,11 +4459,12 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
System.out.println("repllineNo:::::"+repllineNo); System.out.println("repllineNo:::::"+repllineNo);
System.out.println("replOrder["+replOrderpnd+"]"); System.out.println("replOrder["+replOrderpnd+"]");
sql = " UPDATE REPL_ORD_DET SET QUANTITY = ( QUANTITY + ? ) WHERE REPL_ORDER = ? AND LINE_NO = ? " ; sql = " UPDATE REPL_ORD_DET SET QUANTITY = ( QUANTITY + ? ), NO_ART = ( NO_ART + ? ) WHERE REPL_ORDER = ? AND LINE_NO = ? " ;
pstmt2 = conn.prepareStatement(sql); pstmt2 = conn.prepareStatement(sql);
pstmt2.setInt(1, activereplquantity); pstmt2.setInt(1, activereplquantity);
pstmt2.setString(2, replOrderpnd); pstmt2.setDouble(2, numberofArt);
pstmt2.setInt(3, repllineNo); pstmt2.setString(3, replOrderpnd);
pstmt2.setInt(4, repllineNo);
updateCount = pstmt2.executeUpdate(); updateCount = pstmt2.executeUpdate();
if(updateCount > 0) if(updateCount > 0)
{ {
......
...@@ -2964,7 +2964,9 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -2964,7 +2964,9 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
String replOrderpnd = ""; String replOrderpnd = "";
int activereplquantity = 0; int activereplquantity = 0;
int repllineNo = 0; int repllineNo = 0;
double shipperSize = 0;
double numberofArt = 0;
HashMap itmVolumeMap = new HashMap();
try try
{ {
System.out.println("replOrd["+replOrd+"]"); System.out.println("replOrd["+replOrd+"]");
...@@ -2993,6 +2995,14 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -2993,6 +2995,14 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
System.out.println("locCode["+locCode+"]"); System.out.println("locCode["+locCode+"]");
System.out.println("lotNo["+lotNo+"]"); System.out.println("lotNo["+lotNo+"]");
System.out.println("Lotsl["+Lotsl+"]"); System.out.println("Lotsl["+Lotsl+"]");
itmVolumeMap = getItemVoumeMap(itemCode,lotNo,conn);
shipperSize = (Double) itmVolumeMap.get("SHIPPER_SIZE");
System.out.println("shipperSize["+shipperSize+"]");
numberofArt = activereplquantity / shipperSize ;
System.out.println("numberofArt["+numberofArt+"]");
sql = " SELECT RD.REPL_ORDER,RD.LINE_NO FROM REPL_ORD_DET RD WHERE RD.SITE_CODE = ? AND RD.ITEM_CODE = ? AND RD.LOC_CODE = ? " + sql = " SELECT RD.REPL_ORDER,RD.LINE_NO FROM REPL_ORD_DET RD WHERE RD.SITE_CODE = ? AND RD.ITEM_CODE = ? AND RD.LOC_CODE = ? " +
" AND RD.LOT_NO = ? AND RD.LOT_SL = ? AND ( CANCEL_MODE IS NULL OR CANCEL_MODE = 'N' ) " ; " AND RD.LOT_NO = ? AND RD.LOT_SL = ? AND ( CANCEL_MODE IS NULL OR CANCEL_MODE = 'N' ) " ;
...@@ -3022,12 +3032,13 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -3022,12 +3032,13 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
if("R-DSO".equalsIgnoreCase(refSeries.trim()) || "R-TASK".equalsIgnoreCase(refSeries.trim())) //DSO Update if("R-DSO".equalsIgnoreCase(refSeries.trim()) || "R-TASK".equalsIgnoreCase(refSeries.trim())) //DSO Update
{ {
sql = " UPDATE REPL_ORD_DET SET QUANTITY = ( QUANTITY + ? ), ACTUAL_QTY = ( ACTUAL_QTY + ? ) WHERE REPL_ORDER = ? AND LINE_NO = ? " ; sql = " UPDATE REPL_ORD_DET SET QUANTITY = ( QUANTITY + ? ), ACTUAL_QTY = ( ACTUAL_QTY + ? ), NO_ART = ( NO_ART + ? ) WHERE REPL_ORDER = ? AND LINE_NO = ? " ;
pstmt2 = conn.prepareStatement(sql); pstmt2 = conn.prepareStatement(sql);
pstmt2.setInt(1, activereplquantity); pstmt2.setInt(1, activereplquantity);
pstmt2.setInt(2, activereplquantity); pstmt2.setInt(2, activereplquantity);
pstmt2.setString(3, replOrder); pstmt2.setDouble(3, numberofArt);
pstmt2.setInt(4, repllineNo); pstmt2.setString(4, replOrder);
pstmt2.setInt(5, repllineNo);
updateCount = pstmt2.executeUpdate(); updateCount = pstmt2.executeUpdate();
if(updateCount > 0) if(updateCount > 0)
{ {
...@@ -3052,11 +3063,12 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -3052,11 +3063,12 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
System.out.println("replOrderpnd:::::"+replOrderpnd); System.out.println("replOrderpnd:::::"+replOrderpnd);
repllineNo = rs.getInt(2); repllineNo = rs.getInt(2);
System.out.println("repllineNo:::::"+repllineNo); System.out.println("repllineNo:::::"+repllineNo);
sql = " UPDATE REPL_ORD_DET SET QUANTITY = ( QUANTITY + ? ) WHERE REPL_ORDER = ? AND LINE_NO = ? " ; sql = " UPDATE REPL_ORD_DET SET QUANTITY = ( QUANTITY + ? ), NO_ART = ( NO_ART + ? ) WHERE REPL_ORDER = ? AND LINE_NO = ? " ;
pstmt2 = conn.prepareStatement(sql); pstmt2 = conn.prepareStatement(sql);
pstmt2.setInt(1, activereplquantity); pstmt2.setInt(1, activereplquantity);
pstmt2.setString(2, replOrderpnd); pstmt2.setDouble(2, numberofArt);
pstmt2.setInt(3, repllineNo); pstmt2.setString(3, replOrderpnd);
pstmt2.setInt(4, repllineNo);
updateCount = pstmt2.executeUpdate(); updateCount = pstmt2.executeUpdate();
if(updateCount > 0) if(updateCount > 0)
{ {
...@@ -3119,4 +3131,102 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -3119,4 +3131,102 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
return updateCount; return updateCount;
} }
//changed by sankara on 25/08/14 for update active repl quantity to normal repl in repl_ord_det at wave calcel end. //changed by sankara on 25/08/14 for update active repl quantity to normal repl in repl_ord_det at wave calcel end.
//Changed by sankara on 04/09/14 for getting shipper size start.
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_PACKSIZE 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"); //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"); // 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)
{
throw e;
}
finally
{
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
}
return dataVolumeMap;
}
//Changed by sankara on 04/09/14 for getting shipper size end.
} }
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