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
......@@ -35,7 +35,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
{
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 conn123 ) throws RemoteException, ITMException
{
String errString = "", siteCode = "";
......@@ -46,7 +46,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
String childNodeName = "" ;
int ctr = 0, childNodeListLength = 0, cnt = 0;
boolean isError = false;
Connection conn1 = null;
String userId = "", errorType = "", errCode = "";
ArrayList <String> errList = new ArrayList<String>();
ArrayList <String> errFields = new ArrayList <String> ();
......@@ -56,14 +56,14 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
try
{
System.out.println("::::::::::::::::: Inside postSave for palletization confirm :::::::::::::::: ");
GenericUtility genericUtility = GenericUtility.getInstance();
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
conn.setAutoCommit(false);
connDriver = null;
ConnDriver connDriver = new ConnDriver();
conn1 = connDriver.getConnectDB("DriverITM");
conn1.setAutoCommit(false);
connDriver = null;
//CommonWmsUtil commonWmsUtility = CommonWmsUtil.getInstance();
GenericUtility genericUtility = GenericUtility.getInstance();
Document dom = null;
dom = genericUtility.parseString(domString);
......@@ -83,7 +83,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
childNodeListLength = childNodeList.getLength();
System.out.println("childNodeListLength----------->>["+childNodeListLength+"]");
tranIdList = getTranId(conn, siteCode);
tranIdList = getTranId(siteCode, conn1);
for (ctr = 0; ctr < childNodeListLength; ctr++)
{
......@@ -94,7 +94,6 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
if("tran_id".equalsIgnoreCase(childNodeName))
{
System.out.println("Inside tran_id ::::::::::: ");
if(tranId.length() <= 0)
{
System.out.println("Tran Id found blank :::::::::: ");
......@@ -113,7 +112,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
if(tranIdList.contains(tranId))
{
System.out.println("Calling confirm :::::::::::::::::::: ");
confirm(tranId, siteCode, conn);
confirm(tranId, siteCode, conn1);
}
}
}
......@@ -129,7 +128,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
errFldName = errFields.get(cnt);
System.out.println("errCode .........." + errCode);
errString = getErrorString( errFldName, errCode, userId );
errorType = errorType( conn, errCode );
errorType = errorType( conn1, errCode );
if ( errString.length() > 0)
{
String bifurErrString = errString.substring( errString.indexOf("<Errors>") + 8, errString.indexOf("<trace>"));
......@@ -176,17 +175,17 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
if( !isError )
{
System.out.println("commmit");
conn.commit();
conn1.commit();
}
else if ( isError )
{
System.out.println("rollback");
conn.rollback();
conn1.rollback();
}
if (conn != null)
if (conn1 != null)
{
conn.close();
conn = null;
conn1.close();
conn1 = null;
}
}
catch(Exception e)
......@@ -227,7 +226,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
ResultSet rs = null;
try
{
String sql = " SELECT MSG_TYPE FROM MESSAGES WHERE MSG_NO = ? ";
String sql = " SELECT MSG_TYPE FROM MESSAGES WHERE MSG_NO = ? ";
pstmt = conn.prepareStatement( sql );
pstmt.setString(1, errorCode);
rs = pstmt.executeQuery();
......@@ -263,7 +262,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
return msgType;
}
private ArrayList<String> getTranId(Connection conn, String siteCode) throws Exception
private ArrayList<String> getTranId( String siteCode, Connection conn ) throws Exception
{
ArrayList<String> colVal = new ArrayList<String>();
PreparedStatement pstmt = null ;
......@@ -271,9 +270,10 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
String sql = "";
try
{
sql = "SELECT TRAN_ID FROM PALLET_HDR WHERE CONFIRMED = 'N' AND SITE_CODE = ? ";
sql = "SELECT TRAN_ID FROM PALLET_HDR WHERE CONFIRMED = ? AND SITE_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
pstmt.setString(1, "N");
pstmt.setString(2, siteCode);
rs = pstmt.executeQuery();
while(rs.next())
{
......@@ -284,7 +284,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
}
catch(Exception e)
{
System.out.println("Exception in locCode " + e);
System.out.println("Exception in getTranId ::::::::::: " + e);
e.printStackTrace();
throw new Exception(e);
}
......@@ -305,7 +305,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
return colVal;
}
private String generateTranTd( String windowName, String tranDate, String siteCode, Connection conn )throws ITMException, SQLException
private String generateTranTd( String windowName, String tranDate, String siteCode, Connection conn1 )throws ITMException, SQLException
{
System.out.println("inside generateTranTd@@.........");
PreparedStatement pstmt = null;
......@@ -317,7 +317,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
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);
......@@ -331,7 +331,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
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);
......@@ -361,7 +361,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
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);
}
......@@ -394,81 +394,13 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
return tranId;
}
/*
public HashMap getInterface2Data(String itemCode, Connection conn, String siteCode) throws ITMException, SQLException
{
HashMap hm = new HashMap();
PreparedStatement pstmt=null;
ResultSet rs = null;
String sql = "";
String familyGrp = "", qcType = "", stroPref = "";
try
{
sql = "SELECT LOC_ZONE__PREF, PROC_MTH, ANALYSIS_CLASS 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())
{
familyGrp = rs.getString("LOC_ZONE__PREF");
qcType = rs.getString("PROC_MTH");
stroPref = rs.getString("ANALYSIS_CLASS");
}
rs.close();rs = null;
pstmt.close();pstmt = null;
sql = "SELECT LOC_ZONE__PREF, PROC_MTH, ANALYSIS_CLASS FROM ITEM WHERE ITEM_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
rs = pstmt.executeQuery();
if (rs.next())
{
if(familyGrp == null || familyGrp.length() <= 0)
{
familyGrp = rs.getString("LOC_ZONE__PREF");
}
if(qcType == null || qcType.length() <= 0)
{
qcType = rs.getString("PROC_MTH");
}
if(stroPref == null || stroPref.length() <= 0)
{
stroPref = rs.getString("ANALYSIS_CLASS");
}
}
rs.close();rs = null;
pstmt.close();pstmt = null;
hm.put("LOC_ZONE__PREF", familyGrp);
hm.put("PROC_MTH", qcType);
hm.put("ANALYSIS_CLASS", stroPref);
}
catch(Exception e)
{
System.out.println("Exception ::" + e.getMessage() + ":");
e.printStackTrace();
throw new ITMException(e);
}
finally
{
if(pstmt != null){pstmt.close();pstmt = null;}
if(rs != null){rs.close();rs = null;}
}
return hm;
}
*/
private void confirm( String tranId, String siteCode, Connection conn ) throws ITMException, SQLException
private void confirm( String tranId, String siteCode, Connection conn1 ) throws ITMException, SQLException
{
String errString = "", sql = "", interfaceTranId = "", tranDate = "", objName = "", invStat = "", available = "", familyGrp = "", qcType = "",
stroPref = "";
double quantity = 0, holdQuantity = 0;
PreparedStatement pstmt = null, pstmt1 = null, pstmt2 = null, pstmt3 = null;
ResultSet rs = null, rs1 = null, rs2 = null, rs3 = null;
PreparedStatement pstmt = null, pstmt1 = null;
ResultSet rs = null, rs1 = null;
DistCommon distComm = new DistCommon();
String nexpLoc = "", lockCode = "", expLoc = "";
......@@ -478,13 +410,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
System.out.println("::::::::::::::::: Inside confirm :::::::::::::::: ");
System.out.println("tranId :::::::::::::::: " + tranId);
System.out.println("siteCode :::::::::::::::: " + siteCode);
if(conn == null)
{
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
conn.setAutoCommit(false);
connDriver = null;
}
CommonWmsUtil commonWmsUtility = CommonWmsUtil.getInstance();
GenericUtility genericUtility = GenericUtility.getInstance();
......@@ -494,7 +420,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
System.out.println("tranDate ::::::::::::: " + tranDate);
sql = "update pallet_hdr set confirmed = ?, conf_date = ? where tran_id = ? ";
pstmt = conn.prepareStatement(sql);
pstmt = conn1.prepareStatement(sql);
pstmt.setString(1, "Y");
pstmt.setTimestamp(2, new Timestamp(System.currentTimeMillis()));
pstmt.setString(3, tranId);
......@@ -505,14 +431,14 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
sql = "select det.item_code as ITEM_CODE, det.lot_no as LOT_NO, det.lot_sl as LOT_SL, det.quantity as QTY, hdr.pallet_no as PALLET_NO, "
+ "hdr.inv_stat as INV_STAT, det.site_code as SITE_CODE, det.loc_code as LOC_CODE, hdr.tran_date as TRAN_DATE "
+ "from pallet_hdr hdr, pallet_det det where hdr.tran_id = det.tran_id and det.tran_id = ? ";
pstmt = conn.prepareStatement(sql);
pstmt = conn1.prepareStatement(sql);
pstmt.setString(1, tranId);
rs = pstmt.executeQuery();
while(rs.next())
{
sql = "select hold_qty from stock where quantity > 0 and site_code = ? and loc_code = ? and "
+ "item_code = ? and lot_no = ? and lot_sl = ? ";
pstmt1 = conn.prepareStatement(sql);
pstmt1 = conn1.prepareStatement(sql);
pstmt1.setString(1, rs.getString("SITE_CODE"));
pstmt1.setString(2, rs.getString("LOC_CODE"));
pstmt1.setString(3, rs.getString("ITEM_CODE"));
......@@ -533,14 +459,12 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
{
System.out.println("inside hold quantity greater than zero :::::::::::::::::: ");
nexpLoc = distComm.getDisparams("999999","NEAR_EXP_LOCK",conn);
expLoc = distComm.getDisparams("999999","EXP_LOCK",conn);
System.out.println("nexpLoc :::::::::::::::::: " + nexpLoc);
System.out.println("expLoc :::::::::::::::::: " + expLoc);
nexpLoc = distComm.getDisparams("999999","NEAR_EXP_LOCK",conn1);
expLoc = distComm.getDisparams("999999","EXP_LOCK",conn1);
sql = "select i.lock_code from inv_hold i, inv_hold_det d where i.tran_id = d.tran_id and i.site_code = d.site_code and "
+ "d.item_code = ? and d.site_code = ? and d.loc_code = ? and d.lot_no = ? and d.lot_sl = ? and d.hold_status = ? ";
pstmt1 = conn.prepareStatement(sql);
pstmt1 = conn1.prepareStatement(sql);
pstmt1.setString(1, rs.getString("ITEM_CODE"));
pstmt1.setString(2, rs.getString("SITE_CODE"));
pstmt1.setString(3, rs.getString("LOC_CODE"));
......@@ -561,28 +485,23 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
if(lockCode.equalsIgnoreCase(nexpLoc))
{
invStat = "N";
System.out.println("invStat in 1st if::::::::::::: " + invStat);
}
else if(lockCode.equalsIgnoreCase(expLoc))
{
invStat = "E";
System.out.println("invStat in 2nd if::::::::::::: " + invStat);
}
else
{
invStat = "H";
System.out.println("invStat in 3rd if::::::::::::: " + invStat);
}
}
else
{
invStat = "A";
System.out.println("inside else :::::::::::::::::: ");
}
System.out.println("invStat final ::::::::::::: " + invStat);
interfaceTranId = generateTranTd("w_interface2", tranDate, siteCode, conn);
interfaceTranId = generateTranTd("w_interface2", tranDate, siteCode, conn1);
System.out.println("interface2TranId ::::::::::::: " + interfaceTranId);
HashMap hm = new HashMap();
......@@ -622,7 +541,7 @@ public class PalletizationConf extends ValidatorEJB implements PalletizationConf
interfaceArrList.add(hm);
}
commonWmsUtility.updateAwmsInterface(interfaceArrList, conn);
commonWmsUtility.updateAwmsInterface(interfaceArrList, conn1);
System.out.println("Inserted into interface2 table ::::::::::::: ");
pstmt.close();
......
......@@ -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