Commit 6fa77654 authored by sgadve's avatar sgadve

Migration of PB component to Java component for theperk_lapse_proc (Perk Lapse) Form.

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@205214 ce508802-f39f-4f6c-b175-0d175dae99d5
parent af87d2e8
/**
* Added by saiprasad G . for the itemchange and validation of component
*/
package ibase.webitm.ejb.adm;
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 org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import ibase.utility.BaseLogger;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.ITMException;
public class PerkLapsePrcIc extends ValidatorEJB
{
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 errString = "";
try
{
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);
}
errString = wfValData(dom,dom1,dom2,objContext,editFlag,xtraParams);
}
catch(Exception e)
{
BaseLogger.log("0", null, null, "Exception :PerkLapsePrcIc :wfValData(String xmlString):" + e.getMessage() + ":");
errString = genericUtility.createErrorString(e);
e.printStackTrace();
throw new ITMException(e);
}
return errString;
}
public String wfValData(Document dom,Document dom1,Document dom2,String objContext,String editFlag,String xtraParams) throws RemoteException
{
NodeList parentNodeList = null,childNodeList = null;
Node parentNode = null, childNode = null;
String childNodeName="",errString="",userId="";
String sql="",balOpt="",payable="",prdCode="",adCode="";
int currentFormNo=0;
Connection con = null;
PreparedStatement preparedStatement = null;
ResultSet rs= null;
try
{
con = getConnection();
userId = getValueFromXTRA_PARAMS(xtraParams,"loginCode");
if(objContext!=null && objContext.trim().length()>0)
{
currentFormNo = Integer.parseInt(objContext);
}
SimpleDateFormat sdfApplFormat = new SimpleDateFormat(genericUtility.getApplDateFormat());
SimpleDateFormat sdfDBFormat = new SimpleDateFormat(genericUtility.getDBDateFormat());
switch(currentFormNo)
{
case 1:
parentNodeList = dom.getElementsByTagName("Detail1");
int parentNodeListLen = parentNodeList.getLength();
for(int rowCnt=0;rowCnt<parentNodeListLen;rowCnt++)
{
parentNode = parentNodeList.item(rowCnt);
childNodeList =parentNode.getChildNodes();
int childNodeListLength = childNodeList.getLength();
for(int ctr =0; ctr<childNodeListLength;ctr++)
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
System.out.println("childNodeName:"+childNodeName);
if("ad_code".equalsIgnoreCase(childNodeName))
{
adCode=E12GenericUtility.checkNull(genericUtility.getColumnValue("ad_code", dom));
int count =0;
if(adCode.equalsIgnoreCase("") || adCode.trim().length()<0)
{
errString=genericUtility.getErrorString("ad_code", "VPPRKLEPS1", userId);
break;
}
else
{
sql ="select count(*) from allwdedn where ad_code =?";
preparedStatement = con.prepareStatement(sql);
preparedStatement.setString(1, adCode);
rs = preparedStatement.executeQuery();
while(rs.next())
{
count = rs.getInt(1);
System.out.println("count of the ad_code"+count);
}
if(rs!=null)
{
rs.close();
rs = null;
}
if(preparedStatement!=null)
{
preparedStatement.close();
preparedStatement = null;
}
if(count==0)
{
errString=genericUtility.getErrorString("ad_code", "VMADC1", userId);
break;
}
else
{
sql="select bal_opt,payable from allwdedn where ad_code =?";
preparedStatement = con.prepareStatement(sql);
preparedStatement.setString(1, adCode);
rs =preparedStatement.executeQuery();
while(rs.next())
{
balOpt = rs.getString("bal_opt");
payable = rs.getString("payable");
}
if(rs!=null)
{
rs.close();
rs = null;
}
if(preparedStatement!=null)
{
preparedStatement.close();
preparedStatement = null;
}
if("D".equalsIgnoreCase(payable))
{
errString= genericUtility.getErrorString("ad_code", "VTADTYPE", userId);
break;
}
}
}
}
else if("prd_code".equalsIgnoreCase(childNodeName))
{
prdCode= genericUtility.getColumnValue("prd_code", dom);
int prdCodeCnt = 0;
sql="select count(*) from period where code = ?";
preparedStatement = con.prepareStatement(sql);
preparedStatement.setString(1, prdCode);
rs = preparedStatement.executeQuery();
while(rs.next())
{
prdCodeCnt= rs.getInt(1);
}
if(rs!=null)
{
rs.close();
rs = null;
}
if(preparedStatement!=null)
{
preparedStatement.close();
preparedStatement = null;
}
if(prdCodeCnt==0)
{
errString = genericUtility.getErrorString("prd_code", "VMPRD1", userId);
break;
}
}
else if("claim_date".equalsIgnoreCase(childNodeName))
{
String frDateStr = "";
Date frDate = null;
prdCode = genericUtility.getColumnValue("prd_code", dom);
String claimDateStr = genericUtility.getColumnValue("claim_date", dom);
Date claimDate = sdfApplFormat.parse(claimDateStr);
sql = "select fr_date from period where code =?";
preparedStatement = con.prepareStatement(sql);
preparedStatement.setString(1, prdCode);
rs =preparedStatement.executeQuery();
while(rs.next())
{
frDateStr = rs.getString("fr_date");
}
if(rs!=null)
{
rs.close();
rs = null;
}
if(preparedStatement!=null)
{
preparedStatement.close();
preparedStatement = null;
}
if(frDateStr.equals(""))
{
errString = genericUtility.getErrorString("claim_date", "VMPRD1", userId);
break;
}
frDate = sdfDBFormat.parse(frDateStr);
if(claimDate != null && frDate != null)
{
if(claimDate.before(frDate))
{
errString = genericUtility.getErrorString("claim_date", "VPPRKLEPS2", userId);
break;
}
}
}
}
}
}
}
catch(Exception e)
{
System.out.println("Exception"+e);
}
finally
{
try
{
if(rs!=null)
{
rs.close();
rs=null;
}
if(preparedStatement!=null)
{
preparedStatement.close();
preparedStatement=null;
}
if(con!=null)
{
con.close();
con = null;
}
}
catch (Exception e)
{
}
}
return errString.toString();
}
public String itemChanged(String xmlString, String xmlStringHdr, String xmlStringAll, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException
{
Document dom = null, domHdr = null, domAll = null;
String valueXmlString = "";
try {
if (xmlString != null && xmlString.trim().length() > 0)
{
dom = genericUtility.parseString(xmlString);
}
if (xmlStringHdr != null && xmlStringHdr.trim().length() > 0)
{
domHdr = genericUtility.parseString(xmlStringHdr);
}
if (xmlStringAll != null && xmlStringAll.trim().length() > 0)
{
domAll = genericUtility.parseString(xmlStringAll);
}
valueXmlString = itemChanged(dom, domHdr, domAll, objContext, currentColumn, editFlag, xtraParams);
}
catch (Exception e)
{
BaseLogger.log("0", null, null, "Exception :PerkLapsePrcIc :itemChange(String xmlString):" + e.getMessage() + ":");
throw new ITMException(e);
}
return valueXmlString;
}
public String itemChanged(Document dom, Document domHdr , Document domAll ,String objContext,String currentColumn, String editFlag ,String xtraParams) throws RemoteException
{
StringBuffer valueXmlString = new StringBuffer();
String logInEmpCode = "",loginSite="";
Connection con =null;
PreparedStatement pStmt =null;
ResultSet rs =null;
Timestamp currTs =null;
int currentFormNo=0;
Date frDate = null;
try
{
con = getConnection();
if (objContext != null && objContext.trim().length() > 0)
{
currentFormNo = Integer.parseInt(objContext);
}
String sql="" ,siteCodeDescr ="",fullName="",empFname="";
String empLname="",adCodeDescr="",prcGroupFrDescr="",prcGroupToDescr="",dateFrStr="";
logInEmpCode = getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
loginSite = getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode");
System.out.println("[" + this.getClass().getSimpleName() + "] [itemChanged(D)]:currentFormNo:" + currentFormNo);
Date date = new Date();
SimpleDateFormat sdf= new SimpleDateFormat(genericUtility.getApplDateFormat());
String currDateStr = sdf.format(date);
valueXmlString = new StringBuffer("<?xml version=\"1.0\" encoding=''?>\r\n<Root>\r\n<header>\r\n<editFlag>");
valueXmlString.append(editFlag).append("</editFlag>\r\n</header>\r\n");
switch(currentFormNo)
{
case 1:
valueXmlString.append("<Detail1>\r\n");
if("itm_default".equalsIgnoreCase(currentColumn))
{
valueXmlString.append("<resigned><![CDATA[").append("N").append("]]></resigned>");
valueXmlString.append("<claim_date><![CDATA[").append(currDateStr).append("]]></claim_date>");
if(loginSite!=null && loginSite.trim().length()>0)
{
valueXmlString.append("<site_code__from><![CDATA[").append(loginSite).append("]]></site_code__from>");
valueXmlString.append("<site_code__to><![CDATA[").append(loginSite).append("]]></site_code__to>");
sql="select descr from site where site_code=?";
pStmt = con.prepareStatement(sql);
pStmt.setString(1, loginSite);
rs = pStmt.executeQuery();
while(rs.next())
{
siteCodeDescr =rs.getString("descr");
}
if(rs!=null)
{
rs.close();
rs = null;
}
if(pStmt!=null)
{
pStmt.close();
pStmt = null;
}
valueXmlString.append("<site_descr__from><![CDATA[").append(siteCodeDescr).append("]]></site_descr__from>");
valueXmlString.append("<site_descr__to><![CDATA[").append(siteCodeDescr).append("]]></site_descr__to>");
}
//this mlevl is not getting from anywhere
/*if mlevl > 1 then
gbf_itemchg_modifier_ds (dw_currobj,"site_code__from","protect","1")
gbf_itemchg_modifier_ds (dw_currobj,"site_code__to","protect","1")
end if*/
}
else if("site_code__from".equalsIgnoreCase(currentColumn))
{
sql="select descr from site where site_code=?";
pStmt = con.prepareStatement(sql);
pStmt.setString(1, loginSite);
rs = pStmt.executeQuery();
while(rs.next())
{
siteCodeDescr =rs.getString("descr");
}
if(rs!=null)
{
rs.close();
rs = null;
}
if(pStmt!=null)
{
pStmt.close();
pStmt = null;
}
valueXmlString.append("<site_descr__from><![CDATA[").append(siteCodeDescr).append("]]></site_descr__from>");
}
else if("site_code__to".equalsIgnoreCase(currentColumn))
{
sql="select descr from site where site_code=?";
pStmt = con.prepareStatement(sql);
pStmt.setString(1, loginSite);
rs = pStmt.executeQuery();
while(rs.next())
{
siteCodeDescr =rs.getString("descr");
}
if(rs!=null)
{
rs.close();
rs = null;
}
if(pStmt!=null)
{
pStmt.close();
pStmt = null;
}
valueXmlString.append("<site_descr__to><![CDATA[").append(siteCodeDescr).append("]]></site_descr__to>");
}
else if("emp_code__from".equalsIgnoreCase(currentColumn))
{
String empCode=genericUtility.getColumnValue("emp_code__from", dom);
sql="select emp_fname, emp_lname from employee where emp_code=?";
pStmt = con.prepareStatement(sql);
pStmt.setString(1, empCode);
rs = pStmt.executeQuery();
while(rs.next())
{
empFname =rs.getString("emp_fname");
empLname =rs.getString("emp_lname");
fullName = empFname+" "+empLname;
}
if(rs!=null)
{
rs.close();
rs = null;
}
if(pStmt!=null)
{
pStmt.close();
pStmt = null;
}
valueXmlString.append("<emp_name__from><![CDATA[").append(fullName).append("]]></emp_name__from>");
valueXmlString.append("<emp_code__to><![CDATA[").append(empCode).append("]]></emp_code__to>");
valueXmlString.append("<emp_name__to><![CDATA[").append(fullName).append("]]></emp_name__to>");
}
else if("emp_code__to".equalsIgnoreCase(currentColumn))
{
String empCodeTo=genericUtility.getColumnValue("emp_code__to", dom);
sql="select emp_fname, emp_lname from employee where emp_code=?";
pStmt = con.prepareStatement(sql);
pStmt.setString(1, empCodeTo);
rs = pStmt.executeQuery();
while(rs.next())
{
empFname =rs.getString("emp_fname");
empLname =rs.getString("emp_lname");
fullName = empFname+" "+empLname;
}
if(rs!=null)
{
rs.close();
rs = null;
}
if(pStmt!=null)
{
pStmt.close();
pStmt = null;
}
valueXmlString.append("<emp_name__to><![CDATA[").append(fullName).append("]]></emp_name__to>");
}
else if("ad_code".equalsIgnoreCase(currentColumn))
{
String adCode = genericUtility.getColumnValue("ad_code", dom);
sql="select descr from allwdedn where ad_code =?";
pStmt =con.prepareStatement(sql);
pStmt.setString(1, adCode);
rs =pStmt.executeQuery();
while(rs.next())
{
adCodeDescr = rs.getString("descr");
}
if(rs!=null)
{
rs.close();
rs = null;
}
if(pStmt!=null)
{
pStmt.close();
pStmt = null;
}
valueXmlString.append("<ad_descr><![CDATA[").append(adCodeDescr).append("]]></ad_descr>");
}
else if("proc_group__from".equalsIgnoreCase(currentColumn))
{
String procGroupFr = genericUtility.getColumnValue("proc_group__from", dom);
sql="select descr from gencodes where fld_name=? and fld_value = ?";
pStmt = con.prepareStatement(sql);
pStmt.setString(1, "PROC_GROUP");
pStmt.setString(2, procGroupFr);
rs = pStmt.executeQuery();
while(rs.next())
{
prcGroupFrDescr=rs.getString("descr");
}
if(rs!=null)
{
rs.close();
rs = null;
}
if(pStmt!=null)
{
pStmt.close();
pStmt = null;
}
valueXmlString.append("<proc_group__fr_t><![CDATA[").append(prcGroupFrDescr).append("]]></proc_group__fr_t>");
}
else if("proc_group__to".equalsIgnoreCase(currentColumn))
{
String procGroupTo = genericUtility.getColumnValue("proc_group__to", dom);
sql="select descr from gencodes where fld_name=? and fld_value = ?";
pStmt = con.prepareStatement(sql);
pStmt.setString(1, "PROC_GROUP");
pStmt.setString(2, procGroupTo);
rs = pStmt.executeQuery();
while(rs.next())
{
prcGroupToDescr=rs.getString("descr");
}
if(rs!=null)
{
rs.close();
rs = null;
}
if(pStmt!=null)
{
pStmt.close();
pStmt = null;
}
valueXmlString.append("<proc_grp__to_t><![CDATA[").append(prcGroupToDescr).append("]]></proc_grp__to_t>");
}
else if("prd_code".equalsIgnoreCase(currentColumn))
{
String prdCode= genericUtility.getColumnValue("prd_code", dom);
sql = "select fr_date from period where code =?";
pStmt = con.prepareStatement(sql);
pStmt.setString(1, prdCode);
rs = pStmt.executeQuery();
while(rs.next())
{
Timestamp dateFr= rs.getTimestamp("fr_date");
dateFrStr = sdf.format(dateFr);
System.out.println("dateFrStr:"+dateFrStr);
}
if(rs!=null)
{
rs.close();
rs = null;
}
if(pStmt!=null)
{
pStmt.close();
pStmt = null;
}
valueXmlString.append("<date_from><![CDATA[").append(dateFrStr).append("]]></date_from>");
}
valueXmlString.append("</Detail1>\r\n");
valueXmlString.append("</Root>\r\n");
}
}
catch(Exception e)
{
BaseLogger.log("0", null, null, "Exception :PerkLapsePrcIc :ItemChange Details(String xmlString):" + e.getMessage() + ":");
}
finally
{
try
{
if(rs!=null)
{
rs.close();
rs = null;
}
if(pStmt!=null)
{
pStmt.close();
pStmt = null;
}
if(con!=null)
{
con.close();
con = null;
}
}
catch(Exception e)
{
BaseLogger.log("0", null, null, "Exception :PerkLapsePrcIc :connection close():" + e.getMessage() + ":");
}
}
return valueXmlString.toString();
}
}
/**
*
* Added by saiprasad G. for the getting the data and process data
*/
package ibase.webitm.ejb.adm.adv;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import ibase.utility.BaseLogger;
import ibase.utility.E12GenericUtility;
import ibase.utility.UserInfoBean;
import ibase.webitm.ejb.ProcessEJB;
import ibase.webitm.ejb.adm.AdmCommon;
import ibase.webitm.utility.ITMException;
import ibase.webitm.utility.TransIDGenerator;
public class PerkLapsePrc extends ProcessEJB
{
E12GenericUtility genericUtility = new E12GenericUtility();
public String getData(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException
{
Document headerDom = null;
Document detailDom = null;
String rtrStr ="";
try
{
if(xmlString != null && xmlString.trim().length()!=0)
{
headerDom = genericUtility.parseString(xmlString);
}
if(xmlString2 != null && xmlString2.trim().length()!=0)
{
detailDom = genericUtility.parseString(xmlString2);
}
rtrStr = getData(headerDom, detailDom, windowName, xtraParams);
}
catch (Exception e)
{
System.out.println("Exception :PerkLapsePrc :getData(String xmlString, String xmlString2, String windowName, String xtraParams):" + e.getMessage() + ":");
rtrStr = e.getMessage();
}
return rtrStr;
}
public String getData(Document headerDom, Document detailDom, String windowName, String xtraParams) throws RemoteException,ITMException
{
StringBuilder selectSql = new StringBuilder();
String resultStr ="";
AdmCommon admCommon = new AdmCommon();
ResultSet rs = null;
PreparedStatement pstmt = null;
Connection conn = null;
try
{
String dateFr ="",claimDate="",empCodeFr="",empCodeTo="",adCode="",sitefr="";
String siteTo="",procGrpFr="",procGrpTo="",resigned="",envName="",exipry="N";
conn = getConnection();
String userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginCode");
SimpleDateFormat sdfApplFormat = new SimpleDateFormat(genericUtility.getApplDateFormat());
dateFr = E12GenericUtility.checkNull(genericUtility.getColumnValue("date_from", headerDom));
claimDate= E12GenericUtility.checkNull(genericUtility.getColumnValue("claim_date", headerDom));
empCodeFr = E12GenericUtility.checkNull(genericUtility.getColumnValue("emp_code__from", headerDom));
empCodeTo = E12GenericUtility.checkNull(genericUtility.getColumnValue("emp_code__to", headerDom));
adCode = E12GenericUtility.checkNull(genericUtility.getColumnValue("ad_code", headerDom));
sitefr = E12GenericUtility.checkNull(genericUtility.getColumnValue("site_code__from", headerDom));
siteTo = E12GenericUtility.checkNull(genericUtility.getColumnValue("site_code__to", headerDom));
procGrpFr = E12GenericUtility.checkNull(genericUtility.getColumnValue("proc_group__from", headerDom));
procGrpTo = E12GenericUtility.checkNull(genericUtility.getColumnValue("proc_group__to", headerDom));
resigned = E12GenericUtility.checkNull(genericUtility.getColumnValue("resigned", headerDom));
StringBuffer valueXmlString = new StringBuffer("<?xml version=\"1.0\" encoding='UTF-8'?>\r\n<DocumentRoot>\r\n<description>Datawindow Root</description>\r\n<group0>\r\n<description>Group0 description</description>\r\n<Header0>\r\n<description>Header0 members</description>\r\n");
Date startDate = null, endDate = null,expDate = null;
String startDateStr ="",endDateStr="",expDateStr="";
if ("Y".equalsIgnoreCase(resigned))
{
resigned = "S";
}
else
{
resigned = " ";
}
/*ls_env_name = upper(trim(ls_ad_code)) + "_EXPIRY"
ls_expiry = upper(trim(gf_getenv('999999', ls_env_name)))*/
if(empCodeFr.length()<0)
{
empCodeFr="0";
}
if(empCodeTo.length()<0)
{
empCodeTo="ZZZZZZZZZZ";
}
if(sitefr.length()<0)
{
sitefr="0";
}
if(siteTo.length()<0)
{
siteTo="ZZZZZ";
}
if(procGrpFr.length()<0)
{
procGrpFr="0";
}
if(procGrpTo.length()<0)
{
procGrpTo="ZZZZZ";
}
if(empCodeFr.length()<0)
{
empCodeFr="0";
}
int domID =1;
envName =adCode.trim().toUpperCase()+ "_EXPIRY";
exipry = admCommon.getEnv("999999", envName, conn);
BaseLogger.log("2", null, null, "exipry:"+exipry);
selectSql.append("SELECT ALLOWDEDN_BAL.EMP_CODE,AD_CODE,START_DATE,END_DATE,EXP_DATE,AMT_BAL,EMP_FNAME,EMP_LNAME");
selectSql.append(",PAY_SITE,EMPLOYEE.CADRE,EMPLOYEE.GRADE FROM ALLOWDEDN_BAL,EMPLOYEE");
selectSql.append(" WHERE ALLOWDEDN_BAL.EMP_CODE = EMPLOYEE.EMP_CODE AND ALLOWDEDN_BAL.EMP_CODE BETWEEN ? AND ?");
selectSql.append(" AND AD_CODE=? AND START_DATE <= ? AND AMT_BAL <> 0 AND REF_TYPE = 'K' AND PAY_SITE BETWEEN ? AND ? AND PROC_GROUP BETWEEN ? AND ?");
selectSql.append("AND NVL(STATUS , ' ') = ? AND (EXP_DATE IS NULL OR EXP_DATE <= ?) ORDER BY ALLOWDEDN_BAL.EMP_CODE");
pstmt = conn.prepareStatement(selectSql.toString());
pstmt.setString(1, empCodeFr);
pstmt.setString(2, empCodeTo);
pstmt.setString(3, adCode);
pstmt.setString(4, dateFr);
pstmt.setString(5, sitefr);
pstmt.setString(6, siteTo);
pstmt.setString(7, procGrpFr);
pstmt.setString(8, procGrpTo);
pstmt.setString(9, resigned);
pstmt.setString(10, dateFr);
rs = pstmt.executeQuery();
while(rs.next())
{
startDate = rs.getDate("start_date");
endDate = rs.getDate("end_date");
expDate = rs.getDate("exp_date");
if (startDate != null)
{
startDateStr = E12GenericUtility.checkNull(sdfApplFormat.format(startDate));
}
if (endDate != null)
{
endDateStr = E12GenericUtility.checkNull(sdfApplFormat.format(endDate));
}
if (expDate != null)
{
expDateStr = E12GenericUtility.checkNull(sdfApplFormat.format(expDate));
}
String paySite = rs.getString("pay_site");
if (paySite.equals("") || paySite.trim().length() == 0)
{
String errorCode = genericUtility.getErrorString("pay_site", "VMSITE1", userId);
valueXmlString.append(errorCode);
}
valueXmlString.append("<Detail2 domID='" + domID + "' >\r\n");
valueXmlString.append("<attribute updateFlag='N' selected='N' />\r\n");
valueXmlString.append("<emp_code><![CDATA[").append(E12GenericUtility.checkNull(rs.getString("emp_code"))).append("]]></emp_code>\r\n");
valueXmlString.append("<emp_fname><![CDATA[").append(E12GenericUtility.checkNull(rs.getString("emp_fname"))).append("]]></emp_fname>\r\n");
valueXmlString.append("<emp_lname><![CDATA[").append(E12GenericUtility.checkNull(rs.getString("emp_lname"))).append("]]></emp_lname>\r\n");
valueXmlString.append("<ad_code><![CDATA[").append(E12GenericUtility.checkNull(rs.getString("ad_code"))).append("]]></ad_code>\r\n");
valueXmlString.append("<start_date><![CDATA[").append(startDateStr).append("]]></start_date>\r\n");
valueXmlString.append("<end_date><![CDATA[").append(endDateStr).append("]]></end_date>\r\n");
valueXmlString.append("<bal_amt><![CDATA[").append(E12GenericUtility.checkNull(rs.getString("amt_bal"))).append("]]></bal_amt>\r\n");
if (exipry.equalsIgnoreCase("Y"))
{
valueXmlString.append("<claim_amt protect= \"1\"><![CDATA[").append(E12GenericUtility.checkNull(rs.getString("amt_bal"))).append("]]></claim_amt>\r\n");
}
else
{
valueXmlString.append("<claim_amt protect= \"0\"><![CDATA[").append(E12GenericUtility.checkNull(rs.getString("amt_bal"))).append("]]></claim_amt>\r\n");
}
valueXmlString.append("<expiry_date><![CDATA[").append(expDateStr).append("]]></expiry_date>\r\n");
valueXmlString.append("<tran_date><![CDATA[").append(E12GenericUtility.checkNull(claimDate)).append("]]></tran_date>\r\n");
valueXmlString.append("</Detail2>\r\n");
domID++;
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
valueXmlString.append("</Header0>\r\n");
valueXmlString.append("</group0>\r\n");
valueXmlString.append("</DocumentRoot>\r\n");
resultStr = valueXmlString.toString();
System.out.println("resultStr:" + resultStr);
}
catch (Exception e)
{
BaseLogger.log("0", null, null, e);
}
finally
{
try
{
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if (conn != null)
{
conn.close();
conn = null;
}
}
catch (Exception e)
{
BaseLogger.log("0", null, null, e);
}
}
return resultStr;
}
public String process(String xmlString, String xmlString1, String objContext, String xtraParams) throws RemoteException, ITMException
{
Document detailDom = null;
Document headerDom = null;
String retStr = "";
try
{
if (xmlString != null && xmlString.trim().length() != 0)
{
headerDom = genericUtility.parseString(xmlString);
}
if (xmlString1 != null && xmlString1.trim().length() != 0)
{
detailDom = genericUtility.parseString(xmlString1);
}
retStr = process(headerDom, detailDom, objContext, xtraParams);
}
catch (Exception e)
{
BaseLogger.log("0", null, null, "Exception in process method"+e);
}
return retStr;
}
public String process(Document headerDom, Document detailDom, String objContext, String xtraParams) throws RemoteException, ITMException
{
String retStr = "";
Connection con = null;
try
{
if (con == null)
{
con = getConnection();
con.setAutoCommit(false);
}
retStr = processData(headerDom, detailDom, objContext, xtraParams, con);
}
catch (Exception e)
{
BaseLogger.log("0", null, null, e);
}
finally
{
try
{
con.close();
con = null;
}
catch (Exception e)
{
BaseLogger.log("0", null, null, e);
}
}
return retStr;
}
public String processData(Document headerDom, Document detailDom, String objContext, String xtraParams,Connection con)
{
PreparedStatement pStmt = null;
ResultSet rs = null;
String sql = "", errorString = "", childNodeName = "";
NodeList parentNodeList = null,childNodeList = null;
Node parentNode = null, childNode = null;
try
{
String empCode = "", adCode = "", claimDate = "", balAmt = "", claimAmt = "", startDate = "", endDate = "";
String userId = "", payRollVoucher = "",payRoll="",chgTerm="",chgDate="",keyString="";
String empCodeStr = "", adCodeStr = "", startDateStr = "", endDateStr = "", paySite = "";
String finent = "",deptCode = "", payMode = "", currCode = "", bankCode = "";
double loanAdjust = 0, paidAmt = 0, claimAmtDble = 0, balAmtDbl = 0;
SimpleDateFormat sdfApplFormat = new SimpleDateFormat(genericUtility.getApplDateFormat());
userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginCode");
chgDate = sdfApplFormat.format(new Date());
UserInfoBean userInfoBean = getUserInfo();
chgTerm = userInfoBean.getRemoteHost();
parentNodeList = detailDom.getElementsByTagName("Detail2");
int parentNodeListLen = parentNodeList.getLength();
for(int rowCnt=0;rowCnt<parentNodeListLen;rowCnt++)
{
parentNode = parentNodeList.item(rowCnt);
childNodeList =parentNode.getChildNodes();
int childNodeListLength = childNodeList.getLength();
for(int ctr =0; ctr<childNodeListLength;ctr++)
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
BaseLogger.log("3", userInfoBean, null, "####childNodeName:"+childNodeName);
if("emp_code".equalsIgnoreCase(childNodeName))
{
empCode = E12GenericUtility.checkNull(childNode.getFirstChild().getNodeValue());
}
else if("ad_code".equalsIgnoreCase(childNodeName))
{
adCode = E12GenericUtility.checkNull(childNode.getFirstChild().getNodeValue());
}
else if("tran_date".equalsIgnoreCase(childNodeName))
{
claimDate = E12GenericUtility.checkNull(childNode.getFirstChild().getNodeValue());
}
else if("bal_amt".equalsIgnoreCase(childNodeName))
{
balAmt = E12GenericUtility.checkNull(childNode.getFirstChild().getNodeValue());
}
else if("claim_amt".equalsIgnoreCase(childNodeName))
{
claimAmt = E12GenericUtility.checkNull(childNode.getFirstChild().getNodeValue());
}
else if("start_date".equalsIgnoreCase(childNodeName))
{
startDate = E12GenericUtility.checkNull(childNode.getFirstChild().getNodeValue());
}
else if("end_date".equalsIgnoreCase(childNodeName))
{
endDate = E12GenericUtility.checkNull(childNode.getFirstChild().getNodeValue());
}
}
claimAmtDble = Double.parseDouble(claimAmt);
paidAmt = claimAmtDble - loanAdjust;
balAmtDbl = Double.parseDouble(balAmt);
if (balAmtDbl < 0)
{
if (claimAmtDble > 0 || Math.abs(claimAmtDble) > Math.abs(balAmtDbl))
{
errorString = genericUtility.getErrorString("claim_amt", "VTCLAIMAMT", userId);
return errorString;
}
}
else
{
if( (claimAmtDble < 0 || claimAmtDble > balAmtDbl))
{
System.out.println("balAmt123:"+balAmt);
errorString = genericUtility.getErrorString("claim_amt", "VTCLAIMAMT", userId);
return errorString;
}
}
sql="SELECT KEY_STRING FROM TRANSETUP WHERE UPPER(TRAN_WINDOW) = ?";
pStmt = con.prepareStatement(sql);
pStmt.setString(1, "T_EMP_ADLAPSE");
rs = pStmt.executeQuery();
while(rs.next())
{
keyString = rs.getString("key_string");
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pStmt != null)
{
pStmt.close();
pStmt = null;
}
payRollVoucher = "L"; // Set payroll_voucher to 'L' (i.e. lapse
sql = "SELECT EMP_CODE, AD_CODE, START_DATE, END_DATE, AMT_BAL FROM ALLOWDEDN_BAL WHERE EMP_CODE =? AND AD_CODE=? AND START_DATE =?"
+ "AND END_DATE= ?";
pStmt = con.prepareStatement(sql);
pStmt.setString(1, empCode);
pStmt.setString(2, adCode);
pStmt.setString(3, startDate);
pStmt.setString(4, endDate);
rs = pStmt.executeQuery();
while (rs.next())
{
empCodeStr = rs.getString("emp_code");
adCodeStr = rs.getString("ad_code");
startDateStr = rs.getString("start_date");
endDateStr = rs.getString("end_date");
balAmtDbl = rs.getDouble("amt_bal");
if (balAmtDbl < 0)
{
if (claimAmtDble > 0 || Math.abs(claimAmtDble) > Math.abs(balAmtDbl))
{
errorString = genericUtility.getErrorString("claim_amt", "VTCLAIMAMT", userId);
return errorString;
}
}
else
{
if (claimAmtDble < 0 || claimAmtDble > balAmtDbl)
{
errorString = genericUtility.getErrorString("claim_amt", "VTCLAIMAMT", userId);
return errorString;
}
}
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pStmt != null)
{
pStmt.close();
pStmt = null;
}
sql = "SELECT PAY_SITE, SITE.FIN_ENTITY, DEPT_CODE, PAY_MODE, CURR_CODE, EMPLOYEE.BANK_CODE "
+ "FROM EMPLOYEE, SITE, FINENT WHERE EMPLOYEE.PAY_SITE = SITE.SITE_CODE AND"
+ " SITE.FIN_ENTITY = FINENT.FIN_ENTITY AND EMP_CODE =?";
pStmt = con.prepareStatement(sql);
pStmt.setString(1, empCode);
rs = pStmt.executeQuery();
while (rs.next())
{
paySite = rs.getString("pay_site");
finent = rs.getString("fin_entity");
deptCode = rs.getString("dept_code");
payMode = rs.getString("pay_mode");
currCode = rs.getString("curr_code");
bankCode = rs.getString("bank_code");
errorString = claimProcess(adCodeStr, empCodeStr, startDate, endDate, claimAmtDble, xtraParams, con);
if(errorString.length()>0)
{
return errorString;
}
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pStmt != null)
{
pStmt.close();
pStmt = null;
}
TransIDGenerator tranIdGen = new TransIDGenerator(headerDom, userId , userInfoBean.getTransDB());
String tranId = tranIdGen.generateTranSeqID("ELAPSE", "TRAN_ID", keyString , con);
sql="INSERT INTO EMP_ADCLAIMHDR (TRAN_ID, TRAN_DATE, EMP_CODE, CLAIM_AMT, LOAN_ADJAMT," +
"PAYROLL_VOUCHER, PRD_CODE__PAYROLL, CHG_DATE, CHG_USER, CHG_TERM, AD_CODE ,CONFIRMED)" +
"VALUES(?,?,?,?,?,?,?,?,?,?,?,?)";
pStmt = con.prepareStatement(sql);
pStmt.setString(1, tranId);
pStmt.setString(2, claimDate);
pStmt.setString(3, empCode);
pStmt.setDouble(4, claimAmtDble);
pStmt.setDouble(5, loanAdjust);
pStmt.setString(6, payRollVoucher);
pStmt.setString(7, payRoll);
pStmt.setString(8, chgDate);
pStmt.setString(9, userId);
pStmt.setString(10, chgTerm);
pStmt.setString(11, adCode);
pStmt.setString(12, "Y");
int empAdClaimHdrcnt = pStmt.executeUpdate();
if(empAdClaimHdrcnt>0)
{
con.commit();
}
else
{
con.rollback();
}
if (pStmt != null)
{
pStmt.close();
pStmt = null;
}
sql="INSERT INTO EMP_ADCLAIM(TRAN_ID, TRAN_DATE , PAYROLL_VOUCHER, EMP_CODE, AD_CODE, EFF_DATE, BAL_AMT"
+ ",CLAIM_AMT,CHG_DATE, CHG_USER, CHG_TERM ) VALUES (?,?,?,?,?,?,?,?,?,?,?)";
pStmt = con.prepareStatement(sql);
pStmt.setString(1, tranId);
pStmt.setString(2, claimDate);
pStmt.setString(3, payRollVoucher);
pStmt.setString(4, empCode);
pStmt.setString(5, adCode);
pStmt.setString(6, startDate);
pStmt.setDouble(7, balAmtDbl);
pStmt.setDouble(8, claimAmtDble);
pStmt.setString(9, chgDate);
pStmt.setString(10, userId);
pStmt.setString(11, chgTerm);
int empAdClaim = pStmt.executeUpdate();
if(empAdClaim>0)
{
con.commit();
}
else
{
con.rollback();
}
if (pStmt != null)
{
pStmt.close();
pStmt = null;
}
}
if(errorString.trim().length()>0)
{
return errorString;
}
else
{
errorString = genericUtility.getErrorString("", "VPPRKLEPS9", userId);
}
}
catch (Exception e)
{
BaseLogger.log("0", null, null, "Exception in processData details"+e);
}
finally
{
try
{
if (rs != null)
{
rs.close();
rs = null;
}
if (pStmt != null)
{
pStmt.close();
pStmt = null;
}
if (con != null)
{
con.close();
con = null;
}
}
catch (Exception e)
{
BaseLogger.log("0", null, null, "Exception in processData"+e);
}
}
return errorString;
}
public String claimProcess(String adCode,String empCode,String startDate,String endDate,double claimAmt,String xtraParams,Connection con)
{
String errorString ="",sql="",userId="";
double balAmtDbl=0,amtAdjDbl=0;
PreparedStatement pStmt = null;
ResultSet rs = null;
try
{
userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
sql="SELECT AMT_BAL,AMT_ADJ FROM ALLOWDEDN_BAL WHERE EMP_CODE=? AND AD_CODE=? AND START_DATE=? AND END_DATE=?";
pStmt = con.prepareStatement(sql);
pStmt.setString(1, empCode);
pStmt.setString(2, adCode);
pStmt.setString(3, startDate);
pStmt.setString(4, endDate);
rs=pStmt.executeQuery();
while(rs.next())
{
balAmtDbl = rs.getDouble("amt_bal");
amtAdjDbl = rs.getDouble("amt_adj");
}
if(rs!=null)
{
rs.close();
rs = null;
}
if(pStmt!=null)
{
pStmt.close();
pStmt = null;
}
sql="UPDATE ALLOWDEDN_BAL SET AMT_BAL=?,AMT_ADJ=? WHERE EMP_CODE=? AND AD_CODE=? AND START_DATE=? AND END_DATE=?";
pStmt = con.prepareStatement(sql);
pStmt.setDouble(1, balAmtDbl-claimAmt);
pStmt.setDouble(2, amtAdjDbl+claimAmt);
pStmt.setString(3, empCode);
pStmt.setString(4, adCode);
pStmt.setString(5, startDate);
pStmt.setString(6, endDate);
int noRowsUpdate = pStmt.executeUpdate();
if(noRowsUpdate!=1)
{
errorString = genericUtility.getErrorString("", "DS000NR",userId );
con.rollback();
}
else if(noRowsUpdate>0)
{
con.commit();
BaseLogger.log("3", null, null, "Data update"+noRowsUpdate);
}
}
catch(Exception e)
{
BaseLogger.log("0", null, null, "Exception :PerkLapsePrc :processData():" + e.getMessage() + ":");
}
finally
{
try
{
if(rs!=null)
{
rs.close();
rs = null;
}
if(pStmt!=null)
{
pStmt.close();
pStmt = null;
}
}
catch(Exception e)
{
System.out.println(e);
}
}
BaseLogger.log("3", null, null, "errorString in claimprocess method:"+errorString);
return errorString;
}
}
---------------------------Perk Lapse process [START]-----------------------------------------------------------
Insert into TRANSETUP (TRAN_WINDOW,SAVE_FLAG,VAL_FLAG,KEY_FLAG,KEY_STRING,UDF_1,UDF_2,UDF_3,UDF_4,UDF_5,REPEATE_ADD,CHG_DATE,CHG_USER,CHG_TERM,EDI_OPTION,SITE_ACC_COL,CONFIRM_COL,CONFIRM_VAL,REPEAT_ADD_DET,REPEATADDDET,LOAD_MODE,AUTO_CONFIRM,LEDG_POST_CONF,CHG_DATE_ON_CONF,TRAN_ID_COL,MAIL_OPTION,CONFIRM_MODE,GARBAGE_OPT,VAL_FLAG_EDI,VERIFY_PASSWORD,CUST_ACC_COL,SALES_PERS_ACC_COL,SUPP_ACC_COL,ITEM_SER_ACC_CODE,EMP_ACC_COL,ITEM_SER_ACC_COL,WORKFLOW_OPT,TABLE_NAME,APPLICATION,TABLE_DESC,TRAN_DATE_COL,TRAN_ID__FROM,TRAN_ID__TO,TABLE_NAME_DET1,TABLE_NAME_DET2,TABLE_NAME_DET3,MULTITIRE_OPT,REF_SER,VIEW_MODE,TAX_FORMS,SIGN_STATUS,USER_TRAN_WINDOW,CUSTOM_PREVIEW_OBJ,IGNOREERRLIST_ONLOAD,CHILDDATA_ARGOPT,EDIT_TMPLT,WRKFLW_INIT,EDITTAX,FORMAL_ARGS,AUDIT_TRAIL_OPT,EDIT_OPT,CACHE_OPT,OPTIMIZE_MODE,EDIT_EXPR,RATE_COL,QTY_COL,EDIT_EXPR_INP,RCP_CACHE_STATUS,PRINT_CONTROL,TRANSFER_MODE,PROFILE_ID__RES,TRAN_COMPL_MSG,PERIOD_OPTION,WRKFLW_PRIORITY,EXEC_TYPE,DISP_META_DATA,ALLOW_ATTACH,START_FORM,ISATTACHMENT,HEADER_FORM_NO,CONFIRM_DATE_COL,CONFIRM_BY_COL,MSG_ONSAVE,WF_STATUS,RESTART_FORM,CMS_PATH,BROW_DATA_DEF,DEF_VIEW,VIEW_OPTS,ISGWTINITIATED,DEFAULT_DATA_ROW,IN_WF_VAL,IN_WF_COL,CANCEL_VAL,CANCEL_COL,THUMB_ALT_COL,THUMB_IMAGE_COL,THUMB_OBJ,ATTACH_COUNT_MIN,FUNCTION_TYPE,COMPL_ACTION,DEFAULT_EDITOR,MSG_NO,OBJ_TYPE,STATUS_COL,ENABLE_EDITOR,OFFLINE_OPT,CLOSE_COL,CLOSE_VAL) values ('w_perk_lapse_proc','2','2','M','seq10',null,null,null,null,null,'N',to_date('09-02-15','DD-MM-RR'),'BASE ','BASE ','0',null,null,null,'N','N',null,null,null,null,null,'0','0',null,null,null,null,null,null,null,null,null,'0',null,'ADM',null,null,null,null,null,null,null,'0',null,'F',null,null,null,null,null,null,null,null,null,null,'0',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,'Y',null,null,null,null,null,null,null,null,null,null,null,null,null,null,'compact',null,'C',null,null,null,null,null);
Insert into ITM2MENU (APPLICATION,LEVEL_1,LEVEL_2,LEVEL_3,LEVEL_4,LEVEL_5,WIN_NAME,DESCR,COMMENTS,MENU_PATH,ICON_PATH,CLOSE_ICON,OPEN_ICON,OBJ_TYPE,CHG_DATE,CHG_TERM,CHG_USER,MOB_DEPLOY,DEFAULT_STATE,DEF_ACTION,MOB_DEPLY,ENT_TYPES) values ('ADP',4,8,4,0,0,'w_perk_lapse_proc','Perk Lapse','Perk Lapse','ADP.4.8.4.0.0','process.png',null,null,'P',null,null,null,'B',null,null,'B','0 ');
Insert into OBJ_FORMS (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,AUTO_ACCEPT_SCAN,SCAN_FLAG,SCAN_METADATA,PROPERTY_INFO,SCAN_DELIMITER,COLUMN_ON_SAVE,AFTER_SAVE,EXT_SETUP,EXT_METADATA,EXT_COM,AUTO_ACCEPT_WEIGHDATA,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,QTY_COL,RATE_COL,ASSISTED_MODE,STORAGE_KEY_METADATA,SELECTION_MODE,DEFAULT_VIEW,AUTO_ADDON_ENTRY,DUPLICATE_ADD,DEFAULT_ROW_CNT,FREEZE_COL_POS,IS_MANDATORY,TRAN_ID_COL,SELECTION_OPT,KEY_INFO,THUMB_OBJ,THUMB_IMAGE_COL,THUMB_ALT_COL,FORM_NAME,FORM_ICON,FORM_VIEW_OPTS,X_COLUMN,Y_COLUMN,ACTION_ARG) values ('w_perk_lapse_proc','Perk Lapse','d_perk_lapse_proc_filt','d_perk_lapse_proc_data',null,null,null,null,'1','F',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,'DetailForm.png',null,null,null,null);
Insert into OBJ_FORMS (WIN_NAME,TITLE,OBJ_BROW_NAME,OBJ_EDIT_NAME,CROSS_UPDATE_EXPR,EXPR_FLD_INFO,TARGET_FLD_INFO,EXPR_COMMENT,FORM_NO,SCR_FLAG,AUTO_ACCEPT_SCAN,SCAN_FLAG,SCAN_METADATA,PROPERTY_INFO,SCAN_DELIMITER,COLUMN_ON_SAVE,AFTER_SAVE,EXT_SETUP,EXT_METADATA,EXT_COM,AUTO_ACCEPT_WEIGHDATA,FORM_TYPE,DISP_METADATA,PARENT_KEY_COL,QTY_COL,RATE_COL,ASSISTED_MODE,STORAGE_KEY_METADATA,SELECTION_MODE,DEFAULT_VIEW,AUTO_ADDON_ENTRY,DUPLICATE_ADD,DEFAULT_ROW_CNT,FREEZE_COL_POS,IS_MANDATORY,TRAN_ID_COL,SELECTION_OPT,KEY_INFO,THUMB_OBJ,THUMB_IMAGE_COL,THUMB_ALT_COL,FORM_NAME,FORM_ICON,FORM_VIEW_OPTS,X_COLUMN,Y_COLUMN,ACTION_ARG) values ('w_perk_lapse_proc','Perk Detail','d_perk_lapse_proc_filt','d_perk_lapse_proc_data',null,null,null,null,'2','T',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,'A',null,null,null,null,null,null,null,null,null,'0',null,null,null,null,null,'DetailForm.png',null,null,null,null);
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 ('perk_lapse_proc','get_data','1','gd_default_1',null,'0',sysdate,'BASE','BASE','2','WSR','nvo_bo_perk_lapse_proc',null);
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 ('perk_lapse_proc','post_item_change','1','poic_default_1',null,'0',sysdate,'BASE','BASE','2','WSR','nvo_bo_perk_lapse_proc',null);
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 ('perk_lapse_proc','pre_validate','1','prv_default_1',null,'0',sysdate,'BASE','BASE','2','WSR','nvo_bo_perk_lapse_proc',null);
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 ('perk_lapse_proc','process','1','pr_default_2',null,'0',sysdate,'BASE','BASE','2','WSR','nvo_bo_perk_lapse_proc',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 ('gd_default_1','Get Data Default','http://192.168.0.35/BaseE12DotNetService-7-2-24/E12BusinessLogic-7-2-24.asmx','Base Information','gbf_get_data','String','S',null,null,sysdate,'Deepali','User1',null,null,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 ('poic_default_1','post item change default','http://192.168.0.35/BaseE12DotNetService-7-2-24/E12BusinessLogic-7-2-24.asmx','Base Information','gbf_itemchanged','String','S',null,null,sysdate,'Base','Base107',null,null,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 ('pr_default_2','Process Default For Selection','http://192.168.0.35/BaseE12DotNetService-7-2-24/E12BusinessLogic-7-2-24.asmx','Base Information','gbf_process','String','S',null,null,sysdate,'PIYUSH','BASE213',null,null,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 ('prv_default_1','val data default','http://192.168.0.35/BaseE12DotNetService-7-2-24/E12BusinessLogic-7-2-24.asmx','Base Information','gbf_valdata','String','S',null,null,sysdate,'Deepali','48',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 ('gd_default_1',1,'COMPONENT_TYPE','I',null,'S',null,sysdate,'Base','Base107 ',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 ('gd_default_1',2,'COMPONENT_NAME','I',null,'S',null,sysdate,'Base','Base107 ',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 ('gd_default_1',3,'TAB_XML_DATA','I',null,'S',null,sysdate,'Base','Base107 ',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 ('gd_default_1',4,'TAB_XML_DATA_1','I',null,'S',null,sysdate,'Base','Base107 ',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 ('gd_default_1',5,'XTRA_PARAMS','I',null,'S',null,sysdate,'Base','Base107 ',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 ('poic_default_1',1,'COMPONENT_TYPE','I',null,'S',null,sysdate,'BASE','BASE','WSR');
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 ('poic_default_1',2,'COMPONENT_NAME','I',null,'S',null,sysdate,'BASE','BASE',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 ('poic_default_1',3,'TAB_XML_DATA','I',null,'S',null,sysdate,'Base','Base91',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 ('poic_default_1',4,'TAB_XML_DATA_1','I',null,'S',null,sysdate,'Base','Base91',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 ('poic_default_1',5,'OBJ_CONTEXT','I',null,'S',null,sysdate,'Base','Base91',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 ('poic_default_1',6,'FOCUSED_COLUMN','I',null,'S',null,sysdate,'Base','Base91',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 ('poic_default_1',7,'EDIT_FLAG','I',null,'S',null,sysdate,'Base','Base91',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 ('poic_default_1',8,'XTRA_PARAMS','I',null,'S',null,sysdate,'Base','Base91',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 ('pr_default_2',1,'COMPONENT_TYPE','I',null,'S',null,sysdate,'PIYUSH','BASE213',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 ('pr_default_2',2,'COMPONENT_NAME','I',null,'S',null,sysdate,'PIYUSH','BASE213',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 ('pr_default_2',3,'TAB_XML_DATA_1','I',null,'S',null,sysdate,'PIYUSH','BASE213',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 ('pr_default_2',4,'TAB_XML_DATA__ALL','I',null,'S',null,sysdate,'PIYUSH','BASE213',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 ('pr_default_2',5,'XTRA_PARAMS','I',null,'S',null,sysdate,'PIYUSH','BASE213',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 ('prv_default_1',1,'COMPONENT_TYPE','I',null,'S',null,sysdate,'BASE','GAURAV','WSR');
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 ('prv_default_1',2,'COMPONENT_NAME','I',null,'S',null,sysdate,'BASE','GAURAV',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 ('prv_default_1',3,'TAB_XML_DATA','I',null,'S',null,sysdate,'BASE','GAURAV',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 ('prv_default_1',4,'TAB_XML_DATA_1','I',null,'S',null,sysdate,'BASE','GAURAV',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 ('prv_default_1',5,'OBJ_CONTEXT','I',null,'S',null,sysdate,'BASE','GAURAV',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 ('prv_default_1',6,'EDIT_FLAG','I',null,'S',null,sysdate,'BASE','GAURAV',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 ('prv_default_1',7,'XTRA_PARAMS','I',null,'S',null,sysdate,'BASE','GAURAV',null);
---------------migrating the perk lapse PB to Java component
update system_events set comp_name='ibase.webitm.ejb.adm.PerkLapsePrcIc',comp_type='JB' where obj_name='perk_lapse_proc'and event_code='post_item_change';
update system_events set service_code='poic_default_ejb' where obj_name='perk_lapse_proc' and event_code='post_item_change';
update system_events set comp_name='ibase.webitm.ejb.adm.PerkLapsePrcIc',comp_type='JB' where obj_name='perk_lapse_proc'and event_code='pre_validate';
update system_events set service_code='prv_default_ejb' where obj_name='perk_lapse_proc' and event_code='pre_validate';
update system_events set SERVICE_CODE='prc_default_ejb',COMP_NAME='ibase.webitm.ejb.adm.adv.PerkLapsePrc',COMP_TYPE='JB' where OBJ_NAME='perk_lapse_proc' and SERVICE_CODE='pr_default_2' and EVENT_CODE='process';
update transetup set KEY_STRING='_spsite_code__to,_ppclaim_date,LP,seq04' where upper(tran_window) = 'T_EMP_ADLAPSE';
---------------------------Perk Lapse process [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