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 { ...@@ -25,16 +25,15 @@ public class PricelistGenerationWF {
public String confirm(String tran_id, String empCodeAprv, String loginSiteCode, String keyFlag, String remarks) throws RemoteException, ITMException { 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+"]"); System.out.println("PricelistGenerationWF confirm ::: tran_id["+tran_id+"],empCodeAprv["+empCodeAprv+"],keyFlag["+keyFlag+"]");
String loginCode = ""; String loginCode = "",compType = "",xtraParams = "", retString = "",sql = "";
String xtraParams = "";
String retString = "";
Connection conn = null; Connection conn = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
String sql = "";
ConnDriver connDriver = new ConnDriver(); ConnDriver connDriver = new ConnDriver();
E12GenericUtility genericUtility = null; E12GenericUtility genericUtility = null;
loginSiteCode = checkNull(loginSiteCode); loginSiteCode = checkNull(loginSiteCode);
PriceListConf priceListConf = null;
boolean connStatus= false;
if("C".equalsIgnoreCase(keyFlag) || "R".equalsIgnoreCase(keyFlag)){ if("C".equalsIgnoreCase(keyFlag) || "R".equalsIgnoreCase(keyFlag)){
retString = updateWfStatus(tran_id, empCodeAprv, loginSiteCode, keyFlag, remarks); retString = updateWfStatus(tran_id, empCodeAprv, loginSiteCode, keyFlag, remarks);
...@@ -74,24 +73,24 @@ public class PricelistGenerationWF { ...@@ -74,24 +73,24 @@ public class PricelistGenerationWF {
methodName = "gbf_post"; methodName = "gbf_post";
actionURI = "http://NvoServiceurl.org/" + methodName; 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 = conn.prepareStatement(sql);
pstmt.setString(1, businessObj); pstmt.setString(1, businessObj);
pstmt.setString(2, eventCode); pstmt.setString(2, eventCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) { if (rs.next()) {
serviceCode = rs.getString("SERVICE_CODE"); serviceCode = checkNull(rs.getString("SERVICE_CODE"));
compName = rs.getString("COMP_NAME"); compName = checkNull(rs.getString("COMP_NAME"));
compType = checkNull(rs.getString("COMP_TYPE"));
} }
serviceCode = serviceCode == null ? "" : serviceCode.trim(); System.out.println("serviceCode = " + serviceCode + " compName " + compName +"compType : "+compType);
compName = compName == null ? "" : compName.trim();
System.out.println("serviceCode = " + serviceCode + " compName " + compName);
rs.close(); rs.close();
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if("WSR".equalsIgnoreCase(compType)){
sql = "SELECT SERVICE_URI FROM SYSTEM_EVENT_SERVICES WHERE SERVICE_CODE = ? "; sql = "SELECT SERVICE_URI FROM SYSTEM_EVENT_SERVICES WHERE SERVICE_CODE = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, serviceCode); pstmt.setString(1, serviceCode);
...@@ -126,18 +125,23 @@ public class PricelistGenerationWF { ...@@ -126,18 +125,23 @@ public class PricelistGenerationWF {
System.out.println("@@@@@@@@@@loginEmpCode:" + genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode") + ":"); System.out.println("@@@@@@@@@@loginEmpCode:" + genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode") + ":");
call.setReturnType(XMLType.XSD_STRING); call.setReturnType(XMLType.XSD_STRING);
retString = (String) call.invoke(aobj); retString = (String) call.invoke(aobj);
System.out.println("Confirm Complete @@@@@@@@@@@Return string from NVO is:==>[" + retString + "]"); System.out.println("PricelistGenerationWF Confirm Complete @@@@@@@@@@@Return string from NVO is:==>[" + retString + "]");
}
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)) { }
System.out.println("Transaction Successfull"); if ((retString.indexOf("success") > -1) || (retString.indexOf("Success") > -1) || (retString.indexOf("VTSUCC1") > -1) || (retString.indexOf("VTCICONF3") > -1)) {
System.out.println("Transaction Successful");
retString = "Y"; retString = "Y";
} else { } else {
retString = "N"; retString = "N";
System.out.println("Exception in PricelistGenerationWF while calling WSR component");
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
System.out.println("Exeption occured"); System.out.println("Exception in PricelistGenerationWF in confirm()");
throw new ITMException(e); throw new ITMException(e);
} finally { } finally {
if (conn != null) { if (conn != null) {
......
...@@ -2,6 +2,7 @@ package ibase.webitm.ejb.dis; ...@@ -2,6 +2,7 @@ package ibase.webitm.ejb.dis;
import ibase.system.config.ConnDriver; import ibase.system.config.ConnDriver;
import ibase.utility.E12GenericUtility; import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.dis.adv.SalesReturnConfirm;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import java.net.URL; import java.net.URL;
...@@ -25,15 +26,14 @@ public class SalesReturnWF { ...@@ -25,15 +26,14 @@ public class SalesReturnWF {
public String confirm(String tran_id, String empCodeAprv, String loginSiteCode, String keyFlag) throws RemoteException, ITMException { 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+"]"); System.out.println("SaleReturnWF confirm ::: tran_id["+tran_id+"],empCodeAprv["+empCodeAprv+"],keyFlag["+keyFlag+"]");
String loginCode = ""; String loginCode = "",xtraParams = "",retString = "";
String xtraParams = "";
String retString = "";
Connection conn = null; Connection conn = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
String sql = ""; String sql = "",compType = "";
ConnDriver connDriver = new ConnDriver(); ConnDriver connDriver = new ConnDriver();
E12GenericUtility genericUtility = null; E12GenericUtility genericUtility = null;
SalesReturnConfirm sreturnConf = null;
if("C".equalsIgnoreCase(keyFlag) || "R".equalsIgnoreCase(keyFlag) || "O".equalsIgnoreCase(keyFlag)){ if("C".equalsIgnoreCase(keyFlag) || "R".equalsIgnoreCase(keyFlag) || "O".equalsIgnoreCase(keyFlag)){
retString = updateWfStatus(tran_id, empCodeAprv, loginSiteCode, keyFlag); retString = updateWfStatus(tran_id, empCodeAprv, loginSiteCode, keyFlag);
...@@ -73,24 +73,25 @@ public class SalesReturnWF { ...@@ -73,24 +73,25 @@ public class SalesReturnWF {
methodName = "gbf_post"; methodName = "gbf_post";
actionURI = "http://NvoServiceurl.org/" + methodName; 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 = conn.prepareStatement(sql);
pstmt.setString(1, businessObj); pstmt.setString(1, businessObj);
pstmt.setString(2, eventCode); pstmt.setString(2, eventCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) { if (rs.next()) {
serviceCode = rs.getString("SERVICE_CODE"); serviceCode = checkNull(rs.getString("SERVICE_CODE"));
compName = rs.getString("COMP_NAME"); compName = checkNull(rs.getString("COMP_NAME"));
compType = checkNull(rs.getString("COMP_TYPE"));
} }
serviceCode = serviceCode == null ? "" : serviceCode.trim(); System.out.println("serviceCode = " + serviceCode + " compName " + compName +"compType : "+compType);
compName = compName == null ? "" : compName.trim();
System.out.println("serviceCode = " + serviceCode + " compName " + compName);
rs.close(); rs.close();
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if("WSR".equalsIgnoreCase(compType)){
sql = "SELECT SERVICE_URI FROM SYSTEM_EVENT_SERVICES WHERE SERVICE_CODE = ? "; sql = "SELECT SERVICE_URI FROM SYSTEM_EVENT_SERVICES WHERE SERVICE_CODE = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, serviceCode); pstmt.setString(1, serviceCode);
...@@ -125,8 +126,14 @@ public class SalesReturnWF { ...@@ -125,8 +126,14 @@ public class SalesReturnWF {
System.out.println("@@@@@@@@@@loginEmpCode:" + genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode") + ":"); System.out.println("@@@@@@@@@@loginEmpCode:" + genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode") + ":");
call.setReturnType(XMLType.XSD_STRING); call.setReturnType(XMLType.XSD_STRING);
retString = (String) call.invoke(aobj); retString = (String) call.invoke(aobj);
System.out.println("Confirm Complete @@@@@@@@@@@Return string from NVO is:==>[" + retString + "]"); System.out.println("SaleReturnConfWF 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)) { if ((retString.indexOf("success") > -1) || (retString.indexOf("Success") > -1) || (retString.indexOf("VTSUCC1") > -1)) {
System.out.println("Transaction Successfull"); System.out.println("Transaction Successfull");
retString = "Y"; 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