Commit 396e762d authored by smestry's avatar smestry

W15FSUN008, Updated class file for Palletization, Validation for QC sample...

W15FSUN008, Updated class file for Palletization, Validation for QC sample type. values for Qc_type and pallet_status in swma_to_awms table.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@99519 ce508802-f39f-4f6c-b175-0d175dae99d5
parent ded90e7e
...@@ -462,7 +462,8 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf ...@@ -462,7 +462,8 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
pstmt = null; pstmt = null;
sql = "select det.item_code, det.lot_no, det.lot_sl, det.quantity, det.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, i.descr, i.unit, i.item_type " + "hdr.inv_stat, det.site_code, det.loc_code, hdr.tran_date, det.line_no, i.descr, i.unit, i.item_type, "
+ "det.qc_sample_type, hdr.pallet_status "
+ "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 "; + "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);
...@@ -580,7 +581,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf ...@@ -580,7 +581,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
if(pstmt1 != null){ pstmt1.close(); pstmt1 = null; } if(pstmt1 != null){ pstmt1.close(); pstmt1 = null; }
if(rs1 != null){ rs1.close(); rs1 = null; } if(rs1 != null){ rs1.close(); rs1 = null; }
//Pallet Status /*//Pallet Status
if(interfaceQtyRem == 0) if(interfaceQtyRem == 0)
{ {
palletStatus = "F"; palletStatus = "F";
...@@ -589,8 +590,8 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf ...@@ -589,8 +590,8 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
{ {
palletStatus = "P"; palletStatus = "P";
} }
System.out.println("palletStatus ::::::::::::: " + palletStatus); System.out.println("palletStatus ::::::::::::: " + palletStatus); */
/*
// QC Type // QC Type
sql = "select qc_reqd from siteitem where item_code = ? and site_code = ? "; sql = "select qc_reqd from siteitem where item_code = ? and site_code = ? ";
pstmt1 = conn1.prepareStatement(sql); pstmt1 = conn1.prepareStatement(sql);
...@@ -626,7 +627,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf ...@@ -626,7 +627,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
System.out.println("qcReqd ::::::::::::: " + qcReqd); System.out.println("qcReqd ::::::::::::: " + qcReqd);
System.out.println("procMth ::::::::::::: " + procMth); System.out.println("procMth ::::::::::::: " + procMth);
System.out.println("qcType ::::::::::::: " + qcType); System.out.println("qcType ::::::::::::: " + qcType);
*/
/* lineNoInterface = " " + rs.getString("line_no"); /* lineNoInterface = " " + rs.getString("line_no");
lineNoInterface = lineNoInterface.substring( lineNoInterface.length()-3 );*/ lineNoInterface = lineNoInterface.substring( lineNoInterface.length()-3 );*/
lineNoInterface = checkNullAndTrim(rs.getString("line_no")); lineNoInterface = checkNullAndTrim(rs.getString("line_no"));
...@@ -659,12 +660,12 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf ...@@ -659,12 +660,12 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
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("pallet_no"))); hm.put("PALLET_NO", checkNullAndTrim(rs.getString("pallet_no")));
hm.put("PALLET_STATUS", checkNullAndTrim(palletStatus)); hm.put("PALLET_STATUS", checkNullAndTrim(rs.getString("pallet_status")));
hm.put("MSG_STAT", "N"); hm.put("MSG_STAT", "N");
hm.put("LOCK_STAT", checkNullAndTrim(invStat)); hm.put("LOCK_STAT", checkNullAndTrim(invStat));
hm.put("ERR_COD", ""); hm.put("ERR_COD", "");
hm.put("ERR_DESC", ""); hm.put("ERR_DESC", "");
hm.put("QC_TYPE", checkNullAndTrim(qcType)); hm.put("QC_TYPE", checkNullAndTrim(rs.getString("qc_sample_type")));
hm.put("TRANS_DT_ACK", ""); hm.put("TRANS_DT_ACK", "");
//hm.put("STRO_PREF", ""); //hm.put("STRO_PREF", "");
hm.put("STRO_PREF", stroPref); hm.put("STRO_PREF", stroPref);
......
...@@ -267,8 +267,9 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca ...@@ -267,8 +267,9 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
System.out.println("DOM1----->>["+genericUtility.serializeDom(dom1).toString()+"]"); System.out.println("DOM1----->>["+genericUtility.serializeDom(dom1).toString()+"]");
System.out.println("DOM2----->>["+genericUtility.serializeDom(dom2).toString()+"]"); System.out.println("DOM2----->>["+genericUtility.serializeDom(dom2).toString()+"]");
String familyGrp = "", qcType = "", stroPref = "", familyGrpDB = "", qcTypeDB = "", stroPrefDB = "", lotNo = "", String familyGrp = "", qcType = "", stroPref = "", familyGrpDB = "", qcTypeDB = "", stroPrefDB = "", lotNo = "", qcSampleType = "",
lotSl = "", statusDB = "", status = "", itemCode = "", itemCodeDB = "", quantity = "", statusQ = "", lotNoDB = "", lotSlDB = ""; lotSl = "", statusDB = "", status = "", itemCode = "", itemCodeDB = "", quantity = "", statusQ = "", lotNoDB = "", lotSlDB = "",
qcSampleTypeDB = "";
HashMap hm = new HashMap(); HashMap hm = new HashMap();
HashMap hm1 = new HashMap(); HashMap hm1 = new HashMap();
HashMap hm2 = new HashMap(); HashMap hm2 = new HashMap();
...@@ -285,6 +286,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca ...@@ -285,6 +286,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
lotNo = checkNullAndTrim(genericUtility.getColumnValue("lot_no",dom)); lotNo = checkNullAndTrim(genericUtility.getColumnValue("lot_no",dom));
lotSl = checkNullAndTrim(genericUtility.getColumnValue("lot_sl",dom)); lotSl = checkNullAndTrim(genericUtility.getColumnValue("lot_sl",dom));
palletNo = checkNullAndTrim(genericUtility.getColumnValue("pallet_no",dom1)); palletNo = checkNullAndTrim(genericUtility.getColumnValue("pallet_no",dom1));
qcSampleType = checkNullAndTrim(genericUtility.getColumnValue("qc_sample_type", dom));
System.out.println("itemCode :::::::::::::: " + itemCode); System.out.println("itemCode :::::::::::::: " + itemCode);
System.out.println("quantity :::::::::::::: " + quantity); System.out.println("quantity :::::::::::::: " + quantity);
...@@ -372,12 +374,15 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca ...@@ -372,12 +374,15 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
itemCodeDB = (String) hm2.get("ITEM_CODE"); itemCodeDB = (String) hm2.get("ITEM_CODE");
lotNoDB = (String) hm2.get("LOT_NO"); lotNoDB = (String) hm2.get("LOT_NO");
//lotSlDB = (String) hm2.get("LOT_SL"); //lotSlDB = (String) hm2.get("LOT_SL");
qcSampleTypeDB = (String) hm2.get("QC_SAMPLE_TYPE");
System.out.println("itemCodeDB :::::::::: " + itemCodeDB); System.out.println("itemCodeDB :::::::::: " + itemCodeDB);
System.out.println("lotNoDB :::::::::: " + lotNoDB); System.out.println("lotNoDB :::::::::: " + lotNoDB);
System.out.println("qcSampleTypeDB :::::::::: " + qcSampleTypeDB);
if(itemCodeDB.length() > 0) if(itemCodeDB.length() > 0)
{ {
// Validation for Analysis Class
hm = commonWmsUtility.getPalletizedAttributes(itemCode, loginSite, conn); hm = commonWmsUtility.getPalletizedAttributes(itemCode, loginSite, conn);
familyGrp = (String) hm.get("LOC_ZONE__PREF"); familyGrp = (String) hm.get("LOC_ZONE__PREF");
qcType = (String) hm.get("PROC_MTH"); qcType = (String) hm.get("PROC_MTH");
...@@ -388,7 +393,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca ...@@ -388,7 +393,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
qcTypeDB = (String) hm1.get("PROC_MTH"); qcTypeDB = (String) hm1.get("PROC_MTH");
stroPrefDB = (String) hm1.get("ANALYSIS_CLASS"); stroPrefDB = (String) hm1.get("ANALYSIS_CLASS");
/* /*
System.out.println("familyGrp :::::::::: " + familyGrp); System.out.println("familyGrp :::::::::: " + familyGrp);
System.out.println("qcType :::::::::: " + qcType); System.out.println("qcType :::::::::: " + qcType);
System.out.println("stroPref :::::::::: " + stroPref); System.out.println("stroPref :::::::::: " + stroPref);
...@@ -406,8 +411,8 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca ...@@ -406,8 +411,8 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
// Validation for QC Order Status
System.out.println("Checking validation for QC order status :::::::::: " ); System.out.println("Checking validation for QC order status :::::::::: " );
statusDB = getItemQcStatus(itemCodeDB, lotNoDB, loginSite, conn); statusDB = getItemQcStatus(itemCodeDB, lotNoDB, loginSite, conn);
status = getItemQcStatus(itemCode, lotNo, loginSite, conn); status = getItemQcStatus(itemCode, lotNo, loginSite, conn);
...@@ -420,8 +425,9 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca ...@@ -420,8 +425,9 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
status = "C"; status = "C";
} }
System.out.println("value of statusDB after if :::::::::: " + statusDB); /*
System.out.println("value of status after if :::::::::: " + status); System.out.println("value of statusDB after if :::::::::: " + statusDB);
System.out.println("value of status after if :::::::::: " + status);*/
if(!statusDB.equalsIgnoreCase(status)) if(!statusDB.equalsIgnoreCase(status))
{ {
...@@ -430,6 +436,21 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca ...@@ -430,6 +436,21 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
errList.add( errCode ); errList.add( errCode );
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
// Validation for QC Sample Type
System.out.println("Checking validation for QC Sample Type :::::::::: " );
/*System.out.println("value of qcSampleTypeDB :::::::::: " + qcSampleTypeDB);
System.out.println("value of qcSampleType :::::::::: " + qcSampleType);*/
if(!qcSampleTypeDB.equalsIgnoreCase(qcSampleType))
{
System.out.println(" item code is not of same qc sample type :::::::::: ");
errCode = "VTINVQST";
errList.add( errCode );
errFields.add(childNodeName.toLowerCase());
}
} }
} }
} }
...@@ -705,10 +726,10 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca ...@@ -705,10 +726,10 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
HashMap hm = new HashMap(); HashMap hm = new HashMap();
PreparedStatement pstmt = null ; PreparedStatement pstmt = null ;
ResultSet rs = null ; ResultSet rs = null ;
String sql = "", itemCodeDB = "", lotNoDB = "", lotSlDB = ""; String sql = "", itemCodeDB = "", lotNoDB = "", lotSlDB = "", qcSampleTypeDB = "";
try try
{ {
sql ="select distinct(item_code) as item_code, lot_no from pallet_hdr h, pallet_det d where d.pallet_no = ? and " sql ="select distinct(item_code) as item_code, lot_no, d.qc_sample_type from pallet_hdr h, pallet_det d where d.pallet_no = ? and "
+ "h.confirmed = ? and h.site_code = ? and d.tran_id = h.tran_id and rownum < 2 "; + "h.confirmed = ? and h.site_code = ? and d.tran_id = h.tran_id and rownum < 2 ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, palletNo); pstmt.setString(1, palletNo);
...@@ -718,7 +739,8 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca ...@@ -718,7 +739,8 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
if(rs.next()) if(rs.next())
{ {
itemCodeDB = checkNullAndTrim(rs.getString("item_code")); itemCodeDB = checkNullAndTrim(rs.getString("item_code"));
lotNoDB = checkNullAndTrim(rs.getString("lot_no")); lotNoDB = checkNullAndTrim(rs.getString("lot_no"));
qcSampleTypeDB = checkNullAndTrim(rs.getString("qc_sample_type"));
//lotSlDB = checkNullAndTrim(rs.getString("lot_sl")); //lotSlDB = checkNullAndTrim(rs.getString("lot_sl"));
} }
if(pstmt != null){ pstmt.close(); pstmt = null; } if(pstmt != null){ pstmt.close(); pstmt = null; }
...@@ -726,6 +748,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca ...@@ -726,6 +748,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
hm.put("ITEM_CODE", itemCodeDB); hm.put("ITEM_CODE", itemCodeDB);
hm.put("LOT_NO", lotNoDB); hm.put("LOT_NO", lotNoDB);
hm.put("QC_SAMPLE_TYPE", qcSampleTypeDB);
//hm.put("LOT_SL", lotSlDB); //hm.put("LOT_SL", lotSlDB);
} }
catch(Exception e) catch(Exception e)
...@@ -793,6 +816,48 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca ...@@ -793,6 +816,48 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
System.out.println("return value from getItemQcStatus :::::::::: " + status); System.out.println("return value from getItemQcStatus :::::::::: " + status);
return status; return status;
} }
private String getQcSampleType(String itemCode, String siteCode, Connection conn) throws Exception
{
PreparedStatement pstmt = null ;
ResultSet rs = null ;
String sql = "", qcSampleType = "";
try
{
sql ="select qc_sample_type from siteitem where item_code = ? and site_code = ? " ;
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
pstmt.setString(2, siteCode);
rs = pstmt.executeQuery();
if(rs.next())
{
qcSampleType = checkNullAndTrim(rs.getString("qc_sample_type"));
}
if(pstmt != null){ pstmt.close(); pstmt = null; }
if(rs != null){ rs.close(); rs = null; }
}
catch(Exception e)
{
System.out.println("Exception in getQcSampleType ::::::: " + e);
e.printStackTrace();
throw new Exception(e);
}
finally
{
if(rs!=null)
{
rs.close();
rs = null;
}
if(pstmt!=null)
{
pstmt.close();
pstmt = null;
}
}
System.out.println("return value from getQcSampleType :::::::::: " + qcSampleType);
return qcSampleType;
}
@Override @Override
public String itemChanged() throws RemoteException, ITMException public String itemChanged() throws RemoteException, ITMException
...@@ -1011,7 +1076,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca ...@@ -1011,7 +1076,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
case 3://Case 3. Start case 3://Case 3. Start
{ {
String palletNo = "", domID = "", itemCode = "", descr = "", lotNo = "", lotSl = "", unit = "", locCode = ""; String palletNo = "", domID = "", itemCode = "", descr = "", lotNo = "", lotSl = "", unit = "", locCode = "", qcSampleType = "";
int noArt = 0, lineNo = 0; int noArt = 0, lineNo = 0;
double quantity = 0, allocQty = 0; double quantity = 0, allocQty = 0;
...@@ -1030,11 +1095,6 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca ...@@ -1030,11 +1095,6 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
System.out.println("palletNo----------->>["+palletNo+"]"); System.out.println("palletNo----------->>["+palletNo+"]");
System.out.println("lotNo 1st ----------->>["+lotNo+"]"); System.out.println("lotNo 1st ----------->>["+lotNo+"]");
System.out.println("lotSl 1st ----------->>["+lotSl+"]"); System.out.println("lotSl 1st ----------->>["+lotSl+"]");
/*NodeList nodeList = allFormDataDom.getElementsByTagName("Detail3");
System.out.println("sds : "+nodeList.item(0).getNodeName());
domID = nodeList.item(0).getAttributes().getNamedItem("domID").getNodeValue();
System.out.println("domID ::::::::::::::::: "+domID);*/
if( currentColumn.trim().equalsIgnoreCase( "itm_default" ) ) if( currentColumn.trim().equalsIgnoreCase( "itm_default" ) )
{ {
...@@ -1044,10 +1104,10 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca ...@@ -1044,10 +1104,10 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
{ {
System.out.println("--------------inside itm_default edit mode details 3 ----------------------"); System.out.println("--------------inside itm_default edit mode details 3 ----------------------");
sql = "select d.item_code, i.descr, d.lot_no, d.lot_sl, d.quantity, i.unit, d.no_art, d.loc_code, d.line_no, d.alloc_qty " sql = "select d.item_code, i.descr, d.lot_no, d.lot_sl, d.quantity, i.unit, d.no_art, d.loc_code, d.line_no, d.alloc_qty, d.qc_sample_type "
+ "from pallet_hdr h, pallet_det d, item i " + "from pallet_hdr h, pallet_det d, item i "
+ "where d.site_code = ? and d.tran_id = ? and d.tran_id = h.tran_id and " + "where d.site_code = ? and d.tran_id = ? and d.tran_id = h.tran_id and "
+"d.item_code = i.item_code "; + "d.item_code = i.item_code ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, loginSite); pstmt.setString(1, loginSite);
pstmt.setString(2, tranId); pstmt.setString(2, tranId);
...@@ -1059,12 +1119,12 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca ...@@ -1059,12 +1119,12 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
descr = checkNullAndTrim(rs.getString("descr")); descr = checkNullAndTrim(rs.getString("descr"));
lotNo = checkNullAndTrim(rs.getString("lot_no")); lotNo = checkNullAndTrim(rs.getString("lot_no"));
lotSl = checkNullAndTrim(rs.getString("lot_sl")); lotSl = checkNullAndTrim(rs.getString("lot_sl"));
quantity = rs.getDouble("quantity"); quantity = rs.getDouble("quantity");
unit = checkNullAndTrim(rs.getString("unit")); unit = checkNullAndTrim(rs.getString("unit"));
noArt = rs.getInt("no_art"); noArt = rs.getInt("no_art");
locCode = checkNullAndTrim(rs.getString("loc_code")); locCode = checkNullAndTrim(rs.getString("loc_code"));
allocQty = rs.getDouble("alloc_qty"); allocQty = rs.getDouble("alloc_qty");
qcSampleType = checkNullAndTrim(rs.getString("qc_sample_type"));
valueXmlString.append("<Detail3 domID='"+lineNo+"' selected=\"Y\">\r\n"); valueXmlString.append("<Detail3 domID='"+lineNo+"' selected=\"Y\">\r\n");
valueXmlString.append("<attribute selected=\"Y\" updateFlag=\"E\" status=\"O\" pkNames=\"\" />\r\n"); valueXmlString.append("<attribute selected=\"Y\" updateFlag=\"E\" status=\"O\" pkNames=\"\" />\r\n");
...@@ -1082,6 +1142,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca ...@@ -1082,6 +1142,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
valueXmlString.append( "<item_unit><![CDATA[" ).append( unit ).append( "]]></item_unit>\r\n" ); valueXmlString.append( "<item_unit><![CDATA[" ).append( unit ).append( "]]></item_unit>\r\n" );
valueXmlString.append( "<no_art><![CDATA[" ).append( noArt ).append( "]]></no_art>\r\n" ); valueXmlString.append( "<no_art><![CDATA[" ).append( noArt ).append( "]]></no_art>\r\n" );
valueXmlString.append( "<alloc_qty><![CDATA[" ).append( allocQty ).append( "]]></alloc_qty>\r\n" ); valueXmlString.append( "<alloc_qty><![CDATA[" ).append( allocQty ).append( "]]></alloc_qty>\r\n" );
valueXmlString.append( "<qc_sample_type><![CDATA[" ).append( qcSampleType ).append( "]]></qc_sample_type>\r\n" );
valueXmlString.append("</Detail3>\r\n"); valueXmlString.append("</Detail3>\r\n");
} }
if(pstmt != null) { pstmt.close(); pstmt = null; } if(pstmt != null) { pstmt.close(); pstmt = null; }
...@@ -1103,16 +1164,14 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca ...@@ -1103,16 +1164,14 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
valueXmlString.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\" />\r\n"); valueXmlString.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\" />\r\n");
valueXmlString.append( "<tran_id><![CDATA[" ).append( tranId ).append( "]]></tran_id>\r\n" ); valueXmlString.append( "<tran_id><![CDATA[" ).append( tranId ).append( "]]></tran_id>\r\n" );
//valueXmlString.append( "<line_no><![CDATA[" ).append( lineNo ).append( "]]></line_no>\r\n" );
} }
else else
{ {
//valueXmlString.append("<Detail3 domID='"+domID+"' selected=\"N\">\r\n");
valueXmlString.append("<Detail3 domID='"+lineNo+"' selected=\"N\">\r\n"); valueXmlString.append("<Detail3 domID='"+lineNo+"' selected=\"N\">\r\n");
valueXmlString.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\" />\r\n"); valueXmlString.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\" />\r\n");
valueXmlString.append( "<tran_id><![CDATA[]]></tran_id>\r\n" ); valueXmlString.append( "<tran_id><![CDATA[]]></tran_id>\r\n" );
//valueXmlString.append( "<line_no><![CDATA[" ).append( domID ).append( "]]></line_no>\r\n" );
} }
valueXmlString.append( "<line_no><![CDATA[]]></line_no>\r\n" ); valueXmlString.append( "<line_no><![CDATA[]]></line_no>\r\n" );
...@@ -1127,6 +1186,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca ...@@ -1127,6 +1186,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
valueXmlString.append( "<item_unit><![CDATA[]]></item_unit>\r\n" ); valueXmlString.append( "<item_unit><![CDATA[]]></item_unit>\r\n" );
valueXmlString.append( "<no_art><![CDATA[]]></no_art>\r\n" ); valueXmlString.append( "<no_art><![CDATA[]]></no_art>\r\n" );
valueXmlString.append( "<alloc_qty><![CDATA[]]></alloc_qty>\r\n" ); valueXmlString.append( "<alloc_qty><![CDATA[]]></alloc_qty>\r\n" );
valueXmlString.append( "<qc_sample_type><![CDATA[]]></qc_sample_type>\r\n" );
valueXmlString.append("</Detail3>\r\n"); valueXmlString.append("</Detail3>\r\n");
} }
...@@ -1135,14 +1195,16 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca ...@@ -1135,14 +1195,16 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
{ {
System.out.println("--------------inside lot_sl ----------------------"); System.out.println("--------------inside lot_sl ----------------------");
sql = "select s.item_code, i.descr, s.quantity, s.unit, s.no_art, s.loc_code, s.alloc_qty from stock s, item i " sql = "select s.item_code, i.descr, s.quantity, s.unit, s.no_art, s.loc_code, s.alloc_qty, si.qc_sample_type "
+ "where s.lot_no = ? and s.lot_sl = ? and s.site_code = ? and s.quantity > 0 and inv_stat != ? " + "from stock s, item i, siteitem si "
+ "and s.item_code = i.item_code "; + "where s.lot_no = ? and s.lot_sl = ? and s.site_code = ? and s.quantity > 0 and inv_stat not in (?,?) "
+ "and s.item_code = i.item_code and i.item_code = si.item_code and s.item_code = si.item_code and s.site_code = si.site_code ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lotNo); pstmt.setString(1, lotNo);
pstmt.setString(2, lotSl); pstmt.setString(2, lotSl);
pstmt.setString(3, loginSite); pstmt.setString(3, loginSite);
pstmt.setString(4, "AWMS"); pstmt.setString(4, "AWMS");
pstmt.setString(5, "AWMSQ");
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
...@@ -1153,6 +1215,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca ...@@ -1153,6 +1215,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
noArt = rs.getInt("no_art"); noArt = rs.getInt("no_art");
locCode = checkNullAndTrim(rs.getString("loc_code")); locCode = checkNullAndTrim(rs.getString("loc_code"));
allocQty = rs.getDouble("alloc_qty"); allocQty = rs.getDouble("alloc_qty");
qcSampleType = checkNullAndTrim(rs.getString("qc_sample_type"));
lineNo = getMaxLineNo(tranId, palletNo, loginSite, conn); lineNo = getMaxLineNo(tranId, palletNo, loginSite, conn);
System.out.println("lineNo in lot_sl :::::::::::::: " + lineNo); System.out.println("lineNo in lot_sl :::::::::::::: " + lineNo);
...@@ -1164,17 +1227,13 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca ...@@ -1164,17 +1227,13 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
valueXmlString.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\" />\r\n"); valueXmlString.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\" />\r\n");
valueXmlString.append( "<tran_id><![CDATA[" ).append( tranId ).append( "]]></tran_id>\r\n" ); valueXmlString.append( "<tran_id><![CDATA[" ).append( tranId ).append( "]]></tran_id>\r\n" );
//valueXmlString.append( "<line_no><![CDATA[" ).append( lineNo ).append( "]]></line_no>\r\n" );
} }
else else
{ {
//valueXmlString.append("<Detail3 domID='"+domID+"' selected=\"N\">\r\n");
valueXmlString.append("<Detail3 domID='"+lineNo+"' selected=\"N\">\r\n"); valueXmlString.append("<Detail3 domID='"+lineNo+"' selected=\"N\">\r\n");
valueXmlString.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\" />\r\n"); valueXmlString.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\" />\r\n");
valueXmlString.append( "<tran_id><![CDATA[" ).append( "" ).append( "]]></tran_id>\r\n" ); valueXmlString.append( "<tran_id><![CDATA[" ).append( "" ).append( "]]></tran_id>\r\n" );
//valueXmlString.append( "<line_no><![CDATA[" ).append( domID ).append( "]]></line_no>\r\n" );
//valueXmlString.append( "<line_no><![CDATA[]]></line_no>\r\n" );
} }
valueXmlString.append( "<line_no><![CDATA[" ).append( lineNo ).append( "]]></line_no>\r\n" ); valueXmlString.append( "<line_no><![CDATA[" ).append( lineNo ).append( "]]></line_no>\r\n" );
...@@ -1189,6 +1248,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca ...@@ -1189,6 +1248,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
valueXmlString.append( "<item_unit><![CDATA[" ).append( unit ).append( "]]></item_unit>\r\n" ); valueXmlString.append( "<item_unit><![CDATA[" ).append( unit ).append( "]]></item_unit>\r\n" );
valueXmlString.append( "<no_art><![CDATA[" ).append( noArt ).append( "]]></no_art>\r\n" ); valueXmlString.append( "<no_art><![CDATA[" ).append( noArt ).append( "]]></no_art>\r\n" );
valueXmlString.append( "<alloc_qty><![CDATA[" ).append( allocQty ).append( "]]></alloc_qty>\r\n" ); valueXmlString.append( "<alloc_qty><![CDATA[" ).append( allocQty ).append( "]]></alloc_qty>\r\n" );
valueXmlString.append( "<qc_sample_type><![CDATA[" ).append( qcSampleType ).append( "]]></qc_sample_type>\r\n" );
valueXmlString.append("</Detail3>\r\n"); valueXmlString.append("</Detail3>\r\n");
} }
if(pstmt != null) { pstmt.close(); pstmt = null; } if(pstmt != null) { pstmt.close(); pstmt = null; }
......
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