Commit 70abebbf authored by jshaikh's avatar jshaikh

Added two new workflow components for directpayment and payment against voucher


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@106724 ce508802-f39f-4f6c-b175-0d175dae99d5
parent b7da4026
package ibase.webitm.ejb.fin.adv;
import ibase.system.config.ConnDriver;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class DirectPaymentConfWF
{
public String confirm(String tranId, String empCodeAprv, String xmlDataAll, String processId, String keyFlag)
throws RemoteException, ITMException
{
System.out.println("Parameters ::: tranId[" + tranId + "],empCodeAprv[" + empCodeAprv + "],xmlDataAll[" + xmlDataAll + "],processId[" + processId + "],keyFlag[" + keyFlag + "]");
String retString = "";
Connection conn = null;
PreparedStatement pstmt = null;
String sql = "";
ConnDriver connDriver = new ConnDriver();
int updcnt = 0;
try { conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
conn.setAutoCommit(false);
empCodeAprv = empCodeAprv == null ? "" : empCodeAprv.trim();
if ((xmlDataAll != null) && (xmlDataAll.trim().length() != 0)) {
sql = "update payment_exp set confirmed = 'Y', conf_date = sysdate where tran_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId);
updcnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
System.out.println("Updated Successfully:" + updcnt);
if (updcnt > 0) {
conn.commit();
retString = "Y";
}
conn.rollback();
retString = "N";
}
}
catch (Exception e)
{
try
{
conn.rollback();
}
catch (SQLException e1)
{
e1.printStackTrace();
}
e.printStackTrace();
System.out.println("Exception occured");
throw new ITMException(e);
}
finally
{
if (conn != null)
{
try
{
conn.close();
conn = null;
}
catch (SQLException e)
{
e.printStackTrace();
System.out.println("Exception in Finally");
}
}
}
return retString;
}
}
package ibase.webitm.ejb.fin.adv;
import ibase.system.config.ConnDriver;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class PayAgainstVoucherConfWF
{
public String confirm(String tranId, String empCodeAprv, String xmlDataAll, String processId, String keyFlag)
throws RemoteException, ITMException
{
System.out.println("Parameters ::: tranId[" + tranId + "],empCodeAprv[" + empCodeAprv + "],xmlDataAll[" + xmlDataAll + "],processId[" + processId + "],keyFlag[" + keyFlag + "]");
String retString = "";
Connection conn = null;
PreparedStatement pstmt = null;
String sql = "";
ConnDriver connDriver = new ConnDriver();
int updcnt = 0;
try { conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
conn.setAutoCommit(false);
empCodeAprv = empCodeAprv == null ? "" : empCodeAprv.trim();
if ((xmlDataAll != null) && (xmlDataAll.trim().length() != 0)) {
sql = "update misc_payment set confirmed = 'Y', conf_date = sysdate where tran_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId);
updcnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
System.out.println("Updated Successfully:" + updcnt);
if (updcnt > 0) {
conn.commit();
retString = "Y";
}
conn.rollback();
retString = "N";
}
}
catch (Exception e)
{
try
{
conn.rollback();
}
catch (SQLException e1)
{
e1.printStackTrace();
}
e.printStackTrace();
System.out.println("Exeption occured");
throw new ITMException(e);
}
finally
{
if (conn != null)
{
try
{
conn.close();
conn = null;
}
catch (SQLException e)
{
e.printStackTrace();
System.out.println("Exeption in Finally");
}
}
}
return retString;
}
}
\ 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