Commit 1e9899f9 authored by prane's avatar prane

cursor closed bug fixed and add sop in case demand/supply mismatch

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@217567 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 5d82cf4c
...@@ -203,7 +203,7 @@ public class InvDemSuppSummVerifyPrc extends ProcessEJB ...@@ -203,7 +203,7 @@ public class InvDemSuppSummVerifyPrc extends ProcessEJB
adpQuery = adpQuery.replaceAll("@fromdate@", dbDateFrom); adpQuery = adpQuery.replaceAll("@fromdate@", dbDateFrom);
adpQuery = adpQuery.replaceAll("@todate@", dbDateTo); adpQuery = adpQuery.replaceAll("@todate@", dbDateTo);
adpQuery = adpQuery.replaceAll("@ordtypes@", standingOrdTypes); adpQuery = adpQuery.replaceAll("@ordtypes@", standingOrdTypes);
System.out.println("Replacing Values.in SQL.....adpQuery >>> "+adpQuery); //System.out.println("Replacing Values.in SQL.....adpQuery >>> "+adpQuery+"\n\n\n\n");
pstmt = conn.prepareStatement(adpQuery); pstmt = conn.prepareStatement(adpQuery);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while (rs.next()) while (rs.next())
...@@ -217,7 +217,7 @@ public class InvDemSuppSummVerifyPrc extends ProcessEJB ...@@ -217,7 +217,7 @@ public class InvDemSuppSummVerifyPrc extends ProcessEJB
currentSupply = rs.getDouble("supply"); currentSupply = rs.getDouble("supply");
tranId = checkNull(rs.getString("tran_id")); tranId = checkNull(rs.getString("tran_id"));
//Modified by Pavan Rane 02MAR2020 START[added default spaces in ref line no] //Modified by Pavan Rane 02MAR2020 START[added default spaces in ref line no]
lineNo = checkNull(rs.getString("line_no")).trim(); lineNo = checkNull(rs.getString("line_no"));
lineNo = " " + lineNo; lineNo = " " + lineNo;
lineNo = lineNo.substring(lineNo.length() - 3, lineNo.length()); lineNo = lineNo.substring(lineNo.length() - 3, lineNo.length());
//Modified by Pavan Rane 02MAR2020 END[added default spaces in ref line no] //Modified by Pavan Rane 02MAR2020 END[added default spaces in ref line no]
...@@ -238,13 +238,16 @@ public class InvDemSuppSummVerifyPrc extends ProcessEJB ...@@ -238,13 +238,16 @@ public class InvDemSuppSummVerifyPrc extends ProcessEJB
supply= rs1.getDouble(1); supply= rs1.getDouble(1);
demand = rs1.getDouble(2); demand = rs1.getDouble(2);
} }
rs = null; rs1.close();
rs1 = null;
pstmt1.clearParameters(); pstmt1.clearParameters();
if(currentDemand !=demand ) if(currentDemand !=demand )
{ {
rs1.close(); System.out.println("@@@@ DEMAND MISMATCH @@@ CURRENTDEMAND["+currentDemand+"] DEMAND["+demand+"]");
rs1 = null; System.out.println("###siteCode["+siteCode+"]\n###itemCode["+itemCode+"]\n###tranSer["+tranSer+"]\n###tranId["+tranId+"]\n###lineNo["+lineNo+"]\n###dueDate["+dueDate+"]");
//rs1.close();
//rs1 = null;
pstmt1.close(); pstmt1.close();
pstmt1 = null; pstmt1 = null;
errString = itmDBAccessEJB.getErrorString("", "VTDEMMISM", "", "", conn); errString = itmDBAccessEJB.getErrorString("", "VTDEMMISM", "", "", conn);
...@@ -252,8 +255,10 @@ public class InvDemSuppSummVerifyPrc extends ProcessEJB ...@@ -252,8 +255,10 @@ public class InvDemSuppSummVerifyPrc extends ProcessEJB
} }
if(currentSupply != supply) if(currentSupply != supply)
{ {
rs1.close(); System.out.println("@@@@ SUPPLY MISMATCH @@@CURRENTSUPPLY["+currentSupply+"]SUPPLY"+supply+"]");
rs1 = null; System.out.println("###siteCode["+siteCode+"]\n###itemCode["+itemCode+"]\n###tranSer["+tranSer+"]\n###tranId["+tranId+"]\n###lineNo["+lineNo+"]\n###dueDate["+dueDate+"]");
//rs1.close();
//rs1 = null;
pstmt1.close(); pstmt1.close();
pstmt1 = null; pstmt1 = null;
errString = itmDBAccessEJB.getErrorString("", "VTSUPPMISM", "", "", conn); errString = itmDBAccessEJB.getErrorString("", "VTSUPPMISM", "", "", conn);
...@@ -264,8 +269,8 @@ public class InvDemSuppSummVerifyPrc extends ProcessEJB ...@@ -264,8 +269,8 @@ public class InvDemSuppSummVerifyPrc extends ProcessEJB
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
rs1.close(); //rs1.close();
rs1 = null; //rs1 = null;
pstmt1.close(); pstmt1.close();
pstmt1 = null; pstmt1 = null;
...@@ -279,12 +284,30 @@ public class InvDemSuppSummVerifyPrc extends ProcessEJB ...@@ -279,12 +284,30 @@ public class InvDemSuppSummVerifyPrc extends ProcessEJB
{ {
try try
{ {
conn.close(); if(conn!= null) {
conn = null; conn.close();
rs.close(); conn = null;
rs = null; }
pstmt.close(); if(rs!= null) {
pstmt = null; rs.close();
rs = null;
}
if(pstmt!= null) {
pstmt.close();
pstmt = null;
}
if(rs1!= null) {
rs1.close();
rs1 = null;
}
if(pstmt1!= null) {
pstmt1.close();
pstmt1 = null;
}
if(errString == null || errString.trim().length() == 0)
{
errString = itmDBAccessEJB.getErrorString( "", "PROCSUCC", getUserInfo().getLoginCode(), "", conn );
}
} }
catch(Exception e) catch(Exception e)
{ {
......
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