Commit 7ba33dd2 authored by vvengurlekar's avatar vvengurlekar

ReceiptAdvConf.java- Not showing proper error msg shows invoation exception...

ReceiptAdvConf.java- Not showing proper error msg shows invoation exception error in all case(Reported by Tyson)


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@194170 ce508802-f39f-4f6c-b175-0d175dae99d5
parent df9e6a99
...@@ -21,6 +21,7 @@ import java.sql.ResultSet; ...@@ -21,6 +21,7 @@ import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.text.*; import java.text.*;
...@@ -33,23 +34,37 @@ import javax.ejb.Stateless; ...@@ -33,23 +34,37 @@ import javax.ejb.Stateless;
@Stateless @Stateless
public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLocal,ReceiptAdvConfRemote public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLocal,ReceiptAdvConfRemote
{ {
FinCommon Fcommon = new FinCommon();//Added by sarita on 23 NOV 2018
public String confirm(String tranID,String xtraParams, String forcedFlag) throws RemoteException,ITMException public String confirm(String tranID,String xtraParams, String forcedFlag) throws RemoteException,ITMException
{ {
String retString = ""; String retString = "";
boolean isConn= false; boolean isConn= false;
Connection conn = null; Connection conn = null;
boolean isPreview = false; boolean isPreview = false;
try try
{ {
retString = confirm( tranID, xtraParams, forcedFlag, conn ,isPreview); retString = confirm( tranID, xtraParams, forcedFlag, conn ,isPreview);
System.out.println("retString--123 ["+retString+"]");
//Modified by Anjali R. on [05/10/2018][In case of success prompt,system should not throw exception][Start] //Modified by Anjali R. on [05/10/2018][In case of success prompt,system should not throw exception][Start]
//if ( retString != null && retString.length() > 0 ) //if ( retString != null && retString.length() > 0 )
if ( retString != null && retString.length() > 0 && retString.indexOf("VTCICONF3") < 0 ) //Commented by sarita on 23 NOV 2018 [START]
/*if ( retString != null && retString.length() > 0 && retString.indexOf("VTCICONF3") < 0 )
//Modified by Anjali R. on [05/10/2018][In case of success prompt,system should not throw exception][End] //Modified by Anjali R. on [05/10/2018][In case of success prompt,system should not throw exception][End]
{ {
throw new Exception("Exception while calling confirm for tran Id:["+tranID+"]"); throw new Exception("Exception while calling confirm for tran Id:["+tranID+"]");
retString = itmDBAccessEJB.getErrorString("", ls_errcode, userId);
}*/
if (retString != null && retString.length() > 0 && retString.indexOf("<error>") > -1 )
{
return retString;
}
else if(retString != null && retString.length() > 0 && retString.indexOf("VTCICONF3") < 0)
{
retString = getErrorXmlString(Fcommon, retString, tranID);
System.out.println("ReturnString : ["+retString+"]");
} }
//Commented by sarita on 23 NOV 2018 [END]
} }
catch(Exception exception) catch(Exception exception)
{ {
...@@ -66,19 +81,30 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo ...@@ -66,19 +81,30 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
{ {
String retString = ""; String retString = "";
boolean isConn= false; boolean isConn= false;
boolean isPreview = false; boolean isPreview = false;
try try
{ {
retString = confirm( tranID, xtraParams, forcedFlag, conn ,isPreview); retString = confirm( tranID, xtraParams, forcedFlag, conn ,isPreview);
System.out.println("retString--1234 [\"+retString+\"]");
//Modified by Anjali R. on [05/10/2018][In case of success prompt,system should not throw exception][Start] //Modified by Anjali R. on [05/10/2018][In case of success prompt,system should not throw exception][Start]
//if ( retString != null && retString.length() > 0 ) //if ( retString != null && retString.length() > 0 )
if ( retString != null && retString.length() > 0 && retString.indexOf("VTCICONF3") < 0 ) //Commented by sarita on 23 NOV 2018 [START]
/*if ( retString != null && retString.length() > 0 && retString.indexOf("VTCICONF3") < 0 )
//Modified by Anjali R. on [05/10/2018][In case of success prompt,system should not throw exception][End] //Modified by Anjali R. on [05/10/2018][In case of success prompt,system should not throw exception][End]
{ {
throw new Exception("Exception while calling confirm for tran Id:["+tranID+"]"); throw new Exception("Exception while calling confirm for tran Id:["+tranID+"]");
}*/
if (retString != null && retString.length() > 0 && retString.indexOf("<error>") > -1 )
{
return retString;
} }
else if(retString != null && retString.length() > 0 && retString.indexOf("VTCICONF3") < 0)
{
retString = getErrorXmlString(Fcommon, retString, tranID);
System.out.println("ReturnString : ["+retString+"]");
}
//Commented by sarita on 23 NOV 2018 [END]
} }
catch(Exception exception) catch(Exception exception)
{ {
...@@ -2050,7 +2076,7 @@ if(!isPreview){ ...@@ -2050,7 +2076,7 @@ if(!isPreview){
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
System.out.println("Max Line>>>"+maxline); System.out.println("Max Line>>>"+maxline);
if(!isPreview ) if(!isPreview )
{ {
System.out.println(" >>>>>>>>>>>>>"+isPreview); System.out.println(" >>>>>>>>>>>>>"+isPreview);
sql = "Insert into rcpacct (TRAN_ID,LINE_NO,ACCT_CODE,CCTR_CODE,EXCH_RATE,AMOUNT,EMP_CODE,ANAL_CODE,EFFECT_PARTY,SUNDRY_TYPE,SUNDRY_CODE) values (?,?,?,?,?,?,?,?,?,?,?)"; sql = "Insert into rcpacct (TRAN_ID,LINE_NO,ACCT_CODE,CCTR_CODE,EXCH_RATE,AMOUNT,EMP_CODE,ANAL_CODE,EFFECT_PARTY,SUNDRY_TYPE,SUNDRY_CODE) values (?,?,?,?,?,?,?,?,?,?,?)";
...@@ -3797,5 +3823,18 @@ if(! isPreview)//if isPreview is false ...@@ -3797,5 +3823,18 @@ if(! isPreview)//if isPreview is false
return retVal; return retVal;
} }
//Added by sarita on 23 NOV 2018 [START]
private String getErrorXmlString(FinCommon Fcommon, String errString, String tranId) throws RemoteException, ITMException
{
System.out.println("errString.indexOf(\"<error\"): "+errString.indexOf("<error"));
if(errString.indexOf("<error")<1)
{
String[] errorCodeMsg = errString.split("\t");
System.out.println("errorCodeMsg: "+Arrays.toString(errorCodeMsg)+" Length: "+errorCodeMsg.length);
errString = Fcommon.getErrorXML(errorCodeMsg[1], errorCodeMsg[0], errorCodeMsg[0],tranId+" failed");
}
return errString;
}
//Added by sarita on 23 NOV 2018 [END]
} }
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