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
adpQuery = adpQuery.replaceAll("@fromdate@", dbDateFrom);
adpQuery = adpQuery.replaceAll("@todate@", dbDateTo);
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);
rs = pstmt.executeQuery();
while (rs.next())
......@@ -217,7 +217,7 @@ public class InvDemSuppSummVerifyPrc extends ProcessEJB
currentSupply = rs.getDouble("supply");
tranId = checkNull(rs.getString("tran_id"));
//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.substring(lineNo.length() - 3, lineNo.length());
//Modified by Pavan Rane 02MAR2020 END[added default spaces in ref line no]
......@@ -238,13 +238,16 @@ public class InvDemSuppSummVerifyPrc extends ProcessEJB
supply= rs1.getDouble(1);
demand = rs1.getDouble(2);
}
rs = null;
rs1.close();
rs1 = null;
pstmt1.clearParameters();
if(currentDemand !=demand )
{
rs1.close();
rs1 = null;
System.out.println("@@@@ DEMAND MISMATCH @@@ CURRENTDEMAND["+currentDemand+"] DEMAND["+demand+"]");
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 = null;
errString = itmDBAccessEJB.getErrorString("", "VTDEMMISM", "", "", conn);
......@@ -252,8 +255,10 @@ public class InvDemSuppSummVerifyPrc extends ProcessEJB
}
if(currentSupply != supply)
{
rs1.close();
rs1 = null;
System.out.println("@@@@ SUPPLY MISMATCH @@@CURRENTSUPPLY["+currentSupply+"]SUPPLY"+supply+"]");
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 = null;
errString = itmDBAccessEJB.getErrorString("", "VTSUPPMISM", "", "", conn);
......@@ -264,8 +269,8 @@ public class InvDemSuppSummVerifyPrc extends ProcessEJB
rs = null;
pstmt.close();
pstmt = null;
rs1.close();
rs1 = null;
//rs1.close();
//rs1 = null;
pstmt1.close();
pstmt1 = null;
......@@ -279,13 +284,31 @@ public class InvDemSuppSummVerifyPrc extends ProcessEJB
{
try
{
if(conn!= null) {
conn.close();
conn = null;
}
if(rs!= 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)
{
e.printStackTrace();
......
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