Commit 9ed877a8 authored by jshaikh's avatar jshaikh
parent 675fc0f1
......@@ -6,11 +6,15 @@ import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.ejb.Stateless;
import ibase.system.config.ConnDriver;
import ibase.utility.UserInfoBean;
import ibase.webitm.ejb.ActionHandlerEJB;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.ITMException;
@Stateless
public class IndentReqConfWfEJB extends ActionHandlerEJB implements IndentReqConfWfEJBLocal, IndentReqConfWfEJBRemote
{
......@@ -138,7 +142,7 @@ public class IndentReqConfWfEJB extends ActionHandlerEJB implements IndentReqCon
return errString;
}
public String rejection(String tranID, String xtraParams, String forcedFlag) throws RemoteException,ITMException
public String rejection(String tranID, String xtraParams, String forcedFlag, String userInfoStr) throws RemoteException,ITMException
{
System.out.println("================ IndentReqConfWfEJB : rejection ================");
String userId = "";
......@@ -146,6 +150,7 @@ public class IndentReqConfWfEJB extends ActionHandlerEJB implements IndentReqCon
ValidatorEJB validatorEJB = null;
ITMDBAccessEJB itmDBAccessEJB = null;
Connection conn = null;
ConnDriver connDriver = new ConnDriver();
PreparedStatement pStmt = null;
ResultSet rs = null;
String sql = "";
......@@ -158,8 +163,21 @@ public class IndentReqConfWfEJB extends ActionHandlerEJB implements IndentReqCon
try {
itmDBAccessEJB = new ITMDBAccessEJB();
validatorEJB = new ValidatorEJB();
conn = getConnection();
//conn = getConnection();
UserInfoBean userInfo = new UserInfoBean(userInfoStr);
String transDB = userInfo.getTransDB();
if (transDB != null && transDB.trim().length() > 0)
{
conn = connDriver.getConnectDB(transDB);
}
else
{
conn = connDriver.getConnectDB("DriverITM");
}
connDriver = null;
conn.setAutoCommit(false);
userId = validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
System.out.println("tran_id ..> " + tranID+" userId: "+userId+" xtraParams: "+xtraParams+" forcedFlag: "+forcedFlag);
......@@ -184,13 +202,13 @@ public class IndentReqConfWfEJB extends ActionHandlerEJB implements IndentReqCon
closePstmtRs(pStmt, rs);
if("Y".equalsIgnoreCase(confirmed))
{
/*if("Y".equalsIgnoreCase(confirmed))
{*/
/*if("X".equalsIgnoreCase(status) || "C".equalsIgnoreCase(status))
{
errString = new ITMDBAccessEJB().getErrorString("", "VTWFCLOCAN", "");
}*/
if ("O".equalsIgnoreCase(wf_status) || "R".equalsIgnoreCase(wf_status))
if ("O".equalsIgnoreCase(wf_status) || "R".equalsIgnoreCase(wf_status) || "S".equalsIgnoreCase(wf_status))
{
sql = "UPDATE INDENT_HDR SET CONFIRMED = 'N' WF_STATUS = 'O' WHERE IND_NO = ? ";
pStmt = conn.prepareStatement(sql);
......@@ -212,11 +230,11 @@ public class IndentReqConfWfEJB extends ActionHandlerEJB implements IndentReqCon
{
errString = new ITMDBAccessEJB().getErrorString("", "VTMWFALINT", "");
}
}
/*}
else
{
errString = new ITMDBAccessEJB().getErrorString("", "VFMWFCONFN", "");
}
}*/
}
catch (Exception e)
......
......@@ -9,5 +9,5 @@ import javax.ejb.Local;
public interface IndentReqConfWfEJBLocal extends ActionHandlerLocal
{
public String confirm(String tranID,String xtraParams, String forcedFlag) throws RemoteException,ITMException;
public String rejection(String tranID, String xtraParams, String forcedFlag) throws RemoteException,ITMException;
public String rejection(String tranID, String xtraParams, String forcedFlag, String userInfoStr) throws RemoteException,ITMException;
}
......@@ -9,5 +9,5 @@ import javax.ejb.Remote;
public interface IndentReqConfWfEJBRemote extends ActionHandlerRemote
{
public String confirm(String tranID,String xtraParams, String forcedFlag) throws RemoteException,ITMException;
public String rejection(String tranID, String xtraParams, String forcedFlag) throws RemoteException,ITMException;
public String rejection(String tranID, String xtraParams, String forcedFlag, String userInfoStr) throws RemoteException,ITMException;
}
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