Commit a5aa092d authored by abibave's avatar abibave

Request Id:W16LSER003,W16LSER006

Updated Source Files of Pricelist Generation and Sales Return Workflow to confirm transaction using java component.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@43781 ce508802-f39f-4f6c-b175-0d175dae99d5
parent b122b351
......@@ -25,16 +25,15 @@ public class PricelistGenerationWF {
public String confirm(String tran_id, String empCodeAprv, String loginSiteCode, String keyFlag, String remarks) throws RemoteException, ITMException {
System.out.println("PricelistGenerationWF confirm ::: tran_id["+tran_id+"],empCodeAprv["+empCodeAprv+"],keyFlag["+keyFlag+"]");
String loginCode = "";
String xtraParams = "";
String retString = "";
String loginCode = "",compType = "",xtraParams = "", retString = "",sql = "";
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
String sql = "";
ConnDriver connDriver = new ConnDriver();
E12GenericUtility genericUtility = null;
loginSiteCode = checkNull(loginSiteCode);
PriceListConf priceListConf = null;
boolean connStatus= false;
if("C".equalsIgnoreCase(keyFlag) || "R".equalsIgnoreCase(keyFlag)){
retString = updateWfStatus(tran_id, empCodeAprv, loginSiteCode, keyFlag, remarks);
......@@ -74,70 +73,75 @@ public class PricelistGenerationWF {
methodName = "gbf_post";
actionURI = "http://NvoServiceurl.org/" + methodName;
sql = "SELECT SERVICE_CODE,COMP_NAME FROM SYSTEM_EVENTS WHERE OBJ_NAME = ? AND EVENT_CODE = ? ";
sql = "SELECT SERVICE_CODE,COMP_NAME,COMP_TYPE FROM SYSTEM_EVENTS WHERE OBJ_NAME = ? AND EVENT_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, businessObj);
pstmt.setString(2, eventCode);
rs = pstmt.executeQuery();
if (rs.next()) {
serviceCode = rs.getString("SERVICE_CODE");
compName = rs.getString("COMP_NAME");
serviceCode = checkNull(rs.getString("SERVICE_CODE"));
compName = checkNull(rs.getString("COMP_NAME"));
compType = checkNull(rs.getString("COMP_TYPE"));
}
serviceCode = serviceCode == null ? "" : serviceCode.trim();
compName = compName == null ? "" : compName.trim();
System.out.println("serviceCode = " + serviceCode + " compName " + compName);
System.out.println("serviceCode = " + serviceCode + " compName " + compName +"compType : "+compType);
rs.close();
rs = null;
pstmt.close();
pstmt = null;
sql = "SELECT SERVICE_URI FROM SYSTEM_EVENT_SERVICES WHERE SERVICE_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, serviceCode);
rs = pstmt.executeQuery();
if (rs.next()) {
serviceURI = rs.getString("SERVICE_URI");
if("WSR".equalsIgnoreCase(compType)){
sql = "SELECT SERVICE_URI FROM SYSTEM_EVENT_SERVICES WHERE SERVICE_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, serviceCode);
rs = pstmt.executeQuery();
if (rs.next()) {
serviceURI = rs.getString("SERVICE_URI");
}
serviceURI = serviceURI == null ? "" : serviceURI.trim();
System.out.println("serviceURI = " + serviceURI);
rs.close();
rs = null;
pstmt.close();
pstmt = null;
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new URL(serviceURI));
call.setOperationName(new QName("http://NvoServiceurl.org", methodName));
call.setUseSOAPAction(true);
call.setSOAPActionURI(actionURI);
Object[] aobj = new Object[4];
call.addParameter(new QName("http://NvoServiceurl.org", "component_name"), XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter(new QName("http://NvoServiceurl.org", "tran_id"), XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter(new QName("http://NvoServiceurl.org", "xtra_params"), XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter(new QName("http://NvoServiceurl.org", "forced_flag"), XMLType.XSD_STRING, ParameterMode.IN);
aobj[0] = new String(compName);
aobj[1] = new String(tran_id);
aobj[2] = new String(xtraParams);
System.out.println("@@@@@@@@@@loginEmpCode:" + genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode") + ":");
call.setReturnType(XMLType.XSD_STRING);
retString = (String) call.invoke(aobj);
System.out.println("PricelistGenerationWF Confirm Complete @@@@@@@@@@@Return string from NVO is:==>[" + retString + "]");
}
serviceURI = serviceURI == null ? "" : serviceURI.trim();
System.out.println("serviceURI = " + serviceURI);
rs.close();
rs = null;
pstmt.close();
pstmt = null;
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new URL(serviceURI));
call.setOperationName(new QName("http://NvoServiceurl.org", methodName));
call.setUseSOAPAction(true);
call.setSOAPActionURI(actionURI);
Object[] aobj = new Object[4];
call.addParameter(new QName("http://NvoServiceurl.org", "component_name"), XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter(new QName("http://NvoServiceurl.org", "tran_id"), XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter(new QName("http://NvoServiceurl.org", "xtra_params"), XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter(new QName("http://NvoServiceurl.org", "forced_flag"), XMLType.XSD_STRING, ParameterMode.IN);
aobj[0] = new String(compName);
aobj[1] = new String(tran_id);
aobj[2] = new String(xtraParams);
System.out.println("@@@@@@@@@@loginEmpCode:" + genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode") + ":");
call.setReturnType(XMLType.XSD_STRING);
retString = (String) call.invoke(aobj);
System.out.println("Confirm Complete @@@@@@@@@@@Return string from NVO is:==>[" + retString + "]");
if ((retString.indexOf("success") > -1) || (retString.indexOf("Success") > -1) || (retString.indexOf("VTSUCC1") > -1)) {
System.out.println("Transaction Successfull");
else{
priceListConf = new PriceListConf();
retString = priceListConf.confirm(tran_id, xtraParams, "", conn, connStatus);
System.out.println("PricelistGenerationWF Confirm Complete @@@@@@@@@@@Return string from EJB is:==>[" + retString + "]");
}
if ((retString.indexOf("success") > -1) || (retString.indexOf("Success") > -1) || (retString.indexOf("VTSUCC1") > -1) || (retString.indexOf("VTCICONF3") > -1)) {
System.out.println("Transaction Successful");
retString = "Y";
} else {
retString = "N";
System.out.println("Exception in PricelistGenerationWF while calling WSR component");
}
} catch (Exception e) {
e.printStackTrace();
System.out.println("Exeption occured");
System.out.println("Exception in PricelistGenerationWF in confirm()");
throw new ITMException(e);
} finally {
if (conn != null) {
......
......@@ -2,6 +2,7 @@ package ibase.webitm.ejb.dis;
import ibase.system.config.ConnDriver;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.dis.adv.SalesReturnConfirm;
import ibase.webitm.utility.ITMException;
import java.net.URL;
......@@ -25,15 +26,14 @@ public class SalesReturnWF {
public String confirm(String tran_id, String empCodeAprv, String loginSiteCode, String keyFlag) throws RemoteException, ITMException {
System.out.println("SaleReturnWF confirm ::: tran_id["+tran_id+"],empCodeAprv["+empCodeAprv+"],keyFlag["+keyFlag+"]");
String loginCode = "";
String xtraParams = "";
String retString = "";
String loginCode = "",xtraParams = "",retString = "";
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
String sql = "";
String sql = "",compType = "";
ConnDriver connDriver = new ConnDriver();
E12GenericUtility genericUtility = null;
SalesReturnConfirm sreturnConf = null;
if("C".equalsIgnoreCase(keyFlag) || "R".equalsIgnoreCase(keyFlag) || "O".equalsIgnoreCase(keyFlag)){
retString = updateWfStatus(tran_id, empCodeAprv, loginSiteCode, keyFlag);
......@@ -73,60 +73,67 @@ public class SalesReturnWF {
methodName = "gbf_post";
actionURI = "http://NvoServiceurl.org/" + methodName;
sql = "SELECT SERVICE_CODE,COMP_NAME FROM SYSTEM_EVENTS WHERE OBJ_NAME = ? AND EVENT_CODE = ? ";
sql = "SELECT SERVICE_CODE,COMP_NAME,COMP_TYPE FROM SYSTEM_EVENTS WHERE OBJ_NAME = ? AND EVENT_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, businessObj);
pstmt.setString(2, eventCode);
rs = pstmt.executeQuery();
if (rs.next()) {
serviceCode = rs.getString("SERVICE_CODE");
compName = rs.getString("COMP_NAME");
serviceCode = checkNull(rs.getString("SERVICE_CODE"));
compName = checkNull(rs.getString("COMP_NAME"));
compType = checkNull(rs.getString("COMP_TYPE"));
}
serviceCode = serviceCode == null ? "" : serviceCode.trim();
compName = compName == null ? "" : compName.trim();
System.out.println("serviceCode = " + serviceCode + " compName " + compName);
System.out.println("serviceCode = " + serviceCode + " compName " + compName +"compType : "+compType);
rs.close();
rs = null;
pstmt.close();
pstmt = null;
sql = "SELECT SERVICE_URI FROM SYSTEM_EVENT_SERVICES WHERE SERVICE_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, serviceCode);
rs = pstmt.executeQuery();
if (rs.next()) {
serviceURI = rs.getString("SERVICE_URI");
if("WSR".equalsIgnoreCase(compType)){
sql = "SELECT SERVICE_URI FROM SYSTEM_EVENT_SERVICES WHERE SERVICE_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, serviceCode);
rs = pstmt.executeQuery();
if (rs.next()) {
serviceURI = rs.getString("SERVICE_URI");
}
serviceURI = serviceURI == null ? "" : serviceURI.trim();
System.out.println("serviceURI = " + serviceURI);
rs.close();
rs = null;
pstmt.close();
pstmt = null;
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new URL(serviceURI));
call.setOperationName(new QName("http://NvoServiceurl.org", methodName));
call.setUseSOAPAction(true);
call.setSOAPActionURI(actionURI);
Object[] aobj = new Object[4];
call.addParameter(new QName("http://NvoServiceurl.org", "component_name"), XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter(new QName("http://NvoServiceurl.org", "tran_id"), XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter(new QName("http://NvoServiceurl.org", "xtra_params"), XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter(new QName("http://NvoServiceurl.org", "forced_flag"), XMLType.XSD_STRING, ParameterMode.IN);
aobj[0] = new String(compName);
aobj[1] = new String(tran_id);
aobj[2] = new String(xtraParams);
System.out.println("@@@@@@@@@@loginEmpCode:" + genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode") + ":");
call.setReturnType(XMLType.XSD_STRING);
retString = (String) call.invoke(aobj);
System.out.println("SaleReturnConfWF Confirm Complete @@@@@@@@@@@Return string from NVO is:==>[" + retString + "]");
}
serviceURI = serviceURI == null ? "" : serviceURI.trim();
System.out.println("serviceURI = " + serviceURI);
rs.close();
rs = null;
pstmt.close();
pstmt = null;
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new URL(serviceURI));
call.setOperationName(new QName("http://NvoServiceurl.org", methodName));
call.setUseSOAPAction(true);
call.setSOAPActionURI(actionURI);
Object[] aobj = new Object[4];
call.addParameter(new QName("http://NvoServiceurl.org", "component_name"), XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter(new QName("http://NvoServiceurl.org", "tran_id"), XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter(new QName("http://NvoServiceurl.org", "xtra_params"), XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter(new QName("http://NvoServiceurl.org", "forced_flag"), XMLType.XSD_STRING, ParameterMode.IN);
aobj[0] = new String(compName);
aobj[1] = new String(tran_id);
aobj[2] = new String(xtraParams);
System.out.println("@@@@@@@@@@loginEmpCode:" + genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode") + ":");
call.setReturnType(XMLType.XSD_STRING);
retString = (String) call.invoke(aobj);
System.out.println("Confirm Complete @@@@@@@@@@@Return string from NVO is:==>[" + retString + "]");
else{
sreturnConf = new SalesReturnConfirm();
retString = sreturnConf.confirm(tran_id, xtraParams, "");
System.out.println("SaleReturnConfWF Confirm Complete @@@@@@@@@@@Return string from EJB is:==>[" + retString + "]");
}
if ((retString.indexOf("success") > -1) || (retString.indexOf("Success") > -1) || (retString.indexOf("VTSUCC1") > -1)) {
System.out.println("Transaction Successfull");
retString = "Y";
......
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