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