Commit 1ee39701 authored by akhokar's avatar akhokar

Changes done by piyush sir in employee

EmployeeEJB.java


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@204221 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 00de3703
......@@ -7,13 +7,6 @@
package ibase.webitm.ejb.adm;
//import ibase.system.config.*;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.*;
//import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
//import jxl.write.DateTime;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
......@@ -30,12 +23,16 @@ import java.util.GregorianCalendar;
import javax.ejb.Stateless;
import org.w3c.dom.CDATASection;
//import org.dom4j.util.IndexedElement;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
//import ibase.system.config.*;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ITMDBAccessEJB;
//import bsh.util.Util;
//import ibase.system.config.ConnDriver;
//import ibase.utility.E12GenericUtility;
......@@ -43,6 +40,9 @@ import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.ejb.sys.UtilMethods;
//import ibase.webitm.utility.GenericUtility;
//import ibase.webitm.utility.ITMException;
//import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
//import jxl.write.DateTime;
//import com.sun.org.apache.xalan.internal.xsltc.compiler.Pattern;
......@@ -3068,7 +3068,19 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
EmpRetAge = "0";
}
int maval1=Integer.parseInt(EmpRetAge);
// Piyush - 29/07/2019.Start
// int maval1=Integer.parseInt(EmpRetAge);
int maval1 = 0;
try
{
maval1=Integer.parseInt(EmpRetAge);
}
catch (Exception ei)
{
maval1 = 0;
}
// Piyush - 29/07/2019.End
if(maval1 <=0 )
{
maval1=0;
......@@ -3079,6 +3091,9 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
}
valueXmlString.append("<retirement_age>").append(maval1).append("</retirement_age>");
setNodeValue(dom, "retirement_age", "" + maval1); // Piyush - 29/07/2019
String retDateStr = gbSetRetirementDate(dom, connection);
String protect= gbfGetRetdateProtectFlag(dom);
......@@ -3108,182 +3123,9 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
else if(currentColumn.equalsIgnoreCase("itm_defaultedit"))
{
System.out.println("ItemChange of:::::"+currentColumn);
// Piyush - 29/07/2019.Start
//Modified by Rohini T on 14/March/2019[A17DSUN006][start]
// Modified by Yashwant on 26/06/2019.Start
String revNo = checkNull(genericUtility.getColumnValue("revision_no", dom));
//String revNo = genericUtility.getColumnValue("revision_no", dom);
// Modified by Yashwant on 26/06/2019.End
long revisionNo = 0;
try
{
revisionNo = (revNo != null && revNo.trim().length() > 0) ? Long.parseLong(revNo):0;
}
catch (Exception e)
{
revisionNo = 0;
}
revisionNo = revisionNo + 1;
valueXmlString.append("<revision_no><![CDATA[").append(revisionNo).append("]]></revision_no>\r\n");
//Modified by Rohini T on 14/March/2019[A17DSUN006][end]
// Modified by Yashwant on 26/06/2019.Start
reportToAdmin = checkNull(genericUtility.getColumnValue("report_to__admin", dom));
empClass = checkNull(genericUtility.getColumnValue("emp_class", dom));
occuCode = checkNull(genericUtility.getColumnValue("occupation_code", dom));
//reportToAdmin = genericUtility.getColumnValue("report_to__admin", dom);
//empClass = genericUtility.getColumnValue("emp_class", dom);
//occuCode = genericUtility.getColumnValue("occupation_code", dom);
// Modified by Yashwant on 26/06/2019.End
//Added by Anjali Rawankar on[04/04/2017][Start]
lname="";
fname="";
//Added by Anjali Rawankar on[04/04/2017][End]
if(reportToAdmin != null && reportToAdmin.trim().length() > 0)
{
/*Modified by Anjali Rawankar on [04/04/2017][Start]
* [Purpose : To Resolve the issue of employee master reported by aditi]
String sqldefEdit="SELECT EMP_LNAME,EMP_FNAME,TRAINING_PRD,"
+ "PROBATION_PRD,NOTICE_PRD FROM EMPLOYEE WHERE EMP_CODE=?";
String sqldefEdit="SELECT EMP_LNAME,EMP_FNAME FROM EMPLOYEE WHERE EMP_CODE=?";
pstmt = connection.prepareStatement(sqldefEdit);
pstmt.setString(1, reportToAdmin);
rs = pstmt.executeQuery();
if(rs.next())
{
lname=rs.getString("EMP_LNAME");
fname=rs.getString("EMP_FNAME");
trainPrd=rs.getString("TRAINING_PRD");
probPrd=rs.getString("PROBATION_PRD");
noticePrd=rs.getString("NOTICE_PRD");
}*/
String sqldefEdit="SELECT EMP_LNAME_LONG,EMP_FNAME_LONG FROM EMPLOYEE WHERE EMP_CODE=?";
pstmt = connection.prepareStatement(sqldefEdit);
pstmt.setString(1, reportToAdmin);
rs = pstmt.executeQuery();
if(rs.next())
{
lname=rs.getString("EMP_LNAME_LONG");
fname=rs.getString("EMP_FNAME_LONG");
}
/*Modified by Anjali Rawankar on [04/04/2017][End]
* [Purpose : To Resolve the issue of employee master reported by aditi]
*/
close(pstmt, rs);
valueXmlString.append("<admin_fname>").append("<![CDATA[" + fname + "]]>").append("</admin_fname>");
valueXmlString.append("<admin_lname>").append("<![CDATA[" + lname + "]]>").append("</admin_lname>");
}
/*Added by Anjali Rawankar on [04/04/2017][Start]
* [Purpose : To Resolve the issue of employee master reported by aditi]
*/
// Modified by Yashwant on 26/06/2019.Start
empCode = checkNull(genericUtility.getColumnValue("emp_code", dom));
//empCode = genericUtility.getColumnValue("emp_code", dom);
// Modified by Yashwant on 26/06/2019.End
String totExp = "0";
sql = "SELECT TRAINING_PRD,PROBATION_PRD,NOTICE_PRD,GRADE,TOT_EXP FROM EMPLOYEE WHERE EMP_CODE = ?";
pstmt = connection.prepareStatement(sql);
pstmt.setString(1, empCode);
rs = pstmt.executeQuery();
if(rs.next())
{
trainPrd = rs.getString("TRAINING_PRD");
probPrd = rs.getString("PROBATION_PRD");
noticePrd = rs.getString("NOTICE_PRD");
gradeCode = rs.getString("GRADE");
totExp = rs.getString("TOT_EXP");
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
sql = "";
if(totExp == null || totExp.trim().length() == 0)
{
totExp="0";
valueXmlString.append("<tot_exp>").append("<![CDATA[" + totExp + "]]>").append("</tot_exp>");
}
/*Added by Anjali Rawankar on [04/04/2017][End]
* [Purpose : To Resolve the issue of employee master reported by aditi]
*/
if(trainPrd == null)
{
//trainPrd=Integer.toString(0);
valueXmlString.append("<training_prd>").append("<![CDATA[" + 0 + "]]>").append("</training_prd>");
}
if(probPrd == null)
{
probPrd=Integer.toString(0);
valueXmlString.append("<probation_prd>").append("<![CDATA[" + probPrd + "]]>").append("</probation_prd>");
}
if(noticePrd == null || noticePrd.trim().length() == 0)
{
/*Added by Anjali Rawankar on [04/04/2017][Start]
* [Purpose : To Resolve the issue of employee master reported by aditi]
*/
// noticePrd=Integer.toString(0);
noticePrd="0";
/*
if(gradeCode != null)
{
sql = "SELECT NOTICE_PRD FROM GRADE WHERE GRADE_CODE = ?";
pstmt = connection.prepareStatement(sql);
pstmt.setString(1, gradeCode);
rs = pstmt.executeQuery();
if(rs.next())
{
noticePrd = rs.getString("NOTICE_PRD");
if(noticePrd == null || noticePrd.trim().length() == 0)
{
noticePrd = "0";
}
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
*/
valueXmlString.append("<notice_prd>").append("<![CDATA[" + noticePrd + "]]>").append("</notice_prd>");
/*Added by Anjali Rawankar on [04/04/2017][End]
* [Purpose : To Resolve the issue of employee master reported by aditi]
*/
}
/*Commented by anjali Rawankar on[04/04/2017][Start]
* [Purpose : To Resolve the issue of employee master reported by aditi]
valueXmlString.append("<admin_fname>").append("<![CDATA[" + fname + "]]>").append("</admin_fname>");
valueXmlString.append("<admin_lname>").append("<![CDATA[" + lname + "]]>").append("</admin_lname>");
valueXmlString.append("<training_prd>").append("<![CDATA[" + trainPrd + "]]>").append("</training_prd>");
valueXmlString.append("<probation_prd>").append("<![CDATA[" + probPrd + "]]>").append("</probation_prd>");
valueXmlString.append("<notice_prd>").append("<![CDATA[" + noticePrd + "]]>").append("</notice_prd>");
}
Commented by anjali Rawankar on[04/04/2017][End]
* [Purpose : To Resolve the issue of employee master reported by aditi]
*/
if(empClass != null && empClass.trim().length() > 0)
{
String sqlEc="SELECT DESCR FROM GENCODES WHERE FLD_NAME='EMP_CLASS' AND FLD_VALUE =?";
......@@ -3292,14 +3134,12 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
rs = pstmt.executeQuery();
if(rs.next())
{
valueXmlString.append("<class_descr>").append("<![CDATA[" + rs.getString("DESCR") + "]]>").append("</class_descr>");
}
else
{
valueXmlString.append("<class_descr>").append("<![CDATA[]]>").append("</class_descr>");
valueXmlString.append("<class_descr>").append("<![CDATA[" + checkNull(rs.getString("DESCR")) + "]]>").append("</class_descr>");
}
close(pstmt, rs);
}
occuCode = checkNull(genericUtility.getColumnValue("occupation_code", dom));
if(occuCode != null && occuCode.trim().length() > 0)
{
String sqlEc="SELECT DESCR FROM GENCODES WHERE FLD_NAME='OCCUPATION_CODE' AND FLD_VALUE =?";
......@@ -3308,61 +3148,22 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
rs = pstmt.executeQuery();
if(rs.next())
{
valueXmlString.append("<occ_descr>").append("<![CDATA[" + rs.getString("DESCR") + "]]>").append("</occ_descr>");
}
else
{
valueXmlString.append("<occ_descr>").append("<![CDATA[]]>").append("</occ_descr>");
valueXmlString.append("<occ_descr>").append("<![CDATA[" + checkNull(rs.getString("DESCR")) + "]]>").append("</occ_descr>");
}
close(pstmt, rs);
}
//Modified by Ahmed on 23/AUG/2016[A16ESUN005][To set emp_site field as non-editable in edit mode][START]
// Modified by Yashwant on 26/06/2019.Start
empSite = checkNull(genericUtility.getColumnValue("emp_site", dom));
confirmed = checkNull(genericUtility.getColumnValue("confirmed", dom));
//empSite = genericUtility.getColumnValue("emp_site", dom);
//confirmed = genericUtility.getColumnValue("confirmed", dom);
// Modified by Yashwant on 26/06/2019.End
valueXmlString.append("<emp_site protect=\"1\">").append("<![CDATA[" + empSite + "]]>").append("</emp_site>");
valueXmlString.append("<confirmed protect=\"1\">").append("<![CDATA[" + confirmed + "]]>").append("</confirmed>");
//Modified by Ahmed on 23/AUG/2016[A16ESUN005][To set emp_site field as non-editable in edit mode][END]
//Modified by Ahmed on 30/AUG/2016[A16ESUN005][To set contact_state and present state field as non-editable in edit mode][start]
// Modified by Yashwant on 26/06/2019.Start
String contactState = checkNull(genericUtility.getColumnValue("contact_state", dom));
String presentState = checkNull(genericUtility.getColumnValue("cur_state", dom));
//String contactState = genericUtility.getColumnValue("contact_state", dom);
//String presentState = genericUtility.getColumnValue("cur_state", dom);
// Modified by Yashwant on 26/06/2019.End
if(contactState != null && contactState.trim().length() > 0)
{
valueXmlString.append("<contact_state protect=\"1\">").append("<![CDATA[" + contactState + "]]>").append("</contact_state>");
}
if(presentState != null && presentState.trim().length() > 0)
{
valueXmlString.append("<cur_state protect=\"1\">").append("<![CDATA[" + presentState + "]]>").append("</cur_state>");
}
//Modified by Ahmed on 30/AUG/2016[A16ESUN005][To set contact_state and present state field as non-editable in edit mode][ENd]
// Modified by Yashwant on 05/07/2019[start]
//Modified by Jaffar S. on 26/07/19
//String nationality=genericUtility.getColumnValue("nationality", dom2);
String nationality=checkNull(genericUtility.getColumnValue("nationality", dom2));
if(nationality ==null || nationality.trim().length() == 0)
if(nationality == null || nationality.trim().length() == 0)
{
String mdescr=admCommon.getEnv("999999", "NATIONAL", connection);
if(mdescr!=null && mdescr.trim().length()>0)
String mdescr = admCommon.getEnv("999999", "NATIONAL", connection);
if(mdescr != null && mdescr.trim().length() > 0 && !mdescr.equalsIgnoreCase("NULLFOUND"))
{
valueXmlString.append("<nationality>").append(mdescr).append("</nationality>");
}
}
//Modified by Jaffar S. on 26/07/19
//contactCode=genericUtility.getColumnValue("contactCode", dom2);
contactCode=checkNull(genericUtility.getColumnValue("contactCode", dom2));
contactCode=checkNull(genericUtility.getColumnValue("contact_Code", dom));
if(contactCode !=null && contactCode.trim().length()>0)
{
sql="select addr1, addr2, addr3, city, state_code, pin, tele1, tele2, tele3, sh_name, cont_pers from contact where contact_code =?";
......@@ -3395,68 +3196,85 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
}
}
//Modified by Jaffar S. on 26/07/19
//lsState=genericUtility.getColumnValue("cur_state", dom2);
lsState=checkNull(genericUtility.getColumnValue("cur_state", dom2));
if(lsState !=null && lsState.trim().length()>0)
String curStat = checkNull(genericUtility.getColumnValue("cur_state", dom));
if (curStat.trim().length() > 0)
{
valueXmlString.append("<cur_state protect=\"1\">").append("<![CDATA[" ).append(lsState).append( "]]>").append("</cur_state>");
valueXmlString.append("<cur_state protect=\"1\">").append("<![CDATA[" + curStat + "]]>").append("</cur_state>");
}
else
{
valueXmlString.append("<cur_state protect=\"0\">").append("<![CDATA[" ).append(lsState).append( "]]>").append("</cur_state>");
curStat = "";
valueXmlString.append("<cur_state protect=\"1\">").append("<![CDATA[" + curStat + "]]>").append("</cur_state>");
}
setNodeValue(dom, "cur_state", curStat);
//Modified by Jaffar S. on 26/07/19
//mcode=genericUtility.getColumnValue("emp_site", dom2);
mcode=checkNull(genericUtility.getColumnValue("emp_site", dom2));
if(mcode ==null || mcode.trim().length() == 0 )
empSite = checkNull(genericUtility.getColumnValue("emp_site", dom));
if (empSite == null || empSite.trim().length() == 0)
{
empSite = getValueFromXTRA_PARAMS(xtraParams, "loginSite");
if (empSite == null || empSite.trim().length() == 0)
{
valueXmlString.append("<emp_site>").append(empSite).append("</emp_site>");
//dw_edit.setitem(1 , "emp_site" , login_site)
empSite = getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode");
}
//Modified by Jaffar S. on 26/07/19
//mcode=genericUtility.getColumnValue("emp_site", dom2);
mcode=checkNull(genericUtility.getColumnValue("emp_site", dom2));
if(mcode !=null && mcode.trim().length()>0)
}
if (empSite == null || empSite.trim().length() == 0)
{
valueXmlString.append("<emp_site protect=\"1\">").append("<![CDATA[" ).append(mcode).append( "]]>").append("</emp_site>");
empSite = "";
valueXmlString.append("<emp_site protect=\"0\">").append("<![CDATA[" + empSite + "]]>").append("</emp_site>");
}
else
{
valueXmlString.append("<emp_site protect=\"0\">").append("<![CDATA[" ).append(mcode).append( "]]>").append("</emp_site>");
valueXmlString.append("<emp_site protect=\"1\">").append("<![CDATA[" + empSite + "]]>").append("</emp_site>");
}
setNodeValue(dom, "emp_site", empSite);
//Modified by Jaffar S. on 26/07/19
//mcode=genericUtility.getColumnValue("pay_site", dom2);
mcode=checkNull(genericUtility.getColumnValue("pay_site", dom2));
if(mcode ==null || mcode.trim().length() == 0 )
paySite = checkNull(genericUtility.getColumnValue("pay_site", dom));
if (paySite == null || paySite.trim().length() == 0)
{
valueXmlString.append("<pay_site>").append(loginSite).append("</pay_site>");
//dw_edit.setitem(1 , "pay_site" , login_site)
paySite = getValueFromXTRA_PARAMS(xtraParams, "loginSite");
if (paySite == null || paySite.trim().length() == 0)
{
paySite = getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode");
}
}
if (paySite == null || paySite.trim().length() == 0)
{
paySite = "";
valueXmlString.append("<pay_site protect=\"0\">").append("<![CDATA[" + paySite + "]]>").append("</pay_site>");
}
else
{
valueXmlString.append("<pay_site protect=\"1\">").append("<![CDATA[" + paySite + "]]>").append("</pay_site>");
}
setNodeValue(dom, "pay_site", paySite);
//Modified by Jaffar S. on 26/07/19
//mcode=genericUtility.getColumnValue("work_site", dom2);
mcode=checkNull(genericUtility.getColumnValue("work_site", dom2));
if(mcode ==null || mcode.trim().length() == 0 )
workSite = checkNull(genericUtility.getColumnValue("work_site", dom));
if (workSite == null || workSite.trim().length() == 0)
{
workSite = getValueFromXTRA_PARAMS(xtraParams, "loginSite");
if (workSite == null || workSite.trim().length() == 0)
{
valueXmlString.append("<work_site>").append(loginSite).append("</work_site>");
//dw_edit.setitem(1 , "work_site" , login_site)
workSite = getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode");
}
}
if (workSite == null || workSite.trim().length() == 0)
{
workSite = "";
valueXmlString.append("<work_site protect=\"0\">").append("<![CDATA[" + workSite + "]]>").append("</work_site>");
}
else
{
valueXmlString.append("<work_site protect=\"1\">").append("<![CDATA[" + workSite + "]]>").append("</work_site>");
}
setNodeValue(dom, "work_site", workSite);
//Modified by Jaffar S. on 26/07/19
//mval1=genericUtility.getColumnValue("notice_prd", dom2);
mval1=checkNull(genericUtility.getColumnValue("notice_prd", dom2));
if(mval1==null || mval1.trim().length() == 0)
noticePrd = checkNull(genericUtility.getColumnValue("notice_prd", dom));
if (noticePrd.trim().length() == 0)
{
//Modified by Jaffar S. on 26/07/19
//gradeCode=genericUtility.getColumnValue("grade", dom2);
gradeCode=checkNull(genericUtility.getColumnValue("grade", dom2));
gradeCode=checkNull(genericUtility.getColumnValue("grade", dom));
if(gradeCode != null && gradeCode.trim().length() > 0)
{
//select grade.notice_prd into :li_mval2 from grade where grade.grade_code = :mcode ;
sql="select grade.notice_prd as mval2 from grade where grade.grade_code = ? ";
pstmt = connection.prepareStatement(sql);
pstmt.setString(1, gradeCode);
......@@ -3479,49 +3297,39 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
}
}
//Modified by Jaffar S. on 26/07/19
//String trainingPrd=genericUtility.getColumnValue("training_prd", dom2);
String trainingPrd= checkInt(genericUtility.getColumnValue("training_prd", dom2));
int periodTraining = Integer.parseInt(trainingPrd);
if(trainingPrd==null)
trainPrd = checkNull(genericUtility.getColumnValue("training_prd", dom));
if (trainPrd.trim().length() == 0)
{
valueXmlString.append("<training_prd>").append(0).append("</training_prd>");
//dw_edit.setitem(1, "training_prd", 0)
trainPrd = "0";
valueXmlString.append("<training_prd>").append("<![CDATA[" + trainPrd + "]]>").append("</training_prd>");
setNodeValue(dom, "training_prd", trainPrd);
}
//Modified by Jaffar S. on 26/07/19
//String probationPrd=genericUtility.getColumnValue("probation_prd", dom2);
String probationPrd=checkInt(genericUtility.getColumnValue("probation_prd", dom2));
int periodProb = Integer.parseInt(probationPrd);
if(probationPrd==null)
probPrd = checkNull(genericUtility.getColumnValue("probation_prd", dom));
if(probPrd.trim().length() == 0)
{
valueXmlString.append("<probation_prd>").append(0).append("</probation_prd>");
//dw_edit.setitem(1, "probation_prd", 0)
probPrd="0";
valueXmlString.append("<probation_prd>").append("<![CDATA[" + probPrd + "]]>").append("</probation_prd>");
setNodeValue(dom, "probation_prd", probPrd);
}
//Modified by Jaffar S. on 26/07/19
//shiftRot=genericUtility.getColumnValue("shift_rot", dom2);
shiftRot=checkNull(genericUtility.getColumnValue("shift_rot", dom2));
if(shiftRot ==null || shiftRot.trim().length() == 0 )
shiftRot = checkNull(genericUtility.getColumnValue("shift_rot", dom));
if(shiftRot.trim().length() == 0)
{
valueXmlString.append("<shift_rot>").append("N").append("</shift_rot>");
//dw_edit.setitem(1, "shift_rot", 'N')
shiftRot="N";
valueXmlString.append("<shift_rot>").append("<![CDATA[" + shiftRot + "]]>").append("</shift_rot>");
}
String date=checkNull(genericUtility.getColumnValue("date_join", dom2));
//Timestamp ts=Timestamp.valueOf(genericUtility.getValidDateTimeString(date,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())+"00:00:00.0");
//Modified by Jaffar S. on 26/07/19
//empCode=genericUtility.getColumnValue("emp_code", dom2);
empCode=checkNull(genericUtility.getColumnValue("emp_code", dom2));
if(date == null)
String dateJoinStr = checkNull(genericUtility.getColumnValue("date_join", dom));
empCode = checkNull(genericUtility.getColumnValue("emp_code", dom));
if (dateJoinStr.trim().length() == 0)
{
valueXmlString.append("<date_join protect=\"0\">").append("<![CDATA[" ).append(date).append( "]]>").append("</date_join>");
dateJoinStr = "";
valueXmlString.append("<date_join protect=\"0\">").append("<![CDATA[" + dateJoinStr + "]]>").append("</date_join>");
}
else
{
int mval3=0;
//select COUNT(*) into :li_mval3 from payroll where prd_code between '00' and 'zz' and emp_code = :ls_emp_code ;
sql="select count(*) as mval3 from payroll where prd_code between '00' and 'zz' and emp_code = ?";
pstmt = connection.prepareStatement(sql);
pstmt.setString(1, empCode);
......@@ -3542,26 +3350,38 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
}
if(mval3 == 0)
{
valueXmlString.append("<date_join protect=\"0\">").append("<![CDATA[" ).append(date).append( "]]>").append("</date_join>");
valueXmlString.append("<date_join protect=\"0\">").append("<![CDATA[" ).append(dateJoinStr).append( "]]>").append("</date_join>");
}
else
{
valueXmlString.append("<date_join protect=\"1\">").append("<![CDATA[" ).append(date).append( "]]>").append("</date_join>");
valueXmlString.append("<date_join protect=\"1\">").append("<![CDATA[" ).append(dateJoinStr).append( "]]>").append("</date_join>");
}
}
//Modified by Jaffar S. on 26/07/19 [Start]
//probation=genericUtility.getColumnValue("probation", dom2);
//confirmed=genericUtility.getColumnValue("confirmed", dom2);
//trainingPd=genericUtility.getColumnValue("training_prd", dom2);
probation=checkNull(genericUtility.getColumnValue("probation", dom2));
confirmed=checkNull(genericUtility.getColumnValue("confirmed", dom2));
trainingPrd=checkInt(genericUtility.getColumnValue("training_prd", dom2));
int liMval1 = Integer.parseInt(trainingPrd);
//probationPrd=genericUtility.getColumnValue("probation_prd", dom2);
probationPrd=checkInt(genericUtility.getColumnValue("probation_prd", dom2));
//Modified condition by Jaffar S. on 26/07/19 [End]
int liMval2 = Integer.parseInt(probationPrd);
trainPrd = checkNull(genericUtility.getColumnValue("training_prd", dom));
probPrd = checkNull(genericUtility.getColumnValue("probation_prd", dom));
probation=checkNull(genericUtility.getColumnValue("probation", dom));
confirmed=checkNull(genericUtility.getColumnValue("confirmed", dom));
int probPrdNum = 0;
try
{
probPrdNum = Integer.parseInt(probPrd);
}
catch (Exception pp)
{
probPrdNum = 0;
}
int trainPrdNum = 0;
try
{
trainPrdNum = Integer.parseInt(trainPrd);
}
catch (Exception tp)
{
trainPrdNum = 0;
}
sql="select count(*) as countProb from emp_statuschg where emp_code =? and status_type = 'P' and case when confirm is null then 'N' else confirm end <> 'X'";
pstmt = connection.prepareStatement(sql);
......@@ -3583,19 +3403,18 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
}
if(countProb>0)
{
valueXmlString.append("<training_prd protect=\"1\">").append("<![CDATA[" ).append(trainingPrd).append( "]]>").append("</training_prd>");
valueXmlString.append("<date_join protect=\"0\">").append("<![CDATA[" ).append(date).append( "]]>").append("</date_join>");
valueXmlString.append("<training_prd protect=\"1\">").append("<![CDATA[" ).append(trainPrd).append( "]]>").append("</training_prd>");
valueXmlString.append("<date_join protect=\"0\">").append("<![CDATA[" ).append(dateJoinStr).append( "]]>").append("</date_join>");
}
else
{
if((confirmed !=null && confirmed.equalsIgnoreCase("Y"))||(probation!=null && probation.equalsIgnoreCase("Y") && liMval1>0))
if((confirmed !=null && confirmed.equalsIgnoreCase("Y"))||(probation!=null && probation.equalsIgnoreCase("Y") && trainPrdNum>0))
{
valueXmlString.append("<training_prd protect=\"1\">").append("<![CDATA[" ).append(trainingPrd).append( "]]>").append("</training_prd>");
valueXmlString.append("<training_prd protect=\"1\">").append("<![CDATA[" ).append(trainPrd).append( "]]>").append("</training_prd>");
}
else
{
//valueXmlString.append("<training_prd protect=\"0\">").append("<![CDATA[" ).append(date).append( "]]>").append("</training_prd>");
valueXmlString.append("<training_prd protect=\"0\">").append("<![CDATA[" ).append(trainingPrd).append( "]]>").append("</training_prd>");
valueXmlString.append("<training_prd protect=\"0\">").append("<![CDATA[" ).append(trainPrd).append( "]]>").append("</training_prd>");
}
}
......@@ -3619,82 +3438,94 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
}
if(countConf>0)
{
valueXmlString.append("<training_prd protect=\"1\">").append("<![CDATA[" ).append(trainingPrd).append( "]]>").append("</training_prd>");
valueXmlString.append("<probation_prd protect=\"1\">").append("<![CDATA[" ).append(probationPrd).append( "]]>").append("</probation_prd>");
valueXmlString.append("<date_join protect=\"1\">").append("<![CDATA[" ).append(date).append( "]]>").append("</date_join>");
valueXmlString.append("<training_prd protect=\"1\">").append("<![CDATA[" ).append(trainPrd).append( "]]>").append("</training_prd>");
valueXmlString.append("<probation_prd protect=\"1\">").append("<![CDATA[" ).append(probPrd).append( "]]>").append("</probation_prd>");
valueXmlString.append("<date_join protect=\"1\">").append("<![CDATA[" ).append(dateJoinStr).append( "]]>").append("</date_join>");
}
else
{
if(confirmed.equalsIgnoreCase("Y") && liMval2>0)
if(confirmed.equalsIgnoreCase("Y") && probPrdNum>0)
{
valueXmlString.append("<probation_prd protect=\"1\">").append("<![CDATA[" ).append(probationPrd).append( "]]>").append("</probation_prd>");
valueXmlString.append("<probation_prd protect=\"1\">").append("<![CDATA[" ).append(probPrd).append( "]]>").append("</probation_prd>");
}
else
{
valueXmlString.append("<probation_prd protect=\"0\">").append("<![CDATA[" ).append(probationPrd).append( "]]>").append("</probation_prd>");
valueXmlString.append("<probation_prd protect=\"0\">").append("<![CDATA[" ).append(probPrd).append( "]]>").append("</probation_prd>");
}
}
//Modified by Jaffar S. on 26/07/19
//String payType=genericUtility.getColumnValue("pay_type", dom2);
String payType=checkNull(genericUtility.getColumnValue("pay_type", dom2));
if(payType != null && payType.trim().length() > 0)
String payType=checkNull(genericUtility.getColumnValue("pay_type", dom));
if(payType.trim().length() == 0)
{
valueXmlString.append("<pay_type>").append("<![CDATA[S]]>").append("</pay_type>");
}
//Modified by Jaffar S. on 26/07/19
//payMode =genericUtility.getColumnValue("pay_mode", dom2);
payMode =checkNull(genericUtility.getColumnValue("pay_mode", dom2));
if(payMode != null && payMode.trim().length() > 0)
payMode =checkNull(genericUtility.getColumnValue("pay_mode", dom));
if(payMode.trim().length() == 0)
{
valueXmlString.append("<pay_mode>").append("<![CDATA[C]]>").append("</pay_mode>");
}
//Modified by Jaffar S. on 26/07/19
//String withHeld=genericUtility.getColumnValue("with_held", dom2);
String withHeld=checkNull(genericUtility.getColumnValue("with_held", dom2));
if(withHeld != null && withHeld.trim().length() > 0)
String withHeld = checkNull(genericUtility.getColumnValue("with_held", dom));
if(withHeld.trim().length() == 0)
{
valueXmlString.append("<with_held>").append("<![CDATA[N]]>").append("</with_held>");
}
liMval1=0;
liMval2=0;
//Modified by Jaffar S. on 26/07/19
//String state=genericUtility.getColumnValue("per_state", dom2);
String state=checkNull(genericUtility.getColumnValue("per_state", dom2));
if(state !=null && state.trim().length()>0)
String contactState = checkNull(genericUtility.getColumnValue("contact_state", dom));
if(contactState.trim().length() == 0)
{
valueXmlString.append("<per_state protect=\"1\">").append("<![CDATA[" ).append(state).append( "]]>").append("</per_state>");
contactState = "";
valueXmlString.append("<contact_state protect=\"0\">").append("<![CDATA[" ).append(contactState).append( "]]>").append("</contact_state>");
}
else
{
valueXmlString.append("<per_state protect=\"0\">").append("<![CDATA[" ).append(state).append( "]]>").append("</per_state>");
valueXmlString.append("<contact_state protect=\"1\">").append("<![CDATA[" ).append(contactState).append( "]]>").append("</contact_state>");
}
String mStatus="";
//Modified by Jaffar S. on 26/07/19
//mStatus=genericUtility.getColumnValue("m_status", dom2);
mStatus=checkNull(genericUtility.getColumnValue("m_status", dom2));
if(mStatus==null || mStatus.trim().length() ==0)
perState = checkNull(genericUtility.getColumnValue("per_state", dom));
if(perState.trim().length() == 0)
{
valueXmlString.append("<m_status>").append("U").append("</m_status>");
perState = "";
valueXmlString.append("<per_state protect=\"0\">").append("<![CDATA[" ).append(perState).append( "]]>").append("</per_state>");
}
else
{
valueXmlString.append("<per_state protect=\"1\">").append("<![CDATA[" ).append(perState).append( "]]>").append("</per_state>");
}
/*valueXmlString.append("<retirement_age>").append(maval1).append("</retirement_age>");
String protect= gbfGetRetdateProtectFlag(dom);
String mStatus = checkNull(genericUtility.getColumnValue("m_status", dom));
if(mStatus.trim().length() == 0)
{
valueXmlString.append("<m_status>").append("<![CDATA[U]]>").append("</m_status>");
}
valueXmlString.append("<retirement_date protect=\""+protect+"\"><![CDATA[").append(maval1).append("]]></retirement_date>\r\n");*/
long revisionNo = 0;
String revNo = checkNull(genericUtility.getColumnValue("revision_no", dom));
try
{
revisionNo = (revNo != null && revNo.trim().length() > 0) ? Long.parseLong(revNo):0;
}
catch (Exception er)
{
revisionNo = 0;
}
revisionNo = revisionNo + 1;
valueXmlString.append("<revision_no><![CDATA[").append(revisionNo).append("]]></revision_no>\r\n");
//Modified by Jaffar S. on 26/07/19
//String retirmentDate=genericUtility.getColumnValue("retirement_date", dom);
String retirmentDate=checkNull(genericUtility.getColumnValue("retirement_date", dom));
String retirmentDate = checkNull(genericUtility.getColumnValue("retirement_date", dom));
String protect=gbfGetRetdateProtectFlag(dom);
valueXmlString.append("<retirement_date protect=\""+protect+"\"><![CDATA[").append(retirmentDate).append("]]></retirement_date>\r\n");
// Modified by Yashwant on 05/July/2019[End]
String totExp = checkNull(genericUtility.getColumnValue("revision_no", dom));
if(totExp.trim().length() == 0)
{
totExp="0";
valueXmlString.append("<tot_exp>").append("<![CDATA[" + totExp + "]]>").append("</tot_exp>");
}
// Piyush - 29/07/2019.End
}
else if(currentColumn.trim().equalsIgnoreCase("contact_code"))
{
......@@ -6757,4 +6588,20 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
}
//Modified by Yashwant on 04/07/2019[End]
*/
// Piyush - 29/07/2019.Start
private static void setNodeValue(Document dom, String nodeName, String nodeVal) throws Exception {
Node tempNode = dom.getElementsByTagName(nodeName).item(0);
if (tempNode != null) {
if (tempNode.getFirstChild() == null) {
CDATASection cDataSection = dom.createCDATASection(nodeVal);
tempNode.appendChild(cDataSection);
} else {
tempNode.getFirstChild().setNodeValue(nodeVal);
}
}
tempNode = null;
}
// Piyush - 29/07/2019.End
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment