Commit ee8ca8dc 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@39190 ce508802-f39f-4f6c-b175-0d175dae99d5
parent c84bdea8
...@@ -528,7 +528,14 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock ...@@ -528,7 +528,14 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock
updCnt = pstmtUpd.executeUpdate(); updCnt = pstmtUpd.executeUpdate();
System.out.println("Changed By 02/05/13 Pragyan sordalloc updated updCnt [" + updCnt + "]"); 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 = conn.prepareStatement(sSQL);
pstmtSord.setString(1, saleOrder); pstmtSord.setString(1, saleOrder);
pstmtSord.setString(2, lineNoSord); pstmtSord.setString(2, lineNoSord);
...@@ -552,7 +559,16 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock ...@@ -552,7 +559,16 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock
{ {
count = rsSord.getInt(1); 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) if(count > 0)
{ {
...@@ -588,6 +604,13 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock ...@@ -588,6 +604,13 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock
updCnt = pstmtUpd.executeUpdate(); updCnt = pstmtUpd.executeUpdate();
System.out.println("Changed By 02/05/13 Pragyan sordalloc If alrady exist Location Update Inside grater updCnt2nd [" + updCnt + "]"); 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 else
{ {
...@@ -644,7 +667,15 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock ...@@ -644,7 +667,15 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock
//changed by sankara on 15/10/13 for update of wave_flag //changed by sankara on 15/10/13 for update of wave_flag
pstmtUpd.setString( 25, "Y"); pstmtUpd.setString( 25, "Y");
updCnt = pstmtUpd.executeUpdate(); updCnt = pstmtUpd.executeUpdate();
System.out.println("Changed By 02/05/13 Pragyan sordalloc inserted updCnt [" + updCnt + "]"); 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 else
...@@ -672,6 +703,16 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock ...@@ -672,6 +703,16 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock
{ {
count = rsSord.getInt(1); 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) if(count > 0)
...@@ -695,7 +736,16 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock ...@@ -695,7 +736,16 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock
pstmtUpd.setString(7, lotNo); pstmtUpd.setString(7, lotNo);
pstmtUpd.setString(8, lotSl); pstmtUpd.setString(8, lotSl);
updCnt = pstmtUpd.executeUpdate(); updCnt = pstmtUpd.executeUpdate();
System.out.println("Changed By 02/05/13 Pragyan If alrady exist Location Update updCnt1st [" + updCnt + "]"); 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 //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 + ?"
updateSql = "UPDATE SORDALLOC SET QTY_ALLOC = QTY_ALLOC + ? ,QUANTITY__STDUOM = QUANTITY__STDUOM + ?, WAVE_FLAG = 'Y' " 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 ...@@ -725,6 +775,13 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock
updCnt = pstmtUpd.executeUpdate(); updCnt = pstmtUpd.executeUpdate();
System.out.println("Changed By 02/05/13 Pragyan sordalloc If alrady exist Location Update updCnt2nd [" + updCnt + "]"); 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 else
{ {
...@@ -747,11 +804,17 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock ...@@ -747,11 +804,17 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock
pstmtUpd.setString(7, lotSl); pstmtUpd.setString(7, lotSl);
updCnt = pstmtUpd.executeUpdate(); 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 //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 = ? " updateSql = "UPDATE PICK_ISS_DET SET LOC_CODE__TO = ? "
+ " WHERE TRAN_ID = ? AND LINE_NO = ? "; + " WHERE TRAN_ID = ? AND LINE_NO = ? ";
...@@ -762,10 +825,24 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock ...@@ -762,10 +825,24 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock
pstmtUpd.setInt(3, lineNo); pstmtUpd.setInt(3, lineNo);
updCnt = pstmtUpd.executeUpdate(); updCnt = pstmtUpd.executeUpdate();
} }
rs.close(); if(rs != null)
rs = null; {
pstmt.close(); rs.close();
pstmt = null; 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 ) if (retString != null && retString.trim().length() > 0 )
{ {
isError = true; isError = true;
...@@ -779,8 +856,13 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock ...@@ -779,8 +856,13 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock
pstmtUpd.setString(1, pickisstranId); pstmtUpd.setString(1, pickisstranId);
updCnt = pstmtUpd.executeUpdate(); updCnt = pstmtUpd.executeUpdate();
pstmtUpd.close(); //Changed by wasim on 14-03-2016 to close prepared statement [START]
pstmtUpd = null; 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 //Changed by Sankara on 03/oct/13 adding validation to prevent doc transfer in case of pending/aborted picking.start
int countConf = 0; int countConf = 0;
...@@ -797,10 +879,16 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock ...@@ -797,10 +879,16 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock
countConf = rs.getInt(1); countConf = rs.getInt(1);
System.out.println(" Pending Transfer Count["+countConf); System.out.println(" Pending Transfer Count["+countConf);
} }
rs.close(); if(rs != null)
rs = null; {
pstmt.close(); rs.close();
pstmt = null; rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if( countConf > 0) if( countConf > 0)
{ {
...@@ -972,6 +1060,14 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock ...@@ -972,6 +1060,14 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock
pstmtSord = null; 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 //Changed By 02/05/13 Pragyan Close The Connections.end
} }
catch(Exception e) catch(Exception e)
......
...@@ -49,11 +49,11 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT ...@@ -49,11 +49,11 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
double getwayAmount = 0; double getwayAmount = 0;
String projectCode = ""; String projectCode = "";
//Changed By Samadhan on 15/07/2015 D15CKAT015 End //Changed By Samadhan on 15/07/2015 D15CKAT015 End
// Changed by Sneha on 12-03-2016, declaration of global variable [Start] // Changed by Sneha on 12-03-2016, declaration of global variable [Start]
String rcpMode = "", segPayStatus = "", payPalStatus = "", cardType = "", despId = ""; String rcpMode = "", segPayStatus = "", payPalStatus = "", cardType = "", despId = "";
// Changed by Sneha on 12-03-2016, declaration of global variable [End] // Changed by Sneha on 12-03-2016, declaration of global variable [End]
public String postSave()throws RemoteException,ITMException public String postSave()throws RemoteException,ITMException
{ {
return ""; return "";
...@@ -100,7 +100,7 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT ...@@ -100,7 +100,7 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
HashMap itmVolumeMap = null; HashMap itmVolumeMap = null;
//Changes by Dadaso pawar on [24/02/15] (Confirmed dispatch) [Start] //Changes by Dadaso pawar on [24/02/15] (Confirmed dispatch) [Start]
String despSql = "",loginSiteCode = "",itemSer = "",tranSer = "",currCode = "",finEntity = "", String despSql = "",loginSiteCode = "",itemSer = "",tranSer = "",currCode = "",finEntity = "",
saleOrderL = "",custCode = "",refNo = "",siteCodeDesp = "", saleOrderL = "",custCode = "",refNo = "",siteCodeDesp = "",
bankCode = "",modName = "",invoicePrint = "",isDespConfEnable = ""; bankCode = "",modName = "",invoicePrint = "",isDespConfEnable = "";
double sorderTotAmt = 0; double sorderTotAmt = 0;
...@@ -111,7 +111,11 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT ...@@ -111,7 +111,11 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
ReceiptAdvConfLocal receiptAdvConfLocal = null; ReceiptAdvConfLocal receiptAdvConfLocal = null;
//Changes by Dadaso pawar on [24/02/15] (Confirmed dispatch) [End] //Changes by Dadaso pawar on [24/02/15] (Confirmed dispatch) [End]
//Changed By Samadhan on 15/07/2015 D15CKAT015 //Changed By Samadhan on 15/07/2015 D15CKAT015
String ptcnPalletNo = "",tokenInfo = ""; String ptcnPalletNo = "",tokenInfo = "";
// Changed by Sneha on 16-03-2016, [Start]
int receiptCount = 0;
// Changed by Sneha on 16-03-2016, [End]
try try
{ {
DistCommon distCommonObj = new DistCommon(); DistCommon distCommonObj = new DistCommon();
...@@ -359,10 +363,18 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT ...@@ -359,10 +363,18 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
System.out.println("TOKEN_INFO is ::::"+tokenInfo); 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 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)) if("S".equalsIgnoreCase(rcpMode))
{ {
try try
{ {
modName = "W_SAGEPAY";
//segPayStatus = authoriseSagePay(ptcn, conn); //segPayStatus = authoriseSagePay(ptcn, conn);
//Changed by manish to check token_info is present or not on 09/03/16 [start] //Changed by manish to check token_info is present or not on 09/03/16 [start]
if(tokenInfo == null || tokenInfo.trim().length() == 0 ) if(tokenInfo == null || tokenInfo.trim().length() == 0 )
...@@ -380,21 +392,23 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT ...@@ -380,21 +392,23 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
else if(segPayStatus.indexOf("OK") > 0) else if(segPayStatus.indexOf("OK") > 0)
{ {
isReceiptGen = true ; isReceiptGen = true ;
modName = "W_SAGEPAY"; //Changed by wasim
//Changed by samadhan on 08/07/2015 D15CKAT015 Start //Changed by samadhan on 08/07/2015 D15CKAT015 Start
//invoiceDetailsMap.put("chq_amt",sagePayAmount); //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 samadhan on 08/07/2015 D15CKAT015 End
// changed by Sneha on 12-03-2016, [Start] // changed by Sneha on 12-03-2016, [Start]
//errString = insertSagePayDetailsinDespatch(despId,segPayStatus,cardType); //need to check (working or not) //errString = insertSagePayDetailsinDespatch(despId,segPayStatus,cardType); //need to check (working or not)
errString = insertSagePayDetailsinDespatch(despId, segPayStatus, cardType, conn, false); errString = insertSagePayDetailsinDespatch(despId, segPayStatus, cardType, conn, false);
// changed by Sneha on 12-03-2016, [End] // changed by Sneha on 12-03-2016, [End]
System.out.println("After insertSagePayDetailsinDespatch--->>["+errString+"]"); System.out.println("After insertSagePayDetailsinDespatch--->>["+errString+"]");
//Changed by wasim on 08-07-2015 to get TOKEN_INFO [START] //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 //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); tokenInfo = getColumnDescr(conn, "TOKEN_INFO", "DESPATCH", "DESP_ID", despId);
/*String vps = ""; /*String vps = "";
if(specReason != null && specReason.length() > 0) if(specReason != null && specReason.length() > 0)
{ {
...@@ -414,10 +428,15 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT ...@@ -414,10 +428,15 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
throw new Exception("Invalid Sage Payment.....["+segPayStatus+"]"); throw new Exception("Invalid Sage Payment.....["+segPayStatus+"]");
} }
} //Changed by manish to check token_info is present or not on 09/03/16 [end] } //Changed by manish to check token_info is present or not on 09/03/16 [end]
String vps = ""; 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 ; isReceiptGen = true ;
Document dom1 = genericUtility.parseString(tokenInfo); Document dom1 = genericUtility.parseString(tokenInfo);
...@@ -425,7 +444,15 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT ...@@ -425,7 +444,15 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
vps = vps.replace('{', ' '); vps = vps.replace('{', ' ');
vps = vps.replace('}', ' '); vps = vps.replace('}', ' ');
vps = vps == null ? "" : vps.trim(); 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+"]"); System.out.println("After insertSagePayDetailsinDespatch--->>["+errString+"]");
refNo = vps; refNo = vps;
} }
...@@ -448,7 +475,6 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT ...@@ -448,7 +475,6 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
//Changed by wasim on 08-07-2015 to check for PAYPAL [START] //Changed by wasim on 08-07-2015 to check for PAYPAL [START]
else if("P".equalsIgnoreCase(rcpMode)) else if("P".equalsIgnoreCase(rcpMode))
{ {
isReceiptGen = true ;
modName = "W_PAYPAL"; modName = "W_PAYPAL";
//Changed by Samadhan on 15/07/2015 D15CKAT015 for PayPal Start //Changed by Samadhan on 15/07/2015 D15CKAT015 for PayPal Start
System.out.println("RCP MODE is PayPal................."); System.out.println("RCP MODE is PayPal.................");
...@@ -470,18 +496,19 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT ...@@ -470,18 +496,19 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
else if(payPalStatus.indexOf("Success") > 0) else if(payPalStatus.indexOf("Success") > 0)
{ {
isReceiptGen = true ; isReceiptGen = true ;
System.out.println("refNo@@ :["+refNo+"]"); 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] // changed by Sneha on 12-03-2016, [Start]
//errString = insertPayPalDetailsinDespatch(despId, payPalStatus, cardType, ); //need to check (working or not) //errString = insertPayPalDetailsinDespatch(despId, payPalStatus, cardType, ); //need to check (working or not)
errString = insertPayPalDetailsinDespatch(despId, payPalStatus, cardType, conn, false); errString = insertPayPalDetailsinDespatch(despId, payPalStatus, cardType, conn, false);
// changed by Sneha on 12-03-2016, [End] // changed by Sneha on 12-03-2016, [End]
System.out.println("After insertPayPalDetailsinDespatch--->>["+errString+"]"); System.out.println("After insertPayPalDetailsinDespatch--->>["+errString+"]");
//TRANSACTIONID //TRANSACTIONID
// String tokenInfoPayPal = getColumnDescr(conn, "TOKEN_INFO", "DESPATCH", "DESP_ID", despId); // String tokenInfoPayPal = getColumnDescr(conn, "TOKEN_INFO", "DESPATCH", "DESP_ID", despId);
tokenInfo = getColumnDescr(conn, "TOKEN_INFO", "DESPATCH", "DESP_ID", despId); tokenInfo = getColumnDescr(conn, "TOKEN_INFO", "DESPATCH", "DESP_ID", despId);
/*String vps = ""; /*String vps = "";
if(tokenInfoPayPal != null && tokenInfoPayPal.length() > 0) if(tokenInfoPayPal != null && tokenInfoPayPal.length() > 0)
...@@ -497,14 +524,24 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT ...@@ -497,14 +524,24 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
throw new Exception("Invalid PayPal Payment.....["+payPalStatus+"]"); throw new Exception("Invalid PayPal Payment.....["+payPalStatus+"]");
} }
} //Changed by manish to check token_info is present or not on 09/03/16 [end] } //Changed by manish to check token_info is present or not on 09/03/16 [end]
String vps = ""; 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 ; isReceiptGen = true ;
Document dom1 = genericUtility.parseString(tokenInfo); Document dom1 = genericUtility.parseString(tokenInfo);
vps= genericUtility.getColumnValue("TRANSACTIONID", dom1); 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+"]"); System.out.println("After insertPayPalDetailsinDespatch--->>["+errString+"]");
refNo = vps; refNo = vps;
} }
...@@ -1108,7 +1145,7 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT ...@@ -1108,7 +1145,7 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
System.out.println(" ------------- Calling SagePay method in finally ------------ "); System.out.println(" ------------- Calling SagePay method in finally ------------ ");
errString = insertSagePayDetailsinDespatch(despId, segPayStatus, cardType, null, true); errString = insertSagePayDetailsinDespatch(despId, segPayStatus, cardType, null, true);
System.out.println(" errString from SagePay method ==========>>" + errString); System.out.println(" errString from SagePay method ==========>>" + errString);
} }
if("P".equalsIgnoreCase(rcpMode)) if("P".equalsIgnoreCase(rcpMode))
{ {
...@@ -1118,6 +1155,15 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT ...@@ -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 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) catch(Exception e)
{ {
...@@ -1381,7 +1427,7 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT ...@@ -1381,7 +1427,7 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
connDriver = null; connDriver = null;
} }
// Changed by Sneha on 12-03-2016, [End] // Changed by Sneha on 12-03-2016, [End]
// //
sagePayInfo.append("<ROOT>"); sagePayInfo.append("<ROOT>");
if(sagePayStr != null && sagePayStr.length() > 0) if(sagePayStr != null && sagePayStr.length() > 0)
...@@ -1466,34 +1512,34 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT ...@@ -1466,34 +1512,34 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
// //
if(lockSuccess) if(lockSuccess)
{*/ {*/
sql = "UPDATE DESPATCH SET TOKEN_INFO = ? WHERE DESP_ID = ?"; sql = "UPDATE DESPATCH SET TOKEN_INFO = ? WHERE DESP_ID = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, sagePayInfo.toString()); pstmt.setString(1, sagePayInfo.toString());
pstmt.setString(2, despId); pstmt.setString(2, despId);
rowCnt = pstmt.executeUpdate(); rowCnt = pstmt.executeUpdate();
System.out.println("DESPATCH rowCnt: "+rowCnt); System.out.println("DESPATCH rowCnt: "+rowCnt);
if(pstmt != null) if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
// Changed by Sneha on 12-03-2016, need to commit/rollback if isCommit is true [Start]
if(isCommit)
{
if(rowCnt > 0)
{ {
pstmt.close(); conn.commit();
pstmt = null; retString = "Success";
System.out.println("Sage Pay details updated successfully.............");
} }
// Changed by Sneha on 12-03-2016, need to commit/rollback if isCommit is true [Start] else
if(isCommit)
{ {
if(rowCnt > 0) conn.rollback();
{ retString = "Error";
conn.commit();
retString = "Success";
System.out.println("Sage Pay details updated successfully.............");
}
else
{
conn.rollback();
retString = "Error";
}
} }
// Changed by Sneha on 12-03-2016, need to commit/rollback if isCommit is true [End] }
// Changed by Sneha on 12-03-2016, need to commit/rollback if isCommit is true [End]
/*} /*}
else else
{ {
...@@ -2136,12 +2182,9 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT ...@@ -2136,12 +2182,9 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
} }
//Changed by Manish on [12/05/15] start //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
//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]
{
{
String reportObjName = ""; String reportObjName = "";
String errString = ""; String errString = "";
String loginCode = ""; String loginCode = "";
...@@ -2206,10 +2249,34 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT ...@@ -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);
// reportObjName = "d_invoice_rev"; }
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]
DistCommon discommon = new DistCommon();
//reportObjName = "d_invoice_rev";
ibase.webitm.reports.utility.JasperReportGenerator jrGenerator = new ibase.webitm.reports.utility.JasperReportGenerator(); ibase.webitm.reports.utility.JasperReportGenerator jrGenerator = new ibase.webitm.reports.utility.JasperReportGenerator();
String xsdString ="<Arguments>" + String xsdString ="<Arguments>" +
...@@ -2279,11 +2346,11 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT ...@@ -2279,11 +2346,11 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
"</Argument>" + "</Argument>" +
"</Arguments>"; "</Arguments>";
System.out.println("XSD parser **->["+xsdString+"]"); System.out.println("XSD parser **->["+xsdString+"]");
siteCode = loginSite; //siteCode = loginSite;
if(siteCode!=null) 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 = conn.prepareStatement(sql1);
pstmt1.setString(1, siteCode); pstmt1.setString(1, siteCode);
...@@ -2291,7 +2358,7 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT ...@@ -2291,7 +2358,7 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
if(rs1.next()) if(rs1.next())
{ {
reportObjName = rs1.getString(1); reportObjName = rs1.getString(1);
System.out.println("Report object Name : ["+reportObjName+"]");
} }
if(pstmt1 != null) if(pstmt1 != null)
{ {
...@@ -2306,7 +2373,7 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT ...@@ -2306,7 +2373,7 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
} }
} }
String objName = ""; String objName = "";
//String outputFilename = this.objName + loginSite + System.currentTimeMillis(); //String outputFilename = this.objName + loginSite + System.currentTimeMillis();
XSDParser xsdParser = new XSDParser(reportObjName); XSDParser xsdParser = new XSDParser(reportObjName);
...@@ -2553,7 +2620,7 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT ...@@ -2553,7 +2620,7 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
} }
return stdExchRate; 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; ResultSet rs = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
...@@ -2586,9 +2653,17 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT ...@@ -2586,9 +2653,17 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
cctrCodeAdv = rs.getString(7); cctrCodeAdv = rs.getString(7);
custBankRef = rs.getString(8); custBankRef = rs.getString(8);
} }
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
rs.close();
rs = null;
rcpMap.put("cust_name",custName); rcpMap.put("cust_name",custName);
rcpMap.put("acct_code__ar",acctCodeAr); rcpMap.put("acct_code__ar",acctCodeAr);
rcpMap.put("cctr_code__ar",cctrCodeAr); rcpMap.put("cctr_code__ar",cctrCodeAr);
...@@ -2621,6 +2696,16 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT ...@@ -2621,6 +2696,16 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
cctrCodeCfAr = rs.getString(7); cctrCodeCfAr = rs.getString(7);
currCode = rs.getString(8); 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("ACCT_CODE__BAL@@ ::: "+acctCodeBal);
System.out.println("curr_code ::: "+currCode); System.out.println("curr_code ::: "+currCode);
rcpMap.put("acct_code__bal",acctCodeBal); rcpMap.put("acct_code__bal",acctCodeBal);
...@@ -2636,8 +2721,6 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT ...@@ -2636,8 +2721,6 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
} }
rcpMap.put("acct_code__cf",acctCodeCf); rcpMap.put("acct_code__cf",acctCodeCf);
rcpMap.put("cctr_code__cf",cctrCodeCf); rcpMap.put("cctr_code__cf",cctrCodeCf);
rs.close();
pstmt.close();
rcpMap.put("curr_code",currCode); rcpMap.put("curr_code",currCode);
String exchangeRate = getColumnDescr(conn, "std_exrt", "currency", "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 ...@@ -2719,9 +2802,23 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
} }
finally
{
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
return rcpMap; return rcpMap;
}// END OF HASH MAP CustDetail }// END OF HASH MAP CustDetail
public String getColumnDescr(Connection conn, String columnName ,String tableName, String columnName2, String value) throws ITMException,Exception public String getColumnDescr(Connection conn, String columnName ,String tableName, String columnName2, String value) throws ITMException,Exception
{ {
...@@ -2840,7 +2937,7 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT ...@@ -2840,7 +2937,7 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
connDriver = null; connDriver = null;
} }
// Changed by Sneha on 12-03-2016, [End] // Changed by Sneha on 12-03-2016, [End]
payPalInfo.append("<ROOT>"); payPalInfo.append("<ROOT>");
if(payPalStr != null && payPalStr.length() > 0) if(payPalStr != null && payPalStr.length() > 0)
{ {
...@@ -2861,8 +2958,8 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT ...@@ -2861,8 +2958,8 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
if(payPalInfo != null && payPalInfo.length() > 0) if(payPalInfo != null && payPalInfo.length() > 0)
{ {
// //
/* boolean lockSuccess = false; /* boolean lockSuccess = false;
sql = " SELECT TOKEN_INFO FROM DESPATCH WHERE DESP_ID = ? FOR UPDATE NOWAIT"; sql = " SELECT TOKEN_INFO FROM DESPATCH WHERE DESP_ID = ? FOR UPDATE NOWAIT";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, despId); pstmt.setString(1, despId);
...@@ -2886,35 +2983,35 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT ...@@ -2886,35 +2983,35 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
// //
if(lockSuccess) if(lockSuccess)
{*/ {*/
sql = "UPDATE DESPATCH SET TOKEN_INFO = ? WHERE DESP_ID = ?"; sql = "UPDATE DESPATCH SET TOKEN_INFO = ? WHERE DESP_ID = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, payPalInfo.toString()); pstmt.setString(1, payPalInfo.toString());
pstmt.setString(2, despId); pstmt.setString(2, despId);
rowCnt = pstmt.executeUpdate(); rowCnt = pstmt.executeUpdate();
System.out.println("DESPATCH rowCnt: "+rowCnt); System.out.println("DESPATCH rowCnt: "+rowCnt);
if(pstmt != null) if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
// Changed by Sneha on 12-03-2016, need to commit/rollback if isCommit is true [Start]
if(isCommit)
{
if(rowCnt > 0)
{ {
pstmt.close(); conn.commit();
pstmt = null; retString = "Success";
System.out.println("paypal details updated successfully.............");
} }
else
// Changed by Sneha on 12-03-2016, need to commit/rollback if isCommit is true [Start]
if(isCommit)
{ {
if(rowCnt > 0) conn.rollback();
{ retString = "Error";
conn.commit(); System.out.println("paypal details rollback .............");
retString = "Success";
System.out.println("paypal details updated successfully.............");
}
else
{
conn.rollback();
retString = "Error";
System.out.println("paypal details rollback .............");
}
} }
/* // Changed by Sneha on 12-03-2016, need to commit/rollback if isCommit is true [End] }
/* // Changed by Sneha on 12-03-2016, need to commit/rollback if isCommit is true [End]
} }
else else
{ {
...@@ -2952,6 +3049,60 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT ...@@ -2952,6 +3049,60 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
return retString; return retString;
} }
//Changed by samadhan on 15/07/2015 D15CKAT015 for paypal End //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 ...@@ -353,6 +353,19 @@ public class PickIssIC extends ValidatorEJB implements PickIssICLocal, PickIssIC
errFields.add( childNodeName.toLowerCase() ); 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. //Changed by sumit on 28/09/12 validating in case of wave canceled end.
// cpatil end // cpatil end
......
...@@ -487,6 +487,89 @@ public class StockTransferIC extends ValidatorEJB implements StockTransferICRemo ...@@ -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 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 }// for loop end
}//case 2 end }//case 2 end
break; break;
......
...@@ -16313,7 +16313,27 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -16313,7 +16313,27 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
pstmtInsertData.addBatch(); pstmtInsertData.addBatch();
pstmtInsertData.executeBatch(); 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) //"Y".equalsIgnoreCase(isADSIConnReq)
if("P".equalsIgnoreCase(waveMode)) if("P".equalsIgnoreCase(waveMode))
{ {
...@@ -16341,12 +16361,20 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -16341,12 +16361,20 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
if("B".equalsIgnoreCase(frtTerm)) if("B".equalsIgnoreCase(frtTerm))
{ {
sSQL = "UPDATE DESPATCH SET FREIGHT_AMT_ADD = ? WHERE PTCN = ?"; //Changed by Manish on 15/03/16 for max cursor issue for DDUK.[start]
pstmtDesp = conn.prepareStatement(sSQL); /*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.setDouble(1, totalFrtAmt);
pstmtDesp.setString(2, ptcn); pstmtDesp.setString(2, ptcn);
int pUpd = pstmtDesp.executeUpdate(); int pUpd = pstmtDesp.executeUpdate();
if(pstmtDesp != null)
{
pstmtDesp.close();
pstmtDesp = null;
}
System.out.println("Update in desp update freight Amt upd ["+pUpd+"] For"); System.out.println("Update in desp update freight Amt upd ["+pUpd+"] For");
} }
...@@ -16422,10 +16450,13 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -16422,10 +16450,13 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
{ {
createFolder.mkdirs(); 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 = ?"; + " 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(1, trackNo);
pstmtCart.setString(2, path ); pstmtCart.setString(2, path );
pstmtCart.setDouble(3, msnNo); pstmtCart.setDouble(3, msnNo);
...@@ -16451,7 +16482,14 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -16451,7 +16482,14 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
System.out.println("Write File Complete----"); 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 ) if( pstmt != null )
{ {
pstmt.close(); pstmt.close();
...@@ -16492,8 +16530,10 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -16492,8 +16530,10 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
pstmtInsertData.addBatch(); */ 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," + sqlInsertData1 = "INSERT INTO WAVE_STATUS_ORG_DET (TRAN_ID, LINE_NO,PTCN,CARTON_NO," +
" PICK_ORDER, LINE_NO__PICK ,REF_SER, REF_ID, " + " PICK_ORDER, LINE_NO__PICK ,REF_SER, REF_ID, " +
...@@ -16502,8 +16542,9 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -16502,8 +16542,9 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
" VALUES (?,?, ?,?, ?,?, ?,?, ?,?, ?,? , ?,?, ?)"; " VALUES (?,?, ?,?, ?,?, ?,?, ?,?, ?,? , ?,?, ?)";
pstmtInsertData1 = conn.prepareStatement(sqlInsertData1); 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); pstmtDt.setString(1, ptcn);
rsD = pstmtDt.executeQuery(); rsD = pstmtDt.executeQuery();
ArrayList test = new ArrayList(); ArrayList test = new ArrayList();
...@@ -16581,7 +16622,20 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -16581,7 +16622,20 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
{ {
pstmtInsertData1.close(); pstmtInsertData1.close();
pstmtInsertData1 = null; 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) if( pstmtInsertData != null)
...@@ -16612,6 +16666,22 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -16612,6 +16666,22 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
pstmtInsertData1.close(); pstmtInsertData1.close();
pstmtInsertData1 = null; 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) catch(Exception e)
{ {
......
...@@ -209,6 +209,19 @@ public class CommonWmsUtil { ...@@ -209,6 +209,19 @@ public class CommonWmsUtil {
} }
else 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..."); System.out.println("Getting stk_opt from item...");
sql = "SELECT STK_OPT FROM ITEM WHERE ITEM_CODE = ? "; sql = "SELECT STK_OPT FROM ITEM WHERE ITEM_CODE = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -219,8 +232,22 @@ public class CommonWmsUtil { ...@@ -219,8 +232,22 @@ public class CommonWmsUtil {
stkOpt = rs.getString(1) == null ? "" : rs.getString(1).trim(); stkOpt = rs.getString(1) == null ? "" : rs.getString(1).trim();
} }
} }
rs.close();rs = null; /*rs.close();rs = null;
pstmt.close();pstmt = 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 = ? "; /*sql = "SELECT STK_OPT FROM ITEM WHERE ITEM_CODE = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode); pstmt.setString(1, itemCode);
...@@ -241,6 +268,23 @@ public class CommonWmsUtil { ...@@ -241,6 +268,23 @@ public class CommonWmsUtil {
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); 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; return stkOpt;
} }
...@@ -1464,7 +1508,7 @@ public class CommonWmsUtil { ...@@ -1464,7 +1508,7 @@ public class CommonWmsUtil {
} }
// Changed by Sneha on 03/07/2015 for finparm, Request ID: D15DKAT001 // 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 sql = "";
String varValue = ""; String varValue = "";
...@@ -1483,19 +1527,54 @@ public class CommonWmsUtil { ...@@ -1483,19 +1527,54 @@ public class CommonWmsUtil {
varValue = rs.getString("var_value"); varValue = rs.getString("var_value");
addValue = rs.getString("addl_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)
catch (Exception e) { {
// TODO: handle exception rs.close();
rs = null;
}
if(pstmt!=null)
{
pstmt.close();
pstmt = null;
}
if(addValue == null || addValue.trim().length() == 0)
{
return varValue;
}
else
{
return varValue.trim()+";"+addValue.trim();
}
//Changed by wasim on 15-03-2016 to close result set and addValue condition in try block [END]
} }
if(addValue == null || addValue.trim().length() == 0) catch (Exception e)
{ {
return varValue; throw new ITMException(e);
} }
else //Changed by wasim on 15-03-2016 to add finally block [START]
finally
{ {
return varValue.trim()+";"+addValue.trim(); 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 //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