Commit 5057193c authored by msingh's avatar msingh

Changed by Manish on 17/03/16 for DDUK FOR MAXIMUM CURSOR ISSUE.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@100969 ce508802-f39f-4f6c-b175-0d175dae99d5
parent e3fb7c81
......@@ -528,6 +528,13 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock
updCnt = pstmtUpd.executeUpdate();
System.out.println("Changed By 02/05/13 Pragyan sordalloc updated updCnt [" + updCnt + "]");
//Changed by wasim on 14-03-2016 to close prepared statement [START]
if(pstmtUpd != null)
{
pstmtUpd.close();
pstmtUpd = null;
}
//Changed by wasim on 14-03-2016 to close prepared statement [END]
pstmtSord = conn.prepareStatement(sSQL);
pstmtSord.setString(1, saleOrder);
......@@ -552,7 +559,16 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock
{
count = rsSord.getInt(1);
}
//Changed by wasim on 14-03-2016 to close prepared/Result set statement [START]
if(pstmtSord != null)
{
pstmtSord.close();pstmtSord = null;
}
if(rsSord != null)
{
rsSord.close();rsSord = null;
}
//Changed by wasim on 14-03-2016 to close prepared statement/Result Set [END]
if(count > 0)
{
......@@ -588,6 +604,13 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock
updCnt = pstmtUpd.executeUpdate();
System.out.println("Changed By 02/05/13 Pragyan sordalloc If alrady exist Location Update Inside grater updCnt2nd [" + updCnt + "]");
//Changed by wasim on 14-03-2016 to close prepared statement [START]
if(pstmtUpd != null)
{
pstmtUpd.close();
pstmtUpd = null;
}
//Changed by wasim on 14-03-2016 to close prepared statement [END]
}
else
{
......@@ -644,7 +667,15 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock
//changed by sankara on 15/10/13 for update of wave_flag
pstmtUpd.setString( 25, "Y");
updCnt = pstmtUpd.executeUpdate();
System.out.println("Changed By 02/05/13 Pragyan sordalloc inserted updCnt [" + updCnt + "]");
//Changed by wasim on 14-03-2016 to close prepared statement [START]
if(pstmtUpd != null)
{
pstmtUpd.close();
pstmtUpd = null;
}
//Changed by wasim on 14-03-2016 to close prepared statement [END]
}
}
else
......@@ -672,6 +703,16 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock
{
count = rsSord.getInt(1);
}
//Changed by wasim on 14-03-2016 to close prepared/Result set statement [START]
if(pstmtSord != null)
{
pstmtSord.close();pstmtSord = null;
}
if(rsSord != null)
{
rsSord.close();rsSord = null;
}
//Changed by wasim on 14-03-2016 to close prepared statement/Result Set [END]
if(count > 0)
......@@ -695,7 +736,16 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock
pstmtUpd.setString(7, lotNo);
pstmtUpd.setString(8, lotSl);
updCnt = pstmtUpd.executeUpdate();
System.out.println("Changed By 02/05/13 Pragyan If alrady exist Location Update updCnt1st [" + updCnt + "]");
//Changed by wasim on 14-03-2016 to close prepared statement [START]
if(pstmtUpd != null)
{
pstmtUpd.close();
pstmtUpd = null;
}
//Changed by wasim on 14-03-2016 to close prepared statement [END]
//changed by sankara on 17/10/13 update wave_flag
//updateSql = "UPDATE SORDALLOC SET QTY_ALLOC = QTY_ALLOC + ? ,QUANTITY__STDUOM = QUANTITY__STDUOM + ?"
updateSql = "UPDATE SORDALLOC SET QTY_ALLOC = QTY_ALLOC + ? ,QUANTITY__STDUOM = QUANTITY__STDUOM + ?, WAVE_FLAG = 'Y' "
......@@ -725,6 +775,13 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock
updCnt = pstmtUpd.executeUpdate();
System.out.println("Changed By 02/05/13 Pragyan sordalloc If alrady exist Location Update updCnt2nd [" + updCnt + "]");
//Changed by wasim on 14-03-2016 to close prepared statement [START]
if(pstmtUpd != null)
{
pstmtUpd.close();
pstmtUpd = null;
}
//Changed by wasim on 14-03-2016 to close prepared statement [END]
}
else
{
......@@ -747,11 +804,17 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock
pstmtUpd.setString(7, lotSl);
updCnt = pstmtUpd.executeUpdate();
//Changed by wasim on 14-03-2016 to close prepared statement [START]
if(pstmtUpd != null)
{
pstmtUpd.close();
pstmtUpd = null;
}
//Changed by wasim on 14-03-2016 to close prepared statement [END]
}
}
//Changed By 02/05/13 Pragyan To check the sordalloc allocated quantity > quantity then insert new record deducte quantity from old location.end
updateSql = "UPDATE PICK_ISS_DET SET LOC_CODE__TO = ? "
+ " WHERE TRAN_ID = ? AND LINE_NO = ? ";
......@@ -762,10 +825,24 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock
pstmtUpd.setInt(3, lineNo);
updCnt = pstmtUpd.executeUpdate();
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
//Changed by wasim on 14-03-2016 to close prepared statement [START]
if(pstmtUpd != null)
{
pstmtUpd.close();
pstmtUpd = null;
}
//Changed by wasim on 14-03-2016 to close prepared statement [END]
if (retString != null && retString.trim().length() > 0 )
{
isError = true;
......@@ -779,8 +856,13 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock
pstmtUpd.setString(1, pickisstranId);
updCnt = pstmtUpd.executeUpdate();
//Changed by wasim on 14-03-2016 to close prepared statement [START]
if(pstmtUpd != null)
{
pstmtUpd.close();
pstmtUpd = null;
}
//Changed by wasim on 14-03-2016 to close prepared statement [END]
//Changed by Sankara on 03/oct/13 adding validation to prevent doc transfer in case of pending/aborted picking.start
int countConf = 0;
......@@ -797,10 +879,16 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock
countConf = rs.getInt(1);
System.out.println(" Pending Transfer Count["+countConf);
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if( countConf > 0)
{
......@@ -972,6 +1060,14 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock
pstmtSord = null;
}
//Changed by wasim on 14-03-2016 to close prepared statement [START]
if(pstmtUpd != null)
{
pstmtUpd.close();
pstmtUpd = null;
}
//Changed by wasim on 14-03-2016 to close prepared statement [END]
//Changed By 02/05/13 Pragyan Close The Connections.end
}
catch(Exception e)
......
......@@ -112,6 +112,10 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
//Changes by Dadaso pawar on [24/02/15] (Confirmed dispatch) [End]
//Changed By Samadhan on 15/07/2015 D15CKAT015
String ptcnPalletNo = "",tokenInfo = "";
// Changed by Sneha on 16-03-2016, [Start]
int receiptCount = 0;
// Changed by Sneha on 16-03-2016, [End]
try
{
DistCommon distCommonObj = new DistCommon();
......@@ -359,10 +363,18 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
System.out.println("TOKEN_INFO is ::::"+tokenInfo);
//Changed by manish to check token_info is present or not on 09/03/16 [end]
// Changed by Sneha on 16-03-2016, calling isReceiptGeneration method and put values of getwayAmount in map [Start]
receiptCount = isReceiptGeneration(saleOrder, conn);
System.out.println("getwayAmount value ==========>>[" + getwayAmount + "]");
invoiceDetailsMap.put("chq_amt", getwayAmount);
// Changed by Sneha on 16-03-2016, calling isReceiptGeneration method and put values of getwayAmount in map [End]
if("S".equalsIgnoreCase(rcpMode))
{
try
{
modName = "W_SAGEPAY";
//segPayStatus = authoriseSagePay(ptcn, conn);
//Changed by manish to check token_info is present or not on 09/03/16 [start]
if(tokenInfo == null || tokenInfo.trim().length() == 0 )
......@@ -380,10 +392,11 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
else if(segPayStatus.indexOf("OK") > 0)
{
isReceiptGen = true ;
modName = "W_SAGEPAY"; //Changed by wasim
//Changed by samadhan on 08/07/2015 D15CKAT015 Start
//invoiceDetailsMap.put("chq_amt",sagePayAmount);
invoiceDetailsMap.put("chq_amt",getwayAmount);
//invoiceDetailsMap.put("chq_amt",getwayAmount); // comment by sneha on 16-03-2016, getwayAmount called before if loop
//Changed by samadhan on 08/07/2015 D15CKAT015 End
// changed by Sneha on 12-03-2016, [Start]
......@@ -392,6 +405,7 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
// changed by Sneha on 12-03-2016, [End]
System.out.println("After insertSagePayDetailsinDespatch--->>["+errString+"]");
//Changed by wasim on 08-07-2015 to get TOKEN_INFO [START]
//String specReason = getColumnDescr(conn, "TOKEN_INFO", "DESPATCH", despId, currCode); //Commented by Dadaso pawar on 20/08/15
tokenInfo = getColumnDescr(conn, "TOKEN_INFO", "DESPATCH", "DESP_ID", despId);
......@@ -416,8 +430,13 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
} //Changed by manish to check token_info is present or not on 09/03/16 [end]
String vps = "";
if(tokenInfo != null && tokenInfo.length() > 0 && tokenInfo.indexOf("OK") > 0)
// Changed by Sneha on 16-03-2016, checking value from isReceiptGeneration [Start]
//if(tokenInfo != null && tokenInfo.length() > 0 && tokenInfo.indexOf("OK") > 0)
if(tokenInfo != null && tokenInfo.length() > 0 && tokenInfo.indexOf("OK") > 0 && receiptCount <= 0)
// Changed by Sneha on 16-03-2016, calling isReceiptGeneration method [End]
{
isReceiptGen = true ;
Document dom1 = genericUtility.parseString(tokenInfo);
......@@ -425,7 +444,15 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
vps = vps.replace('{', ' ');
vps = vps.replace('}', ' ');
vps = vps == null ? "" : vps.trim();
}
// Changed by Sneha on 16-03-2016, isReceiptGen is false [Start]
else
{
isReceiptGen = false ;
}
// Changed by Sneha on 16-03-2016, isReceiptGen is false [End]
System.out.println("After insertSagePayDetailsinDespatch--->>["+errString+"]");
refNo = vps;
}
......@@ -448,7 +475,6 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
//Changed by wasim on 08-07-2015 to check for PAYPAL [START]
else if("P".equalsIgnoreCase(rcpMode))
{
isReceiptGen = true ;
modName = "W_PAYPAL";
//Changed by Samadhan on 15/07/2015 D15CKAT015 for PayPal Start
System.out.println("RCP MODE is PayPal.................");
......@@ -470,9 +496,10 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
else if(payPalStatus.indexOf("Success") > 0)
{
isReceiptGen = true ;
System.out.println("refNo@@ :["+refNo+"]");
invoiceDetailsMap.put("chq_amt",getwayAmount);
// invoiceDetailsMap.put("chq_amt",getwayAmount); // comment by sneha on 16-03-2016, getwayAmount called before if loop
// changed by Sneha on 12-03-2016, [Start]
//errString = insertPayPalDetailsinDespatch(despId, payPalStatus, cardType, ); //need to check (working or not)
......@@ -499,12 +526,22 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
} //Changed by manish to check token_info is present or not on 09/03/16 [end]
String vps = "";
if(tokenInfo != null && tokenInfo.length() > 0 && tokenInfo.indexOf("Success") > 0)
// Changed by Sneha on 16-03-2016, checking value from isReceiptGeneration [Start]
//if(tokenInfo != null && tokenInfo.length() > 0 && tokenInfo.indexOf("Success") > 0)
if(tokenInfo != null && tokenInfo.length() > 0 && tokenInfo.indexOf("Success") > 0 && receiptCount <= 0)
// Changed by Sneha on 16-03-2016, calling isReceiptGeneration method [End]
{
isReceiptGen = true ;
Document dom1 = genericUtility.parseString(tokenInfo);
vps= genericUtility.getColumnValue("TRANSACTIONID", dom1);
}
// Changed by Sneha on 16-03-2016, isReceiptGen is false [Start]
else
{
isReceiptGen = false ;
}
// Changed by Sneha on 16-03-2016, isReceiptGen is false [End]
System.out.println("After insertPayPalDetailsinDespatch--->>["+errString+"]");
refNo = vps;
}
......@@ -1118,6 +1155,15 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
}
}
// Changed by Sneha on 12-03-2016, calling SagePay and PayPal method in finally [End]
// Changed by Sneha on 16-03-2016, set blank values for global variable [Start]
getwayAmount = 0;
rcpMode = "";
segPayStatus = "";
payPalStatus = "";
cardType = "";
despId = "";
// Changed by Sneha on 16-03-2016, set blank values for global variable [End]
}
catch(Exception e)
{
......@@ -2136,12 +2182,9 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
}
//Changed by Manish on [12/05/15] start
// Changed by Sneha on 09-03-2016, [Start]
//private String generateInvoiceReport(String ptcn, String despatchID, String printer, Connection conn, String xtraParams) throws ITMException
public String generateInvoiceReport(String ptcn, String despatchID, String printer, Connection conn, String xtraParams) throws ITMException
// Changed by Sneha on 09-03-2016, [End]
{
private String generateInvoiceReport(String ptcn, String despatchID, String printer, Connection conn, String xtraParams) throws ITMException
{
String reportObjName = "";
String errString = "";
String loginCode = "";
......@@ -2206,10 +2249,34 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
}
//Changed by Manish on 17/03/2016 for taking site_code from sorder for invoice generation Report [start]
sql1 = " SELECT S.SITE_CODE FROM SORDER S, DESPATCH D WHERE S.SALE_ORDER = D.SORD_NO AND D.PTCN = ? AND D.DESP_ID = ? ";
DistCommon discommon = new DistCommon();
pstmt1 = conn.prepareStatement(sql1);
pstmt1.setString(1, ptcn);
pstmt1.setString(2, despatchID);
rs1 = pstmt1.executeQuery();
if(rs1.next())
{
siteCode = rs1.getString(1);
}
if(rs1 != null)
{
rs1.close();
rs1 = null;
}
if(pstmt1 != null)
{
pstmt1.close();
pstmt1 = null;
}
//Changed by Manish on 17/03/2016 for taking site_code from sorder for invoice generation Report [end]
// reportObjName = "d_invoice_rev";
DistCommon discommon = new DistCommon();
//reportObjName = "d_invoice_rev";
ibase.webitm.reports.utility.JasperReportGenerator jrGenerator = new ibase.webitm.reports.utility.JasperReportGenerator();
String xsdString ="<Arguments>" +
......@@ -2279,11 +2346,11 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
"</Argument>" +
"</Arguments>";
System.out.println("XSD parser **->["+xsdString+"]");
siteCode = loginSite;
//siteCode = loginSite;
if(siteCode!=null)
{
sql1 = "select report_name from site_spec_report where site_code = ?";
sql1 = " select report_name from site_spec_report where site_code = ? ";
pstmt1 = conn.prepareStatement(sql1);
pstmt1.setString(1, siteCode);
......@@ -2291,7 +2358,7 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
if(rs1.next())
{
reportObjName = rs1.getString(1);
System.out.println("Report object Name : ["+reportObjName+"]");
}
if(pstmt1 != null)
{
......@@ -2553,7 +2620,7 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
}
return stdExchRate;
}
private HashMap custDetail(String custCode,String bankCode,Connection conn )throws ITMException
private HashMap custDetail(String custCode,String bankCode,Connection conn )throws ITMException, SQLException
{
ResultSet rs = null;
PreparedStatement pstmt = null;
......@@ -2586,9 +2653,17 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
cctrCodeAdv = rs.getString(7);
custBankRef = rs.getString(8);
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
rcpMap.put("cust_name",custName);
rcpMap.put("acct_code__ar",acctCodeAr);
rcpMap.put("cctr_code__ar",cctrCodeAr);
......@@ -2621,6 +2696,16 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
cctrCodeCfAr = rs.getString(7);
currCode = rs.getString(8);
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
System.out.println("ACCT_CODE__BAL@@ ::: "+acctCodeBal);
System.out.println("curr_code ::: "+currCode);
rcpMap.put("acct_code__bal",acctCodeBal);
......@@ -2636,8 +2721,6 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
}
rcpMap.put("acct_code__cf",acctCodeCf);
rcpMap.put("cctr_code__cf",cctrCodeCf);
rs.close();
pstmt.close();
rcpMap.put("curr_code",currCode);
String exchangeRate = getColumnDescr(conn, "std_exrt", "currency", "curr_code", currCode);
......@@ -2719,9 +2802,23 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
e.printStackTrace();
throw new ITMException(e);
}
finally
{
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
return rcpMap;
}// END OF HASH MAP CustDetail
public String getColumnDescr(Connection conn, String columnName ,String tableName, String columnName2, String value) throws ITMException,Exception
{
......@@ -2952,6 +3049,60 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
return retString;
}
//Changed by samadhan on 15/07/2015 D15CKAT015 for paypal End
// Changed by Sneha on 16-03-2016, [String]
private int isReceiptGeneration(String saleOrder, Connection conn) throws ITMException, SQLException
{
String sql = "";
PreparedStatement pstmt = null;
ResultSet rs = null;
int count = 0;
try
{
sql = "select count(*) from receipt where sale_order = ? and confirmed = ? " ;
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, saleOrder);
pstmt.setString(2, "Y");
rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt(1);
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
catch(Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
finally
{
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
System.out.println("Count from isReceiptGeneration ==========>> " + count);
return count;
}
// Changed by Sneha on 16-03-2016, set blank values for global variable [End]
}
......@@ -353,6 +353,19 @@ public class PickIssIC extends ValidatorEJB implements PickIssICLocal, PickIssIC
errFields.add( childNodeName.toLowerCase() );
}
}
//Changed by wasim on 14-03-2016 to close prepared statement/Result Set [START]
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
//Changed by wasim on 14-03-2016 to close prepared statement/ Result set [END]
}
//Changed by sumit on 28/09/12 validating in case of wave canceled end.
// cpatil end
......
......@@ -487,6 +487,89 @@ public class StockTransferIC extends ValidatorEJB implements StockTransferICRemo
}
//changed by sankara on 13-02-14 shholud not allow stock transfer if repl is pending end.
}
//Changed by wasim on 17-03-2016 to validate no more quantity validation [START]
else if ("item_code".equalsIgnoreCase( childNodeName ) && "DDUK".equalsIgnoreCase(projectName) )
{
itemCode = genericUtility.getColumnValue("item_code", currDom );
locCode = genericUtility.getColumnValue("loc_code", currDom );
siteCode = genericUtility.getColumnValue("site_code", allDom, "1" );
System.out.println("Item Code["+itemCode+"] Location ["+locCode+"] Site Code ["+siteCode+"]");
if ( childNode.getFirstChild() == null )
{
errList.add( "VTITMNL" );
errFields.add( childNodeName.toLowerCase() );
}
else
{
sql = " SELECT COUNT(*) AS COUNT " +
" FROM STOCK STOCK, ITEM ITEM, LOCATION LOCATION " +
" WHERE STOCK.ITEM_CODE = ITEM.ITEM_CODE AND STOCK.LOC_CODE = LOCATION.LOC_CODE "+
" AND STOCK.ITEM_CODE = ? AND STOCK.LOC_CODE = ? AND STOCK.SITE_CODE = ?";
pstmt = conn.prepareStatement( sql );
pstmt.setString( 1, itemCode );
pstmt.setString( 2, locCode );
pstmt.setString( 3, siteCode );
rs = pstmt.executeQuery();
if( rs.next() )
{
count = rs.getInt("COUNT");
}
if(rs!=null)
{
rs.close();rs = null;
}
if(pstmt!=null)
{
pstmt.close();pstmt = null;
}
System.out.println("Total Item code in this location code is"+count);
if( count == 0 )
{
errList.add( "VTINVVITM" );
errFields.add( childNodeName.toLowerCase() );
}
if(count > 0)
{
count = 0;
sql = " SELECT COUNT(*) AS COUNT " +
" FROM STOCK STOCK, ITEM ITEM, LOCATION LOCATION " +
" WHERE STOCK.ITEM_CODE = ITEM.ITEM_CODE AND STOCK.LOC_CODE = LOCATION.LOC_CODE "+
" AND ((CASE WHEN STOCK.QUANTITY IS NULL THEN 0 ELSE STOCK.QUANTITY END) - ((CASE WHEN STOCK.ALLOC_QTY IS NULL THEN 0 ELSE STOCK.ALLOC_QTY END) + (CASE WHEN STOCK.HOLD_QTY IS NULL THEN 0 ELSE STOCK.HOLD_QTY END))) > 0 "+
" AND STOCK.ITEM_CODE = ? AND STOCK.LOC_CODE = ? AND STOCK.SITE_CODE = ?";
pstmt = conn.prepareStatement( sql );
pstmt.setString( 1, itemCode );
pstmt.setString( 2, locCode );
pstmt.setString( 3, siteCode );
rs = pstmt.executeQuery();
if( rs.next() )
{
count = rs.getInt("COUNT");
}
if(rs!=null)
{
rs.close();rs = null;
}
if(pstmt!=null)
{
pstmt.close();pstmt = null;
}
System.out.println("Total count for (Quantity - (alloc_qty + hold_qty) > 0)="+count);
if( count == 0 )
{
errList.add( "VTQTYNT" );
errFields.add( childNodeName.toLowerCase() );
}
}
}
}
//Changed by wasim on 17-03-2016 to validate no more quantity validation [END]
}// for loop end
}//case 2 end
break;
......
......@@ -16314,6 +16314,26 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
pstmtInsertData.addBatch();
pstmtInsertData.executeBatch();
//Changed by Manish on 15/03/16 for max cursor issue for DDUK.[start]
sSQL = "UPDATE DESPATCH SET FREIGHT_AMT_ADD = ? WHERE PTCN = ?";
pstmtDesp = conn.prepareStatement(sSQL);
sql = "UPDATE CARTON_MASTER SET TRACKING_NO = ? , SHIP_LABEL= ? , MSN_NO =?,CARRIER_SYMBOL = ? , CARRIER_FRIENDLYNAME = ?"
+ " WHERE CARTON_NO = ?";
pstmtCart = conn.prepareStatement(sql);
sqlInsertDt = "SELECT CARTON_NO,PICK_ORDER,LINE_NO__PICK,CARTON_TYPE,PACK_CODE,MASTER_CARTON,ITEM_CODE,TRACKING_NO,SHIP_LABEL FROM CARTON_MASTER WHERE PTCN = ? ORDER BY ITEM_CODE";
sqlInsertData1 = "INSERT INTO WAVE_STATUS_ORG_DET (TRAN_ID, LINE_NO,PTCN,CARTON_NO," +
" PICK_ORDER, LINE_NO__PICK ,REF_SER, REF_ID, " +
" CARTON_TYPE,PACK_CODE,MASTER_CARTON,ITEM_CODE, " +
"WEIGHT,TRACKING_NO, SHIP_LABEL )"+
" VALUES (?,?, ?,?, ?,?, ?,?, ?,?, ?,? , ?,?, ?)";
pstmtInsertData1 = conn.prepareStatement(sqlInsertData1);
pstmtDt = conn.prepareStatement(sqlInsertDt);
//Changed by Manish on 15/03/16 for max cursor issue for DDUK.[end]
//"Y".equalsIgnoreCase(isADSIConnReq)
if("P".equalsIgnoreCase(waveMode))
{
......@@ -16341,12 +16361,20 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
if("B".equalsIgnoreCase(frtTerm))
{
sSQL = "UPDATE DESPATCH SET FREIGHT_AMT_ADD = ? WHERE PTCN = ?";
pstmtDesp = conn.prepareStatement(sSQL);
//Changed by Manish on 15/03/16 for max cursor issue for DDUK.[start]
/*sSQL = "UPDATE DESPATCH SET FREIGHT_AMT_ADD = ? WHERE PTCN = ?";
pstmtDesp = conn.prepareStatement(sSQL);*/
//Changed by Manish on 15/03/16 for max cursor issue for DDUK.[end]
pstmtDesp.setDouble(1, totalFrtAmt);
pstmtDesp.setString(2, ptcn);
int pUpd = pstmtDesp.executeUpdate();
if(pstmtDesp != null)
{
pstmtDesp.close();
pstmtDesp = null;
}
System.out.println("Update in desp update freight Amt upd ["+pUpd+"] For");
}
......@@ -16423,9 +16451,12 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
createFolder.mkdirs();
}
sql = "UPDATE CARTON_MASTER SET TRACKING_NO = ? , SHIP_LABEL= ? , MSN_NO =?,CARRIER_SYMBOL = ? , CARRIER_FRIENDLYNAME = ?"
//Changed by Manish on 15/03/16 for max cursor issue for DDUK.[start]
/*sql = "UPDATE CARTON_MASTER SET TRACKING_NO = ? , SHIP_LABEL= ? , MSN_NO =?,CARRIER_SYMBOL = ? , CARRIER_FRIENDLYNAME = ?"
+ " WHERE CARTON_NO = ?";
pstmtCart = conn.prepareStatement(sql);
pstmtCart = conn.prepareStatement(sql);*/
//Changed by Manish on 15/03/16 for max cursor issue for DDUK.[end]
pstmtCart.setString(1, trackNo);
pstmtCart.setString(2, path );
pstmtCart.setDouble(3, msnNo);
......@@ -16451,6 +16482,13 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
System.out.println("Write File Complete----");
}
//Changed by Manish on 15/03/16 for max cursor issue for DDUK.[start]
if( pstmtCart != null )
{
pstmtCart.close();
pstmtCart = null;
}
//Changed by Manish on 15/03/16 for max cursor issue for DDUK.[start]
if( pstmt != null )
{
......@@ -16493,7 +16531,9 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
pstmtInsertData.addBatch(); */
sqlInsertDt = "SELECT CARTON_NO,PICK_ORDER,LINE_NO__PICK,CARTON_TYPE,PACK_CODE,MASTER_CARTON,ITEM_CODE,TRACKING_NO,SHIP_LABEL FROM CARTON_MASTER WHERE PTCN = ? ORDER BY ITEM_CODE";
//Changed by Manish on 15/03/16 for max cursor issue for DDUK.[start]
/*sqlInsertDt = "SELECT CARTON_NO,PICK_ORDER,LINE_NO__PICK,CARTON_TYPE,PACK_CODE,MASTER_CARTON,ITEM_CODE,TRACKING_NO,SHIP_LABEL FROM CARTON_MASTER WHERE PTCN = ? ORDER BY ITEM_CODE";
sqlInsertData1 = "INSERT INTO WAVE_STATUS_ORG_DET (TRAN_ID, LINE_NO,PTCN,CARTON_NO," +
" PICK_ORDER, LINE_NO__PICK ,REF_SER, REF_ID, " +
......@@ -16502,7 +16542,8 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
" VALUES (?,?, ?,?, ?,?, ?,?, ?,?, ?,? , ?,?, ?)";
pstmtInsertData1 = conn.prepareStatement(sqlInsertData1);
pstmtDt = conn.prepareStatement(sqlInsertDt);
pstmtDt = conn.prepareStatement(sqlInsertDt);*/
//Changed by Manish on 15/03/16 for max cursor issue for DDUK.[end]
pstmtDt.setString(1, ptcn);
rsD = pstmtDt.executeQuery();
......@@ -16582,6 +16623,19 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
pstmtInsertData1.close();
pstmtInsertData1 = null;
}
//Changed by Manish on 15/03/16 for max cursor issue for DDUK.[start]
if( rsD != null)
{
rsD.close();
rsD = null;
}
if( pstmtDt != null)
{
pstmtDt.close();
pstmtDt = null;
}
//Changed by Manish on 15/03/16 for max cursor issue for DDUK.[end]
}
}
if( pstmtInsertData != null)
......@@ -16612,6 +16666,22 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
pstmtInsertData1.close();
pstmtInsertData1 = null;
}
if( rsD != null)
{
rsD.close();
rsD = null;
}
if( pstmtDt != null)
{
pstmtDt.close();
pstmtDt = null;
}
if( pstmtCart != null )
{
pstmtCart.close();
pstmtCart = null;
}
}
catch(Exception e)
{
......
......@@ -209,6 +209,19 @@ public class CommonWmsUtil {
}
else
{
//Changed by Manish on 15/03/16 [start]
if(rs != null)
{
rs.close();
rs=null;
}
if(pstmt != null)
{
pstmt.close();
pstmt=null;
}
//Changed by Manish on 15/03/16 [end]
System.out.println("Getting stk_opt from item...");
sql = "SELECT STK_OPT FROM ITEM WHERE ITEM_CODE = ? ";
pstmt = conn.prepareStatement(sql);
......@@ -219,8 +232,22 @@ public class CommonWmsUtil {
stkOpt = rs.getString(1) == null ? "" : rs.getString(1).trim();
}
}
rs.close();rs = null;
pstmt.close();pstmt = null;
/*rs.close();rs = null;
pstmt.close();pstmt = null;*/
//Changed by Manish on 15/03/16 [start]
if(rs != null)
{
rs.close();
rs=null;
}
if(pstmt != null)
{
pstmt.close();
pstmt=null;
}
//Changed by Manish on 15/03/16 [end]
/*sql = "SELECT STK_OPT FROM ITEM WHERE ITEM_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
......@@ -241,6 +268,23 @@ public class CommonWmsUtil {
e.printStackTrace();
throw new ITMException(e);
}
//Changed by Manish on 15/03/16 [start]
finally
{
if(rs != null)
{
rs.close();
rs=null;
}
if(pstmt != null)
{
pstmt.close();
pstmt=null;
}
}
//Changed by Manish on 15/03/16 [start]
return stkOpt;
}
......@@ -1464,7 +1508,7 @@ public class CommonWmsUtil {
}
// Changed by Sneha on 03/07/2015 for finparm, Request ID: D15DKAT001
public String getfinparm(String pCode, String varName, Connection conn)
public String getfinparm(String pCode, String varName, Connection conn) throws ITMException
{
String sql = "";
String varValue = "";
......@@ -1483,11 +1527,18 @@ public class CommonWmsUtil {
varValue = rs.getString("var_value");
addValue = rs.getString("addl_value");
}
//Changed by wasim on 15-03-2016 to close result set and addValue condition in try block [START]
if(rs!=null)
{
rs.close();
rs = null;
}
catch (Exception e) {
// TODO: handle exception
if(pstmt!=null)
{
pstmt.close();
pstmt = null;
}
if(addValue == null || addValue.trim().length() == 0)
{
return varValue;
......@@ -1496,6 +1547,34 @@ public class CommonWmsUtil {
{
return varValue.trim()+";"+addValue.trim();
}
//Changed by wasim on 15-03-2016 to close result set and addValue condition in try block [END]
}
catch (Exception e)
{
throw new ITMException(e);
}
//Changed by wasim on 15-03-2016 to add finally block [START]
finally
{
try
{
if(rs!=null)
{
rs.close();
rs = null;
}
if(pstmt!=null)
{
pstmt.close();
pstmt = null;
}
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
//Changed by wasim on 15-03-2016 to add finally block [END]
}
//End by Sneha on 03/07/2015 for finparm, Request ID: D15DKAT001
......
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