Commit c1fe0a6a authored by smestry's avatar smestry

W15FSUN008, Updated class file Palletization confirm.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98908 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 6290f46f
...@@ -102,7 +102,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf ...@@ -102,7 +102,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
else if(!tranIdList.contains(tranId) && tranId.length() > 0) else if(!tranIdList.contains(tranId) && tranId.length() > 0)
{ {
System.out.println("Tran Id does not exist in pallet hdr :::::::::: "); System.out.println("Tran Id does not exist in pallet hdr :::::::::: ");
errCode = "VTSTRTRIDA"; errCode = "VTINVTID";
errList.add( errCode ); errList.add( errCode );
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
...@@ -269,7 +269,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf ...@@ -269,7 +269,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
String sql = ""; String sql = "";
try try
{ {
sql = "select tran_id from pallet_hdr where confirmed = ? and site_code = ? "; sql = "select det.tran_id as TRAN_ID from pallet_det det, pallet_hdr hdr where hdr.confirmed = ? and hdr.site_code = ? and hdr.tran_id = det.tran_id ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, "N"); pstmt.setString(1, "N");
pstmt.setString(2, siteCode); pstmt.setString(2, siteCode);
...@@ -306,9 +306,9 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf ...@@ -306,9 +306,9 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
private void confirm( String tranId, String siteCode, Connection conn1 ) throws ITMException, SQLException private void confirm( String tranId, String siteCode, Connection conn1 ) throws ITMException, SQLException
{ {
String errString = "", sql = "", interfaceTranId = "", tranDate = "", objName = "", invStat = "", available = "", familyGrp = "", qcType = "", String sql = "", tranDate = "", invStat = "", qcType = "",
stroPref = "", expDate = "", mfgDate = "", palletStatus = "", qcReqd = "", procMth = ""; expDate = "", mfgDate = "", palletStatus = "", qcReqd = "", procMth = "", lineNoInterface = "";
double quantity = 0, holdQuantity = 0, quantityDB = 0, packSize = 0, interfaceQty = 0, qtyPerArt = 0, interfaceQtyRem = 0, totQuantity = 0; double holdQuantity = 0, quantityDB = 0, packSize = 0, interfaceQty = 0, interfaceQtyRem = 0, totQuantity = 0;
PreparedStatement pstmt = null, pstmt1 = null; PreparedStatement pstmt = null, pstmt1 = null;
ResultSet rs = null, rs1 = null; ResultSet rs = null, rs1 = null;
boolean isError = false; boolean isError = false;
...@@ -340,9 +340,9 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf ...@@ -340,9 +340,9 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
sql = "select det.item_code, det.lot_no, det.lot_sl, det.quantity, hdr.pallet_no, " sql = "select det.item_code, det.lot_no, det.lot_sl, det.quantity, det.pallet_no, "
+ "hdr.inv_stat, det.site_code, det.loc_code, hdr.tran_date, det.line_no " + "hdr.inv_stat, det.site_code, det.loc_code, hdr.tran_date, det.line_no, i.descr, i.unit, i.item_type "
+ "from pallet_hdr hdr, pallet_det det where hdr.tran_id = det.tran_id and det.tran_id = ? "; + "from pallet_hdr hdr, pallet_det det, item i where hdr.tran_id = det.tran_id and det.tran_id = ? and i.item_code = det.item_code ";
pstmt = conn1.prepareStatement(sql); pstmt = conn1.prepareStatement(sql);
pstmt.setString(1, tranId); pstmt.setString(1, tranId);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -362,10 +362,8 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf ...@@ -362,10 +362,8 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
holdQuantity = rs1.getDouble("hold_qty"); holdQuantity = rs1.getDouble("hold_qty");
} }
System.out.println("holdQuantity ::::::::::::: " + holdQuantity); System.out.println("holdQuantity ::::::::::::: " + holdQuantity);
pstmt1.close(); if(pstmt1 != null){ pstmt1.close(); pstmt1 = null; }
pstmt1 = null; if(rs1 != null){ rs1.close(); rs1 = null; }
rs1.close();
rs1 = null;
// InvStat // InvStat
if(holdQuantity > 0) if(holdQuantity > 0)
...@@ -389,10 +387,8 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf ...@@ -389,10 +387,8 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
lockCode = checkNullAndTrim(rs1.getString("lock_code")); lockCode = checkNullAndTrim(rs1.getString("lock_code"));
} }
System.out.println("lockCode ::::::::::::: " + lockCode); System.out.println("lockCode ::::::::::::: " + lockCode);
pstmt1.close(); if(pstmt1 != null){ pstmt1.close(); pstmt1 = null; }
pstmt1 = null; if(rs1 != null){ rs1.close(); rs1 = null; }
rs1.close();
rs1 = null;
if(lockCode.equalsIgnoreCase(nexpLoc)) if(lockCode.equalsIgnoreCase(nexpLoc))
{ {
...@@ -456,10 +452,8 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf ...@@ -456,10 +452,8 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
expDate = rs1.getString("exp_date"); expDate = rs1.getString("exp_date");
mfgDate = rs1.getString("mfg_date"); mfgDate = rs1.getString("mfg_date");
} }
pstmt1.close(); if(pstmt1 != null){ pstmt1.close(); pstmt1 = null; }
pstmt1 = null; if(rs1 != null){ rs1.close(); rs1 = null; }
rs1.close();
rs1 = null;
//Pallet Status //Pallet Status
if(interfaceQtyRem == 0) if(interfaceQtyRem == 0)
...@@ -482,19 +476,13 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf ...@@ -482,19 +476,13 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
{ {
qcReqd = rs1.getString("qc_reqd"); qcReqd = rs1.getString("qc_reqd");
} }
pstmt1.close(); if(pstmt1 != null){ pstmt1.close(); pstmt1 = null; }
pstmt1 = null; if(rs1 != null){ rs1.close(); rs1 = null; }
rs1.close();
rs1 = null;
HashMap hm2 = new HashMap(); HashMap hm2 = new HashMap();
hm2 = commonWmsUtility.getPalletizedAttributes(rs.getString("item_code"), siteCode, conn1); hm2 = commonWmsUtility.getPalletizedAttributes(rs.getString("item_code"), siteCode, conn1);
procMth = (String) hm2.get("PROC_MTH"); procMth = (String) hm2.get("PROC_MTH");
//= parse procMth;
System.out.println("qcReqd ::::::::::::: " + qcReqd);
System.out.println("procMth ::::::::::::: " + procMth);
if("".equalsIgnoreCase(procMth) && procMth.length() <= 0) if("".equalsIgnoreCase(procMth) && procMth.length() <= 0)
{ {
qcType = "N"; qcType = "N";
...@@ -507,15 +495,19 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf ...@@ -507,15 +495,19 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
{ {
qcType = "C"; qcType = "C";
} }
System.out.println("qcReqd ::::::::::::: " + qcReqd);
System.out.println("procMth ::::::::::::: " + procMth);
System.out.println("qcType ::::::::::::: " + qcType); System.out.println("qcType ::::::::::::: " + qcType);
lineNoInterface = " " + rs.getString("line_no");
lineNoInterface = lineNoInterface.substring( lineNoInterface.length()-3 );
HashMap hm = new HashMap(); HashMap hm = new HashMap();
hm.put("TRAN_ID", ""); hm.put("TRAN_ID", "");
hm.put("ITEM_CODE", checkNullAndTrim(rs.getString("item_code"))); hm.put("ITEM_CODE", checkNullAndTrim(rs.getString("item_code")));
hm.put("DESCR", ""); hm.put("DESCR", checkNullAndTrim(rs.getString("descr")));
hm.put("UNIT", ""); hm.put("UNIT", checkNullAndTrim(rs.getString("unit")));
hm.put("ITEM_TYPE", ""); hm.put("ITEM_TYPE", checkNullAndTrim(rs.getString("item_type")));
hm.put("FAMILY_GRP", ""); hm.put("FAMILY_GRP", "");
hm.put("IN_OUT", "I"); hm.put("IN_OUT", "I");
hm.put("REF_SER", "PZ"); hm.put("REF_SER", "PZ");
...@@ -528,7 +520,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf ...@@ -528,7 +520,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
hm.put("TOTAL_QTY", checkNullAndTrim((String.valueOf(totQuantity)))); hm.put("TOTAL_QTY", checkNullAndTrim((String.valueOf(totQuantity))));
hm.put("EXP_DATE", checkNullAndTrim(expDate)); hm.put("EXP_DATE", checkNullAndTrim(expDate));
hm.put("MFG_DATE", checkNullAndTrim(mfgDate)); hm.put("MFG_DATE", checkNullAndTrim(mfgDate));
hm.put("PALLET_NO", checkNullAndTrim(rs.getString("loc_code"))); hm.put("PALLET_NO", checkNullAndTrim(rs.getString("pallet_no")));
hm.put("PALLET_STATUS", checkNullAndTrim(palletStatus)); hm.put("PALLET_STATUS", checkNullAndTrim(palletStatus));
hm.put("MSG_STAT", "N"); hm.put("MSG_STAT", "N");
hm.put("LOCK_STAT", checkNullAndTrim(invStat)); hm.put("LOCK_STAT", checkNullAndTrim(invStat));
...@@ -537,18 +529,17 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf ...@@ -537,18 +529,17 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
hm.put("QC_TYPE", checkNullAndTrim(qcType)); hm.put("QC_TYPE", checkNullAndTrim(qcType));
hm.put("TRANS_DT_ACK", ""); hm.put("TRANS_DT_ACK", "");
hm.put("STRO_PREF", ""); hm.put("STRO_PREF", "");
hm.put("LINE_NO",checkNullAndTrim(String.valueOf(rs.getString("line_no")))); hm.put("LINE_NO", lineNoInterface);
interfaceArrList.add(hm); interfaceArrList.add(hm);
} }
commonWmsUtility.updateAwmsInterface(interfaceArrList, siteCode, conn1); commonWmsUtility.updateAwmsInterface(interfaceArrList, siteCode, conn1);
System.out.println("Inserted into interface2 table ::::::::::::: "); System.out.println("Inserted into interface2 table ::::::::::::: ");
pstmt.close(); if(pstmt != null){ pstmt.close(); pstmt = null; }
pstmt = null; if(rs != null){ rs.close(); rs = null; }
rs.close();
rs = null;
} }
catch (SQLException ex) catch (SQLException ex)
{ {
......
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