Commit a6600203 authored by msingh's avatar msingh

Changed by Manish on 01/04/16 for maximum cursor issue for DDUK .


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@101073 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 3db5e586
......@@ -258,6 +258,18 @@ String runMode="";
compName = rs.getString("COMP_NAME");
}
System.out.println("serviceCode = "+serviceCode+" compName "+compName);
// Changed by Manish on 01/04/16 for max cursor issue [start]
if (pstmt != null)
{
pstmt.close();
pstmt=null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
sql = "SELECT SERVICE_URI FROM SYSTEM_EVENT_SERVICES WHERE SERVICE_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,serviceCode);
......@@ -266,6 +278,18 @@ String runMode="";
{
serviceURI = rs.getString("SERVICE_URI");
}
// Changed by Manish on 01/04/16 for max cursor issue [start]
if (pstmt != null)
{
pstmt.close();
pstmt=null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
System.out.println("serviceURI = "+serviceURI+" compName = "+compName);
Service service = new Service();
Call call = (Call)service.createCall();
......@@ -309,6 +333,11 @@ String runMode="";
pstmt.close();
pstmt = null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
/*if( conn != null ){
conn.close();
conn = null;
......
......@@ -30,7 +30,7 @@ public class GeneratePReturnPrc extends ProcessEJB implements GeneratePReturnPrc
Document detailDom = null;
Document headerDom = null;
GenericUtility genericUtility = GenericUtility.getInstance();
try
{
if(xmlString != null && xmlString.trim().length()!=0)
......@@ -89,7 +89,7 @@ public class GeneratePReturnPrc extends ProcessEJB implements GeneratePReturnPrc
//System.out.println("Now the date is :=> ["+newsysDate+"]");
tranId = genericUtility.getColumnValue("tran_id",headerDom);
System.out.println("tranId["+tranId);
if( tranId != null && tranId.trim().length() > 0 )
......@@ -138,7 +138,7 @@ public class GeneratePReturnPrc extends ProcessEJB implements GeneratePReturnPrc
retString =itmDBAccessEJB.getErrorString("","VTTRANIDNL","","",conn);
return retString;
}
sql = " select invoice_id ,tran_date from sreturn where tran_id = ? " ;
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranId);
......@@ -169,7 +169,7 @@ public class GeneratePReturnPrc extends ProcessEJB implements GeneratePReturnPrc
pstmt.close();
rs = null;
pstmt = null;
sql = " select tran_id__porcp,purc_order from sorder where sale_order = ? " ;
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,saleOrder);
......@@ -209,14 +209,14 @@ public class GeneratePReturnPrc extends ProcessEJB implements GeneratePReturnPrc
return retString;
}
}
}
else
{
retString =itmDBAccessEJB.getErrorString("","VTINVIDBK","","",conn);
return retString;
}
xmlBuff.append("<?xml version='1.0' encoding='ISO-8859-1'?>\n");
xmlBuff.append("<DocumentRoot>");
xmlBuff.append("<description>").append("Datawindow Root").append("</description>");
......@@ -267,9 +267,9 @@ public class GeneratePReturnPrc extends ProcessEJB implements GeneratePReturnPrc
xmlBuff.append("<tran_id/>");
xmlBuff.append("<line_no><![CDATA["+lineNo+"]]></line_no>");
xmlBuff.append("<purc_order><![CDATA["+purchOrder+"]]></purc_order>");
sql = " select porcpdet.line_no__ord from porcp,porcpdet where porcp.tran_id = porcpdet.tran_id "
+" and porcp.tran_id = ? and porcp.tran_ser = 'P-RCP' and porcpdet.purc_order = ? and porcpdet.item_code = ? " ;
+" and porcp.tran_id = ? and porcp.tran_ser = 'P-RCP' and porcpdet.purc_order = ? and porcpdet.item_code = ? " ;
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1,porderRef);
pstmt1.setString(2,purchOrder);
......@@ -283,7 +283,7 @@ public class GeneratePReturnPrc extends ProcessEJB implements GeneratePReturnPrc
pstmt1.close();
rs1 = null;
pstmt1 = null;
xmlBuff.append("<line_no__ord><![CDATA["+lineNoOrd+"]]></line_no__ord>");
xmlBuff.append("<item_code><![CDATA["+itemCode+"]]></item_code>");
xmlBuff.append("<quantity><![CDATA["+quantity+"]]></quantity>");
......@@ -429,6 +429,18 @@ public class GeneratePReturnPrc extends ProcessEJB implements GeneratePReturnPrc
compName = rs.getString("COMP_NAME");
}
System.out.println("serviceCode = "+serviceCode+" compName "+compName);
// Changed by Manish on 01/04/16 for max cursor issue [start]
if (pstmt != null)
{
pstmt.close();
pstmt=null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
sql = "SELECT SERVICE_URI FROM SYSTEM_EVENT_SERVICES WHERE SERVICE_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,serviceCode);
......@@ -438,6 +450,18 @@ public class GeneratePReturnPrc extends ProcessEJB implements GeneratePReturnPrc
serviceURI = rs.getString("SERVICE_URI");
}
System.out.println("serviceURI = "+serviceURI+" compName = "+compName);
// Changed by Manish on 01/04/16 for max cursor issue [start]
if (pstmt != null)
{
pstmt.close();
pstmt=null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
Service service = new Service();
Call call = (Call)service.createCall();
call.setTargetEndpointAddress(new java.net.URL(serviceURI));
......@@ -479,6 +503,11 @@ public class GeneratePReturnPrc extends ProcessEJB implements GeneratePReturnPrc
pstmt.close();
pstmt = null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
/*if( conn != null ){
conn.close();
conn = null;
......
......@@ -2261,6 +2261,18 @@ public class GenerateSaleOrderPrc extends ProcessEJB implements GenerateSaleOrde
compName = rs.getString("COMP_NAME");
}
System.out.println("serviceCode = "+serviceCode+" compName "+compName);
// Changed by Manish on 01/04/16 for max cursor issue [start]
if (pstmt != null)
{
pstmt.close();
pstmt=null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
sql = "SELECT SERVICE_URI FROM SYSTEM_EVENT_SERVICES WHERE SERVICE_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,serviceCode);
......@@ -2270,6 +2282,18 @@ public class GenerateSaleOrderPrc extends ProcessEJB implements GenerateSaleOrde
serviceURI = rs.getString("SERVICE_URI");
}
System.out.println("serviceURI = "+serviceURI+" compName = "+compName);
// Changed by Manish on 01/04/16 for max cursor issue [start]
if (pstmt != null)
{
pstmt.close();
pstmt=null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
Service service = new Service();
Call call = (Call)service.createCall();
call.setTargetEndpointAddress(new java.net.URL(serviceURI));
......@@ -2309,6 +2333,11 @@ public class GenerateSaleOrderPrc extends ProcessEJB implements GenerateSaleOrde
pstmt.close();
pstmt = null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
/*if( conn != null ){
conn.close();
conn = null;
......
......@@ -5,18 +5,15 @@ import ibase.system.config.ConnDriver;
import ibase.webitm.ejb.ActionHandlerEJB;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.MasterStatefulLocal;
import ibase.webitm.ejb.fin.FinCommon;
import ibase.webitm.ejb.fin.MiscDrCrRcpConf;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
import java.math.BigDecimal;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.HashMap;
......@@ -143,10 +140,10 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements
rs = pstmt.executeQuery();
if (rs.next()) {
invoiceId = rs.getString(1);
custCode = rs.getString(2) == null ? "" : rs.getString(2);
siteCode = rs.getString(3) == null ? "" : rs.getString(3);
currCode = rs.getString(4) == null ? "" : rs.getString(4);
ExchRate = rs.getDouble(5);
custCode = rs.getString(2) == null ? "" : rs.getString(2);
siteCode = rs.getString(3) == null ? "" : rs.getString(3);
currCode = rs.getString(4) == null ? "" : rs.getString(4);
ExchRate = rs.getDouble(5);
}
if (rs != null) {
rs.close();
......@@ -196,13 +193,6 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements
mapDebitNoteAmt.put(lineNo, detail3Amt);
// detail2xmlString=getDetailsXmlString(conn, xtraParams,
// invoiceId, aprvRate, debitNoteAmtDetail);
// make rounding off logic detail3Amt
System.out.println("detail3Amt Before rounding["+detail3Amt+"]");
detail3Amt = getRequiredDecimal(detail3Amt, custCode,conn);
System.out.println("detail3Amt After rounding["+detail3Amt+"]");
detail2xmlString = detail2xmlString
+ getDetailsXmlString(conn, invoiceId, lineNotrace,
lineNo, aprvRate, PODqty, lotNo, lotSl,
......@@ -211,14 +201,13 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements
} // end while
System.out.println("detail2xmlString---->>[["
+ detail2xmlString + "]]");
System.out.println("Final detail3AmtT in debit note---Before rounding------->> : ["+ detail3AmtT+"]");
System.out
.println("Final detail3AmtT in debit note---------->> : "
+ detail3AmtT);
// Debit note amount cannot less than hundred.
// [31-JUL-2015] Sanket Girme
if (detail3AmtT >= 100) {
// make roundings off logic detail3AmtT
detail3AmtT = getRequiredDecimal(detail3AmtT, custCode,conn);
System.out.println("Final detail3AmtT in debit note---After rounding------->> : ["+ detail3AmtT+"]");
errString = genDebitNote("POD", invoiceId, custCode,
siteCode, xtraParams, currCode, ExchRate,
detail2xmlString, detail3AmtT, conn);
......@@ -237,20 +226,24 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements
if ((errString != null)
&& errString.indexOf("CONFSUCCES") > -1) {
updCnt = updatePodHeader(conn, tranId, loginCode);
System.out.println("return count from updateDebitNoteAmounts--->["
System.out
.println("return count from updateDebitNoteAmounts--->["
+ updCnt + "]");
if (updCnt > 0) {
conn.commit();
errString = itmdbAccess.getErrorString("",
"VTCONSUCF", "", "", conn);
System.out.println("-----@@@Debit Note Generated successfully for amount : "
System.out
.println("------@@@Debit Note Generated successfully for amount : "
+ actualDBamount);
System.out.println("Confirmation of Debit note done successfully----------");
System.out
.println("Confirmation of Debit note done successfully----------");
} else {
errString = itmdbAccess.getErrorString("",
"VTNCONFT", "", "", conn);
conn.rollback();
System.out.println("transaction not confirmed----------");
System.out
.println("transaction not confirmed----------");
}
} else {
errString = itmdbAccess.getErrorString("",
......@@ -267,7 +260,8 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements
} else {
errString = itmdbAccess.getErrorString("", "VTCOSUCFT", "",
"", conn);
System.out.println("Debit note generated zero for invoice ID-->>["
System.out
.println("Debit note generated zero for invoice ID-->>["
+ invoiceId + "]");
debitNoteTranID = "";
updCnt = updatePodHeader(conn, tranId, loginCode);
......@@ -877,6 +871,18 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements
compName = compName == null ? "" : compName.trim();
System.out.println("serviceCode = [" + serviceCode
+ "] compName [" + compName + "]");
// Changed by Manish on 01/04/16 for max cursor issue [start]
if (pstmt != null)
{
pstmt.close();
pstmt=null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
sql = "SELECT SERVICE_URI FROM SYSTEM_EVENT_SERVICES WHERE SERVICE_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, serviceCode);
......@@ -887,6 +893,18 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements
serviceURI = serviceURI == null ? "" : serviceURI.trim();
System.out.println("serviceURI = [" + serviceURI
+ "]---> compName = [" + compName + "]");
// Changed by Manish on 01/04/16 for max cursor issue [start]
if (pstmt != null)
{
pstmt.close();
pstmt=null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(serviceURI));
......@@ -987,6 +1005,18 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements
}
System.out.println("serviceCode = " + serviceCode + " compName "
+ compName);
// Changed by Manish on 01/04/16 for max cursor issue [start]
if (pstmt != null)
{
pstmt.close();
pstmt=null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
sql = "SELECT SERVICE_URI FROM SYSTEM_EVENT_SERVICES WHERE SERVICE_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, serviceCode);
......@@ -994,7 +1024,20 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements
if (rs.next()) {
serviceURI = rs.getString("SERVICE_URI");
}
System.out.println("serviceURI = " + serviceURI + " compName = " + compName);
System.out.println("serviceURI = " + serviceURI + " compName = "
+ compName);
// Changed by Manish on 01/04/16 for max cursor issue [start]
if (pstmt != null)
{
pstmt.close();
pstmt=null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(serviceURI));
......@@ -1052,71 +1095,11 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements
System.out.println("Unable to rollback");
s.printStackTrace();
}
throw new ITMException(e);
}
}
return retString;
}
@SuppressWarnings("finally")
public double getRequiredDecimal(double actVal, String custCode,Connection conn) throws SQLException
{
ResultSet rs = null;
PreparedStatement pstmt = null;
String sql = "",round="";
double roundTo= 0d,reqVal=0d;
java.sql.Timestamp invDate = null;
DistCommon dist = new DistCommon();
try {
sql = " select round,round_to from customer where cust_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, custCode);
rs = pstmt.executeQuery();
if (rs.next()) {
round = rs.getString("round")==null?"":rs.getString("round").trim();
roundTo = rs.getDouble("round_to");
}
reqVal = dist.getRndamt(actVal, round, roundTo);
// if("R".equals(round)) //Near
// {
//
// }
// else if("X".equals(round)) //Next
// {
// BigDecimal noZero = new BigDecimal(actVal);
// noZero.scale();
// noZero.precision();
// }
// else if("P".equals(round)) //Previous
// {
//
// }
// else if("N".equals(round)) //No Round
// {
// reqVal = actVal;
// }
} catch (Exception e) {
System.out.println("Exception in getRequiredDecimal off Round-------");
e.printStackTrace();
}
// NumberFormat numberFormat = NumberFormat.getIntegerInstance();
// Double DoubleValue = new Double(actVal);
// numberFormat.setMaximumFractionDigits(prec);
// String strValue = numberFormat.format(DoubleValue);
// strValue = strValue.replaceAll(",", "");
// double reqVal = Double.parseDouble(strValue);
finally
{
rs.close();
rs=null;
pstmt.close();
pstmt=null;
return reqVal;
}
}
}
......@@ -481,6 +481,13 @@ public class ConsumeIssueAct extends ActionHandlerEJB implements ConsumeIssueAct
issCriteria = rset.getString(1);
System.out.println("issCriteria :"+issCriteria);
}
// Changed by Manish on 01/04/16 for max cursor issue [start]
if (rset !=null)
{
rset.close();
rset = null;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
NodeList detailList = selDataDom.getElementsByTagName("Detail");
int noOfDetails = detailList.getLength();
for(int ctr = 0; ctr < noOfDetails; ctr++)
......@@ -562,6 +569,13 @@ public class ConsumeIssueAct extends ActionHandlerEJB implements ConsumeIssueAct
valueXmlString.append("<acct_code__inv isSrvCallOnChg='0'>").append("<![CDATA[").append(acctCodeInv).append("]]>").append("</acct_code__inv>\r\n");
valueXmlString.append("<cctr_code__inv isSrvCallOnChg='0'>").append("<![CDATA[").append(cctrCodeInv).append("]]>").append("</cctr_code__inv>\r\n");
}
// Changed by Manish on 01/04/16 for max cursor issue [start]
if (rset !=null)
{
rset.close();
rset = null;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
if (Double.parseDouble(stockQty) <= quantity1)
{
valueXmlString.append("<quantity isSrvCallOnChg='0'>").append("<![CDATA[").append(stockQty).append("]]>").append("</quantity>\r\n");
......
......@@ -34,7 +34,7 @@ public class DistIssPrc extends ProcessEJB implements DistIssPrcLocal,DistIssPr
CommonConstants commonConstants = new CommonConstants();
Connection conn = null;
public String process() throws RemoteException,ITMException
{
return "";
......@@ -77,7 +77,7 @@ public class DistIssPrc extends ProcessEJB implements DistIssPrcLocal,DistIssPr
ResultSet rs = null;
PreparedStatement pstmt = null;
StringBuffer retDistOrdIssBuff = new StringBuffer();
String siteCodeFr="", siteCodeTo="",toDateStr="",frDateStr="";
java.sql.Date toDate = null;
java.sql.Date frDate = null;
......@@ -89,7 +89,7 @@ public class DistIssPrc extends ProcessEJB implements DistIssPrcLocal,DistIssPr
double grossWeight=0.0,tareWeight=0.0,netWeight=0.0,frtAmt=0.0;
double amount=0.0,taxAmt=0.0,netAmt=0.0,discount=0.0,exchRateFrt=0.0;
double dcNo=0.0;
*/
*/
SimpleDateFormat sdf = null;
java.sql.Date tranDate = null;
java.sql.Date effDate = null;
......@@ -119,7 +119,7 @@ public class DistIssPrc extends ProcessEJB implements DistIssPrcLocal,DistIssPr
toDateStr = genericUtility.getColumnValue("to_date",headerDom);
System.out.println("siteCodeFrom is ::"+siteCodeFr+"and siteCodeTo is ::"+siteCodeTo);
System.out.println("frDateStr is ::"+frDateStr+"and toDateStr is ::"+toDateStr);
if ((siteCodeFr == null || siteCodeFr.trim().length() == 0) ||(siteCodeTo == null || siteCodeTo.trim().length() == 0))
{
errString = itmDBAccessEJB.getErrorString("","VTMNULSITE","","",conn);
......@@ -144,7 +144,7 @@ public class DistIssPrc extends ProcessEJB implements DistIssPrcLocal,DistIssPr
rs = null;
pstmt.close();
pstmt = null;
sql =" select count(*) from site where site_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,siteCodeTo);
......@@ -163,7 +163,7 @@ public class DistIssPrc extends ProcessEJB implements DistIssPrcLocal,DistIssPr
pstmt.close();
pstmt = null;
}
if (frDateStr != null && frDateStr.trim().length() > 0 )
{
//frDate=java.sql.Date.valueOf(frDateStr.trim());
......@@ -185,26 +185,26 @@ public class DistIssPrc extends ProcessEJB implements DistIssPrcLocal,DistIssPr
return errString;
}
System.out.println("frDate is ::"+frDate+"and toDate is ::"+toDate);
if (frDate.after(toDate)) //frmdate is grater than todate
{
errString = itmDBAccessEJB.getErrorString("","VTDATE12","","",conn);
return errString;
}
sql =" SELECT TRAN_ID,TRAN_DATE,EFF_DATE,DIST_ORDER,SITE_CODE, "
+" SITE_CODE__DLV,DIST_ROUTE,TRAN_CODE,LR_NO,LR_DATE,LORRY_NO, "
+" GROSS_WEIGHT,TARE_WEIGHT,NET_WEIGHT,FRT_AMT,AMOUNT,TAX_AMT, "
+" NET_AMT,LOC_CODE__GIT,REMARKS,FRT_TYPE,CHG_USER,CHG_TERM , "
+" CURR_CODE,CHG_DATE,CONFIRMED,CONF_DATE,ORDER_TYPE,AVAILABLE_YN ,"
+" STOCK_STATUS,GP_NO,GP_DATE,GP_SER,DISCOUNT,SHIPMENT_ID, "
+" CURR_CODE__FRT,EXCH_RATE__FRT,PROJ_CODE,DC_NO "
+" FROM DISTORD_ISS "
+" WHERE (tran_date >= ? ) AND "
+" (tran_date <= ? ) AND "
+" (site_code between ? and ? )AND "
+" CONFIRMED = ? ";
+" SITE_CODE__DLV,DIST_ROUTE,TRAN_CODE,LR_NO,LR_DATE,LORRY_NO, "
+" GROSS_WEIGHT,TARE_WEIGHT,NET_WEIGHT,FRT_AMT,AMOUNT,TAX_AMT, "
+" NET_AMT,LOC_CODE__GIT,REMARKS,FRT_TYPE,CHG_USER,CHG_TERM , "
+" CURR_CODE,CHG_DATE,CONFIRMED,CONF_DATE,ORDER_TYPE,AVAILABLE_YN ,"
+" STOCK_STATUS,GP_NO,GP_DATE,GP_SER,DISCOUNT,SHIPMENT_ID, "
+" CURR_CODE__FRT,EXCH_RATE__FRT,PROJ_CODE,DC_NO "
+" FROM DISTORD_ISS "
+" WHERE (tran_date >= ? ) AND "
+" (tran_date <= ? ) AND "
+" (site_code between ? and ? )AND "
+" CONFIRMED = ? ";
System.out.println("sql..."+ sql);
pstmt = conn.prepareStatement(sql);
pstmt.setDate(1,frDate );
......@@ -309,7 +309,7 @@ public class DistIssPrc extends ProcessEJB implements DistIssPrcLocal,DistIssPr
rs = null;
pstmt.close();
pstmt = null;
}
catch (SQLException e)
{
......@@ -325,7 +325,7 @@ public class DistIssPrc extends ProcessEJB implements DistIssPrcLocal,DistIssPr
{
try
{
// retTabSepStrBuff = null;
// retTabSepStrBuff = null;
if(conn != null && !conn.isClosed())
{
if(rs != null)
......@@ -359,10 +359,10 @@ public class DistIssPrc extends ProcessEJB implements DistIssPrcLocal,DistIssPr
String retStr = "";
try
{
System.out.println("xmlString[process]::::::::::;;;"+xmlString);
System.out.println("xmlString2[process]::::::::::;;;"+xmlString2);
System.out.println("windowName[process]::::::::::;;;"+windowName);
System.out.println("xtraParams[process]:::::::::;;;"+xtraParams);
System.out.println("xmlString[process]::::::::::;;;"+xmlString);
System.out.println("xmlString2[process]::::::::::;;;"+xmlString2);
System.out.println("windowName[process]::::::::::;;;"+windowName);
System.out.println("xtraParams[process]:::::::::;;;"+xtraParams);
}
catch(Exception e)
{
......@@ -397,7 +397,7 @@ public class DistIssPrc extends ProcessEJB implements DistIssPrcLocal,DistIssPr
//Connection conn = null;
int parentNodeListLength = 0;
int childNodeListLength = 0;
NodeList parentNodeList = null;
NodeList childNodeList = null;
......@@ -422,7 +422,7 @@ public class DistIssPrc extends ProcessEJB implements DistIssPrcLocal,DistIssPr
System.out.println("[DistIssPrcEJB][loginCode]=>"+loginCode);
System.out.println("[DistIssPrcEJB][chgTerm]=>"+chgTerm);
genericUtility = new ibase.utility.E12GenericUtility();
parentNodeList = detailDom.getElementsByTagName("Detail2");
parentNodeListLength = parentNodeList.getLength();
System.out.println("parentNodeListLength:::::::::"+parentNodeListLength);
......@@ -444,7 +444,7 @@ public class DistIssPrc extends ProcessEJB implements DistIssPrcLocal,DistIssPr
System.out.println( "tranIdFr before.........:-"+ tranIdFr );
tranIdFr = childNode.getFirstChild().getNodeValue();
System.out.println( "tranIdFr after.........:-"+ tranIdFr );
}
}
System.out.println( "tranIdFr final.........:-"+ tranIdFr );
......@@ -477,16 +477,16 @@ public class DistIssPrc extends ProcessEJB implements DistIssPrcLocal,DistIssPr
{
System.out.println("Exception : WorkorderPrcEJB =>"+d.toString());
d.printStackTrace();
System.out.println("Exception :WorkorderPrcEJB :process(String xmlString2, String xmlString2, String windowName, String xtraParams):" + e.getMessage() + ":");
e.printStackTrace();
errString = e.getMessage();
throw new ITMException(e);
System.out.println("Exception :WorkorderPrcEJB :process(String xmlString2, String xmlString2, String windowName, String xtraParams):" + e.getMessage() + ":");
e.printStackTrace();
errString = e.getMessage();
throw new ITMException(e);
}
}
finally
{
System.out.println("errorString...." + errString);
System.out.println("Closing Connection....");
System.out.println("Closing Connection....");
try
{
if(conn != null && !conn.isClosed())
......@@ -534,6 +534,18 @@ public class DistIssPrc extends ProcessEJB implements DistIssPrcLocal,DistIssPr
compName = rs.getString("COMP_NAME");
}
System.out.println("serviceCode = "+serviceCode+" compName "+compName);
// Changed by Manish on 01/04/16 for max cursor issue [start]
if (pStmt != null)
{
pStmt.close();
pStmt=null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
sql = "SELECT SERVICE_URI FROM SYSTEM_EVENT_SERVICES WHERE SERVICE_CODE = ? ";
pStmt = conn.prepareStatement(sql);
pStmt.setString(1,serviceCode);
......@@ -543,6 +555,18 @@ public class DistIssPrc extends ProcessEJB implements DistIssPrcLocal,DistIssPr
serviceURI = rs.getString("SERVICE_URI");
}
System.out.println("serviceURI = "+serviceURI+" compName = "+compName);
// Changed by Manish on 01/04/16 for max cursor issue [start]
if (pStmt != null)
{
pStmt.close();
pStmt=null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
Service service = new Service();
Call call = (Call)service.createCall();
call.setTargetEndpointAddress(new java.net.URL(serviceURI));
......@@ -583,20 +607,25 @@ public class DistIssPrc extends ProcessEJB implements DistIssPrcLocal,DistIssPr
pStmt.close();
pStmt = null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
}
catch(Exception e)
{
System.out.println("Exception inCalling confirmed");
e.printStackTrace();
try{
conn.rollback();
}catch (Exception s)
{
System.out.println("Unable to rollback");
s.printStackTrace();
}
}
e.printStackTrace();
try{
conn.rollback();
}catch (Exception s)
{
System.out.println("Unable to rollback");
s.printStackTrace();
}
}
}
return retString;
}
......
......@@ -874,6 +874,18 @@ public class StockTransferConf extends ActionHandlerEJB implements StockTransfer
{
try
{
//Changed by Manish on 1-04-2016 to close prepared statement [START]
if(pstmtStock != null)
{
pstmtStock.close();
pstmtStock = null;
}
if(rsStock != null)
{
rsStock.close();
rsStock = null;
}
//Changed by Manish on 1-04-2016 to close prepared statement [END]
//added by chitranjan connStatus if connstatus is true then commit.
if( !isError && connStatus )
{
......@@ -3521,7 +3533,7 @@ public class StockTransferConf extends ActionHandlerEJB implements StockTransfer
lineNo++;
sql = " Insert into qc_order_lots (QC_ORDER,LINE_NO,ITEM_CODE,LOT_NO,LOT_SL,LOC_CODE,QUANTITY," +
"UNIT,SAMPLE_QTY,LOCTYPE,LOC_CODE__ISSUE,QORDER_NO,NO_ART,NET_WEIGHT) " +
"UNIT,SAMPLE_QTY,LOCTYPE,LOC_CODE__ISSUE,QORDER_NO,NO_ART,NET_WEIGHT,LOC_CODE) " +
" values (?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
pstmtInsert = conn.prepareStatement(sql);
pstmtInsert.setString(1, qorderNo);
......@@ -3530,7 +3542,7 @@ public class StockTransferConf extends ActionHandlerEJB implements StockTransfer
pstmtInsert.setString(4, lotNo);
pstmtInsert.setString(5, lotSl);
// pstmtInsert.setString(6, locationCode);
pstmtInsert.setString(6, locCode);
pstmtInsert.setString(6, qcLotLocCode);
quantity = getUnroundDecimal(quantity, 3);
pstmtInsert.setDouble(7, quantity);
pstmtInsert.setString(8, unit);
......@@ -3540,7 +3552,7 @@ public class StockTransferConf extends ActionHandlerEJB implements StockTransfer
pstmtInsert.setString(12, qorderNo);
pstmtInsert.setDouble(13, noArt);
pstmtInsert.setDouble(14, netWeight);
// pstmtInsert.setString(15, locCode);
pstmtInsert.setString(15, locCode);
updCnt1 = pstmtInsert.executeUpdate();
pstmtInsert.close();
pstmtInsert = null;
......
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