Commit 9383e2f5 authored by arawankar's avatar arawankar

Added below components

1.MiscPayAutoIC.java
- Migrated component for itemchange and validation of automatic payment process

2.MiscPayAutoPrc.java
-migrated getdata and process method for automatic payment process

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@186519 ce508802-f39f-4f6c-b175-0d175dae99d5
parent eb4a5709
package ibase.webitm.ejb.fin.adv;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.ejb.Stateless;
import javax.naming.InitialContext;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import ibase.system.config.AppConnectParm;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ITMDBAccessLocal;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.ejb.fin.FinCommon;
import ibase.webitm.ejb.sys.UtilMethods;
import ibase.webitm.utility.ITMException;
@Stateless
public class MiscPayAutoIC extends ValidatorEJB implements MiscPayAutoICLocal,MiscPayAutoICRemote
{
E12GenericUtility genericUtility = new E12GenericUtility();
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException
{
Document dom = null;
Document dom1 = null;
Document dom2 = null;
String retString = "";
E12GenericUtility genericUtility = null;
try
{
genericUtility = new E12GenericUtility();
if(xmlString != null && xmlString.trim().length() > 0)
{
dom = genericUtility.parseString(xmlString);
}
if(xmlString1 != null && xmlString1.trim().length() > 0)
{
dom1 = genericUtility.parseString(xmlString1);
}
if(xmlString2 != null && xmlString2.trim().length() > 0)
{
dom2 = genericUtility.parseString(xmlString2);
}
retString = wfValData(dom,dom1,dom2,objContext,editFlag,xtraParams);
System.out.println("retString:::"+retString);
}
catch(Exception e)
{
System.out.println("Exception in MiscPayAutoIC----["+e.getMessage()+"]");
}
return retString;
}
public String wfValData(Document dom, Document dom1, Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException
{
E12GenericUtility genericUtility = null;
Connection conn = null;
int childNodeLength = 0;
int currentFormNo=0;
int ctr=0,cnt=0;
String sql = "";
PreparedStatement pstmt = null;
ResultSet rs = null ;
AppConnectParm appConnect = null;
InitialContext initialCtx = null;
ITMDBAccessLocal itmDBAccess = null;
FinCommon finCommon = null;
NodeList parentNodeList = null;
Node parentNode = null;
NodeList childNodeList = null;
Node childNode = null;
String childNodeName = "";
String retString = "";
String errCode = "";
String loginCode = "";
String datePay = null;
String siteCode = "";
String dateFr = "",dateTo = "";
String vouchNoFr = "";
String vouchNoTo = "";
String siteCodeFr = "";
String siteCodeTo = "";
String bankCode = "";
String bankCodeAdd = "";
String currCode = "";
double exchRate = 0.0;
java.util.Date datePayInDate = null;
java.util.Date dateFrInDate = null , dateToInDate = null;
try
{
System.out.println("================= Inside wfValData method ==============");
genericUtility = new E12GenericUtility();
conn = getConnection();
loginCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
System.out.println("loginCode--["+loginCode+"]");
appConnect = new AppConnectParm();
initialCtx = new InitialContext(appConnect.getProperty());
itmDBAccess = (ITMDBAccessLocal)initialCtx.lookup("ibase/ITMDBAccessEJB/local");
finCommon = new FinCommon();
if(objContext != null && objContext.trim().length() > 0)
{
currentFormNo = Integer.parseInt(objContext);
System.out.println("currentFormNo:::"+currentFormNo);
}
switch(currentFormNo)
{
case 1:
{
parentNodeList = dom.getElementsByTagName("Detail"+currentFormNo);
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
childNodeLength = childNodeList.getLength();
for(ctr = 0; ctr < childNodeLength; ctr++)
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
if("date__pay".equalsIgnoreCase(childNodeName))
{
datePay = genericUtility.getColumnValue("date__pay", dom);
datePayInDate = getStringToDate(datePay);
System.out.println("datePay--["+datePay+"]datePayInDate--["+datePayInDate+"]");
if(datePay == null || datePay.trim().length() == 0)
{
retString = itmDBAccess.getErrorString( "date__pay", "VEDATE" , loginCode);
return retString;
}
else
{
siteCode = genericUtility.getColumnValue("site_code__fr",dom);
errCode = finCommon.nfCheckPeriod("FIN", datePayInDate, siteCode, conn);
System.out.println("errCode---["+errCode+"]");
if(errCode != null && errCode.trim().length() > 0)
{
retString = itmDBAccess.getErrorString( "date__pay", errCode , loginCode);
return retString;
}
}
}
else if("date__fr".equalsIgnoreCase(childNodeName))
{
dateFr = genericUtility.getColumnValue("date__fr",dom);
dateTo = genericUtility.getColumnValue("date__to",dom);
System.out.println("dateFr--["+dateFr+"]dateTo--["+dateTo+"]");
dateFrInDate = getStringToDate(dateFr);
dateToInDate = getStringToDate( dateTo);
System.out.println("dateFrInDate--["+dateFrInDate+"]dateToInDate--["+dateToInDate+"]");
if(dateFr == null && dateFr.trim().length() == 0 || dateTo == null && dateTo.trim().length() == 0)
{
retString = itmDBAccess.getErrorString( "date__fr", "VEDATE" , loginCode);
return retString;
}
else if(dateFrInDate.after(dateToInDate))
{
retString = itmDBAccess.getErrorString( "date__fr", "VFRTODATE" , loginCode);
return retString;
}
else
{
datePay = genericUtility.getColumnValue("date__pay", dom);
datePayInDate = getStringToDate(datePay);
if(datePayInDate.before(dateToInDate))
{
retString = itmDBAccess.getErrorString( "date__fr", "VXPAYDATE" , loginCode);
return retString;
}
}
}
else if("vouch_no__fr".equalsIgnoreCase(childNodeName) || "vouch_no__to".equalsIgnoreCase(childNodeName))
{
vouchNoFr = genericUtility.getColumnValue("vouch_no__fr", dom);
vouchNoTo = genericUtility.getColumnValue("vouch_no__to", dom);
if(vouchNoFr != null && vouchNoFr.trim().length() > 0 && vouchNoTo != null && vouchNoTo.trim().length() > 0)
{
if(vouchNoFr.compareTo(vouchNoTo) > 0)
{
retString = itmDBAccess.getErrorString( "", "VMVOU" , loginCode);
return retString;
}
}
}
else if("site_code__fr".equalsIgnoreCase(childNodeName))
{
siteCodeFr = genericUtility.getColumnValue("site_code__fr", dom);
cnt = 0;
sql = "select count(*) from site where site_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCodeFr);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1);
}
System.out.println("cnt from site--["+cnt+"]");
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(cnt == 0)
{
retString = itmDBAccess.getErrorString( "site_code__fr", "VMSITE1" , loginCode);
return retString;
}
else
{
datePay = genericUtility.getColumnValue("date__pay", dom);
datePayInDate = getStringToDate(datePay);
errCode = finCommon.nfCheckPeriod("FIN", datePayInDate, siteCodeFr, conn);
System.out.println("errCode--["+errCode+"]");
if(errCode != null && errCode.trim().length() > 0)
{
retString = itmDBAccess.getErrorString( "site_code__fr", errCode , loginCode);
return retString;
}
}
}
else if("bank_code".equalsIgnoreCase(childNodeName))
{
siteCodeFr = genericUtility.getColumnValue("site_code__fr", dom);
bankCode = genericUtility.getColumnValue("bank_code", dom);
System.out.println("siteCodeFr--["+siteCodeFr+"]--bankCode--["+bankCode+"]");
errCode = finCommon.isBankCode(siteCodeFr, bankCode, "FIN", conn);
System.out.println("errCode--["+errCode+"]");
if(errCode != null && errCode.trim().length() > 0)
{
retString = itmDBAccess.getErrorString( "bank_code", errCode , loginCode);
return retString;
}
}
else if("bank_code__add".equalsIgnoreCase(childNodeName))
{
bankCodeAdd = genericUtility.getColumnValue("bank_code__add", dom);
System.out.println("bankCodeAdd--["+bankCodeAdd+"]");
if(bankCodeAdd != null && bankCodeAdd.trim().length() > 0)
{
siteCodeFr = genericUtility.getColumnValue("site_code__fr", dom);
errCode = finCommon.isBankCode(siteCodeFr, bankCodeAdd, "FIN", conn);
System.out.println("errCode--["+errCode+"]");
if(errCode != null && errCode.trim().length() > 0)
{
retString = itmDBAccess.getErrorString( "bank_code__add", errCode , loginCode);
return retString;
}
}
}
else if("curr_code".equalsIgnoreCase(childNodeName))
{
currCode = genericUtility.getColumnValue("curr_code", dom);
cnt = 0;
sql = "select count(*) from currency where curr_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, currCode);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1);
}
System.out.println("cnt for currency--["+cnt+"]");
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(cnt == 0)
{
retString = itmDBAccess.getErrorString( "curr_code", "VTCURRCD1" , loginCode);
return retString;
}
}
else if("exch_rate".equalsIgnoreCase(childNodeName))
{
String exchangeRate = genericUtility.getColumnValue("exch_rate", dom);
if(exchangeRate == null || exchangeRate.trim().length() == 0)
{
exchangeRate = "0.0";
}
exchRate = Double.parseDouble(exchangeRate);
System.out.println("exchRate----["+exchRate+"]");
if(exchRate == 0.0)
{
retString = itmDBAccess.getErrorString( "exch_rate", "VTEXCHRATE" , loginCode);
return retString;
}
}
else if("site_code__to".equalsIgnoreCase(childNodeName))
{
siteCodeTo = genericUtility.getColumnValue("site_code__to", dom);
System.out.println("siteCodeTo--["+siteCodeTo+"]");
cnt = 0;
sql = "select count(*) from site where site_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCodeTo);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1);
}
System.out.println("cnt from site--["+cnt+"]");
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(cnt == 0)
{
retString = itmDBAccess.getErrorString( "site_code__to", "VTSITECD" , loginCode);
return retString;
}
else
{
datePay = genericUtility.getColumnValue("date__pay", dom);
datePayInDate = getStringToDate(datePay);
errCode = finCommon.nfCheckPeriod("FIN", datePayInDate, siteCodeTo, conn);
System.out.println("errCode--["+errCode+"]");
if(errCode != null && errCode.trim().length() > 0)
{
retString = itmDBAccess.getErrorString( "site_code__to", errCode , loginCode);
return retString;
}
}
}
}
}
}
}
catch(Exception e)
{
System.out.println(":::" + getClass().getSimpleName() + "::"+ e.getMessage());
throw new ITMException(e);
}
return retString;
}
public String itemChanged(String xmlString, String xmlString1, String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException
{
Document dom = null;
Document domhr = null;
Document domAll = null;
String retString="";
try
{
System.out.println("************** Inside itemChanged method ****************");
if(xmlString != null && xmlString.trim().length() > 0)
{
dom = genericUtility.parseString(xmlString);
}
if(xmlString1 != null && xmlString1.trim().length() > 0)
{
domhr = genericUtility.parseString(xmlString1);
}
if(xmlString2 != null && xmlString2.trim().length() > 0)
{
domAll = genericUtility.parseString(xmlString2);
}
retString = itemChanged(dom,domhr,domAll,objContext,currentColumn,editFlag,xtraParams);
System.out.println("retString::::::::::"+retString);
}
catch(Exception e)
{
System.out.println("Exception in itemchange--["+e.getMessage()+"]");
}
return retString;
}
public String itemChanged(Document dom, Document dom1, Document dom2,String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException
{
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null ;
String sql = "";
SimpleDateFormat sdf;
int childNodeListLength = 0;
int currentFormNo=0,ctr=0;
StringBuffer valueXmlString = new StringBuffer();
NodeList parentNodeList = null;
NodeList childNodeList = null;
Node parentNode = null;
Node childNode = null;
String childNodeName = null;
String loginsiteCode = "";
String siteDescr = "";
String varValue = "";
String bankCode = "";
String bankName = "";
String bankCodeAddName = "";
String bankCodeAdd = "";
String tranType = "";
String siteCodeFr = "";
String siteCodeTo = "";
String siteCodeToDescr = "";
String finEntity = "";
String currCode = "";
String currCodeTemp = "";
double maxRate = 0.0;
String datePay = null;
UtilMethods utilMethods = null;
FinCommon finCommon = null;
try
{
conn = getConnection();
utilMethods = new UtilMethods();
finCommon = new FinCommon();
sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
Date date = new Date();
System.out.println(sdf.format(date));
loginsiteCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode");
if(objContext != null && objContext.trim().length()>0)
{
currentFormNo = Integer.parseInt(objContext);
}
System.out.println("[MiscPayAutoIC] [itemChanged] :currentFormNo ....." +currentFormNo);
valueXmlString = new StringBuffer("<?xml version=\"1.0\"?><Root><header><editFlag>");
valueXmlString.append(editFlag).append("</editFlag></header>");
switch(currentFormNo)
{
case 1:
{
parentNodeList = dom.getElementsByTagName("Detail1");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
valueXmlString.append("<Detail1>");
childNodeListLength = childNodeList.getLength();
do
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
ctr ++;
}
while(ctr < childNodeListLength && ! childNodeName.equals(currentColumn));
if("itm_default".equalsIgnoreCase(currentColumn.trim()))
{
valueXmlString.append("<date__pay>").append("<![CDATA["+ sdf.format(date) +"]]>").append("</date__pay>");
valueXmlString.append("<date__fr>").append("<![CDATA["+ sdf.format(date) +"]]>").append("</date__fr>");
valueXmlString.append("<date__to>").append("<![CDATA["+ sdf.format(date) +"]]>").append("</date__to>");
valueXmlString.append("<site_code__fr>").append("<![CDATA["+loginsiteCode+"]]>").append("</site_code__fr>");
valueXmlString.append("<site_code__to>").append("<![CDATA["+loginsiteCode+"]]>").append("</site_code__to>");
//itemChanged( dom, dom1, dom2, objContext, "site_code__to", editFlag, xtraParams) ;
sql = "select descr from site where site_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, loginsiteCode);
rs = pstmt.executeQuery();
if(rs.next())
{
siteDescr = rs.getString("descr");
}
System.out.println("loginsiteCode--["+loginsiteCode+"]--siteDescr--["+siteDescr+"]");
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
valueXmlString.append("<site_code_descr__fr>").append("<![CDATA["+siteDescr+"]]>").append("</site_code_descr__fr>");
valueXmlString.append("<site_code_descr__to>").append("<![CDATA["+siteDescr+"]]>").append("</site_code_descr__to>");
varValue = finCommon.getFinparams("999999", "SITE_CODE_MULTI", conn);
if(varValue == null || varValue.trim().length() == 0 || varValue.equalsIgnoreCase("NULLFOUND"))
{
varValue = "N";
}
if(varValue.equalsIgnoreCase("N"))
{
valueXmlString.append("<site_code__to protect = '1'>").append("<![CDATA["+loginsiteCode+"]]>").append("</site_code__to>");
}
else
{
valueXmlString.append("<site_code__to protect = '0'>").append("<![CDATA["+loginsiteCode+"]]>").append("</site_code__to>");
}
sql = "select A.bank_code ,B.bank_name from site A ,bank B where A.bank_code = B.bank_code AND A.site_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, loginsiteCode);
rs = pstmt.executeQuery();
if(rs.next())
{
bankCode = checkNullAndTrim(rs.getString("bank_code"));
bankName = checkNullAndTrim(rs.getString("bank_name"));
}
System.out.println("bankCode--["+bankCode+"]bankName--["+bankName+"]");
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
valueXmlString.append("<bank_code>").append("<![CDATA["+bankCode+"]]>").append("</bank_code>");
valueXmlString.append("<bank_name>").append("<![CDATA["+bankName+"]]>").append("</bank_name>");
//itemChanged(dom, dom1, dom2,objContext, "bank_code", editFlag, xtraParams);
tranType = finCommon.getFinparams("999999", "TRAN_TYPE_AUTO_PAY", conn);
if(tranType == null || tranType.trim().length() == 0 || tranType.equalsIgnoreCase("NULLFOUND"))
{
tranType = "0";
}
valueXmlString.append("<tran_type>").append("<![CDATA["+tranType+"]]>").append("</tran_type>");
valueXmlString.append("<pay_mode>").append("<![CDATA["+"%"+"]]>").append("</pay_mode>");
valueXmlString.append("<post>").append("<![CDATA["+"N"+"]]>").append("</post>");
valueXmlString.append("<chq_split>").append("<![CDATA["+"N"+"]]>").append("</chq_split>");
}
if("bank_code".equalsIgnoreCase(currentColumn.trim()))
{
bankCode = genericUtility.getColumnValue("bank_code", dom);
sql = "select bank_name from bank where bank_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, bankCode);
rs = pstmt.executeQuery();
if(rs.next())
{
bankName = checkNullAndTrim(rs.getString("bank_name"));
}
System.out.println("bankCode--["+bankCode+"]--bankName["+bankName+"]");
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
valueXmlString.append("<bank_name>").append("<![CDATA["+bankName+"]]>").append("</bank_name>");
}
else if("bank_code__add".equalsIgnoreCase(currentColumn.trim()))
{
bankCodeAdd = genericUtility.getColumnValue("bank_code__add", dom);
sql = "select bank_name from bank where bank_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, bankCodeAdd);
rs = pstmt.executeQuery();
if(rs.next())
{
bankCodeAddName = checkNullAndTrim(rs.getString("bank_name"));
}
System.out.println("bank_name__add--["+bankCodeAdd+"]--bankCodeAddName["+bankCodeAddName+"]");
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
valueXmlString.append("<bank_name__add>").append("<![CDATA["+bankCodeAddName+"]]>").append("</bank_name__add>");
}
else if("site_code__fr".equalsIgnoreCase(currentColumn.trim()))
{
siteCodeFr = genericUtility.getColumnValue("site_code__fr", dom);
sql = "select fin_entity from site where site_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCodeFr);
rs = pstmt.executeQuery();
if(rs.next())
{
finEntity = checkNullAndTrim(rs.getString("fin_entity"));
}
System.out.println("finEntity--["+finEntity+"]--siteCodeFr["+siteCodeFr+"]");
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
sql = "select curr_code from finent where fin_entity = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, finEntity);
rs = pstmt.executeQuery();
if(rs.next())
{
currCodeTemp = checkNullAndTrim(rs.getString("curr_code"));
}
System.out.println("currCode--["+currCode+"]--finEntity["+finEntity+"]");
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
valueXmlString.append("<curr_code>").append("<![CDATA["+currCode+"]]>").append("</curr_code>");
//itemChanged(dom, dom1, dom2,objContext, "curr_code", editFlag, xtraParams);
sql = "select descr from site where site_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCodeFr);
rs = pstmt.executeQuery();
if(rs.next())
{
siteDescr = checkNullAndTrim(rs.getString("descr"));
}
System.out.println("siteCodeFr--["+siteCodeFr+"]--siteDescr["+siteDescr+"]");
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
valueXmlString.append("<site_code_descr__fr>").append("<![CDATA["+siteDescr+"]]>").append("</site_code_descr__fr>");
varValue = finCommon.getFinparams("999999", "SITE_CODE_MULTI", conn);
if(varValue == null || varValue.trim().length() == 0 || varValue.equalsIgnoreCase("NULLFOUND"))
{
varValue = "N";
}
if("N".equalsIgnoreCase(varValue))
{
valueXmlString.append("<site_code__to protect='1'>").append("<![CDATA["+siteCodeFr+"]]>").append("</site_code__to>");
valueXmlString.append("<site_code_descr__to>").append("<![CDATA["+siteDescr+"]]>").append("</site_code_descr__to>");
}
else
{
valueXmlString.append("<site_code__to protect='0'>").append("<![CDATA["+""+"]]>").append("</site_code__to>");
}
}
else if("curr_code".equalsIgnoreCase(currentColumn.trim()))
{
datePay = genericUtility.getColumnValue("date__pay", dom);
System.out.println("datePay---["+datePay+"]");
siteCodeFr = genericUtility.getColumnValue("site_code__fr", dom);
sql = "select curr_code from finent where fin_entity = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, finEntity);
rs = pstmt.executeQuery();
if(rs.next())
{
currCodeTemp = checkNullAndTrim(rs.getString("curr_code"));
}
System.out.println("currCodeTemp--["+currCodeTemp+"]--finEntity["+finEntity+"]");
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
valueXmlString.append("<curr_code>").append("<![CDATA["+currCodeTemp+"]]>").append("</curr_code>");
//itemChanged(dom, dom1, dom2,objContext, "curr_code", editFlag, xtraParams);
sql = "select descr from site where site_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCodeFr);
rs = pstmt.executeQuery();
if(rs.next())
{
siteDescr = checkNullAndTrim(rs.getString("descr"));
}
System.out.println("siteCodeFr--["+siteCodeFr+"]--siteDescr["+siteDescr+"]");
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
currCode = genericUtility.getColumnValue("curr_code", dom);
System.out.println("currCode-----["+currCode+"]");
maxRate = finCommon.getDailyExchRateSellBuy(currCodeTemp, "", siteCodeFr, datePay, "B",conn);
System.out.println("maxRate--["+maxRate+"]");
valueXmlString.append("<exch_rate>").append("<![CDATA["+maxRate+"]]>").append("</exch_rate>");
if(currCode.equalsIgnoreCase(currCodeTemp))
{
valueXmlString.append("<exch_rate protect='1'>").append("<![CDATA["+"1"+"]]>").append("</exch_rate>");
}
else
{
valueXmlString.append("<exch_rate protect='1'>").append("<![CDATA["+"0"+"]]>").append("</exch_rate>");
}
}
else if("site_code__to".equalsIgnoreCase(currentColumn.trim()))
{
siteCodeTo = genericUtility.getColumnValue("site_code__to", dom);
sql = "select descr from site where site_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCodeTo);
rs = pstmt.executeQuery();
if(rs.next())
{
siteCodeToDescr = checkNullAndTrim(rs.getString("descr"));
}
System.out.println("siteCodeTo--["+siteCodeTo+"]--siteCodeToDescr["+siteCodeToDescr+"]");
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
valueXmlString.append("<site_code_descr__to>").append("<![CDATA["+siteCodeToDescr+"]]>").append("</site_code_descr__to>");
}
}
valueXmlString.append("</Detail1>");
break;
}
valueXmlString.append("</Root>");
}
catch(Exception e)
{
System.out.println("Exception from itemchange [MiscPayAuto]----"+e.getMessage());
}
finally
{
try
{
if(conn != null)
{
conn.close();
conn = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
catch(Exception e)
{
System.out.println("Exception in EJB["+ getClass().getSimpleName() + "]::itemChanged::["+ e.getMessage() + "]");
}
}
return valueXmlString.toString();
}
private static String checkNullAndTrim(String input)
{
if (input==null)
{
input="";
}
return input.trim();
}
private java.util.Date getStringToDate(String dateString)
{
java.util.Date date = null;
E12GenericUtility genericUtility = null;
try
{
genericUtility = new E12GenericUtility();
date = new SimpleDateFormat(genericUtility.getApplDateFormat()).parse(dateString);
}
catch(Exception e )
{
System.out.println("Inside Exception in getStringToDate ----["+e.getMessage()+"]");
}
return date;
}
}
package ibase.webitm.ejb.fin.adv;
import javax.ejb.Local;
import ibase.webitm.ejb.ValidatorLocal;
@Local
public interface MiscPayAutoICLocal extends ValidatorLocal
{
}
package ibase.webitm.ejb.fin.adv;
import javax.ejb.Remote;
import ibase.webitm.ejb.ValidatorRemote;
@Remote
public interface MiscPayAutoICRemote extends ValidatorRemote
{
}
This source diff could not be displayed because it is too large. You can view the blob instead.
SET DEFINE OFF;
--FOR WSR COMPONENTS OF AUTOMATIC PAYMENT--
update system_events set service_code = 'poic_default_1' , comp_type = 'WSR' ,comp_name = 'nvo_bo_miscpay_auto' where obj_name ='miscpay_auto' and event_code = 'post_item_change';
update system_events set service_code = 'gd_default_1' , comp_type = 'WSR' ,comp_name = 'MiscPayAutoPrc' where obj_name ='miscpay_auto' and event_code = 'get_data';
update system_events set service_code = 'pr_default_2' , comp_type = 'WSR' ,comp_name = 'MiscPayAutoPrc' where obj_name ='miscpay_auto' and event_code = 'process';
--Added by Anjali R. on[14/06/2018][Start]
--FOR EJB COMPONENTS OF AUTOMATIC PAYMENT--
update system_events set service_code = 'poic_default_ejb' , comp_type = 'EJB' ,comp_name = 'MiscPayAutoIC' where obj_name ='miscpay_auto' and event_code = 'post_item_change';
update system_events set service_code = 'gd_default_2' , comp_type = 'EJB' ,comp_name = 'MiscPayAutoPrc' where obj_name ='miscpay_auto' and event_code = 'get_data';
update system_events set service_code = 'prc_miscpayauto' , comp_type = 'EJB' ,comp_name = 'MiscPayAutoPrc' where obj_name ='miscpay_auto' and event_code = 'process';
Insert into SYSTEM_EVENTS (OBJ_NAME,EVENT_CODE,EVENT_CONTEXT,SERVICE_CODE,METHOD_RULE,OVERWRITE_CORE,CHG_DATE,CHG_USER,CHG_TERM,RESULT_HANDLE,COMP_TYPE,COMP_NAME,COMM_FORMAT) values ('miscpay_auto','pre_validate','1','prv_default_ejb',null,'0',SYSDATE,'BASE','BASE','2','EJB','MiscPayAutoIC',null);
Insert into SYSTEM_EVENT_SERVICES (SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,RETURN_DESCR,RETURN_XFRM,CHG_DATE,CHG_USER,CHG_TERM,SERVICE_NAMESPACE,RES_ELEM,SOAP_ACTION)
values ('prc_miscpayauto','Action To process the Data','http://localhost/axis/services/ProcessService','Base Information','process','String','S',null,null,to_date('21-03-07','DD-MM-RR'),'AVIPRASH ','BASE216',null,null,null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prc_miscpayauto',1,'COMPONENT_TYPE','I','Component Type','C.String',null,to_date('04-12-07','DD-MM-RR'),'AVIPRASH ','BASE216 ','EJB');
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prc_miscpayauto',2,'COMPONENT_NAME','I','Component Name','C.String',null,to_date('04-12-07','DD-MM-RR'),'AVIPRASH ','BASE216 ','MiscPayAutoPrs');
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prc_miscpayauto',3,'XML_DATA_1','I','XML data of form no 1','S',null,to_date('04-12-07','DD-MM-RR'),'AVIPRASH ','BASE216 ',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prc_miscpayauto',4,'XML_DATA_ALL','I','XML data of form no 1','S',null,to_date('04-12-07','DD-MM-RR'),'AVIPRASH ','BASE216 ',null);
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prc_miscpayauto',5,'WINDOW_NAME','I','Window Name','S',null,to_date('04-12-07','DD-MM-RR'),'AVIPRASH ','BASE216 ','w_miscpay_auto');
Insert into SYSTEM_SERVICE_ARGS (SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,ARG_XFRM,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE) values ('prc_miscpayauto',6,'XTRA_PARAMS','I','Extra Arguments','S',null,to_date('04-12-07','DD-MM-RR'),'AVIPRASH ','BASE216 ',null);
Insert into MESSAGES (MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,MSG_TIME,ALARM,ERR_SOURCE,CHG_DATE,CHG_USER,CHG_TERM,OVERRIDE_INPUT,MAIL_OPTION)
values ('VTFIN0001','RECORD PROCESSED.','Selected record has been processed succesfully.','P','Y',null,null,null,SYSDATE,'BASE','BASE',null,null);
COMMIT;
--Added by Anjali R. on[14/06/2018][End]
\ No newline at end of file
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