Commit 006e991c authored by manohar's avatar manohar

upto date filtering added


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91372 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 3490f91e
...@@ -83,13 +83,16 @@ public class BankRecoPrc extends ProcessEJB implements BankRecoPrcLocal,BankReco ...@@ -83,13 +83,16 @@ public class BankRecoPrc extends ProcessEJB implements BankRecoPrcLocal,BankReco
String getDataSql = ""; String getDataSql = "";
String bankCode = ""; String bankCode = "";
String effDate = ""; String effDate = "";
String refDate = "";
String resultString = ""; String resultString = "";
String errString = ""; String errString = "";
String errCode = "", entryBatchNo = ""; String errCode = "", entryBatchNo = "";
Connection conn = null; Connection conn = null;
ResultSet rs = null; ResultSet rs = null;
Statement stmt = null; Statement stmt = null;
PreparedStatement pstmt = null;
int cnt = 0; int cnt = 0;
java.sql.Timestamp refDateTs = null;
StringBuffer retTabSepStrBuff = new StringBuffer(); StringBuffer retTabSepStrBuff = new StringBuffer();
ConnDriver connDriver = new ConnDriver(); ConnDriver connDriver = new ConnDriver();
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB(); ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
...@@ -99,6 +102,11 @@ public class BankRecoPrc extends ProcessEJB implements BankRecoPrcLocal,BankReco ...@@ -99,6 +102,11 @@ public class BankRecoPrc extends ProcessEJB implements BankRecoPrcLocal,BankReco
conn = connDriver.getConnectDB("DriverITM"); conn = connDriver.getConnectDB("DriverITM");
bankCode = genericUtility.getColumnValue("bank_code",dom); bankCode = genericUtility.getColumnValue("bank_code",dom);
effDate = genericUtility.getColumnValue("eff_date",dom); effDate = genericUtility.getColumnValue("eff_date",dom);
refDate = genericUtility.getColumnValue("ref_date",dom);
if( refDate != null )
{
refDateTs = Timestamp.valueOf(genericUtility.getValidDateString(refDate, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
}
getDataSql ="SELECT BANKTRAN_LOG.TRAN_ID," getDataSql ="SELECT BANKTRAN_LOG.TRAN_ID,"
+"BANKTRAN_LOG.TRAN_TYPE," +"BANKTRAN_LOG.TRAN_TYPE,"
+"BANKTRAN_LOG.TRAN_DATE," +"BANKTRAN_LOG.TRAN_DATE,"
...@@ -120,10 +128,16 @@ public class BankRecoPrc extends ProcessEJB implements BankRecoPrcLocal,BankReco ...@@ -120,10 +128,16 @@ public class BankRecoPrc extends ProcessEJB implements BankRecoPrcLocal,BankReco
+"BANKTRAN_LOG.CURR_CODE," +"BANKTRAN_LOG.CURR_CODE,"
+"BANKTRAN_LOG.ENTRY_BATCH_NO " +"BANKTRAN_LOG.ENTRY_BATCH_NO "
+"FROM BANKTRAN_LOG " +"FROM BANKTRAN_LOG "
+"WHERE (BANKTRAN_LOG.BANK_CODE = '"+ bankCode +"'"+") AND( BANKTRAN_LOG.STATUS IN ( 'P','E' ) ) ORDER BY TRAN_ID"; +"WHERE (BANKTRAN_LOG.BANK_CODE = ? ) "
+" AND( BANKTRAN_LOG.STATUS IN ( 'P','E' ) ) "
+" AND ( BANKTRAN_LOG.TRAN_DATE <= ? ) ORDER BY TRAN_ID";
System.out.println("The getDataSql becomes :"+getDataSql); System.out.println("The getDataSql becomes :"+getDataSql);
stmt = conn.createStatement(); pstmt = conn.prepareStatement( getDataSql );
rs = stmt.executeQuery(getDataSql);
pstmt.setString( 1, bankCode );
pstmt.setTimestamp( 2, refDateTs );
rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
do do
...@@ -326,7 +340,7 @@ public class BankRecoPrc extends ProcessEJB implements BankRecoPrcLocal,BankReco ...@@ -326,7 +340,7 @@ public class BankRecoPrc extends ProcessEJB implements BankRecoPrcLocal,BankReco
conn = null; conn = null;
return errString; return errString;
} }
errCode = updateTable(cnt,headerDom,detailDom); errCode = updateTable(cnt,headerDom,detailDom,conn);
if (errCode != null || errCode.trim().length()>0) if (errCode != null || errCode.trim().length()>0)
{ {
errString = itmDBAccessEJB.getErrorString("", errCode, "", "", conn); errString = itmDBAccessEJB.getErrorString("", errCode, "", "", conn);
...@@ -350,7 +364,7 @@ public class BankRecoPrc extends ProcessEJB implements BankRecoPrcLocal,BankReco ...@@ -350,7 +364,7 @@ public class BankRecoPrc extends ProcessEJB implements BankRecoPrcLocal,BankReco
return errString; return errString;
} }
private String updateTable(int cnt, Document headerDom, Document detailDom) throws RemoteException, ITMException private String updateTable(int cnt, Document headerDom, Document detailDom, Connection conn) throws RemoteException, ITMException
{ {
Document dom1 = null; Document dom1 = null;
System.out.println("Counter :"+ cnt + "\n detailDom :"+detailDom + "\n headerDom :"+headerDom); System.out.println("Counter :"+ cnt + "\n detailDom :"+detailDom + "\n headerDom :"+headerDom);
...@@ -380,7 +394,7 @@ public class BankRecoPrc extends ProcessEJB implements BankRecoPrcLocal,BankReco ...@@ -380,7 +394,7 @@ public class BankRecoPrc extends ProcessEJB implements BankRecoPrcLocal,BankReco
ArrayList tranIdList = new ArrayList(); ArrayList tranIdList = new ArrayList();
ArrayList amountList = new ArrayList(); ArrayList amountList = new ArrayList();
ArrayList amtAdjList = new ArrayList(); ArrayList amtAdjList = new ArrayList();
Connection conn = null; //Connection conn = null; //commented by rajendra on 31/03/09
ResultSet rSet = null; ResultSet rSet = null;
Statement stmt = null; Statement stmt = null;
String keyStringQuery = ""; String keyStringQuery = "";
...@@ -404,13 +418,17 @@ public class BankRecoPrc extends ProcessEJB implements BankRecoPrcLocal,BankReco ...@@ -404,13 +418,17 @@ public class BankRecoPrc extends ProcessEJB implements BankRecoPrcLocal,BankReco
NodeList childNodeList = null; NodeList childNodeList = null;
Node parentNode = null; Node parentNode = null;
Node childNode = null; Node childNode = null;
ConnDriver connDriver = new ConnDriver(); //commented by rajendra on 31/03/09
// ConnDriver connDriver = new ConnDriver();
GenericUtility genericUtility = GenericUtility.getInstance(); GenericUtility genericUtility = GenericUtility.getInstance();
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB(); ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
try try
{ {
//conn = getConnection(); //conn = getConnection();
conn = connDriver.getConnectDB("DriverITM"); //commented by rajendra on 31/03/09
//conn = connDriver.getConnectDB("DriverITM");
//ended by rajendra on 31/03/09
/*--- Commented by Gulzar as the logic to process single and multiple record should same 15/11/06 /*--- Commented by Gulzar as the logic to process single and multiple record should same 15/11/06
if (cnt == 1) if (cnt == 1)
{ {
......
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