Commit e8897b8d authored by smestry's avatar smestry

W15FSUN008, Updated class file Palletization.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98891 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 3d6da7f8
......@@ -149,11 +149,11 @@ 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));
//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("palletNoSource ------->>["+palletNoSource+"]");
System.out.println("palletNo ------->>["+palletNo+"]");
locStockList = getLocationCode(conn, loginSite);
......@@ -324,7 +324,7 @@ 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));
//palletNoSource = checkNullAndTrim(genericUtility.getColumnValue("pallet_no__source",dom1));
palletNo = checkNullAndTrim(genericUtility.getColumnValue("pallet_no",dom1));
System.out.println("itemCode :::::::::::::: " + itemCode);
......@@ -332,15 +332,15 @@ 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("palletNoSource :::::::::::::: " + palletNoSource);
System.out.println("palletNo :::::::::::::: " + palletNo);
sql ="select distinct(item_code) from pallet_hdr h, pallet_det d where d.loc_code in (?, ?) and d.pallet_no = ? and "
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(3, palletNo);
//pstmt.setString(2, palletNoSource);
pstmt.setString(2, palletNo);
rs = pstmt.executeQuery();
if(rs.next())
{
......@@ -353,7 +353,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
//parseQuantity = Double.parseDouble(quantity);
//System.out.println("parseQuantity ------->>["+parseQuantity+"]");
sql = "select (quantity - (alloc_qty + hold_qty)) as quantity from stock where loc_code in (?,?) "
/*sql = "select (quantity - (alloc_qty + hold_qty)) as quantity from stock where loc_code in (?,?) "
+ "and (quantity - (alloc_qty + hold_qty)) > 0 and site_code = ? and item_code = ? and lot_no = ? and lot_sl = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, locationCode);
......@@ -368,7 +368,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
quantityDB = rs.getDouble("quantity");
}
if(pstmt != null){pstmt.close();pstmt = null;}
if(rs != null){rs.close();rs = null;}
if(rs != null){rs.close();rs = null;}*/
for (ctr = 0; ctr < childNodeListLength; ctr++)
{
......@@ -378,7 +378,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
if("lot_sl".equalsIgnoreCase(childNodeName))
{
//System.out.println("Inside quantity ::::::::::: ");
System.out.println("Inside lot_sl ::::::::::: ");
/*if(parseQuantity <= 0)
{
......@@ -397,7 +397,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
if( itemCodeDB != null && itemCodeDB.trim().length() > 0 )
{
//System.out.println("Inside if loop for analysis class :::::::::: ");
System.out.println("Inside if loop for analysis class :::::::::: ");
hm = commonWmsUtility.getPalletizedAttributes(itemCode, loginSite, conn);
familyGrp = (String) hm.get("LOC_ZONE__PREF");
......@@ -412,6 +412,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
System.out.println("familyGrp :::::::::: " + familyGrp);
System.out.println("qcType :::::::::: " + qcType);
System.out.println("stroPref :::::::::: " + stroPref);
System.out.println("familyGrpDB :::::::::: " + familyGrpDB);
System.out.println("qcTypeDB :::::::::: " + qcTypeDB);
System.out.println("stroPrefDB :::::::::: " + stroPrefDB);
......@@ -422,6 +423,10 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
errCode = "VTINVAC";
errList.add( errCode );
errFields.add(childNodeName.toLowerCase());
}
else
{
System.out.println(" analysis class found same :::::::::: ");
}
}
}
......@@ -899,7 +904,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
double quantity = 0;
String itemCode = "", lotNo = "", lotSl = "", locationCode ="", palletNo = "", palletNoSource = "", scanTranId = "", tableName = "";
int noArt = 0;
int noArt = 0, lineNo = 0, domIdEdit = 0;
tranId = checkNull(genericUtility.getColumnValue("tran_id", allFormDataDom, "2" ));
System.out.println("Tran_id----------->>["+tranId+"]");
......@@ -907,85 +912,43 @@ 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" ) )
{
//System.out.println(" Inside if details 3 for itm_default :::::::::::::::::: ");
sql = "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 = ? "
+ "union all "
+ "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 = ? "
+ "and d.tran_id = h.tran_id ";
sql = "Select max(line_no) as line_no from pallet_det where tran_id = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, locationCode);
pstmt.setString(2, loginSite);
pstmt.setString(3, locationCode);
pstmt.setString(4, palletNo);
pstmt.setString(5, "N");
pstmt.setString(6, loginSite);
pstmt.setString(7, tranId);
pstmt.setString(1, tranId);
rs = pstmt.executeQuery();
if( tranId != null && tranId.trim().length() > 0 )
{
System.out.println("-------------- itemchanged Edit mode in Details 3 ----------------------");
while(rs.next())
{
itemCode = checkNullAndTrim(rs.getString("item_code"));
lotNo = checkNullAndTrim(rs.getString("lot_no"));
lotSl = checkNullAndTrim(rs.getString("lot_sl"));
quantity = rs.getDouble("quantity");
noArt = rs.getInt("no_art");
domId++;
if(isScanningDone(tranId, itemCode, loginSite, locationCode, lotNo, lotSl, palletNo, conn))
if(rs.next())
{
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( "<tran_id><![CDATA[" ).append( tranId ).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( "<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( "<no_art><![CDATA[" ).append( noArt ).append( "]]></no_art>\r\n" );
valueXmlString.append("</Detail3>\r\n");
domIdEdit = rs.getInt("line_no");
}
System.out.println("lineno::::::::::::: " + domIdEdit);
if(pstmt != null) { pstmt.close(); pstmt = null; }
if(rs != null) { rs.close(); rs = null; }
}
/*sql = "select item_code, lot_no, lot_sl, (quantity - (alloc_qty + hold_qty)) as quantity, no_art, '' as tran_id from stock where loc_code in (?,?) "
+ "and (quantity - (alloc_qty + hold_qty)) > 0 and site_code = ? "
+ "union all "
+ "select d.item_code, d.lot_no, d.lot_sl, d.quantity, no_art, d.tran_id 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, 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 ";
+ "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, palletNoSource);
pstmt.setString(3, loginSite);
pstmt.setString(4, locationCode);
pstmt.setString(5, palletNo);
pstmt.setString(6, "N");
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(8, tranId);
rs = pstmt.executeQuery();
if( tranId != null && tranId.trim().length() > 0 )
{
System.out.println("-------------- itemchanged Edit mode in Details 3 ----------------------");
while(rs.next())
{
itemCode = checkNullAndTrim(rs.getString("item_code"));
......@@ -993,22 +956,27 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
lotSl = checkNullAndTrim(rs.getString("lot_sl"));
quantity = rs.getDouble("quantity");
noArt = rs.getInt("no_art");
scanTranId = checkNullAndTrim(rs.getString("tran_id"));
domId++;
lineNo = rs.getInt("line_no");
domIdEdit++;
//domId = domIdEdit + 1;
if("".equals(scanTranId) && scanTranId.trim().length() <= 0 )
System.out.println("domIdEdit::::::::::::: " + domIdEdit);
if(isScanningDone(tranId, itemCode, loginSite, locationCode, lotNo, lotSl, palletNo, conn))
{
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='"+lineNo+"' selected=\"Y\">\r\n");
valueXmlString.append("<attribute selected=\"Y\" updateFlag=\"E\" status=\"O\" pkNames=\"\" />\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
{
valueXmlString.append("<Detail3 domID='"+domId+"' selected=\"Y\">\r\n");
valueXmlString.append("<attribute selected=\"Y\" updateFlag=\"E\" status=\"O\" pkNames=\"\" />\r\n");
valueXmlString.append("<Detail3 domID='"+domIdEdit+"' selected=\"N\">\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( "<line_no><![CDATA[" ).append( domIdEdit ).append( "]]></line_no>\r\n" );
}
valueXmlString.append( "<tran_id><![CDATA[" ).append( tranId ).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( "<site_code><![CDATA[" ).append( loginSite ).append( "]]></site_code>\r\n" );
valueXmlString.append( "<loc_code><![CDATA[" ).append( locationCode ).append( "]]></loc_code>\r\n" );
......@@ -1021,7 +989,7 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
}
if(pstmt != null) { pstmt.close(); pstmt = null; }
if(rs != null) { rs.close(); rs = null; }
}*/
}
else
{
System.out.println("-------------- itemchanged Add mode in Details 3 ----------------------");
......@@ -1034,11 +1002,13 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
noArt = rs.getInt("no_art");
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");
valueXmlString.append( "<tran_id><![CDATA[" ).append( "").append( "]]></tran_id>\r\n" );
valueXmlString.append( "<line_no><![CDATA[" ).append( "").append( "]]></line_no>\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( "<site_code><![CDATA[" ).append( loginSite ).append( "]]></site_code>\r\n" );
valueXmlString.append( "<loc_code><![CDATA[" ).append( locationCode ).append( "]]></loc_code>\r\n" );
......
......@@ -89,6 +89,23 @@ public class PalletizationPos extends ValidatorEJB implements PalletizationPosLo
System.out.println("lotNo----------->>["+lotNo+"]");
System.out.println("lotSl----------->>["+lotSl+"]");
NodeList detail3List = dom.getElementsByTagName("attribute");
String test = "";
boolean isDelete = false;
for(int ctr = 0;ctr < detail3List.getLength() ; ctr++)
{
Node detail3Node = detail3List.item(ctr);
test = detail3Node.getAttributes().getNamedItem("updateFlag").getNodeValue();
System.out.println("test----------->>["+test+"]");
if("D".equalsIgnoreCase(test))
{
isDelete = true;
}
}
System.out.println("isDelete----------->>["+isDelete+"]");
strAllocate.put("tran_date", tranDate);
strAllocate.put("ref_ser","PZ");
strAllocate.put("ref_id", tranId);
......@@ -98,7 +115,14 @@ public class PalletizationPos extends ValidatorEJB implements PalletizationPosLo
strAllocate.put("loc_code", locCode);
strAllocate.put("lot_no", lotNo);
strAllocate.put("lot_sl", lotSl);
if(isDelete)
{
strAllocate.put("alloc_qty", -parseQuantity) ;
}
else
{
strAllocate.put("alloc_qty", parseQuantity) ;
}
strAllocate.put("chg_user", GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams,"loginCode"));
strAllocate.put("chg_term", GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams,"termId"));
strAllocate.put("chg_win", "W_PALLETIZATION");
......@@ -108,6 +132,7 @@ public class PalletizationPos extends ValidatorEJB implements PalletizationPosLo
System.out.println("errString ::: " + errString);
if (errString != null && errString.trim().length() > 0 )
{
isError = true;
return errString;
}
strAllocate = null;
......@@ -124,6 +149,7 @@ public class PalletizationPos extends ValidatorEJB implements PalletizationPosLo
}
catch (Exception e1)
{
isError = true;
e1.printStackTrace();
throw new ITMException(e1);
}
......
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