Commit ecb1413c authored by wansari's avatar wansari

W15GSUN002 updated source code to remove quantity calculation logic from getItemVolumeMap


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@99122 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 5761dd4a
...@@ -148,7 +148,7 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR ...@@ -148,7 +148,7 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR
Timestamp expDate = null; Timestamp expDate = null;
Timestamp mfgDate = null; Timestamp mfgDate = null;
double quantity = 0, noArtQuot = 0,noArtRem = 0,notArt = 0,shipperSize = 0,totalQuantity = 0; double quantity = 0, noArtQuot = 0,noArtRem = 0,notArt = 0,shipperSize = 0,totalQuantity = 0, qtyPerArt = 0;
GenericUtility genericUtility = GenericUtility.getInstance(); GenericUtility genericUtility = GenericUtility.getInstance();
System.out.println("XTRA PARAMS ["+xtraParams+"]"); System.out.println("XTRA PARAMS ["+xtraParams+"]");
...@@ -188,13 +188,22 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR ...@@ -188,13 +188,22 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR
} }
else else
{ {
sql = "SELECT ITEM_CODE,LINE_NO,QUANTITY,UNIT,LOT_NO,LOT_SL,MFG_DATE,EXP_DATE,LOC_CODE,SITE_CODE__MFG FROM DISTORDER_ALLOC WHERE DIST_ORDER = ?"; //sql = "SELECT ITEM_CODE,LINE_NO,QUANTITY,UNIT,LOT_NO,LOT_SL,MFG_DATE,EXP_DATE,LOC_CODE,SITE_CODE__MFG FROM DISTORDER_ALLOC WHERE DIST_ORDER = ?";
sql = "SELECT D.ITEM_CODE,D.LINE_NO,D.QUANTITY,D.UNIT,D.LOT_NO,D.LOT_SL,S.SITE_CODE,D.LOC_CODE,S.NO_ART,S.QTY_PER_ART"
+" FROM STOCK S,DISTORDER_ALLOC D,DISTORDER H WHERE"
+" S.ITEM_CODE = D.ITEM_CODE"
+" AND S.LOT_NO = D.LOT_NO"
+" AND S.LOT_SL = D.LOT_SL"
+" AND S.LOC_CODE = D.LOC_CODE"
+" AND S.SITE_CODE = H.SITE_CODE"
+" AND H.DIST_ORDER = D.DIST_ORDER"
+" AND D.DIST_ORDER = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId); pstmt.setString(1, tranId);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while(rs.next()) while(rs.next())
{ {
flag = 1; flag = 1;//record found in distribution order
itemCode = checkNullAndTrim(rs.getString("ITEM_CODE")); itemCode = checkNullAndTrim(rs.getString("ITEM_CODE"));
lineNo = checkNullAndTrim(rs.getString("LINE_NO")); lineNo = checkNullAndTrim(rs.getString("LINE_NO"));
...@@ -209,7 +218,9 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR ...@@ -209,7 +218,9 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR
//mfgDate = rs.getTimestamp("MFG_DATE"); //mfgDate = rs.getTimestamp("MFG_DATE");
//expDate = rs.getTimestamp("EXP_DATE"); //expDate = rs.getTimestamp("EXP_DATE");
palletNo = checkNullAndTrim(rs.getString("LOC_CODE")); palletNo = checkNullAndTrim(rs.getString("LOC_CODE"));
siteCode = checkNullAndTrim(rs.getString("SITE_CODE__MFG")); siteCode = checkNullAndTrim(rs.getString("SITE_CODE"));
notArt = rs.getDouble("NO_ART");
qtyPerArt = rs.getDouble("QTY_PER_ART");
/*hm = getPalletizedAttributes(itemCode,siteCode,conn); /*hm = getPalletizedAttributes(itemCode,siteCode,conn);
familyGrp = (String) hm.get("LOC_ZONE__PREF"); familyGrp = (String) hm.get("LOC_ZONE__PREF");
...@@ -220,7 +231,7 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR ...@@ -220,7 +231,7 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR
HashMap interfaceHmap = new HashMap(); HashMap interfaceHmap = new HashMap();
hm = commonWmsUtility.getItemVoumeMap(itemCode,lotNo,conn); /*hm = commonWmsUtility.getItemVoumeMap(itemCode,lotNo,conn);
shipperSize = (Double) hm.get("PACK_SIZE"); shipperSize = (Double) hm.get("PACK_SIZE");
noArtQuot= quantity / shipperSize ; noArtQuot= quantity / shipperSize ;
...@@ -233,36 +244,36 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR ...@@ -233,36 +244,36 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR
totalQuantity = notArt * shipperSize; totalQuantity = notArt * shipperSize;
System.out.println("Quantity["+quantity+"]ShipperSize["+shipperSize+"]noArtQuot["+noArtQuot+"]" System.out.println("Quantity["+quantity+"]ShipperSize["+shipperSize+"]noArtQuot["+noArtQuot+"]"
+ "noArtRem["+noArtRem+"]notArt["+notArt+"]TotalQuantity["+totalQuantity+"]"); + "noArtRem["+noArtRem+"]notArt["+notArt+"]TotalQuantity["+totalQuantity+"]");*/
interfaceHmap.put("TRAN_ID", ""); interfaceHmap.put("TRAN_ID", "");
interfaceHmap.put("ITEM_CODE", itemCode); interfaceHmap.put("ITEM_CODE", itemCode);
interfaceHmap.put("DESCR", ""); interfaceHmap.put("DESCR", "");
interfaceHmap.put("UNIT", unit); interfaceHmap.put("UNIT", unit);
interfaceHmap.put("ITEM_TYPE", itemType); interfaceHmap.put("ITEM_TYPE", "");
interfaceHmap.put("FAMILY_GRP", familyGrp); interfaceHmap.put("FAMILY_GRP", "");
interfaceHmap.put("IN_OUT", "O"); interfaceHmap.put("IN_OUT", "O");
interfaceHmap.put("REF_SER", "D-SO"); interfaceHmap.put("REF_SER", "D-SO");
interfaceHmap.put("REF_ID", tranId); interfaceHmap.put("REF_ID", tranId);
interfaceHmap.put("TRAN_DATE", checkNullAndTrim(String.valueOf(today))); interfaceHmap.put("TRAN_DATE", checkNullAndTrim(String.valueOf(today)));
interfaceHmap.put("LOT_NO", lotNo); interfaceHmap.put("LOT_NO", lotNo);
interfaceHmap.put("LOT_SL", lotSl); interfaceHmap.put("LOT_SL", lotSl);
interfaceHmap.put("QUANTITY", String.valueOf(noArtQuot)); interfaceHmap.put("QUANTITY", String.valueOf(notArt));
interfaceHmap.put("QTY_PER_ART", String.valueOf(shipperSize)); interfaceHmap.put("QTY_PER_ART", String.valueOf(qtyPerArt));
interfaceHmap.put("TOTAL_QTY", String.valueOf(totalQuantity)); interfaceHmap.put("TOTAL_QTY", String.valueOf(quantity));
System.out.println("exp_date="+expDate); System.out.println("exp_date="+expDate);
System.out.println("Mfg_date="+mfgDate); System.out.println("Mfg_date="+mfgDate);
interfaceHmap.put("EXP_DATE", checkNullAndTrim(String.valueOf(expDate))); interfaceHmap.put("EXP_DATE", "");
interfaceHmap.put("MFG_DATE", checkNullAndTrim(String.valueOf(mfgDate))); interfaceHmap.put("MFG_DATE", "");
interfaceHmap.put("PALLET_NO", palletNo); interfaceHmap.put("PALLET_NO", palletNo);
interfaceHmap.put("MSG_STAT", ""); interfaceHmap.put("MSG_STAT", "");
interfaceHmap.put("PALLET_STATUS", palletStatus); interfaceHmap.put("PALLET_STATUS", "");
interfaceHmap.put("LOCK_STAT", lockStat); interfaceHmap.put("LOCK_STAT", "");
interfaceHmap.put("ERR_COD", ""); interfaceHmap.put("ERR_COD", "");
interfaceHmap.put("ERR_DESC", ""); interfaceHmap.put("ERR_DESC", "");
interfaceHmap.put("QC_TYPE", qcType); interfaceHmap.put("QC_TYPE", "");
interfaceHmap.put("TRANS_DT_ACK", ""); interfaceHmap.put("TRANS_DT_ACK", "");
interfaceHmap.put("STRO_PREF", stroPref); interfaceHmap.put("STRO_PREF", "");
interfaceHmap.put("LINE_NO", lineNo); interfaceHmap.put("LINE_NO", lineNo);
interfaceArrList.add(interfaceHmap); interfaceArrList.add(interfaceHmap);
...@@ -272,8 +283,79 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR ...@@ -272,8 +283,79 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR
if(flag == 0) if(flag == 0)
{ {
errString = itmDBAccessEJB.getErrorString("","RECNOTSORA","","",conn); sql = "SELECT D.ITEM_CODE,D.LINE_NO,D.QUANTITY,D.UNIT,D.LOT_NO,D.LOT_SL,D.LOC_CODE,S.NO_ART,S.QTY_PER_ART"
return errString; +" FROM STOCK S,DISTORD_ISSDET D,DISTORD_ISS H WHERE"
+" S.ITEM_CODE = D.ITEM_CODE"
+" AND S.LOT_NO = D.LOT_NO"
+" AND S.LOT_SL = D.LOT_SL"
+" AND S.LOC_CODE = D.LOC_CODE"
+" AND S.SITE_CODE = H.SITE_CODE"
+" AND D.TRAN_ID = H.TRAN_ID"
+" AND H.CONFIRMED = 'N'"
+" AND D.DIST_ORDER = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId);
rs = pstmt.executeQuery();
while(rs.next())
{
flag = 1;
itemCode = checkNullAndTrim(rs.getString("ITEM_CODE"));
lineNo = checkNullAndTrim(rs.getString("LINE_NO"));
lineNo = " " + lineNo;
lineNo = lineNo.substring(lineNo.length()-3);
quantity = rs.getDouble("QUANTITY");
unit = checkNullAndTrim(rs.getString("UNIT"));
lotNo = checkNullAndTrim(rs.getString("LOT_NO"));
lotSl = checkNullAndTrim(rs.getString("LOT_SL"));
palletNo = checkNullAndTrim(rs.getString("LOC_CODE"));
notArt = rs.getDouble("NO_ART");
qtyPerArt = rs.getDouble("QTY_PER_ART");
HashMap interfaceHmap = new HashMap();
interfaceHmap.put("TRAN_ID", "");
interfaceHmap.put("ITEM_CODE", itemCode);
interfaceHmap.put("DESCR", "");
interfaceHmap.put("UNIT", unit);
interfaceHmap.put("ITEM_TYPE", "");
interfaceHmap.put("FAMILY_GRP", "");
interfaceHmap.put("IN_OUT", "O");
interfaceHmap.put("REF_SER", "D-SO");
interfaceHmap.put("REF_ID", tranId);
interfaceHmap.put("TRAN_DATE", checkNullAndTrim(String.valueOf(today)));
interfaceHmap.put("LOT_NO", lotNo);
interfaceHmap.put("LOT_SL", lotSl);
interfaceHmap.put("QUANTITY", String.valueOf(notArt));
interfaceHmap.put("QTY_PER_ART", String.valueOf(qtyPerArt));
interfaceHmap.put("TOTAL_QTY", String.valueOf(quantity));
interfaceHmap.put("EXP_DATE", "");
interfaceHmap.put("MFG_DATE", "");
interfaceHmap.put("PALLET_NO", palletNo);
interfaceHmap.put("MSG_STAT", "");
interfaceHmap.put("PALLET_STATUS", "");
interfaceHmap.put("LOCK_STAT", "");
interfaceHmap.put("ERR_COD", "");
interfaceHmap.put("ERR_DESC", "");
interfaceHmap.put("QC_TYPE", "");
interfaceHmap.put("TRANS_DT_ACK", "");
interfaceHmap.put("STRO_PREF", "");
interfaceHmap.put("LINE_NO", lineNo);
interfaceArrList.add(interfaceHmap);
}
rs.close();rs = null;
pstmt.close();pstmt = null;
if(flag == 0)
{
errString = itmDBAccessEJB.getErrorString("","RECNOTSORA","","",conn);
return errString;
}
else
{
commonWmsUtility.updateAwmsInterface(interfaceArrList,loginSite,conn);
}
} }
else else
{ {
...@@ -333,7 +415,7 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR ...@@ -333,7 +415,7 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR
palletNo = "",palletStatus = "",lockStat = "",qcType = "",stroPref = "",palletRej = "",palletRejDesc = "",confirmed = "",siteCode = ""; palletNo = "",palletStatus = "",lockStat = "",qcType = "",stroPref = "",palletRej = "",palletRejDesc = "",confirmed = "",siteCode = "";
String transactionId = ""; String transactionId = "";
double quantity = 0, noArtQuot = 0,noArtRem = 0,notArt = 0,shipperSize = 0,totalQuantity = 0; double quantity = 0, noArtQuot = 0,noArtRem = 0,notArt = 0,shipperSize = 0,totalQuantity = 0,qtyPerArt = 0;
Timestamp today = new Timestamp(System.currentTimeMillis()); Timestamp today = new Timestamp(System.currentTimeMillis());
Timestamp expDate = null; Timestamp expDate = null;
...@@ -379,7 +461,15 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR ...@@ -379,7 +461,15 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR
} }
else else
{ {
sql = "SELECT ITEM_CODE,LINE_NO,QUANTITY,UNIT__STD,LOT_NO,LOT_SL,MFG_DATE,EXP_DATE,LOC_CODE,SITE_CODE FROM SORDALLOC WHERE SALE_ORDER = ?"; //sql = "SELECT ITEM_CODE,LINE_NO,QUANTITY,UNIT__STD,LOT_NO,LOT_SL,MFG_DATE,EXP_DATE,LOC_CODE,SITE_CODE FROM SORDALLOC WHERE SALE_ORDER = ?";
sql = "SELECT D.ITEM_CODE,D.LINE_NO,D.QUANTITY,D.UNIT,D.LOT_NO,D.LOT_SL,D.SITE_CODE,D.LOC_CODE,S.NO_ART,S.QTY_PER_ART"
+" FROM STOCK S,SORDALLOC D WHERE"
+" S.ITEM_CODE = D.ITEM_CODE"
+" AND S.LOT_NO = D.LOT_NO"
+" AND S.LOT_SL = D.LOT_SL"
+" AND S.LOC_CODE = D.LOC_CODE"
+" AND S.SITE_CODE = D.SITE_CODE"
+" AND D.SALE_ORDER = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId); pstmt.setString(1, tranId);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -394,13 +484,15 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR ...@@ -394,13 +484,15 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR
lineNo = lineNo.substring(lineNo.length()-3); lineNo = lineNo.substring(lineNo.length()-3);
quantity = rs.getDouble("QUANTITY"); quantity = rs.getDouble("QUANTITY");
unit = checkNullAndTrim(rs.getString("UNIT__STD")); unit = checkNullAndTrim(rs.getString("UNIT"));
lotNo = checkNullAndTrim(rs.getString("LOT_NO")); lotNo = checkNullAndTrim(rs.getString("LOT_NO"));
lotSl = checkNullAndTrim(rs.getString("LOT_SL")); lotSl = checkNullAndTrim(rs.getString("LOT_SL"));
//mfgDate = rs.getTimestamp("MFG_DATE"); //mfgDate = rs.getTimestamp("MFG_DATE");
//expDate = rs.getTimestamp("EXP_DATE"); //expDate = rs.getTimestamp("EXP_DATE");
palletNo = checkNullAndTrim(rs.getString("LOC_CODE")); palletNo = checkNullAndTrim(rs.getString("LOC_CODE"));
siteCode = checkNullAndTrim(rs.getString("SITE_CODE"));
notArt = rs.getDouble("NO_ART");
qtyPerArt = rs.getDouble("QTY_PER_ART");
/*hm = getPalletizedAttributes(itemCode,siteCode,conn); /*hm = getPalletizedAttributes(itemCode,siteCode,conn);
familyGrp = (String) hm.get("LOC_ZONE__PREF"); familyGrp = (String) hm.get("LOC_ZONE__PREF");
...@@ -409,7 +501,7 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR ...@@ -409,7 +501,7 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR
//transactionId = generateTranTd("w_interface2",today.toString(),loginSite,conn); //transactionId = generateTranTd("w_interface2",today.toString(),loginSite,conn);
HashMap hm = new HashMap(); /*HashMap hm = new HashMap();
hm = commonWmsUtility.getItemVoumeMap(itemCode,lotNo,conn); hm = commonWmsUtility.getItemVoumeMap(itemCode,lotNo,conn);
shipperSize = (Double) hm.get("PACK_SIZE"); shipperSize = (Double) hm.get("PACK_SIZE");
...@@ -421,9 +513,8 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR ...@@ -421,9 +513,8 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR
} }
notArt = noArtQuot + noArtRem; notArt = noArtQuot + noArtRem;
totalQuantity = notArt * shipperSize; totalQuantity = notArt * shipperSize;
System.out.println("Quantity["+quantity+"]ShipperSize["+shipperSize+"]noArtQuot["+noArtQuot+"]" System.out.println("Quantity["+quantity+"]ShipperSize["+shipperSize+"]noArtQuot["+noArtQuot+"]"
+ "noArtRem["+noArtRem+"]notArt["+notArt+"]TotalQuantity["+totalQuantity+"]"); + "noArtRem["+noArtRem+"]notArt["+notArt+"]TotalQuantity["+totalQuantity+"]");*/
HashMap interfaceHmap = new HashMap(); HashMap interfaceHmap = new HashMap();
...@@ -431,30 +522,30 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR ...@@ -431,30 +522,30 @@ public class PalletRequisitionActEJB extends ActionHandlerEJB implements PalletR
interfaceHmap.put("ITEM_CODE", itemCode); interfaceHmap.put("ITEM_CODE", itemCode);
interfaceHmap.put("DESCR", ""); interfaceHmap.put("DESCR", "");
interfaceHmap.put("UNIT", unit); interfaceHmap.put("UNIT", unit);
interfaceHmap.put("ITEM_TYPE", itemType); interfaceHmap.put("ITEM_TYPE", "");
interfaceHmap.put("FAMILY_GRP", familyGrp); interfaceHmap.put("FAMILY_GRP", "");
interfaceHmap.put("IN_OUT", "O"); interfaceHmap.put("IN_OUT", "O");
interfaceHmap.put("REF_SER", "S-ORD"); interfaceHmap.put("REF_SER", "S-ORD");
interfaceHmap.put("REF_ID", tranId); interfaceHmap.put("REF_ID", tranId);
interfaceHmap.put("TRAN_DATE", checkNullAndTrim(String.valueOf(today))); interfaceHmap.put("TRAN_DATE", checkNullAndTrim(String.valueOf(today)));
interfaceHmap.put("LOT_NO", lotNo); interfaceHmap.put("LOT_NO", lotNo);
interfaceHmap.put("LOT_SL", lotSl); interfaceHmap.put("LOT_SL", lotSl);
interfaceHmap.put("QUANTITY", String.valueOf(noArtQuot)); interfaceHmap.put("QUANTITY", String.valueOf(notArt));
interfaceHmap.put("QTY_PER_ART", String.valueOf(shipperSize)); interfaceHmap.put("QTY_PER_ART", String.valueOf(qtyPerArt));
interfaceHmap.put("TOTAL_QTY", String.valueOf(totalQuantity)); interfaceHmap.put("TOTAL_QTY", String.valueOf(quantity));
System.out.println("exp_date="+expDate); System.out.println("exp_date="+expDate);
System.out.println("Mfg_date="+mfgDate); System.out.println("Mfg_date="+mfgDate);
interfaceHmap.put("EXP_DATE", checkNullAndTrim(String.valueOf(expDate))); interfaceHmap.put("EXP_DATE", "");
interfaceHmap.put("MFG_DATE", checkNullAndTrim(String.valueOf(mfgDate))); interfaceHmap.put("MFG_DATE", "");
interfaceHmap.put("PALLET_NO", palletNo); interfaceHmap.put("PALLET_NO", palletNo);
interfaceHmap.put("MSG_STAT", ""); interfaceHmap.put("MSG_STAT", "");
interfaceHmap.put("PALLET_STATUS", palletStatus); interfaceHmap.put("PALLET_STATUS", "");
interfaceHmap.put("LOCK_STAT", lockStat); interfaceHmap.put("LOCK_STAT", "");
interfaceHmap.put("ERR_COD", ""); interfaceHmap.put("ERR_COD", "");
interfaceHmap.put("ERR_DESC", ""); interfaceHmap.put("ERR_DESC", "");
interfaceHmap.put("QC_TYPE", qcType); interfaceHmap.put("QC_TYPE", "");
interfaceHmap.put("TRANS_DT_ACK", ""); interfaceHmap.put("TRANS_DT_ACK", "");
interfaceHmap.put("STRO_PREF", stroPref); interfaceHmap.put("STRO_PREF", "");
interfaceHmap.put("LINE_NO", lineNo); interfaceHmap.put("LINE_NO", lineNo);
interfaceArrList.add(interfaceHmap); interfaceArrList.add(interfaceHmap);
......
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