Commit feb5dbb8 authored by msingh's avatar msingh

Changed by Manish on 30/03/16 for maximum cursor issue for DDUK .


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@101062 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 3bb9ee9f
......@@ -28,7 +28,7 @@ public class SaleOrderPostSave extends ValidatorEJB implements SaleOrderPostSave
System.out.println("xml String--->>["+xmlString+"]");
Document dom = null;
String errString="";
try
{
if (xmlString != null && xmlString.trim().length() > 0)
......@@ -36,7 +36,7 @@ public class SaleOrderPostSave extends ValidatorEJB implements SaleOrderPostSave
dom = parseString(xmlString);
errString = postSave(dom,tranId,xtraParams,conn);
}
}
catch(Exception e)
{
......@@ -52,8 +52,8 @@ public class SaleOrderPostSave extends ValidatorEJB implements SaleOrderPostSave
PreparedStatement pstmt=null,pstmt1=null;
String sql="",sql1="",errorString="";
double quantityStduom = 0,rateStduom=0,discount=0,taxAmt=0,netAmt=0,taxAmtH=0,totAmtH=0,
ordAmtH=0,ordValueH=0,ordValue=0,totOrdValueH=0,
billBackAmt=0,offInvAmt=0,netTotAmtDet=0,netTotAmtHdr=0,ordBillBackAmt=0,ordOffInvAmt=0,lineBillBackAmt=0,lineOffInvAmt=0;
ordAmtH=0,ordValueH=0,ordValue=0,totOrdValueH=0,
billBackAmt=0,offInvAmt=0,netTotAmtDet=0,netTotAmtHdr=0,ordBillBackAmt=0,ordOffInvAmt=0,lineBillBackAmt=0,lineOffInvAmt=0;
int count=0,lineNo=0;
try
{
......@@ -62,8 +62,8 @@ public class SaleOrderPostSave extends ValidatorEJB implements SaleOrderPostSave
tranId = GenericUtility.getInstance().getColumnValue("sale_order",dom);
System.out.println("sale_order--->>["+tranId+"]");
sql="select quantity__stduom,rate__stduom,discount,tax_amt,line_no,ord_value,"
+ "billback_amt,offinv_amt " //VALLABH KADAM [20/JUL/15] find billback_amt,offinv_amt
+ "from sorddet where sale_order = ?";
+ "billback_amt,offinv_amt " //VALLABH KADAM [20/JUL/15] find billback_amt,offinv_amt
+ "from sorddet where sale_order = ?";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1, tranId);
rs=pstmt.executeQuery();
......@@ -77,14 +77,14 @@ public class SaleOrderPostSave extends ValidatorEJB implements SaleOrderPostSave
ordValue=rs.getDouble(6);
billBackAmt=rs.getDouble(7); //VALLABH KADAM [20/JUL/15] find billback_amt
offInvAmt=rs.getDouble(8); //VALLABH KADAM [20/JUL/15] find offinv_amt
System.out.println("quantityStduom-->["+quantityStduom+"]");
System.out.println("rateStduom-->["+rateStduom+"]taxAmt-->["+taxAmt+"]");
System.out.println("discount-->["+discount+"] lineNo-->["+lineNo+"]");
netAmt=(quantityStduom*rateStduom)-((quantityStduom*rateStduom*discount)/100)+taxAmt;
System.out.println("NetAmt--->>["+netAmt+"]");
/**
* VALLABH KADAM [20/JUL/15]
* Calculate net_tot_amt
......@@ -92,7 +92,7 @@ public class SaleOrderPostSave extends ValidatorEJB implements SaleOrderPostSave
* */
netTotAmtDet=netAmt-billBackAmt-offInvAmt;
System.out.println("Nte Total Amt Det:- ["+netTotAmtDet+"]");
sql1="update sorddet set net_amt = ?,net_tot_amt=? where sale_order = ? and line_no = ?";
pstmt1=conn.prepareStatement(sql1);
pstmt1.setDouble(1, netAmt);
......@@ -101,30 +101,30 @@ public class SaleOrderPostSave extends ValidatorEJB implements SaleOrderPostSave
pstmt1.setInt(4, lineNo);
pstmt1.executeUpdate();
if (pstmt1 != null){
pstmt1.close();
pstmt1=null;
}
pstmt1.close();
pstmt1=null;
}
taxAmtH=taxAmtH + taxAmt;
totAmtH=totAmtH + netAmt;
totOrdValueH=totOrdValueH + ordValue;
} //end while
if (pstmt != null)
{
pstmt.close();
pstmt=null;
}
pstmt.close();
pstmt=null;
}
if (rs !=null)
{
rs.close();
rs=null;
rs.close();
rs=null;
}
ordAmtH=totAmtH - taxAmtH;
System.out.println("pre count---->>["+count+"]");
System.out.println("taxAmtH-->["+taxAmtH+"] totAmtH-->["+totAmtH+"]");
System.out.println("ordAmtH-->["+ordAmtH+"] totOrdValueH-->["+totOrdValueH+"]");
/**
* VALLABH KADAM [20/JUL/15]
* find ord_billback_amt, ord_offinv_amt, line_billback_amt, line_offinv_amt
......@@ -145,11 +145,11 @@ public class SaleOrderPostSave extends ValidatorEJB implements SaleOrderPostSave
pstmt1=null;
rs1.close();
rs1=null;
netTotAmtHdr=totAmtH-ordBillBackAmt-ordOffInvAmt-lineBillBackAmt-lineOffInvAmt;
System.out.println("Net Tot Amt Hdr :- ["+netTotAmtHdr+"]");
sql="update sorder set tax_amt = ? ,tot_amt= ? ,ord_amt = ?,tot_ord_value= ?,net_tot_amt=? where sale_order = ?";
pstmt=conn.prepareStatement(sql);
pstmt.setDouble(1, taxAmtH);
......@@ -166,7 +166,13 @@ public class SaleOrderPostSave extends ValidatorEJB implements SaleOrderPostSave
errorString=itmDBAccessEJB.getErrorString("","VTNORUPDT","","",conn);
System.out.println("errorString :"+errorString);
}
// Changed by Manish for Maximum open cursor on 29/03/16 [start]
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
// Changed by Manish for Maximum open cursor on 29/03/16 [end]
}
catch(Exception e)
{
......@@ -174,7 +180,7 @@ public class SaleOrderPostSave extends ValidatorEJB implements SaleOrderPostSave
e.printStackTrace();
try
{
conn.rollback();
conn.rollback();
}
catch(Exception e1)
{
......@@ -182,6 +188,38 @@ public class SaleOrderPostSave extends ValidatorEJB implements SaleOrderPostSave
e1.printStackTrace();
}
}
// Changed by Manish for Maximum open cursor on 29/03/16 [start]
finally
{
try
{
if (pstmt != null)
{
pstmt.close();
pstmt=null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
if (pstmt1 != null)
{
pstmt1.close();
pstmt1=null;
}
if (rs1 !=null)
{
rs1.close();
rs1=null;
}
}
catch(Exception e)
{
e.printStackTrace();
}
}
// Changed by Manish for Maximum open cursor on 29/03/16 [end]
return errorString;
}
}
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