Commit 9fe4078a authored by vvengurlekar's avatar vvengurlekar

PayIbcaConf.java- Changes done for IBCA Payables confirmation


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@196900 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 7d4c6294
...@@ -53,15 +53,19 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P ...@@ -53,15 +53,19 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P
try try
{ {
retString = confirm( tranID, xtraParams, forcedFlag, conn ); retString = confirm( tranID, xtraParams, forcedFlag, conn );
System.out.println("retString in PayIbcaConf::: ["+retString+"]");
if ( retString != null && retString.length() > 0 ) //changed confirmation condition in below line by Varsha V
//if ( retString != null && retString.length() > 0 )
if ( retString != null && retString.length() > 0 && retString.indexOf("VTCICONF3") < 0)
{ {
throw new Exception("Exception while calling confirm for tran Id:["+tranID+"]"); throw new Exception("Exception while calling confirm for tran Id:["+tranID+"]");
} }
} }
catch(Exception exception) catch(Exception exception)
{ {
System.out.println("Exception in [InvHoldConfEJB] getCurrdateAppFormat " + exception.getMessage()); System.out.println("Exception in [PayIbcaConf] confirm " + exception.getMessage());
//Added by Varsha V for throwing exception on 07-02-19
throw new ITMException(exception);
} }
return retString; return retString;
} }
...@@ -80,7 +84,8 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P ...@@ -80,7 +84,8 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P
FinCommon finCommon = null; FinCommon finCommon = null;
// GenericUtility genericUtility = null; // GenericUtility genericUtility = null;
ITMDBAccessEJB itmDBAccessEJB = null; ITMDBAccessEJB itmDBAccessEJB = null;
ValidatorEJB validatorEJB = null; //Commented BY Varsha V object no longer required on 07-02-19
//ValidatorEJB validatorEJB = null;
System.out.println("tran id = "+tranId); System.out.println("tran id = "+tranId);
//Added By Pavan R on 06/NOV/17 Start //Added By Pavan R on 06/NOV/17 Start
...@@ -108,8 +113,10 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P ...@@ -108,8 +113,10 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P
finCommon = new FinCommon(); finCommon = new FinCommon();
//genericUtility = new GenericUtility(); //genericUtility = new GenericUtility();
itmDBAccessEJB = new ITMDBAccessEJB(); itmDBAccessEJB = new ITMDBAccessEJB();
validatorEJB = new ValidatorEJB(); //Commented BY Varsha V object no longer required on 07-02-19
loginEmpCode =validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode"); //validatorEJB = new ValidatorEJB();
//loginEmpCode =validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
loginEmpCode =genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
System.out.println("Printing loginEmpCode---1-----"+loginEmpCode+"--"); System.out.println("Printing loginEmpCode---1-----"+loginEmpCode+"--");
...@@ -154,16 +161,19 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P ...@@ -154,16 +161,19 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P
{ {
errString = gbfRetrievePibca(tranId,siteCode,xtraParams,conn); errString = gbfRetrievePibca(tranId,siteCode,xtraParams,conn);
System.out.println("err String from gdfRetrieveMiscRcp ="+errString); System.out.println("err String from gdfRetrieveMiscRcp ="+errString);
if(errString != null && errString.trim().length() > 0) //Condition changed by Varsha V on 07-02-19 not to return if success
//if(errString != null && errString.trim().length() > 0)
if((errString != null && errString.trim().length() > 0) && errString.indexOf("VTCICONF3") < 0)
{ {
return errString; return errString;
} }
if(errString != null && errString.trim().length() > 0) /*if(errString != null && errString.trim().length() > 0)
{ {
return errString; return errString;
} }*///Commented by Varsha V on 07-02-19 because condition already added
//Condition changed by Varsha V on 07-02-19 not to return if success
if(errString == null || errString.trim().length() == 0) //if(errString == null || errString.trim().length() == 0)
if((errString == null || errString.trim().length() == 0)|| errString.indexOf("VTCICONF3") >-1)
{ {
if("null".equalsIgnoreCase(loginEmpCode) || loginEmpCode==null || loginEmpCode.trim().length()==0) if("null".equalsIgnoreCase(loginEmpCode) || loginEmpCode==null || loginEmpCode.trim().length()==0)
{ {
...@@ -209,7 +219,7 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P ...@@ -209,7 +219,7 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P
try try
{ {
System.out.println("connStatus:: ["+connStatus+"]");
if( conn != null && !conn.isClosed() && connStatus ) if( conn != null && !conn.isClosed() && connStatus )
{ {
if(errString.indexOf("VTCICONF3") > -1) if(errString.indexOf("VTCICONF3") > -1)
...@@ -425,6 +435,7 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P ...@@ -425,6 +435,7 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P
} }
errCode = gbfPostPibca(HdrMap,DetList,xtraParams,conn); errCode = gbfPostPibca(HdrMap,DetList,xtraParams,conn);
System.out.println("err String from gbfPostPibca ="+errCode);
} }
catch(Exception e) catch(Exception e)
{ {
...@@ -451,12 +462,15 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P ...@@ -451,12 +462,15 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
int cntrHdr = 0,cntr = 0,insertedRow = 0,rows = 0, ediOption = 0; int cntrHdr = 0,cntr = 0,insertedRow = 0,rows = 0, ediOption = 0;
ValidatorEJB validatorEJB = null; //Commented BY Varsha V object no longer required on 07-02-19
validatorEJB = new ValidatorEJB(); //ValidatorEJB validatorEJB = null;
//validatorEJB = new ValidatorEJB();
java.sql.Timestamp tranDate, today; java.sql.Timestamp tranDate, today;
try try
{ {
loginEmpCode = validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode"); //Commented BY Varsha V object no longer required on 07-02-19
//loginEmpCode = validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
loginEmpCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
today = new java.sql.Timestamp(System.currentTimeMillis()) ; today = new java.sql.Timestamp(System.currentTimeMillis()) ;
sql = "select edi_option from transetup where tran_window = 'w_pay_ibca'"; sql = "select edi_option from transetup where tran_window = 'w_pay_ibca'";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -475,11 +489,12 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P ...@@ -475,11 +489,12 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P
if("I".equalsIgnoreCase(tranSer)) if("I".equalsIgnoreCase(tranSer))
{ {
errCode = gbfPostPibcaHdrIss(HdrMap,xtraParams,conn); errCode = gbfPostPibcaHdrIss(HdrMap,xtraParams,conn);
System.out.println("err String from gbfPostPibcaHdrIss ="+errCode);
if(errCode == null || errCode.trim().length() == 0) if(errCode == null || errCode.trim().length() == 0)
{ {
errCode = gbfPostPibcaDetIss(HdrMap,DetList,xtraParams,conn); errCode = gbfPostPibcaDetIss(HdrMap,DetList,xtraParams,conn);
System.out.println("err String from gbfPostPibcaDetIss ="+errCode);
if(errCode == null || errCode.trim().length() == 0) if(errCode == null || errCode.trim().length() == 0)
{ {
...@@ -504,20 +519,28 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P ...@@ -504,20 +519,28 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P
return errCode; return errCode;
} }
} }
}//Else condition added By Varsha V on 07-02-19
else
{
return errCode;
} }
}//Else condition added By Varsha V on 07-02-19
else
{
return errCode;
} }
} }//added else keyword by Varsha V on 07-02-19
else if("R".equalsIgnoreCase(tranSer))
if("R".equalsIgnoreCase(tranSer))
{ {
errCode = gbfPostPibcaHdrRcp(HdrMap,xtraParams,conn); errCode = gbfPostPibcaHdrRcp(HdrMap,xtraParams,conn);
System.out.println("err String from gbfPostPibcaHdrRcp ="+errCode);
if(errCode == null || errCode.trim().length() == 0) if(errCode == null || errCode.trim().length() == 0)
{ {
errCode = gbfPostPibcaDetRcp(HdrMap,DetList, xtraParams ,conn); errCode = gbfPostPibcaDetRcp(HdrMap,DetList, xtraParams ,conn);
System.out.println("err String from gbfPostPibcaDetRcp ="+errCode);
if(errCode == null || errCode.trim().length() == 0) if(errCode == null || errCode.trim().length() == 0)
{ {
...@@ -542,8 +565,16 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P ...@@ -542,8 +565,16 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P
return errCode; return errCode;
} }
} }
}//Else condition added By Varsha V on 07-02-19
else
{
return errCode;
} }
}//Else condition added By Varsha V on 07-02-19
else
{
return errCode;
} }
} }
System.out.println("tran_id From Confirm::"+tranId1); System.out.println("tran_id From Confirm::"+tranId1);
...@@ -665,14 +696,16 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P ...@@ -665,14 +696,16 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
FinCommon finCommon = null; FinCommon finCommon = null;
ValidatorEJB validatorEJB = new ValidatorEJB(); //Commented BY Varsha V object no longer required on 07-02-19
//ValidatorEJB validatorEJB = new ValidatorEJB();
// GenericUtility genericUtility = new GenericUtility(); // GenericUtility genericUtility = new GenericUtility();
ITMDBAccessEJB itmDBAccessEJB = null; ITMDBAccessEJB itmDBAccessEJB = null;
try try
{ {
finCommon =new FinCommon(); finCommon =new FinCommon();
//Commented BY Varsha V object no longer required on 07-02-19
loginEmpCode = validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode"); //loginEmpCode = validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
loginEmpCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
//java.util.Date today= new java.sql.Date(new java.util.Date().getTime()); //java.util.Date today= new java.sql.Date(new java.util.Date().getTime());
itmDBAccessEJB = new ITMDBAccessEJB(); itmDBAccessEJB = new ITMDBAccessEJB();
...@@ -1110,7 +1143,8 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P ...@@ -1110,7 +1143,8 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P
FinCommon finCommon = null; FinCommon finCommon = null;
DistCommon distCommon = null; DistCommon distCommon = null;
ITMDBAccessEJB itmDBAccessEJB = null; ITMDBAccessEJB itmDBAccessEJB = null;
ValidatorEJB validatorEJB = new ValidatorEJB(); //Commented BY Varsha V object no longer required on 07-02-19
//ValidatorEJB validatorEJB = new ValidatorEJB();
// GenericUtility genericUtility = new GenericUtility(); // GenericUtility genericUtility = new GenericUtility();
java.sql.Timestamp dateInterest = null; java.sql.Timestamp dateInterest = null;
...@@ -1119,8 +1153,9 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P ...@@ -1119,8 +1153,9 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P
finCommon = new FinCommon(); finCommon = new FinCommon();
distCommon = new DistCommon(); distCommon = new DistCommon();
itmDBAccessEJB = new ITMDBAccessEJB(); itmDBAccessEJB = new ITMDBAccessEJB();
loginEmpCode = validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginCode"); //Commented BY Varsha V object no longer required on 07-02-19
//loginEmpCode = validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
loginEmpCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
finlink = finCommon.getFinparams("999999", "ADM_FIN_LINK", conn); finlink = finCommon.getFinparams("999999", "ADM_FIN_LINK", conn);
tranDate = (Timestamp)MapHrd.get("tran_date"); tranDate = (Timestamp)MapHrd.get("tran_date");
...@@ -1513,14 +1548,17 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P ...@@ -1513,14 +1548,17 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
FinCommon finCommon = null; FinCommon finCommon = null;
ValidatorEJB validatorEJB = new ValidatorEJB(); //Commented BY Varsha V object no longer required on 07-02-19
//ValidatorEJB validatorEJB = new ValidatorEJB();
// GenericUtility genericUtility = new GenericUtility(); // GenericUtility genericUtility = new GenericUtility();
ITMDBAccessEJB itmDBAccessEJB = null; ITMDBAccessEJB itmDBAccessEJB = null;
try try
{ {
finCommon =new FinCommon(); finCommon =new FinCommon();
loginEmpCode = validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode"); //Commented BY Varsha V object no longer required on 07-02-19
//loginEmpCode = validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
loginEmpCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
java.util.Date today= new java.sql.Date(new java.util.Date().getTime()); java.util.Date today= new java.sql.Date(new java.util.Date().getTime());
itmDBAccessEJB = new ITMDBAccessEJB(); itmDBAccessEJB = new ITMDBAccessEJB();
...@@ -1684,14 +1722,17 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P ...@@ -1684,14 +1722,17 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P
FinCommon finCommon = null; FinCommon finCommon = null;
DistCommon distCommon = null; DistCommon distCommon = null;
ITMDBAccessEJB itmDBAccessEJB = null; ITMDBAccessEJB itmDBAccessEJB = null;
ValidatorEJB validatorEJB = new ValidatorEJB(); //Commented BY Varsha V object no longer required on 07-02-19
//ValidatorEJB validatorEJB = new ValidatorEJB();
// GenericUtility genericUtility = new GenericUtility(); // GenericUtility genericUtility = new GenericUtility();
try try
{ {
finCommon = new FinCommon(); finCommon = new FinCommon();
distCommon = new DistCommon(); distCommon = new DistCommon();
itmDBAccessEJB = new ITMDBAccessEJB(); itmDBAccessEJB = new ITMDBAccessEJB();
loginEmpCode = validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginCode"); //Commented BY Varsha V object no longer required on 07-02-19
//loginEmpCode = validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
loginEmpCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
//tranid to tran_Id Changed by Pavan R on On 06/NOV/17 //tranid to tran_Id Changed by Pavan R on On 06/NOV/17
tranId = (String)HdrMap.get("tran_id"); tranId = (String)HdrMap.get("tran_id");
...@@ -1891,9 +1932,6 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P ...@@ -1891,9 +1932,6 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P
return errString; return errString;
} }
} }
} }
catch(Exception e) catch(Exception e)
...@@ -1908,20 +1946,26 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P ...@@ -1908,20 +1946,26 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P
} }
public double getReqDecimal(double actVal, int prec) public double getReqDecimal(double actVal, int prec) throws ITMException
{ {
String fmtStr = "############0"; String fmtStr = "############0";
String strValue = null; String strValue = null;
double retVal = 0; double retVal = 0;
if (prec > 0) try {
{ if (prec > 0)
fmtStr = fmtStr + "." + "000000000".substring(0, prec); {
fmtStr = fmtStr + "." + "000000000".substring(0, prec);
}
DecimalFormat decFormat = new DecimalFormat(fmtStr);
retVal = Double.parseDouble(decFormat.format(actVal));
if (Math.abs(retVal) == 0)
{
retVal = 0;
}
} }
DecimalFormat decFormat = new DecimalFormat(fmtStr); catch (Exception e) {
retVal = Double.parseDouble(decFormat.format(actVal)); e.printStackTrace();
if (Math.abs(retVal) == 0) throw new ITMException(e);
{
retVal = 0;
} }
return retVal; return retVal;
} }
......
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