Commit 1599bdd3 authored by smestry's avatar smestry

W15FSUN008, Create transaction screen Palletization and palletization Confirm for AWMS.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98803 ce508802-f39f-4f6c-b175-0d175dae99d5
parent ca9ef54b
......@@ -100,8 +100,7 @@ public class PalletizationConfIC extends ValidatorEJB implements PalletizationIC
StringBuffer errStringXml = new StringBuffer("<?xml version=\"1.0\"?>\r\n<Root><Errors>");
try
{
System.out.println("::::::::::::::::: Inside wfValData :::::::::::::::: ");
genericUtility = GenericUtility.getInstance();
System.out.println("xtraParam----->>["+xtraParams+"]");
System.out.println("DOM---->>["+genericUtility.serializeDom(dom).toString()+"]");
......@@ -198,8 +197,6 @@ public class PalletizationConfIC extends ValidatorEJB implements PalletizationIC
return msgType;
}
/**
* The public method is defined without any parameters and returns blank string
*/
......@@ -228,6 +225,7 @@ public class PalletizationConfIC extends ValidatorEJB implements PalletizationIC
Document hdrDataDom = null;
Document allFormDataDom = null;
String errString = null;
GenericUtility genericUtility = GenericUtility.getInstance();
System.out.println("xmlString ["+xmlString+"]");
System.out.println("xmlString1 ["+xmlString1+"]");
......@@ -279,7 +277,6 @@ public class PalletizationConfIC extends ValidatorEJB implements PalletizationIC
int currentFormNo = 0;
ConnDriver connDriver = new ConnDriver();
try
{
conn = connDriver.getConnectDB("DriverITM");
......@@ -325,7 +322,6 @@ public class PalletizationConfIC extends ValidatorEJB implements PalletizationIC
conn = null;
}
}
}
catch(Exception d)
{
......
......@@ -936,12 +936,24 @@ public class PalletizationIC extends ValidatorEJB implements PalletizationICLoca
{
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 from stock where loc_code in (?,?) "
+ "and (quantity - (alloc_qty + hold_qty)) > 0 and site_code = ? ";
/*sql = "select item_code, lot_no, lot_sl, (quantity - (alloc_qty + hold_qty)) as quantity from stock where loc_code in (?,?) "
+ "and (quantity - (alloc_qty + hold_qty)) > 0 and site_code = ? "; */
sql = "select item_code, lot_no, lot_sl, (quantity - (alloc_qty + hold_qty)) as quantity from stock where loc_code in (?,?) "
+ "and (quantity - (alloc_qty + hold_qty)) > 0 and site_code = ? union "
+ "select d.item_code, d.lot_no, d.lot_sl, d.quantity 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 ";
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(7, loginSite);
pstmt.setString(8, tranId);
rs = pstmt.executeQuery();
if( tranId != null && tranId.trim().length() > 0 )
......
......@@ -37,61 +37,82 @@ public class PalletizationPos extends ValidatorEJB implements PalletizationPosLo
{
return "";
}
public String postSave( String domString, String tranId, String editFlag, String xtraParams, Connection conn ) throws RemoteException,ITMException
public String postSave( String domString, String tranId, String editFlag, String xtraParams, Connection conn ) throws RemoteException, ITMException
{
InvAllocTraceBean invAllocTrace = new InvAllocTraceBean();
String errString = "", sql = "", siteCode = "", interfaceTranId = "", tranDate = "", objName = "";
PreparedStatement pstmt = null, pstmt1 = null, pstmt2 = null, pstmt3 = null;
ResultSet rs = null, rs1 = null, rs2 = null, rs3 = null;
String errString = "", sql = "", siteCode = "", interfaceTranId = "", objName = "", lineNo = "", locCode = "", palletNo = "",
PalletNoSource = "", itemCode = "", lotNo = "", lotSl = "", quantity = "";
PreparedStatement pstmt = null, pstmt1 = null;
ResultSet rs = null, rs1 = null;
double parseQuantity = 0;
HashMap strAllocate = new HashMap();
Connection conn1 = null;
try
{
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
conn.setAutoCommit(false);
conn1 = connDriver.getConnectDB("DriverITM");
conn1.setAutoCommit(false);
connDriver = null;
GenericUtility genericUtility = GenericUtility.getInstance();
Document dom = null;
dom = genericUtility.parseString(domString);
String dbDateFormat = genericUtility.getDBDateFormat();
String applDateFormat = genericUtility.getApplDateFormat();
java.util.Date currDate1 = new java.util.Date();
SimpleDateFormat sdf = new SimpleDateFormat(applDateFormat);
String currDateStr = sdf.format(currDate1);
java.sql.Timestamp tranDate = java.sql.Timestamp.valueOf(genericUtility.getValidDateString( currDateStr , applDateFormat, dbDateFormat ) + " 00:00:00.0") ;
System.out.println("Calling Post Save ::::::::::::: " );
System.out.println("domString ::::::::::::: " + domString);
System.out.println("xtraParams ::::::::::::: " + xtraParams);
System.out.println("tranId ::::::::::::: " + tranId);
Document dom = null;
dom = genericUtility.parseString(domString);
String lineNo = checkNull(genericUtility.getColumnValue("line_no", dom, "3" ));
System.out.println("line no----------->>["+lineNo+"]");
lineNo = checkNull(genericUtility.getColumnValue("line_no", dom, "3" ));
if( tranId != null && tranId.trim().length() > 0 && lineNo != null && lineNo.trim().length() > 0)
{
System.out.println("tranId for post save ::::::::::::: " + tranId);
sql = "select site_code, item_code, loc_code, lot_no, lot_sl, quantity from pallet_det where tran_id = ? "
+ "and line_no = ? ";
pstmt = conn.prepareStatement(sql);
siteCode = checkNull(genericUtility.getValueFromXTRA_PARAMS( xtraParams, "loginSiteCode" ));
itemCode = checkNull(genericUtility.getColumnValue("item_code", dom, "3" ));
locCode = checkNull(genericUtility.getColumnValue("loc_code", dom, "3" ));
lotNo = checkNull(genericUtility.getColumnValue("lot_no", dom, "3" ));
lotSl = checkNull(genericUtility.getColumnValue("lot_sl", dom, "3" ));
quantity = checkNull(genericUtility.getColumnValue("quantity", dom, "3" ));
parseQuantity = Double.parseDouble(quantity);
System.out.println("lineNo----------->>["+lineNo+"]");
System.out.println("siteCode----------->>["+siteCode+"]");
System.out.println("itemCode----------->>["+itemCode+"]");
System.out.println("locCode----------->>["+locCode+"]");
System.out.println("lotNo----------->>["+lotNo+"]");
System.out.println("lotSl----------->>["+lotSl+"]");
sql = "select * from INVALLOC_TRACE where ref_id = ? and ref_line = ? ";
pstmt = conn1.prepareStatement(sql);
pstmt.setString(1, tranId);
pstmt.setString(2, lineNo);
rs = pstmt.executeQuery();
if(rs.next())
{
System.out.println("Inside while loop::::::::::: ");
//strAllocate.put("tran_date", new Timestamp(System.currentTimeMillis()));
if(!rs.next())
{
System.out.println("Inside if for post save palletization ::::::::: " );
strAllocate.put("tran_date", tranDate);
strAllocate.put("ref_ser","PZ");
strAllocate.put("ref_id", tranId);
strAllocate.put("ref_line", lineNo);
strAllocate.put("site_code", checkNullAndTrim(rs.getString("site_code")));
strAllocate.put("item_code", checkNullAndTrim(rs.getString("item_code")));
strAllocate.put("loc_code",checkNullAndTrim(rs.getString("loc_code")));
strAllocate.put("lot_no", checkNullAndTrim(rs.getString("lot_no")));
strAllocate.put("lot_sl", checkNullAndTrim(rs.getString("lot_sl")));
strAllocate.put("alloc_qty", rs.getDouble("quantity")) ;
strAllocate.put("site_code", siteCode);
strAllocate.put("item_code", itemCode);
strAllocate.put("loc_code", locCode);
strAllocate.put("lot_no", lotNo);
strAllocate.put("lot_sl", lotSl);
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");
errString = invAllocTrace.updateInvallocTrace(strAllocate, conn);
errString = invAllocTrace.updateInvallocTrace(strAllocate, conn1);
System.out.println("errString ::: " + errString);
if (errString != null && errString.trim().length() > 0 )
......@@ -101,7 +122,9 @@ public class PalletizationPos extends ValidatorEJB implements PalletizationPosLo
strAllocate = null;
System.out.println("Allocated the quantity in stock::::::::::: ");
}
}
if(pstmt1 != null){pstmt1.close();pstmt1 = null;}
if(rs1 != null){rs1.close();rs1 = null;}
}
}
catch(Exception e)
{
......@@ -131,10 +154,20 @@ public class PalletizationPos extends ValidatorEJB implements PalletizationPosLo
pstmt.close();
pstmt = null;
}
if (conn != null)
if( rs1 != null )
{
rs1.close();
rs1 = null;
}
if( pstmt1 != null )
{
pstmt1.close();
pstmt1 = null;
}
if (conn1 != null)
{
conn.close();
conn = null;
conn1.close();
conn1 = null;
}
}
catch(Exception e)
......@@ -168,7 +201,7 @@ public class PalletizationPos extends ValidatorEJB implements PalletizationPosLo
return inputVal;
}
private String generateTranTd( String windowName, String tranDate, String siteCode, Connection conn )throws ITMException
private String generateTranTd( String windowName, String tranDate, String siteCode, Connection conn1 )throws ITMException
{
System.out.println("inside generateTranTd@@.........");
PreparedStatement pstmt = null;
......@@ -180,7 +213,7 @@ public class PalletizationPos extends ValidatorEJB implements PalletizationPosLo
try
{
sql = "SELECT KEY_STRING, TRAN_ID_COL, REF_SER FROM TRANSETUP WHERE TRAN_WINDOW = ? ";
pstmt = conn.prepareStatement(sql);
pstmt = conn1.prepareStatement(sql);
pstmt.setString(1, windowName);
rs = pstmt.executeQuery();
System.out.println("keyString :"+sql);
......@@ -194,7 +227,7 @@ public class PalletizationPos extends ValidatorEJB implements PalletizationPosLo
else
{
sql = "SELECT KEY_STRING, TRAN_ID_COL, REF_SER FROM TRANSETUP WHERE TRAN_WINDOW = ? ";
pstmt = conn.prepareStatement(sql);
pstmt = conn1.prepareStatement(sql);
pstmt.setString(1, "GENERAL");
rs = pstmt.executeQuery();
System.out.println("keyString :"+sql);
......@@ -224,7 +257,7 @@ public class PalletizationPos extends ValidatorEJB implements PalletizationPosLo
xmlValues = xmlValues + "</Detail1></Root>";
System.out.println("xmlValues :["+xmlValues+"]");
TransIDGenerator tg = new TransIDGenerator(xmlValues, "BASE", commonConstants.DB_NAME);
tranId = tg.generateTranSeqID(tranSer1, keyCol, keyString, conn);
tranId = tg.generateTranSeqID(tranSer1, keyCol, keyString, conn1);
System.out.println("tranId ::"+tranId);
}
......
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