Commit 3db5e586 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@101072 ce508802-f39f-4f6c-b175-0d175dae99d5
parent ebad5d95
......@@ -830,6 +830,18 @@ public class AcctBalTransPrc extends ProcessEJB implements AcctBalTransPrcLocal,
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);
......@@ -839,6 +851,18 @@ public class AcctBalTransPrc extends ProcessEJB implements AcctBalTransPrcLocal,
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));
......@@ -880,6 +904,11 @@ public class AcctBalTransPrc extends ProcessEJB implements AcctBalTransPrcLocal,
pstmt.close();
pstmt = null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
/*if( conn != null ){
conn.close();
conn = null;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -9783,7 +9783,11 @@ public class FinCommon
break;
}
while (true);
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
catch ( SQLException sqlE)
{
......
......@@ -55,8 +55,8 @@ public class JvYearEndPrc extends ProcessEJB implements JvYearEndPrcLocal,JvYear
JournalDetBean dtlItems = null;
public String process(String xmlString, String xmlString2, String windowName, String xtraParams)
throws RemoteException,ITMException
{
throws RemoteException,ITMException
{
Document detailDom = null;
Document headerDom = null;
String retStr = "";
......@@ -83,7 +83,7 @@ public class JvYearEndPrc extends ProcessEJB implements JvYearEndPrcLocal,JvYear
throw new ITMException(e);
}
return retStr;
}//END OF PROCESS (1)
}//END OF PROCESS (1)
public String process(Document headerDom, Document detailDom, String windowName, String xtraParams) throws RemoteException,ITMException
{
......@@ -152,27 +152,27 @@ public class JvYearEndPrc extends ProcessEJB implements JvYearEndPrcLocal,JvYear
double drAmtHdr = 0, crAmtHdr = 0;
count = 0;
sql = "SELECT A.ACCT_CODE, SUM(CASE WHEN A.DR_AMT__BASE IS NULL THEN 0 ELSE A.DR_AMT__BASE END) AMT_DR,"
+"SUM(CASE WHEN A.CR_AMT__BASE IS NULL THEN 0 ELSE A.CR_AMT__BASE END) AMT_CR "//A.CCTR_CODE, "
// +" A.FIN_ENTITY "
+" FROM ACCTBAL A, "
+"ACCOUNTS B, ACCTSGRP C, ACCTGRP D "
+"WHERE A.ACCT_CODE = B.ACCT_CODE "
+"AND B.SGROUP_CODE = C.SGROUP_CODE "
+"AND C.GROUP_CODE = D.GROUP_CODE "
+"AND D.ACCT_CAT IN ('I','E') "
// +"AND A.SITE_CODE IN ( ? ) "
// +"AND A.SITE_CODE IN ('"+siteCode+"') "
+"AND A.SITE_CODE = ? "
/*+"AND A.PRD_CODE >= ? "
+"SUM(CASE WHEN A.CR_AMT__BASE IS NULL THEN 0 ELSE A.CR_AMT__BASE END) AMT_CR "//A.CCTR_CODE, "
// +" A.FIN_ENTITY "
+" FROM ACCTBAL A, "
+"ACCOUNTS B, ACCTSGRP C, ACCTGRP D "
+"WHERE A.ACCT_CODE = B.ACCT_CODE "
+"AND B.SGROUP_CODE = C.SGROUP_CODE "
+"AND C.GROUP_CODE = D.GROUP_CODE "
+"AND D.ACCT_CAT IN ('I','E') "
// +"AND A.SITE_CODE IN ( ? ) "
// +"AND A.SITE_CODE IN ('"+siteCode+"') "
+"AND A.SITE_CODE = ? "
/*+"AND A.PRD_CODE >= ? "
+"AND A.PRD_CODE <= ? "*/
+"AND A.ACCT_PRD = ? " // +"AND A.ACCT_PRD >= ? " modify by cpatil on 19/0814
// +"AND A.ACCT_PRD <= ? " // commented by cpatil on 19/0814
//+"AND A.ACCT_CODE >= ? "
//+"AND A.ACCT_CODE <= ? "
+" AND upper(A.PRD_CODE) <> 'ZZZZZZ' "
// +"GROUP BY A.PRD_CODE, A.ACCT_CODE, A.CCTR_CODE, A.FIN_ENTITY "
+"GROUP BY A.ACCT_CODE "
+"HAVING SUM(CASE WHEN A.DR_AMT__BASE IS NULL THEN 0 ELSE A.DR_AMT__BASE END) <> SUM(CASE WHEN A.CR_AMT__BASE " +"IS NULL THEN 0 ELSE A.CR_AMT__BASE END)";
+"AND A.ACCT_PRD = ? " // +"AND A.ACCT_PRD >= ? " modify by cpatil on 19/0814
// +"AND A.ACCT_PRD <= ? " // commented by cpatil on 19/0814
//+"AND A.ACCT_CODE >= ? "
//+"AND A.ACCT_CODE <= ? "
+" AND upper(A.PRD_CODE) <> 'ZZZZZZ' "
// +"GROUP BY A.PRD_CODE, A.ACCT_CODE, A.CCTR_CODE, A.FIN_ENTITY "
+"GROUP BY A.ACCT_CODE "
+"HAVING SUM(CASE WHEN A.DR_AMT__BASE IS NULL THEN 0 ELSE A.DR_AMT__BASE END) <> SUM(CASE WHEN A.CR_AMT__BASE " +"IS NULL THEN 0 ELSE A.CR_AMT__BASE END)";
//System.out.println("sql ::"+sql);
pstmt = conn.prepareStatement( sql );
......@@ -305,7 +305,7 @@ public class JvYearEndPrc extends ProcessEJB implements JvYearEndPrcLocal,JvYear
conn.rollback();
return errString;
}
}
else
{
......@@ -365,7 +365,7 @@ public class JvYearEndPrc extends ProcessEJB implements JvYearEndPrcLocal,JvYear
}
else
{*/
retString = sundryTransferPrc.process(argDom, null, "sundrybal_xfr", xtraParams,conn,false);
retString = sundryTransferPrc.process(argDom, null, "sundrybal_xfr", xtraParams,conn,false);
//}
System.out.println("retString PRC::"+retString);
......@@ -406,7 +406,7 @@ public class JvYearEndPrc extends ProcessEJB implements JvYearEndPrcLocal,JvYear
}
else
{*/
retString = glTransferPrc.process(argDom, null, "acctbal_xfr", xtraParams,conn,false);
retString = glTransferPrc.process(argDom, null, "acctbal_xfr", xtraParams,conn,false);
//}
System.out.println("trans retString prc::"+retString);
......@@ -499,13 +499,13 @@ public class JvYearEndPrc extends ProcessEJB implements JvYearEndPrcLocal,JvYear
rs = null;
hdrInsertSql = "insert into journal( "
+" TRAN_ID, TRAN_DATE, EFF_DATE, FIN_ENTITY, CURR_CODE, "
+" EXCH_RATE, DR_AMT, CR_AMT, REMARKS, REVERSIBLE, SITE_CODE, "
+" CHG_DATE, CHG_USER, CHG_TERM, SITE_CODE__REV, SITE_CODE__FOR, "
+" AUTO_REV, CONFIRMED, STATUS )"
+" VALUES( ?, ?, ?, ?, ?, "
+" ?, ?, ?, ?, ?, ?, ?, ?, ?, "
+" ?, ?, ?, ?, ? ) ";
+" TRAN_ID, TRAN_DATE, EFF_DATE, FIN_ENTITY, CURR_CODE, "
+" EXCH_RATE, DR_AMT, CR_AMT, REMARKS, REVERSIBLE, SITE_CODE, "
+" CHG_DATE, CHG_USER, CHG_TERM, SITE_CODE__REV, SITE_CODE__FOR, "
+" AUTO_REV, CONFIRMED, STATUS )"
+" VALUES( ?, ?, ?, ?, ?, "
+" ?, ?, ?, ?, ?, ?, ?, ?, ?, "
+" ?, ?, ?, ?, ? ) ";
System.out.println( "Hdr Insert Sql :: " + hdrInsertSql );
pstmt = conn.prepareStatement( hdrInsertSql );
......@@ -536,7 +536,7 @@ public class JvYearEndPrc extends ProcessEJB implements JvYearEndPrcLocal,JvYear
pstmt = null;
String getCctr = "SELECT var_value from finparm "
+" where prd_code ='999999' AND var_name = ? ";
+" where prd_code ='999999' AND var_name = ? ";
pstmt = conn.prepareStatement( getCctr );
pstmt.setString( 1, "YEAR_END_CCTR" );
rs = pstmt.executeQuery();
......@@ -560,9 +560,9 @@ public class JvYearEndPrc extends ProcessEJB implements JvYearEndPrcLocal,JvYear
System.out.println("JV DET DATA::"+dtlItems.acct_code +" :: "+dtlItems.drcrFlag);
lineNo = lineNo + 1;
dtlInsertSql = "insert into jourdet( "
+" TRAN_ID, LINE_NO, ACCT_CODE, CCTR_CODE, DRCR_FLAG, "
+" AMOUNT, REMARKS )"
+" VALUES( ?, ?, ?,'"+cctrCode+"', ?, ?, ?) ";
+" TRAN_ID, LINE_NO, ACCT_CODE, CCTR_CODE, DRCR_FLAG, "
+" AMOUNT, REMARKS )"
+" VALUES( ?, ?, ?,'"+cctrCode+"', ?, ?, ?) ";
System.out.println( "Hdr Insert Sql :: " + dtlInsertSql );
pstmt = conn.prepareStatement( dtlInsertSql );
......@@ -680,7 +680,7 @@ public class JvYearEndPrc extends ProcessEJB implements JvYearEndPrcLocal,JvYear
tranId = tg.generateTranSeqID(tranSer1, keyCol, keyString, conn);
System.out.println(" new tranId :"+tranId);
}
catch(SQLException ex)
{
......@@ -730,6 +730,18 @@ public class JvYearEndPrc extends ProcessEJB implements JvYearEndPrcLocal,JvYear
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);
......@@ -739,6 +751,18 @@ public class JvYearEndPrc extends ProcessEJB implements JvYearEndPrcLocal,JvYear
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));
......@@ -780,6 +804,11 @@ public class JvYearEndPrc extends ProcessEJB implements JvYearEndPrcLocal,JvYear
pstmt.close();
pstmt = null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
/*if( conn != null ){
conn.close();
conn = null;
......
......@@ -75,10 +75,6 @@ public class MiscPayConfSch implements Schedule
String strToWrite="";
SimpleDateFormat sdf1 = new SimpleDateFormat(genericUtility.getDBDateFormat());
String currTime = null;
String epayNoDays="";
int noOfDays=0;
Date fromDate=null;
Timestamp fromDateDB=null;
Calendar calendar = Calendar.getInstance();
currTime = sdf1.format(new Timestamp(System.currentTimeMillis())).toString();
currTime = currTime.replaceAll("-","");
......@@ -108,7 +104,6 @@ public class MiscPayConfSch implements Schedule
userInfo = new ibase.utility.UserInfoBean( scheduleParamXML );
loginSiteCode = userInfo.getSiteCode();
java.util.Date today=new java.util.Date();
Calendar c = Calendar.getInstance();
c.setTime(today);
......@@ -126,35 +121,9 @@ public class MiscPayConfSch implements Schedule
Timestamp newsysDate = java.sql.Timestamp.valueOf( sdf1.format(currentDate)+" 00:00:00.0");
System.out.println(">>>> newsysDate is:"+newsysDate);
java.util.Date todayDate=new java.util.Date();
// Code added by Sagar on 25/11/15 Start
FinCommon finCommon=new FinCommon();
UtilMethods utilmethod = new UtilMethods();
epayNoDays = checkNull(finCommon.getFinparams("999999", "EPAY_NO_DAYS", conn));
System.out.println(">>>>epayNoDays:"+epayNoDays);
//Retrive no of days from finparam, If it is not null then minus noofdays from current date and set as from date, Other wise noofdays is null then set current date.
if(epayNoDays!=null && epayNoDays.trim().length() > 0 && !"NULLFOUND".equals(epayNoDays) )
{
noOfDays= Integer.parseInt(epayNoDays);
fromDate = utilmethod.RelativeDate(currentDate, -noOfDays);
System.out.println(">>>fromDate:"+fromDate);
}
else
{
fromDate= currentDate;
}
fromDateDB = java.sql.Timestamp.valueOf(sdf1.format(fromDate)+" 00:00:00.0");
System.out.println(">>>>>fromDateDB:"+fromDateDB);
System.out.println(">>>>>newsysDate:"+newsysDate);
// Code added by Sagar on 25/11/15 End
//queryString = "SELECT TRAN_ID FROM MISC_PAYMENT WHERE CONFIRMED='N' AND WF_STATUS='S' AND REF_DATE= ? "; // Comment added by Sagar on 25/11/15
queryString = "SELECT TRAN_ID FROM MISC_PAYMENT WHERE CONFIRMED='N' AND WF_STATUS='S' AND REF_DATE BETWEEN ? AND ? ";
queryString = "SELECT TRAN_ID FROM MISC_PAYMENT WHERE CONFIRMED='N' AND WF_STATUS='S' AND REF_DATE= ? ";
pstmt = conn.prepareStatement(queryString);
pstmt.setTimestamp(1, fromDateDB );
pstmt.setTimestamp(2, newsysDate );
pstmt.setTimestamp(1, newsysDate );
rs=pstmt.executeQuery();
while(rs.next())
{
......@@ -282,6 +251,18 @@ public class MiscPayConfSch implements Schedule
compName = rs.getString("COMP_NAME");
}
System.out.println(">>>Misc Payments 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);
......@@ -291,6 +272,18 @@ public class MiscPayConfSch implements Schedule
serviceURI = rs.getString("SERVICE_URI");
}
System.out.println(">>>Misc Payments 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));
......@@ -330,6 +323,11 @@ public class MiscPayConfSch implements Schedule
pstmt.close();
pstmt = null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
/*if( conn != null ){
conn.close();
conn = null;
......@@ -375,13 +373,5 @@ public class MiscPayConfSch implements Schedule
}
catch(Exception exWm){exWm.printStackTrace();}
}
private String checkNull(String input)
{
if (input == null)
{
input = "";
}
return input.trim();
}
}
......@@ -1603,6 +1603,18 @@ public class ReceivablesTransPrc extends ProcessEJB implements ReceivablesTransP
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);
......@@ -1612,6 +1624,18 @@ public class ReceivablesTransPrc extends ProcessEJB implements ReceivablesTransP
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));
......
......@@ -362,6 +362,11 @@ public class VoucherConfScheduler implements Schedule
pstmt.close();
pstmt = null;
}
if (rs != null )
{
rs.close();
rs = null;
}
/*if( conn != null ){
conn.close();
conn = null;
......
......@@ -1080,6 +1080,18 @@ public String confirmMiscVoucher(String businessObj, String tranIdFr,String xtra
}
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);
......@@ -1090,6 +1102,18 @@ public String confirmMiscVoucher(String businessObj, String tranIdFr,String xtra
}
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));
......
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