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