Commit 6cb7b55a authored by pgole's avatar pgole

Updated ejb for edi generation component[D16ESUN003]


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@103157 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 97238597
...@@ -11,20 +11,14 @@ import ibase.webitm.ejb.E12CreateBatchLoadEjb; ...@@ -11,20 +11,14 @@ import ibase.webitm.ejb.E12CreateBatchLoadEjb;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import ibase.utility.E12GenericUtility; import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.sys.CreateRCPXML; import ibase.webitm.ejb.sys.CreateRCPXML;
import ibase.webitm.ejb.sys_UTL.CommonFunctions;
import java.rmi.RemoteException; import java.rmi.RemoteException;
import java.sql.*; import java.sql.*;
import org.w3c.dom.*; import org.w3c.dom.*;
@javax.ejb.Stateless @javax.ejb.Stateless
public class GenBatchPosSave extends ValidatorEJB implements GenBatchPosSaveLocal, GenBatchPosSaveRemote public class GenBatchPosSave extends ValidatorEJB implements GenBatchPosSaveLocal, GenBatchPosSaveRemote
{ {
E12GenericUtility genericUtility = new E12GenericUtility();
ValidatorEJB validator = null;
CommonFunctions commonFunctions = new CommonFunctions();
ITMDBAccessEJB dbEjb = new ITMDBAccessEJB() ;
@Override @Override
public String postSave() throws RemoteException, ITMException public String postSave() throws RemoteException, ITMException
{ {
...@@ -36,22 +30,23 @@ public class GenBatchPosSave extends ValidatorEJB implements GenBatchPosSaveLoca ...@@ -36,22 +30,23 @@ public class GenBatchPosSave extends ValidatorEJB implements GenBatchPosSaveLoca
public String postSave(String xmlStringAll, String tranId, String editFlag, String xtraParams, Connection conn) throws RemoteException, ITMException public String postSave(String xmlStringAll, String tranId, String editFlag, String xtraParams, Connection conn) throws RemoteException, ITMException
{ {
System.out.println("PostSave Action Called:::"); System.out.println("PostSave Action Called:::");
E12GenericUtility genericUtility = new E12GenericUtility();
ITMDBAccessEJB dbEjb = new ITMDBAccessEJB() ;
Document dom = null; Document dom = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null ; ResultSet rs = null ;
boolean isError = false ; boolean isError = false ;
String sql = "", ediOption = "" ,winName = "" ,dataStr = "" ,retString = "",tranIdCol = ""; String sql = "", ediOption = "" , winName = "" ,dataStr = "" ,retString = "",tranIdCol = "";
try try
{ {
E12GenericUtility genericUtility = new E12GenericUtility();
dom = genericUtility.parseString(xmlStringAll); dom = genericUtility.parseString(xmlStringAll);
/*System.out.println("dom>>"+dom); /*System.out.println("dom>>"+dom);
System.out.println("xmlStringAll>>"+xmlStringAll); System.out.println("xmlStringAll>>"+xmlStringAll);
System.out.println(" Tran id = "+tranId); System.out.println(" Tran id = "+tranId);
System.out.println("xtraParams:::" +xtraParams); System.out.println("xtraParams:::" +xtraParams);*/
*/
NodeList parentNodeList1 = dom.getElementsByTagName("Detail1"); NodeList parentNodeList1 = dom.getElementsByTagName("Detail1");
Node parentNode1 = parentNodeList1.item(0); Node parentNode1 = parentNodeList1.item(0);
...@@ -59,18 +54,23 @@ public class GenBatchPosSave extends ValidatorEJB implements GenBatchPosSaveLoca ...@@ -59,18 +54,23 @@ public class GenBatchPosSave extends ValidatorEJB implements GenBatchPosSaveLoca
System.out.println("winName in posSave"+ winName); System.out.println("winName in posSave"+ winName);
sql = "select edi_option,tran_id_col from transetup where tran_window = ? "; sql = "select edi_option,tran_id_col from transetup where tran_window= ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, winName); pstmt.setString(1, winName);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
ediOption = checkNull(rs.getString("edi_option")); ediOption = checkNull(rs.getString("edi_option"));
tranIdCol = checkNull(rs.getString("tran_id_col")); tranIdCol = checkNull(rs.getString("tran_id_col")).toLowerCase();
} }
rs.close();rs = null; rs.close();rs = null;
pstmt.close();pstmt = null; pstmt.close();pstmt = null;
if(tranIdCol != null)
{
tranIdCol = tranIdCol.trim();
}
System.out.println("ediOption["+ediOption+"]tranIdCol["+tranIdCol + "]"); System.out.println("ediOption["+ediOption+"]tranIdCol["+tranIdCol + "]");
tranId = checkNull(genericUtility.getColumnValue(tranIdCol, dom)); tranId = checkNull(genericUtility.getColumnValue(tranIdCol, dom));
...@@ -107,9 +107,11 @@ public class GenBatchPosSave extends ValidatorEJB implements GenBatchPosSaveLoca ...@@ -107,9 +107,11 @@ public class GenBatchPosSave extends ValidatorEJB implements GenBatchPosSaveLoca
} }
catch(Exception e) catch(Exception e)
{ {
System.out.println("iNSIDE CATCH......");
e.printStackTrace(); e.printStackTrace();
retString = dbEjb.getErrorString("", "POSFAIL", ""); retString = dbEjb.getErrorString("", "POSFAIL", "");
throw new ITMException( e ); throw new ITMException( e );
} }
finally finally
{ {
...@@ -117,8 +119,7 @@ public class GenBatchPosSave extends ValidatorEJB implements GenBatchPosSaveLoca ...@@ -117,8 +119,7 @@ public class GenBatchPosSave extends ValidatorEJB implements GenBatchPosSaveLoca
{ {
if(isError) if(isError)
{ {
conn.rollback(); retString = dbEjb.getErrorString("", "POSFAIL", "");
System.out.println("Transaction rollback... ");
} }
} }
catch(Exception e) catch(Exception e)
......
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