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
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);
pstmtSord.setString(2, lineNoSord);
......@@ -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();
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
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();
pstmtUpd.close();
pstmtUpd = 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 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);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
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)
......
......@@ -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;
......
......@@ -16313,7 +16313,27 @@ 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");
}
......@@ -16422,10 +16450,13 @@ 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,7 +16482,14 @@ 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 )
{
pstmt.close();
......@@ -16492,8 +16530,10 @@ 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,8 +16542,9 @@ 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();
ArrayList test = new ArrayList();
......@@ -16581,7 +16622,20 @@ 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,19 +1527,54 @@ public class CommonWmsUtil {
varValue = rs.getString("var_value");
addValue = rs.getString("addl_value");
}
}
catch (Exception e) {
// TODO: handle exception
//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;
}
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
......
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