Commit df3fc4a2 authored by smestry's avatar smestry

W15FSUN008, Updated class file Palletization.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@99126 ce508802-f39f-4f6c-b175-0d175dae99d5
parent a65f4387
......@@ -390,10 +390,10 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
{
lockCode = checkNullAndTrim(rs1.getString("lock_code"));
}
System.out.println("lockCode ::::::::::::: " + lockCode);
if(pstmt1 != null){ pstmt1.close(); pstmt1 = null; }
if(rs1 != null){ rs1.close(); rs1 = null; }
System.out.println("lockCode ::::::::::::: " + lockCode);
if(lockCode.equalsIgnoreCase(nexpLoc))
{
invStat = "N";
......@@ -522,9 +522,11 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
hm.put("QUANTITY", checkNullAndTrim((String.valueOf(noArt))));
hm.put("QTY_PER_ART",checkNullAndTrim((String.valueOf(qtyPerArt))));
hm.put("TOTAL_QTY", checkNullAndTrim(rs.getString("quantity")));
/*hm.put("QUANTITY", checkNullAndTrim((String.valueOf(interfaceQty))));
/*
hm.put("QUANTITY", checkNullAndTrim((String.valueOf(interfaceQty))));
hm.put("QTY_PER_ART", checkNullAndTrim((String.valueOf(packSize))));
hm.put("TOTAL_QTY", checkNullAndTrim((String.valueOf(totQuantity)))); */
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("pallet_no")));
......
......@@ -27,8 +27,8 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
/**
* The method is defined without any parameter and returns blank string
*/
DistCommon discommon = new DistCommon();
@Override
public String wfValData() throws RemoteException, ITMException
{
return "";
......@@ -145,25 +145,24 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
PreparedStatement pstmt = null ;
ResultSet rs = null ;
int countPalletNo = 0;
double palletQty = 0;
parentNodeList = dom.getElementsByTagName("Detail1");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength();
locationCode = checkNullAndTrim(genericUtility.getColumnValue("loc_code",dom));
palletNo = checkNullAndTrim(genericUtility.getColumnValue("pallet_no",dom));
System.out.println("locationCode ------->>["+locationCode+"]");
//locationCode = checkNullAndTrim(genericUtility.getColumnValue("loc_code", dom));
palletNo = checkNullAndTrim(genericUtility.getColumnValue("pallet_no", dom));
System.out.println("palletNo ------->>["+palletNo+"]");
locStockList = getLocationCode(conn, loginSite);
palletList = getPalletNo(conn, loginSite);
//locStockList = getLocationCode(conn, loginSite);
palletList = getPalletNoList(loginSite, conn);
palletQty = getPalletNoQty(palletNo, loginSite, conn);
sql ="select count(*) from swms_to_awms where pallet_no = ? and schedule_status is null and ref_ser = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, palletNo);
// pstmt.setString(2, "y"); Changed by Wasim
pstmt.setString(2, "PZ");
rs = pstmt.executeQuery();
if(rs.next())
......@@ -178,7 +177,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
System.out.println("childNodeName ------->>["+childNodeName+"]");
/*
if("loc_code".equalsIgnoreCase(childNodeName))
{
System.out.println("Inside loc_code ::::::::::: ");
......@@ -197,7 +196,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
errList.add( errCode );
errFields.add(childNodeName.toLowerCase());
}
}
}*/
/*if("pallet_no__source".equalsIgnoreCase(childNodeName))
{
System.out.println("Inside pallet_no__source ::::::::::: ");
......@@ -240,13 +239,22 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
errList.add( errCode );
errFields.add(childNodeName.toLowerCase());
}
if(locationCode.equals(palletNo))
else if(palletQty > 0)
{
System.out.println("Pallet is not empty :::::::::: ");
errCode = "VMPALLETNO";
errList.add( errCode );
errFields.add(childNodeName.toLowerCase());
}
/*if(locationCode.equals(palletNo))
{
System.out.println("Location Code or Pallet No Source and Pallet No is same :::::::::: ");
errCode = "VTLOCPLT";
errList.add( errCode );
errFields.add(childNodeName.toLowerCase());
}
}*/
/*if(locationCode.equals(palletNo) || palletNoSource.equals(palletNo))
{
System.out.println("Location Code or Pallet No Source and Pallet No is same :::::::::: ");
......@@ -261,7 +269,6 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
errList.add( errCode );
errFields.add(childNodeName.toLowerCase());
}
}
}
break;
......@@ -303,13 +310,13 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
errList.add( errCode );
errFields.add(childNodeName.toLowerCase());
}
if("".equalsIgnoreCase(palletType))
/*if("".equalsIgnoreCase(palletType))
{
System.out.println("Blank Pallet Type :::::::::: ");
errCode = "VMNULLPT";
errList.add( errCode );
errFields.add(childNodeName.toLowerCase());
}
}*/
if(remarks.length() > 60)
{
System.out.println(" Remarks cannot be greater than 60 :::::::::: ");
......@@ -321,6 +328,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
break;
case 3:
System.out.println("------in detail3 validation----------------");
System.out.println("DOM---->>["+genericUtility.serializeDom(dom).toString()+"]");
System.out.println("DOM1----->>["+genericUtility.serializeDom(dom1).toString()+"]");
......@@ -342,21 +350,26 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
lotNo = checkNullAndTrim(genericUtility.getColumnValue("lot_no",dom));
lotSl = checkNullAndTrim(genericUtility.getColumnValue("lot_sl",dom));
locationCode = checkNullAndTrim(genericUtility.getColumnValue("loc_code",dom1));
//locationCode = checkNullAndTrim(genericUtility.getColumnValue("loc_code",dom1));
palletNo = checkNullAndTrim(genericUtility.getColumnValue("pallet_no",dom1));
System.out.println("itemCode :::::::::::::: " + itemCode);
System.out.println("quantity :::::::::::::: " + quantity);
System.out.println("lotNo :::::::::::::: " + lotNo);
System.out.println("lotSl :::::::::::::: " + lotSl);
System.out.println("locationCode :::::::::::::: " + locationCode);
System.out.println("palletNo :::::::::::::: " + palletNo);
sql ="select distinct(item_code) from pallet_hdr h, pallet_det d where d.loc_code = ? and d.pallet_no = ? and "
+ "h.confirmed = 'N' and d.tran_id = h.tran_id and rownum < 2 ";
/*sql ="select distinct(item_code) from pallet_hdr h, pallet_det d where d.loc_code = ? and d.pallet_no = ? and "
+ "h.confirmed = 'N' and d.tran_id = h.tran_id and rownum < 2 ";*/
//Changed by Sneha on 06-11-2015, Request ID: W15FSUN008
sql ="select distinct(item_code) from pallet_hdr h, pallet_det d where d.pallet_no = ? and "
+ "h.confirmed = ? and d.tran_id = h.tran_id and rownum < 2 ";
//End by Sneha on 06-11-2015, Request ID: W15FSUN008
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, locationCode);
pstmt.setString(2, palletNo);
//pstmt.setString(1, locationCode);
pstmt.setString(1, palletNo);
pstmt.setString(2, "N");
rs = pstmt.executeQuery();
if(rs.next())
{
......@@ -435,14 +448,10 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
if(!familyGrpDB.equalsIgnoreCase(familyGrp) || !qcTypeDB.equalsIgnoreCase(qcType) || !stroPrefDB.equalsIgnoreCase(stroPref))
{
System.out.println(" item code is not of same analysis grp :::::::::: ");
//System.out.println(" item code is not of same analysis grp :::::::::: ");
errCode = "VTINVAC";
errList.add( errCode );
errFields.add(childNodeName.toLowerCase());
}
else
{
System.out.println(" analysis class found same :::::::::: ");
}
}
}
......@@ -558,7 +567,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
return msgType;
}
private ArrayList<String> getLocationCode(Connection conn, String loginSite) throws Exception
/*private ArrayList<String> getLocationCode(Connection conn, String loginSite) throws Exception
{
ArrayList<String> colVal = new ArrayList<String>();
PreparedStatement pstmt = null ;
......@@ -596,9 +605,52 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
}
System.out.println("Return List from getLocationCode------>>" + colVal);
return colVal;
}
}*/
private ArrayList<String> getPalletNo(Connection conn, String loginSite) throws Exception
//private ArrayList<String> getPalletNo(String palletNo, String loginSite, Connection conn) throws Exception
private Double getPalletNoQty(String palletNo, String loginSite, Connection conn) throws Exception
{
PreparedStatement pstmt = null ;
ResultSet rs = null ;
String sql = "";
double quantity = 0;
try
{
sql = "select sum(quantity) from stock where loc_code = ? and site_code = ? and inv_stat = ? group by loc_code ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, palletNo);
pstmt.setString(2, loginSite);
pstmt.setString(3, "AWMS");
rs = pstmt.executeQuery();
if(rs.next())
{
quantity = rs.getInt(1);
}
System.out.println("Location in getPalletNo :::::::::: " + quantity);
}
catch(Exception e)
{
System.out.println("Exception in locCode " + 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 from getPalletNo------>>" + quantity);
return quantity;
}
private ArrayList<String> getPalletNoList(String loginSite, Connection conn) throws Exception
{
ArrayList<String> colVal = new ArrayList<String>();
PreparedStatement pstmt = null ;
......@@ -718,7 +770,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
PreparedStatement pstmt = null, pstmt1 = null;
ResultSet rs = null, rs1 = null;
int currentFormNo = 0, domId = 0;
String sql = "", tranId = "", chgUser = "", chgTerm = "", loginEmpCode = "",loginSite = "";
String sql = "", tranId = "", chgUser = "", chgTerm = "", loginEmpCode = "", loginSite = "", invstatForQstk = "";
StringBuffer valueXmlString;
System.out.println("xtraParams=["+xtraParams+"]");
......@@ -771,26 +823,32 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
String locationCode ="", palletNo = "";
String siteCodeEdit = "", tranTypeEdit = "", locCodeEdit = "", palletTypeEdit = "", invStatEdit = "", palletNoEdit = "",
remarksEdit = "", chgUserEdit = "", chgTermEdit = "", invStat = "", tranIdEdit = "";
remarksEdit = "", chgUserEdit = "", chgTermEdit = "", invStat = "", tranIdEdit = "", palletNoCheck = "";
Date chgDateEdit = null, tranDateEdit = null;
locationCode = checkNullAndTrim(genericUtility.getColumnValue("loc_code", hdrDataDom));
//locationCode = checkNullAndTrim(genericUtility.getColumnValue("loc_code", hdrDataDom));
palletNo = checkNullAndTrim(genericUtility.getColumnValue("pallet_no", hdrDataDom));
if( currentColumn.trim().equalsIgnoreCase( "itm_default" ) )
{
System.out.println(" Inside if details 2 for itm_default ::::::::::::::::: ");
sql = "select tran_id, tran_date, site_code, tran_type, loc_code, pallet_type, inv_stat, pallet_no, remarks, "
/*sql = "select tran_id, tran_date, site_code, tran_type, loc_code, pallet_type, inv_stat, pallet_no, remarks, "
+ " chg_user, chg_date, chg_term from pallet_hdr "
+ "where loc_code = ? and pallet_no = ? "
+ "and site_code = ? and add_user = ? and case when confirmed is null then 'N' else confirmed end = 'N' ";*/
//Changed by Sneha on 06-11-2015, Request ID: W15FSUN008
sql = "select tran_id, tran_date, site_code, tran_type, pallet_type, pallet_no, remarks, "
+ "chg_user, chg_date, chg_term from pallet_hdr "
+ "where pallet_no = ? "
+ "and site_code = ? and add_user = ? and case when confirmed is null then 'N' else confirmed end = 'N' ";
//End by Sneha on 06-11-2015, Request ID: W15FSUN008
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, locationCode);
//pstmt.setString(1, locationCode);
//pstmt.setString(2, palletNoSource);
pstmt.setString(2, palletNo);
pstmt.setString(3, loginSite);
pstmt.setString(4, chgUser);
pstmt.setString(1, palletNo);
pstmt.setString(2, loginSite);
pstmt.setString(3, chgUser);
rs = pstmt.executeQuery();
if(rs.next())
{
......@@ -798,9 +856,9 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
tranDateEdit = rs.getDate("tran_date");
siteCodeEdit = checkNullAndTrim(rs.getString("site_code"));
tranTypeEdit = checkNullAndTrim(rs.getString("tran_type"));
locCodeEdit = checkNullAndTrim(rs.getString("loc_code"));
//locCodeEdit = checkNullAndTrim(rs.getString("loc_code"));
palletTypeEdit = checkNullAndTrim(rs.getString("pallet_type"));
invStatEdit = checkNullAndTrim(rs.getString("inv_stat"));
//invStatEdit = checkNullAndTrim(rs.getString("inv_stat"));
palletNoEdit = checkNullAndTrim(rs.getString("pallet_no"));
remarksEdit = checkNullAndTrim(rs.getString("remarks"));
chgUserEdit = checkNullAndTrim(rs.getString("chg_user"));
......@@ -817,9 +875,18 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
valueXmlString.append( "<tran_date><![CDATA[" ).append( sdf.format(tranDateEdit).toString() ).append( "]]></tran_date>\r\n" );
valueXmlString.append( "<site_code><![CDATA[" ).append( siteCodeEdit ).append( "]]></site_code>\r\n" );
valueXmlString.append( "<tran_type><![CDATA[" ).append( tranTypeEdit ).append( "]]></tran_type>\r\n" );
valueXmlString.append( "<loc_code><![CDATA[" ).append( locCodeEdit ).append( "]]></loc_code>\r\n" );
//valueXmlString.append( "<loc_code><![CDATA[" ).append( locCodeEdit ).append( "]]></loc_code>\r\n" );
//Changed by Sneha on 06-11-2015, Request ID: W15FSUN008
valueXmlString.append( "<loc_code><![CDATA[" ).append( "" ).append( "]]></loc_code>\r\n" );
//End by Sneha on 06-11-2015, Request ID: W15FSUN008
valueXmlString.append( "<pallet_type><![CDATA[" ).append( palletTypeEdit ).append( "]]></pallet_type>\r\n" );
valueXmlString.append( "<inv_stat><![CDATA[" ).append( invStatEdit ).append( "]]></inv_stat>\r\n" );
//valueXmlString.append( "<inv_stat><![CDATA[" ).append( invStatEdit ).append( "]]></inv_stat>\r\n" );
//Changed by Sneha on 06-11-2015, Request ID: W15FSUN008
valueXmlString.append( "<inv_stat><![CDATA[" ).append( "" ).append( "]]></inv_stat>\r\n" );
//End by Sneha on 06-11-2015, Request ID: W15FSUN008
valueXmlString.append( "<pallet_no><![CDATA[" ).append( palletNoEdit ).append( "]]></pallet_no>\r\n" );
valueXmlString.append( "<remarks><![CDATA[" ).append( remarksEdit ).append( "]]></remarks>\r\n" );
valueXmlString.append( "<confirmed><![CDATA[" ).append( "N" ).append( "]]></confirmed>\r\n" );
......@@ -838,7 +905,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
{
System.out.println("in itm_default@@@@@.........." + tranId);
System.out.println("-------------- itemchanged Add mode in Details 2 ----------------------");
/*
sql = "select inv_stat from location where loc_code = ? ";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, locationCode);
......@@ -850,6 +917,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
}
if(pstmt1 != null) { pstmt1.close(); pstmt1 = null; }
if(rs1 != null) { rs1.close(); rs1 = null; }
*/
valueXmlString.append("<Detail2 domID=\"1\" selected=\"N\">\r\n");
valueXmlString.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\" />\r\n");
......@@ -857,9 +925,35 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
valueXmlString.append( "<tran_date><![CDATA[" ).append( currDate ).append( "]]></tran_date>\r\n" );
valueXmlString.append( "<site_code><![CDATA[" ).append( loginSite ).append( "]]></site_code>\r\n" );
valueXmlString.append( "<tran_type><![CDATA[" ).append( "P" ).append( "]]></tran_type>\r\n" );
valueXmlString.append( "<loc_code><![CDATA[" ).append( locationCode ).append( "]]></loc_code>\r\n" );
valueXmlString.append( "<pallet_type><![CDATA[" ).append( "" ).append( "]]></pallet_type>\r\n" );
valueXmlString.append( "<inv_stat><![CDATA[" ).append( invStat ).append( "]]></inv_stat>\r\n" );
//valueXmlString.append( "<loc_code><![CDATA[" ).append( locationCode ).append( "]]></loc_code>\r\n" );
//Changed by Sneha on 06-11-2015, Request ID: W15FSUN008
valueXmlString.append( "<loc_code><![CDATA[" ).append( "" ).append( "]]></loc_code>\r\n" );
palletNoCheck = String.valueOf(palletNo.charAt(0));
if("1".equalsIgnoreCase(palletNoCheck))
{
valueXmlString.append( "<pallet_type><![CDATA[" ).append( "N" ).append( "]]></pallet_type>\r\n" );
}
else if("2".equalsIgnoreCase(palletNoCheck))
{
valueXmlString.append( "<pallet_type><![CDATA[" ).append( "C" ).append( "]]></pallet_type>\r\n" );
}
else if("3".equalsIgnoreCase(palletNoCheck))
{
valueXmlString.append( "<pallet_type><![CDATA[" ).append( "S" ).append( "]]></pallet_type>\r\n" );
}
else
{
valueXmlString.append( "<pallet_type><![CDATA[" ).append( "N" ).append( "]]></pallet_type>\r\n" );
}
//End by Sneha on 06-11-2015, Request ID: W15FSUN008
//valueXmlString.append( "<inv_stat><![CDATA[" ).append( invStat ).append( "]]></inv_stat>\r\n" );
//Changed by Sneha on 06-11-2015, Request ID: W15FSUN008
valueXmlString.append( "<inv_stat><![CDATA[" ).append( "" ).append( "]]></inv_stat>\r\n" );
//End by Sneha on 06-11-2015, Request ID: W15FSUN008
valueXmlString.append( "<pallet_no><![CDATA[" ).append( palletNo ).append( "]]></pallet_no>\r\n" );
valueXmlString.append( "<remarks><![CDATA[" ).append( "" ).append( "]]></remarks>\r\n" );
valueXmlString.append( "<confirmed><![CDATA[" ).append( "N" ).append( "]]></confirmed>\r\n" );
......@@ -889,19 +983,18 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
System.out.println("allFormDataDom------>>["+genericUtility.serializeDom(allFormDataDom)+"]");
double quantity = 0;
String itemCode = "", lotNo = "", lotSl = "", locationCode ="", palletNo = "";
String itemCode = "", lotNo = "", lotSl = "", locationCode ="", palletNo = "", invstat = "", descr = "", unit = "";
int noArt = 0, lineNo = 0, domIdEdit = 0;
String[] disparmInvstat;
tranId = checkNull(genericUtility.getColumnValue("tran_id", allFormDataDom, "2" ));
System.out.println("Tran_id----------->>["+tranId+"]");
locationCode = checkNullAndTrim(genericUtility.getColumnValue("loc_code", hdrDataDom));
//locationCode = checkNullAndTrim(genericUtility.getColumnValue("loc_code", hdrDataDom));
palletNo = checkNullAndTrim(genericUtility.getColumnValue("pallet_no", hdrDataDom));
if( currentColumn.trim().equalsIgnoreCase( "itm_default" ) )
{
//System.out.println(" Inside if details 3 for itm_default :::::::::::::::::: ");
sql = "Select max(line_no) as line_no from pallet_det where tran_id = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId);
......@@ -910,43 +1003,63 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
{
domIdEdit = rs.getInt("line_no");
}
System.out.println("lineno::::::::::::: " + domIdEdit);
if(pstmt != null) { pstmt.close(); pstmt = null; }
if(rs != null) { rs.close(); rs = null; }
invstatForQstk = discommon.getDisparams("999999","INVSTAT_FOR_QSTK",conn);
disparmInvstat = invstatForQstk.split(",");
for (int i = 0; i < disparmInvstat.length; i++)
{
invstat = disparmInvstat[i];
//System.out.println("invstat :::::::::::: " + invstat);
if( tranId != null && tranId.trim().length() > 0 )
{
System.out.println("-------------- itemchanged Edit mode in Details 3 ----------------------");
sql = "select d.item_code, d.lot_no, d.lot_sl, d.quantity, d.no_art, d.line_no as line_no "
/*sql = "select d.item_code, d.lot_no, d.lot_sl, d.quantity, d.no_art, d.line_no as line_no "
+ "from pallet_det d, pallet_hdr h where d.loc_code = ? "
+ "and d.pallet_no = ? and h.confirmed = ? and d.site_code = ? and d.tran_id = ? "
+ "and d.tran_id = h.tran_id "
+ "union all "
+ "select item_code, lot_no, lot_sl, (quantity - (alloc_qty + hold_qty)) as quantity, no_art, 0 as line_no "
+ "from stock where loc_code = ? "
+ "and (quantity - (alloc_qty + hold_qty)) > 0 and site_code = ? ";
+ "and (quantity - (alloc_qty + hold_qty)) > 0 and site_code = ? "; */
//Change by Sneha on 06-11-2015, Request ID: W15FSUN008
sql = "select d.item_code, i.descr, d.lot_no, d.lot_sl, d.quantity, i.unit, d.no_art, d.line_no as line_no, d.loc_code "
+ "from pallet_det d, pallet_hdr h, item i where "
+ "d.pallet_no = ? and h.confirmed = ? and d.site_code = ? and d.tran_id = ? "
+ "and d.tran_id = h.tran_id and i.item_code = d.item_code "
+ "union all "
+ "select s.item_code, i.descr, s.lot_no, s.lot_sl, (quantity - (alloc_qty + hold_qty)) as quantity, i.unit, s.no_art, 0 as line_no, s.loc_code "
+ "from stock s, item i where inv_stat = ? "
+ "and (quantity - (alloc_qty + hold_qty)) > 0 and s.site_code = ? and i.item_code = s.item_code ";
//End by Sneha on 06-11-2015, Request ID: W15FSUN008
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, locationCode);
pstmt.setString(2, palletNo);
pstmt.setString(3, "N");
pstmt.setString(4, loginSite);
pstmt.setString(5, tranId);
pstmt.setString(6, locationCode);
pstmt.setString(7, loginSite);
//pstmt.setString(1, locationCode);
pstmt.setString(1, palletNo);
pstmt.setString(2, "N");
pstmt.setString(3, loginSite);
pstmt.setString(4, tranId);
pstmt.setString(5, invstat);
//pstmt.setString(6, locationCode);
pstmt.setString(6, loginSite);
rs = pstmt.executeQuery();
while(rs.next())
{
domIdEdit++;
itemCode = checkNullAndTrim(rs.getString("item_code"));
descr = checkNullAndTrim(rs.getString("descr"));
lotNo = checkNullAndTrim(rs.getString("lot_no"));
lotSl = checkNullAndTrim(rs.getString("lot_sl"));
quantity = rs.getDouble("quantity");
unit = checkNullAndTrim(rs.getString("unit"));
noArt = rs.getInt("no_art");
lineNo = rs.getInt("line_no");
domIdEdit++;
System.out.println("domIdEdit::::::::::::: " + domIdEdit);
locationCode = checkNullAndTrim(rs.getString("loc_code"));
//System.out.println("domIdEdit::::::::::::: " + domIdEdit);
if(isScanningDone(tranId, itemCode, loginSite, locationCode, lotNo, lotSl, palletNo, conn))
{
valueXmlString.append("<Detail3 domID='"+lineNo+"' selected=\"Y\">\r\n");
......@@ -963,12 +1076,14 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
}
valueXmlString.append( "<item_code><![CDATA[" ).append( itemCode ).append( "]]></item_code>\r\n" );
valueXmlString.append( "<item_descr><![CDATA[" ).append( "("+descr+")" ).append( "]]></item_descr>\r\n" );
valueXmlString.append( "<site_code><![CDATA[" ).append( loginSite ).append( "]]></site_code>\r\n" );
valueXmlString.append( "<loc_code><![CDATA[" ).append( locationCode ).append( "]]></loc_code>\r\n" );
valueXmlString.append( "<lot_no><![CDATA[" ).append( lotNo ).append( "]]></lot_no>\r\n" );
valueXmlString.append( "<lot_sl><![CDATA[" ).append( lotSl ).append( "]]></lot_sl>\r\n" );
valueXmlString.append( "<pallet_no><![CDATA[" ).append( palletNo ).append( "]]></pallet_no>\r\n" );
valueXmlString.append( "<quantity><![CDATA[" ).append( quantity ).append( "]]></quantity>\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("</Detail3>\r\n");
}
......@@ -978,31 +1093,42 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
else
{
System.out.println("-------------- itemchanged Add mode in Details 3 ----------------------");
sql = "select d.item_code, d.lot_no, d.lot_sl, d.quantity, d.no_art "
+ "from pallet_det d, pallet_hdr h where d.loc_code = ? "
/*sql = "select d.item_code, d.lot_no, d.lot_sl, d.quantity, d.no_art "
+ "from pallet_det d, pinvstatallet_hdr h where d.loc_code = ? "
+ "and d.pallet_no = ? and h.confirmed = ? and d.site_code = ? and d.tran_id = h.tran_id "
+ "union all "
+ "select item_code, lot_no, lot_sl, (quantity - (alloc_qty + hold_qty)) as quantity, no_art "
+ "from stock where loc_code = ? "
+ "and (quantity - (alloc_qty + hold_qty)) > 0 and site_code = ? ";
+ "and (quantity - (alloc_qty + hold_qty)) > 0 and site_code = ? "; */
//Change by Sneha on 06-11-2015, Request ID: W15FSUN008
sql = "select d.item_code, i.descr, d.lot_no, d.lot_sl, d.quantity, i.unit, d.no_art, d.line_no as line_no, d.loc_code "
+ "from pallet_det d, pallet_hdr h, item i where "
+ "d.pallet_no = ? and h.confirmed = ? and d.site_code = ? and d.tran_id = h.tran_id and i.item_code = d.item_code "
+ "union all "
+ "select s.item_code, i.descr, s.lot_no, s.lot_sl, (quantity - (alloc_qty + hold_qty)) as quantity, i.unit, s.no_art, 0 as line_no, s.loc_code "
+ "from stock s, item i where s.inv_stat = ? "
+ "and (quantity - (alloc_qty + hold_qty)) > 0 and s.site_code = ? and i.item_code = s.item_code ";
//End by Sneha on 06-11-2015, Request ID: W15FSUN008
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, locationCode);
pstmt.setString(2, palletNo);
pstmt.setString(3, "N");
pstmt.setString(4, loginSite);
pstmt.setString(5, locationCode);
pstmt.setString(6, loginSite);
//pstmt.setString(1, locationCode);
pstmt.setString(1, palletNo);
pstmt.setString(2, "N");
pstmt.setString(3, loginSite);
pstmt.setString(4, invstat);
pstmt.setString(5, loginSite);
rs = pstmt.executeQuery();
while(rs.next())
{
domId++;
itemCode = checkNullAndTrim(rs.getString("item_code"));
descr = checkNullAndTrim(rs.getString("descr"));
lotNo = checkNullAndTrim(rs.getString("lot_no"));
lotSl = checkNullAndTrim(rs.getString("lot_sl"));
quantity = rs.getDouble("quantity");
unit = checkNullAndTrim(rs.getString("unit"));
noArt = rs.getInt("no_art");
domId++;
System.out.println("domId ::::::::::::::::: " + domId);
locationCode = checkNullAndTrim(rs.getString("loc_code"));
if(isScanningDone(tranId, itemCode, loginSite, locationCode, lotNo, lotSl, palletNo, conn))
{
......@@ -1016,18 +1142,17 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
valueXmlString.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\" />\r\n");
}
/*valueXmlString.append("<Detail3 domID='"+domId+"' selected=\"N\">\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( "<line_no><![CDATA[" ).append( domId ).append( "]]></line_no>\r\n" );
valueXmlString.append( "<item_code><![CDATA[" ).append( itemCode ).append( "]]></item_code>\r\n" );
valueXmlString.append( "<item_descr><![CDATA[" ).append( "("+descr+")" ).append( "]]></item_descr>\r\n" );
valueXmlString.append( "<site_code><![CDATA[" ).append( loginSite ).append( "]]></site_code>\r\n" );
valueXmlString.append( "<loc_code><![CDATA[" ).append( locationCode ).append( "]]></loc_code>\r\n" );
valueXmlString.append( "<lot_no><![CDATA[" ).append( lotNo ).append( "]]></lot_no>\r\n" );
valueXmlString.append( "<lot_sl><![CDATA[" ).append( lotSl ).append( "]]></lot_sl>\r\n" );
valueXmlString.append( "<pallet_no><![CDATA[" ).append( palletNo ).append( "]]></pallet_no>\r\n" );
valueXmlString.append( "<quantity><![CDATA[" ).append( quantity ).append( "]]></quantity>\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("</Detail3>\r\n");
}
......@@ -1035,6 +1160,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
if(rs != null) { rs.close(); rs = null; }
}
}
}
} //Case 3. End
break;
......@@ -1108,18 +1234,18 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
if("".equalsIgnoreCase(tranId) || tranId.trim().length() < 0 || tranId == null )
{
System.out.println("Inside if is scanning done ................");
//System.out.println("Inside if is scanning done ................");
sql = "select count(*) from pallet_det det, pallet_hdr hdr where det.item_code = ? and det.site_code = ? "
+ "and hdr.loc_code = ? and det.lot_no = ? and det.lot_sl = ? "
+ "and det.lot_no = ? and det.lot_sl = ? "
+ "and hdr.pallet_no = ? and hdr.confirmed = ? and det.tran_id = hdr.tran_id ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
pstmt.setString(2, loginSite);
pstmt.setString(3, locationCode);
pstmt.setString(4, lotNo);
pstmt.setString(5, lotSl);
pstmt.setString(6, palletNo);
pstmt.setString(7, "N");
//pstmt.setString(3, locationCode);
pstmt.setString(3, lotNo);
pstmt.setString(4, lotSl);
pstmt.setString(5, palletNo);
pstmt.setString(6, "N");
rs = pstmt.executeQuery();
if(rs.next())
{
......@@ -1139,7 +1265,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
}
else
{
System.out.println("Inside else is scanning done ................");
//System.out.println("Inside else is scanning done ................");
sql = "select count(*) from pallet_det where tran_id = ? and item_code = ? and site_code = ? and loc_code = ? and lot_no = ? and lot_sl = ? "
+ " and pallet_no = ? ";
pstmt = conn.prepareStatement(sql);
......@@ -1165,11 +1291,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
return true;
}
return false;
}
}
}
......@@ -71,10 +71,8 @@ public class PalletizationPos extends ValidatorEJB implements PalletizationPosLo
System.out.println("xtraParams ::::::::::::: " + xtraParams);
System.out.println("tranId ::::::::::::: " + tranId);
lineNo = checkNullAndTrim(genericUtility.getColumnValue("line_no", dom, "3" ));
lineNo = checkNullAndTrim(genericUtility.getColumnValue("line_no", dom, "3" ));
//objName = getObjNameFromDom(dom, "updateFlag", "3");
updateFlag = getUpdateFlagFromDom(dom, "3");
System.out.println("updateFlag--------->>["+updateFlag+"]");
......@@ -206,7 +204,7 @@ public class PalletizationPos extends ValidatorEJB implements PalletizationPosLo
}
return inputVal;
}
//private String getObjNameFromDom( Document dom, String attribute, String objContext ) throws RemoteException,ITMException
private String getUpdateFlagFromDom( Document dom, String objContext ) throws RemoteException,ITMException
{
NodeList detailList = 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