Commit 6d284107 authored by vvengurlekar's avatar vvengurlekar

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@192126 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 9ce0445f
This diff is collapsed.
package ibase.webitm.ejb.fin;
import java.rmi.RemoteException;
import org.w3c.dom.*;
//import javax.ejb.EJBObject;
import ibase.webitm.utility.ITMException;
import ibase.webitm.ejb.*;
import javax.ejb.Local; // added for ejb3
import ibase.webitm.ejb.ValidatorLocal;// added for ejb3
@Local // added for ejb3
public interface ChqNoChgICLocal extends ValidatorLocal
{
public String wfValData(String xmlString, String xmlString1,String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException, ITMException;
public String wfValData(Document dom, Document dom1,Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(String xmlString, String xmlString1,String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(Document dom, Document dom1,Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
}
\ No newline at end of file
package ibase.webitm.ejb.fin;
import java.rmi.RemoteException;
import org.w3c.dom.*;
//import javax.ejb.EJBObject;
import ibase.webitm.utility.ITMException;
import ibase.webitm.ejb.*;
import javax.ejb.Remote; // added for ejb3
import ibase.webitm.ejb.ValidatorRemote;// added for ejb3
@Remote // added for ejb3
public interface ChqNoChgICRemote extends ValidatorRemote
{
public String wfValData(String xmlString, String xmlString1,String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException, ITMException;
public String wfValData(Document dom, Document dom1,Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(String xmlString, String xmlString1,String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(Document dom, Document dom1,Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
}
\ No newline at end of file
...@@ -65,7 +65,7 @@ public class ChqNoChgPos extends ValidatorEJB implements ChqNoChgPosLocal ,ChqN ...@@ -65,7 +65,7 @@ public class ChqNoChgPos extends ValidatorEJB implements ChqNoChgPosLocal ,ChqN
logDir = new File(logDirName); logDir = new File(logDirName);
filePtr = new File(logDirName+ File.separator + "ChqNoChgPos.log"); filePtr = new File(logDirName+ File.separator + "ChqNoChgPos.log");
System.out.println("--------------------------------------->ChqNoChgPosEJB called"); System.out.println("--------------------------------------->ChqNoChgPosEJB called xmlString1: "+xmlString1);
writeLog(filePtr,"ChqNoChgPosEJB called",true); writeLog(filePtr,"ChqNoChgPosEJB called",true);
Document dom = null; Document dom = null;
try try
...@@ -92,8 +92,8 @@ public class ChqNoChgPos extends ValidatorEJB implements ChqNoChgPosLocal ,ChqN ...@@ -92,8 +92,8 @@ public class ChqNoChgPos extends ValidatorEJB implements ChqNoChgPosLocal ,ChqN
PreparedStatement pstmt = null, pstmt1 = null; PreparedStatement pstmt = null, pstmt1 = null;
ResultSet rs = null; ResultSet rs = null;
String oldChqNo = "", newChqNo = "", tranIDPay = "" ; String oldChqNo = "", newChqNo = "", tranIDPay = "" ;
String sqlUpd = ""; String sqlUpd = "", tableName = "";
String oldRefDate = "", newRefDate = ""; String oldRefDate = "", newRefDate = "", newRefSeries = "";
int updCnt = 0, updCnt1 = 0; int updCnt = 0, updCnt1 = 0;
writeLog(filePtr,"dom-->"+dom,true); writeLog(filePtr,"dom-->"+dom,true);
...@@ -109,56 +109,100 @@ public class ChqNoChgPos extends ValidatorEJB implements ChqNoChgPosLocal ,ChqN ...@@ -109,56 +109,100 @@ public class ChqNoChgPos extends ValidatorEJB implements ChqNoChgPosLocal ,ChqN
// GenericUtility genericUtility = GenericUtility.getInstance(); // GenericUtility genericUtility = GenericUtility.getInstance();
if (dom != null ) if (dom != null )
{ {
oldChqNo = genericUtility.getColumnValue("chq_no__old",dom); oldChqNo = checkNull(genericUtility.getColumnValue("chq_no__old",dom));
writeLog(filePtr,"oldChqNo-->"+oldChqNo,true); writeLog(filePtr,"oldChqNo-->"+oldChqNo,true);
newChqNo = genericUtility.getColumnValue("chq_no__new",dom); newChqNo = checkNull(genericUtility.getColumnValue("chq_no__new",dom));
writeLog(filePtr,"newChqNo-->"+newChqNo,true); writeLog(filePtr,"newChqNo-->"+newChqNo,true);
tranIDPay = genericUtility.getColumnValue("tran_id__pay",dom); tranIDPay = checkNull(genericUtility.getColumnValue("tran_id__pay",dom));
writeLog(filePtr,"tranIDPay-->"+tranIDPay,true); writeLog(filePtr,"tranIDPay-->"+tranIDPay,true);
oldRefDate = genericUtility.getColumnValue("ref_date__old",dom); oldRefDate = checkNull(genericUtility.getColumnValue("ref_date__old",dom));
writeLog(filePtr,"oldRefDate-->"+oldRefDate,true); writeLog(filePtr,"oldRefDate-->"+oldRefDate,true);
newRefDate = genericUtility.getColumnValue("ref_date",dom); newRefDate = checkNull(genericUtility.getColumnValue("ref_date",dom));
writeLog(filePtr,"newRefDate-->"+newRefDate,true); writeLog(filePtr,"newRefDate-->"+newRefDate,true);
newRefSeries = checkNull(genericUtility.getColumnValue("ref_ser",dom));
writeLog(filePtr,"newRefSeries-->"+newRefSeries,true);
} }
System.out.println("oldChqNo--> "+ oldChqNo + " newChqNo--> "+ newChqNo + " tranIDPay--> " + tranIDPay + " oldRefDate--> "
+ oldRefDate + " newRefDate--> " + newRefDate + " newRefSeries--> "+newRefSeries);
//changed by msalam on 24/10/07 for //changed by msalam on 24/10/07 for
//directly appending tran_id in sqlUpd and removing ? and setString //directly appending tran_id in sqlUpd and removing ? and setString
//next line commented and changed line added. //next line commented and changed line added.
//sqlUpd = "UPDATE MISC_PAYMENT SET REF_NO = ? , REF_NO__OLD = ? ,REF_DATE = ?, REF_DATE__OLD = ? where tran_id = ? "; //sqlUpd = "UPDATE MISC_PAYMENT SET REF_NO = ? , REF_NO__OLD = ? ,REF_DATE = ?, REF_DATE__OLD = ? where tran_id = ? ";
sqlUpd = " UPDATE MISC_PAYMENT SET REF_NO = ? , REF_NO__OLD = ? ,REF_DATE = ?, REF_DATE__OLD = ? " if(newRefSeries.equalsIgnoreCase("M-PAY"))
+ " where tran_id = '" + tranIDPay.trim() + "'";
writeLog(filePtr,"sqlUpd-->"+sqlUpd,true);
System.out.println("Update Sql :"+sqlUpd);
pstmt = conn.prepareStatement(sqlUpd);
pstmt.setString(1,newChqNo);
pstmt.setString(2,oldChqNo);
pstmt.setTimestamp(3,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(newRefDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
pstmt.setTimestamp(4,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(oldRefDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
//changed by msalam on 24/10/07 for
//directly appending tran_id in sqlUpd and removing ? and setString
//next line commented as not required.
//pstmt.setString(5,tranIDPay);
updCnt = pstmt.executeUpdate();
if (updCnt == 1)
{ {
System.out.println("Update Into MISC_PAYMENT Sucessfully : updCnt : " + updCnt); tableName = "MISC_PAYMENT";
writeLog(filePtr,"updCnt-->"+updCnt,true); }
else if(newRefSeries.equalsIgnoreCase("E-PAY"))
{
tableName = "PAYMENT_EXP";
}
if(newRefSeries.equalsIgnoreCase("M-PAY"))
{
sqlUpd = " UPDATE MISC_PAYMENT SET REF_NO = ? , REF_NO__OLD = ? ,REF_DATE = ?, REF_DATE__OLD = ? "
+ " where tran_id = '" + tranIDPay.trim() + "'";
writeLog(filePtr,"sqlUpd-->"+sqlUpd,true);
System.out.println("Update Sql :"+sqlUpd);
pstmt = conn.prepareStatement(sqlUpd);
pstmt.setString(1,newChqNo);
pstmt.setString(2,oldChqNo);
pstmt.setTimestamp(3,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(newRefDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
pstmt.setTimestamp(4,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(oldRefDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
//changed by msalam on 24/10/07 for
//directly appending tran_id in sqlUpd and removing ? and setString
//next line commented as not required.
//pstmt.setString(5,tranIDPay);
updCnt = pstmt.executeUpdate();
if (updCnt == 1)
{
System.out.println("Update Into MISC_PAYMENT Sucessfully : updCnt : " + updCnt);
writeLog(filePtr,"updCnt-->"+updCnt,true);
}
//changed by msalam on 24/10/07 for
//directly appending tran_id in sqlUpd and removing ? and setString
//next line commented and changed line added.
//sqlUpd = "UPDATE BANKTRAN_LOG SET REF_NO = ?, REF_DATE = ? WHERE TRAN_SER = 'M-PAY' AND TRAN_NO = ? ";
sqlUpd = " UPDATE BANKTRAN_LOG SET REF_NO = ?, REF_DATE = ? "
+ " WHERE TRAN_SER = ? AND TRAN_NO = '" + tranIDPay.trim() + "'";
System.out.println("Update Sql :"+sqlUpd);
writeLog(filePtr,"sqlUpd-->"+sqlUpd,true);
pstmt1 = conn.prepareStatement(sqlUpd);
pstmt1.setString(1,newChqNo);
pstmt1.setTimestamp(2,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(newRefDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
pstmt1.setString(3, newRefSeries);
//changed by msalam on 24/10/07 for
//directly appending tran_id in sqlUpd and removing ? and setString
//next line commented as not required.
//pstmt1.setString(3,tranIDPay);
updCnt1 = pstmt1.executeUpdate();
}
else if(newRefSeries.equalsIgnoreCase("E-PAY"))
{
sqlUpd = " UPDATE PAYMENT_EXP SET REF_NO = ? , REF_DATE = ? "
+ " where tran_id = '" + tranIDPay.trim() + "'";
writeLog(filePtr,"sqlUpd-->"+sqlUpd,true);
System.out.println("Update Sql :"+sqlUpd);
pstmt = conn.prepareStatement(sqlUpd);
pstmt.setString(1,newChqNo);
//pstmt.setString(2,oldChqNo);
pstmt.setTimestamp(2,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(newRefDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
//pstmt.setTimestamp(4,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(oldRefDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
updCnt = pstmt.executeUpdate();
if (updCnt == 1)
{
System.out.println("Update Into PAYMENT_EXP Sucessfully : updCnt : " + updCnt);
writeLog(filePtr,"updCnt-->"+updCnt,true);
}
sqlUpd = " UPDATE BANKTRAN_LOG SET REF_NO = ?, REF_DATE = ? "
+ " WHERE TRAN_SER = ? AND TRAN_NO = '" + tranIDPay.trim() + "'";
System.out.println("Update Sql :"+sqlUpd);
writeLog(filePtr,"sqlUpd-->"+sqlUpd,true);
pstmt1 = conn.prepareStatement(sqlUpd);
pstmt1.setString(1,newChqNo);
pstmt1.setTimestamp(2,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(newRefDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
pstmt1.setString(3, newRefSeries);
updCnt1 = pstmt1.executeUpdate();
} }
//changed by msalam on 24/10/07 for
//directly appending tran_id in sqlUpd and removing ? and setString
//next line commented and changed line added.
//sqlUpd = "UPDATE BANKTRAN_LOG SET REF_NO = ?, REF_DATE = ? WHERE TRAN_SER = 'M-PAY' AND TRAN_NO = ? ";
sqlUpd = " UPDATE BANKTRAN_LOG SET REF_NO = ?, REF_DATE = ? "
+ " WHERE TRAN_SER = 'M-PAY' AND TRAN_NO = '" + tranIDPay.trim() + "'";
System.out.println("Update Sql :"+sqlUpd);
writeLog(filePtr,"sqlUpd-->"+sqlUpd,true);
pstmt1 = conn.prepareStatement(sqlUpd);
pstmt1.setString(1,newChqNo);
pstmt1.setTimestamp(2,java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(newRefDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())));
//changed by msalam on 24/10/07 for
//directly appending tran_id in sqlUpd and removing ? and setString
//next line commented as not required.
//pstmt1.setString(3,tranIDPay);
updCnt1 = pstmt1.executeUpdate();
if (updCnt1 == 1) if (updCnt1 == 1)
{ {
System.out.println("Update Into BANKTRAN_LOG Sucessfully : updCnt1 : " + updCnt1); System.out.println("Update Into BANKTRAN_LOG Sucessfully : updCnt1 : " + updCnt1);
...@@ -166,8 +210,8 @@ public class ChqNoChgPos extends ValidatorEJB implements ChqNoChgPosLocal ,ChqN ...@@ -166,8 +210,8 @@ public class ChqNoChgPos extends ValidatorEJB implements ChqNoChgPosLocal ,ChqN
} }
if (updCnt == 1 && updCnt1 == 1) if (updCnt == 1 && updCnt1 == 1)
{ {
System.out.println("Update Into MISC_PAYMENT and BANKTRAN_LOG Sucessfully : And conn.commit() called ::"); System.out.println("Update Into "+tableName+" and BANKTRAN_LOG Sucessfully : And conn.commit() called ::");
writeLog(filePtr,"Update Into MISC_PAYMENT and BANKTRAN_LOG Sucessfully : And conn.commit() called ::",true); writeLog(filePtr,"Update Into "+tableName+" and BANKTRAN_LOG Sucessfully : And conn.commit() called ::",true);
//conn.commit(); //conn.commit();
} }
} }
...@@ -226,4 +270,9 @@ public class ChqNoChgPos extends ValidatorEJB implements ChqNoChgPosLocal ,ChqN ...@@ -226,4 +270,9 @@ public class ChqNoChgPos extends ValidatorEJB implements ChqNoChgPosLocal ,ChqN
writeLog(filePtr,"Return from executepostSaveRec()",true); writeLog(filePtr,"Return from executepostSaveRec()",true);
return ""; return "";
} }
private String checkNull(String input)
{
return input == null ? "" : input;
}
} }
\ No newline at end of file
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