Commit 5a3dabc1 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@98911 ce508802-f39f-4f6c-b175-0d175dae99d5
parent f2c353dd
......@@ -139,9 +139,9 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
System.out.println("DOM1----->>["+genericUtility.serializeDom(dom1).toString()+"]");
System.out.println("DOM2----->>["+genericUtility.serializeDom(dom2).toString()+"]");
String locationCode ="", palletNo = "", palletNoSource = "", sql = "", scheduleStatus = "";
String locationCode ="", palletNo = "", sql = "", scheduleStatus = "";
ArrayList<String> locStockList = new ArrayList<String>();
ArrayList<String> locList = new ArrayList<String>();
ArrayList<String> palletList = new ArrayList<String>();
PreparedStatement pstmt = null ;
ResultSet rs = null ;
......@@ -151,19 +151,17 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
childNodeListLength = childNodeList.getLength();
locationCode = checkNullAndTrim(genericUtility.getColumnValue("loc_code",dom));
//palletNoSource = checkNullAndTrim(genericUtility.getColumnValue("pallet_no__source",dom));
palletNo = checkNullAndTrim(genericUtility.getColumnValue("pallet_no",dom));
System.out.println("locationCode ------->>["+locationCode+"]");
//System.out.println("palletNoSource ------->>["+palletNoSource+"]");
System.out.println("palletNo ------->>["+palletNo+"]");
locStockList = getLocationCode(conn, loginSite);
locList = getLocation(conn, loginSite);
palletList = getPalletNo(conn, loginSite);
sql ="select schedule_status from interface2 where pallet_no = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, locationCode);
pstmt.setString(1, palletNo);
rs = pstmt.executeQuery();
if(rs.next())
{
......@@ -232,7 +230,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
errList.add( errCode );
errFields.add(childNodeName.toLowerCase());
}
else if(!locList.contains(palletNo) && palletNo.length() > 0)
else if(!palletList.contains(palletNo) && palletNo.length() > 0)
{
System.out.println("Invalid Pallet No :::::::::: ");
errCode = "INVPALTNO";
......@@ -253,7 +251,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
errList.add( errCode );
errFields.add(childNodeName.toLowerCase());
}*/
if("".equalsIgnoreCase(scheduleStatus))
if(!"Y".equalsIgnoreCase(scheduleStatus) && "".equalsIgnoreCase(scheduleStatus))
{
System.out.println("Pallet No still transist, interface table :::::::::: ");
errCode = "VTINOUTPL";
......@@ -327,7 +325,6 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
String itemCode = "", itemCodeDB = "", quantity = "";
String familyGrp = "", qcType = "", stroPref = "", familyGrpDB = "", qcTypeDB = "", stroPrefDB = "", lotNo = "", lotSl = "";
double quantityDB = 0, parseQuantity = 0;
HashMap hm = new HashMap();
HashMap hm1 = new HashMap();
......@@ -342,7 +339,6 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
lotSl = checkNullAndTrim(genericUtility.getColumnValue("lot_sl",dom));
locationCode = checkNullAndTrim(genericUtility.getColumnValue("loc_code",dom1));
//palletNoSource = checkNullAndTrim(genericUtility.getColumnValue("pallet_no__source",dom1));
palletNo = checkNullAndTrim(genericUtility.getColumnValue("pallet_no",dom1));
System.out.println("itemCode :::::::::::::: " + itemCode);
......@@ -350,14 +346,12 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
System.out.println("lotNo :::::::::::::: " + lotNo);
System.out.println("lotSl :::::::::::::: " + lotSl);
System.out.println("locationCode :::::::::::::: " + locationCode);
//System.out.println("palletNoSource :::::::::::::: " + palletNoSource);
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 ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, locationCode);
//pstmt.setString(2, palletNoSource);
pstmt.setString(2, palletNo);
rs = pstmt.executeQuery();
if(rs.next())
......@@ -568,7 +562,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
String sql = "";
try
{
sql ="select distinct(loc_code) as loc_code from stock where (quantity - (alloc_qty + hold_qty)) > 0 and site_code = ? ";
sql ="select distinct(loc_code) as loc_code from stock where (quantity - (alloc_qty + hold_qty)) > 0 and site_code = ? and inv_stat != 'AWMS' ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, loginSite);
rs = pstmt.executeQuery();
......@@ -600,7 +594,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
return colVal;
}
private ArrayList<String> getLocation(Connection conn, String loginSite) throws Exception
private ArrayList<String> getPalletNo(Connection conn, String loginSite) throws Exception
{
ArrayList<String> colVal = new ArrayList<String>();
PreparedStatement pstmt = null ;
......@@ -719,14 +713,9 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
Connection conn = null;
PreparedStatement pstmt = null, pstmt1 = null;
ResultSet rs = null, rs1 = null;
int currentFormNo = 0, domId = 0, childNodeListLength = 0;
int currentFormNo = 0, domId = 0;
String sql = "", tranId = "", chgUser = "", chgTerm = "", loginEmpCode = "",loginSite = "";
StringBuffer valueXmlString;
NodeList parentNodeList = null;
NodeList childNodeList = null;
Node parentNode = null;
Node childNode = null;
System.out.println("xtraParams=["+xtraParams+"]");
System.out.println("PalletizationCalled123........................... : ["+currentColumn+"]");
......@@ -776,14 +765,12 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
System.out.println("currFormDataDom------>>["+genericUtility.serializeDom(currFormDataDom)+"]");
System.out.println("allFormDataDom------>>["+genericUtility.serializeDom(allFormDataDom)+"]");
String locationCode ="", palletNo = "", palletNoSource = "";
String locationCode ="", palletNo = "";
String siteCodeEdit = "", tranTypeEdit = "", locCodeEdit = "", palletTypeEdit = "", invStatEdit = "", palletNoEdit = "",
palletNoSourceEdit = "", remarksEdit = "", chgUserEdit = "", confirmEdit = "",
chgTermEdit = "", invStat = "", tranIdEdit = "";
Date chgDateEdit = null, tranDateEdit = null, confirmDateEdit = null;
remarksEdit = "", chgUserEdit = "", chgTermEdit = "", invStat = "", tranIdEdit = "";
Date chgDateEdit = null, tranDateEdit = null;
locationCode = checkNullAndTrim(genericUtility.getColumnValue("loc_code", hdrDataDom));
//palletNoSource = checkNullAndTrim(genericUtility.getColumnValue("pallet_no__source", hdrDataDom));
locationCode = checkNullAndTrim(genericUtility.getColumnValue("loc_code", hdrDataDom));
palletNo = checkNullAndTrim(genericUtility.getColumnValue("pallet_no", hdrDataDom));
if( currentColumn.trim().equalsIgnoreCase( "itm_default" ) )
......@@ -811,10 +798,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
palletTypeEdit = checkNullAndTrim(rs.getString("pallet_type"));
invStatEdit = checkNullAndTrim(rs.getString("inv_stat"));
palletNoEdit = checkNullAndTrim(rs.getString("pallet_no"));
//palletNoSourceEdit = checkNullAndTrim(rs.getString("pallet_no__source"));
remarksEdit = checkNullAndTrim(rs.getString("remarks"));
//confirmEdit = checkNullAndTrim(rs.getString("confirmed"));
//confirmDateEdit = rs.getDate("conf_date");
chgUserEdit = checkNullAndTrim(rs.getString("chg_user"));
chgDateEdit = rs.getDate("chg_date");
chgTermEdit = checkNullAndTrim(rs.getString("chg_term"));
......@@ -833,7 +817,6 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
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( "<pallet_no><![CDATA[" ).append( palletNoEdit ).append( "]]></pallet_no>\r\n" );
//valueXmlString.append( "<pallet_no__source><![CDATA[" ).append( palletNoSourceEdit ).append( "]]></pallet_no__source>\r\n" );
valueXmlString.append( "<remarks><![CDATA[" ).append( remarksEdit ).append( "]]></remarks>\r\n" );
valueXmlString.append( "<confirmed><![CDATA[" ).append( "N" ).append( "]]></confirmed>\r\n" );
valueXmlString.append( "<conf_date><![CDATA[" ).append( "" ).append( "]]></conf_date>\r\n" );
......@@ -869,30 +852,11 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
valueXmlString.append( "<tran_id><![CDATA[" ).append( "" ).append( "]]></tran_id>\r\n" );
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( "" ).append( "]]></tran_type>\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" );
/*if("".equalsIgnoreCase(locationCode) && locationCode.length() <= 0 )
{
valueXmlString.append( "<loc_code><![CDATA[" ).append( palletNoSource ).append( "]]></loc_code>\r\n" );
}
else
{
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( "<pallet_no><![CDATA[" ).append( palletNo ).append( "]]></pallet_no>\r\n" );
/*
if("".equalsIgnoreCase(palletNoSource) && palletNoSource.length() <= 0 )
{
valueXmlString.append( "<pallet_no__source><![CDATA[" ).append( locationCode ).append( "]]></pallet_no__source>\r\n" );
}
else
{
valueXmlString.append( "<pallet_no__source><![CDATA[" ).append( palletNoSource ).append( "]]></pallet_no__source>\r\n" );
}*/
valueXmlString.append( "<remarks><![CDATA[" ).append( "" ).append( "]]></remarks>\r\n" );
valueXmlString.append( "<confirmed><![CDATA[" ).append( "N" ).append( "]]></confirmed>\r\n" );
valueXmlString.append( "<conf_date><![CDATA[" ).append( "" ).append( "]]></conf_date>\r\n" );
......@@ -921,7 +885,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
System.out.println("allFormDataDom------>>["+genericUtility.serializeDom(allFormDataDom)+"]");
double quantity = 0;
String itemCode = "", lotNo = "", lotSl = "", locationCode ="", palletNo = "", palletNoSource = "", scanTranId = "", tableName = "";
String itemCode = "", lotNo = "", lotSl = "", locationCode ="", palletNo = "";
int noArt = 0, lineNo = 0, domIdEdit = 0;
tranId = checkNull(genericUtility.getColumnValue("tran_id", allFormDataDom, "2" ));
......@@ -930,7 +894,6 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
locationCode = checkNullAndTrim(genericUtility.getColumnValue("loc_code", hdrDataDom));
palletNo = checkNullAndTrim(genericUtility.getColumnValue("pallet_no", hdrDataDom));
if( currentColumn.trim().equalsIgnoreCase( "itm_default" ) )
{
......@@ -946,27 +909,28 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
System.out.println("lineno::::::::::::: " + domIdEdit);
if(pstmt != null) { pstmt.close(); pstmt = null; }
if(rs != null) { rs.close(); rs = null; }
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 = ? ";
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);
rs = pstmt.executeQuery();
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 "
+ "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 = ? ";
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);
rs = pstmt.executeQuery();
while(rs.next())
{
itemCode = checkNullAndTrim(rs.getString("item_code"));
......@@ -976,7 +940,6 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
noArt = rs.getInt("no_art");
lineNo = rs.getInt("line_no");
domIdEdit++;
//domId = domIdEdit + 1;
System.out.println("domIdEdit::::::::::::: " + domIdEdit);
......@@ -1011,6 +974,21 @@ 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 = ? "
+ "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 = ? ";
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);
rs = pstmt.executeQuery();
while(rs.next())
{
itemCode = checkNullAndTrim(rs.getString("item_code"));
......@@ -1022,8 +1000,20 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
domId++;
System.out.println("domId ::::::::::::::::: " + domId);
valueXmlString.append("<Detail3 domID='"+domId+"' selected=\"N\">\r\n");
valueXmlString.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\" />\r\n");
if(isScanningDone(tranId, itemCode, loginSite, locationCode, lotNo, lotSl, palletNo, conn))
{
valueXmlString.append("<Detail3 domID='"+domId+"' selected=\"Y\">\r\n");
valueXmlString.append("<attribute selected=\"Y\" updateFlag=\"E\" status=\"O\" pkNames=\"\" />\r\n");
}
else
{
valueXmlString.append("<Detail3 domID='"+domId+"' selected=\"N\">\r\n");
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" );
......@@ -1110,38 +1100,72 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
String sql = "";
int count = 0;
tranId = tranId == null ? "" : tranId.trim();
System.out.println("in isScanningDone--------->" + tranId);
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);
pstmt.setString(1,tranId);
pstmt.setString(2,itemCode);
pstmt.setString(3,loginSite);
pstmt.setString(4,locationCode);
pstmt.setString(5,lotNo);
pstmt.setString(6,lotSl);
pstmt.setString(7,palletNo);
//pstmt.setDouble(8,quantity);
rs = pstmt.executeQuery();
if(rs.next())
System.out.println("in isScanningDone--------->[" +tranId+"]");
if("".equalsIgnoreCase(tranId) || tranId.trim().length() < 0 || tranId == null )
{
count = rs.getInt(1);
//quantity = rs.getDouble(1);
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 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");
rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt(1);
}
if(pstmt != null) { pstmt.close(); pstmt = null; }
if(rs != null) { rs.close(); rs = null; }
System.out.println("count in isScanningDone@@----->>["+count+"]");
if(count > 0)
{
return true;
}
return false;
}
if(pstmt != null) { pstmt.close(); pstmt = null; }
if(rs != null) { rs.close(); rs = null; }
System.out.println("count in isScanningDone@@----->>["+count+"]");
if(count > 0)
else
{
return true;
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);
pstmt.setString(1,tranId);
pstmt.setString(2,itemCode);
pstmt.setString(3,loginSite);
pstmt.setString(4,locationCode);
pstmt.setString(5,lotNo);
pstmt.setString(6,lotSl);
pstmt.setString(7,palletNo);
rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt(1);
}
if(pstmt != null) { pstmt.close(); pstmt = null; }
if(rs != null) { rs.close(); rs = null; }
System.out.println("count in isScanningDone@@----->>["+count+"]");
if(count > 0)
{
return true;
}
return false;
}
return false;
}
}
}
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