Commit c63541ec authored by jshaikh's avatar jshaikh

Fixed bugs related to employee master's EJB for getting errors for applying checknull

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@204145 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 18876915
......@@ -280,7 +280,9 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
empMname = checkNull(genericUtility.getColumnValue("emp_mname", dom));
// Modified by Yashwant on 26/06/2019.End
if(empMname == null)
//Modified condition by Jaffar S. on 26/07/19
//if(empMname == null)
if(empMname == null || empMname.trim().length() == 0)
{
errList.add("VEEMP5");
errFields.add(childNodeName.toLowerCase());
......@@ -819,8 +821,10 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
dateJoinStr = checkNull(genericUtility.getColumnValue("date_join", dom));
//dateJoinStr = genericUtility.getColumnValue("date_join", dom);
// Modified by Yashwant on 26/06/2019.End
System.out.println(" dateJoinStr................ "+dateJoinStr);
if( dateJoinStr == null )
System.out.println(" dateJoinStr................ "+dateJoinStr);
//Modified condition by Jaffar S. on 26/07/19
//if( dateJoinStr == null )
if(dateJoinStr == null || dateJoinStr.trim().length() == 0)
{
errList.add("VMJOIN");
errFields.add(childNodeName.toLowerCase());
......@@ -960,7 +964,10 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
payableBank=checkNull(genericUtility.getColumnValue("dd_payable_bank", dom));
//payableBank=genericUtility.getColumnValue("dd_payable_bank", dom);
// Modified by Yashwant on 26/06/2019.End
if(payableBank != null)
//Modified condition by Jaffar S. on 26/07/19
//if(payableBank != null)
if(payableBank != null && payableBank.trim().length() > 0)
{
cnt=isValueExist("bank","bank_code",payableBank, conn);
if(cnt==0)
......@@ -1028,7 +1035,10 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
projCode = checkNull(genericUtility.getColumnValue("proj_code", dom));
//projCode = genericUtility.getColumnValue("proj_code", dom);
// Modified by Yashwant on 26/06/2019.End
if(projCode != null)
//Modified condition by Jaffar S. on 26/07/19
//if(projCode != null)
if(projCode != null && projCode.trim().length() > 0)
{
cnt = isValueExist("project","proj_code",projCode, conn);
if(cnt==0)
......@@ -1465,7 +1475,10 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
graDate = checkNull(genericUtility.getColumnValue("gratuity_date", dom));
//graDate = genericUtility.getColumnValue("gratuity_date", dom);
// Modified by Yashwant on 26/06/2019.End
if(graDate != null)
//Modified condition by Jaffar S. on 26/07/19
//if(graDate != null)
if(graDate != null && graDate.trim().length() > 0)
{
graDt = sdf.parse(graDate);
//} Commented by Azhar on [11-JUN-2019][To avoid null pointer Exception]
......@@ -1473,7 +1486,10 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
dateJoinStr = checkNull(genericUtility.getColumnValue("date_join", dom));
//dateJoinStr = genericUtility.getColumnValue("date_join", dom);
// Modified by Yashwant on 26/06/2019.End
if(dateJoinStr != null)
//Modified condition by Jaffar S. on 26/07/19
//if(dateJoinStr != null)
if(dateJoinStr != null && dateJoinStr.trim().length() > 0)
{
joinDate = sdf.parse(dateJoinStr);
//} Commented by Azhar on [11-JUN-2019][To avoid null pointer Exception]
......@@ -1836,7 +1852,7 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
}
}
else if (suppCode != null)
/*else if (suppCode != null)
{
errList.add("VMSUPPCD");
errFields.add(childNodeName.toLowerCase());
......@@ -1845,7 +1861,7 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
{
break;
}
}
}*/
}
//Added by Suraj [11/06/2015] [To validate supplier contract code][Start]
......@@ -2150,7 +2166,7 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
if(childNodeName.equalsIgnoreCase("pf_perc"))
{
// Modified by Yashwant on 26/06/2019.Start
pfPerc = checkNull(genericUtility.getColumnValue("pf_perc", dom));
pfPerc = checkInt(genericUtility.getColumnValue("pf_perc", dom));
//pfPerc = genericUtility.getColumnValue("pf_perc", dom);
// Modified by Yashwant on 26/06/2019.End
if(pfPerc == null || Integer.parseInt(pfPerc) < 0 || Integer.parseInt(pfPerc) >100)
......@@ -2185,7 +2201,7 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
if(childNodeName.equalsIgnoreCase("grat_perc"))
{
// Modified by Yashwant on 26/06/2019.Start
gratPerc = checkNull(genericUtility.getColumnValue("grat_perc", dom));
gratPerc = checkInt(genericUtility.getColumnValue("grat_perc", dom));
//gratPerc = genericUtility.getColumnValue("grat_perc", dom);
// Modified by Yashwant on 26/06/2019.End
if(gratPerc == null || Integer.parseInt(gratPerc) < 0 || Integer.parseInt(gratPerc) >100)
......@@ -2202,7 +2218,7 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
if(childNodeName.equalsIgnoreCase("pen_perc"))
{
// Modified by Yashwant on 26/06/2019.Start
penPerc = checkNull(genericUtility.getColumnValue("pen_perc", dom));
penPerc = checkInt(genericUtility.getColumnValue("pen_perc", dom));
//penPerc = genericUtility.getColumnValue("pen_perc", dom);
// Modified by Yashwant on 26/06/2019.End
if(penPerc == null || Integer.parseInt(penPerc) < 0 || Integer.parseInt(penPerc) >100)
......@@ -2292,7 +2308,7 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
if(childNodeName.equalsIgnoreCase("print_seq"))
{
// Modified by Yashwant on 26/06/2019.Start
printSeq = checkNull(genericUtility.getColumnValue("print_seq", dom));
printSeq = checkInt(genericUtility.getColumnValue("print_seq", dom));
//printSeq = genericUtility.getColumnValue("print_seq", dom);
// Modified by Yashwant on 26/06/2019.End
if(printSeq == null || Integer.parseInt(printSeq) < 0)
......@@ -2396,7 +2412,7 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
if(childNodeName.equalsIgnoreCase("duration"))
{
// Modified by Yashwant on 26/06/2019.Start
duration = checkNull(genericUtility.getColumnValue("duration", dom));
duration = checkInt(genericUtility.getColumnValue("duration", dom));
//duration = genericUtility.getColumnValue("duration", dom);
// Modified by Yashwant on 26/06/2019.End
try{
......@@ -2426,7 +2442,7 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
if(childNodeName.equalsIgnoreCase("year"))
{
// Modified by Yashwant on 26/06/2019.Start
year = checkNull(genericUtility.getColumnValue("year", dom));
year = checkInt(genericUtility.getColumnValue("year", dom));
//year = genericUtility.getColumnValue("year", dom);
// Modified by Yashwant on 26/06/2019.End
try
......@@ -2601,7 +2617,7 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
if(childNodeName.equalsIgnoreCase("print_seq"))
{
// Modified by Yashwant on 26/06/2019.Start
printSeq = checkNull(genericUtility.getColumnValue("print_seq", dom));
printSeq = checkInt(genericUtility.getColumnValue("print_seq", dom));
//printSeq = genericUtility.getColumnValue("print_seq", dom);
// Modified by Yashwant on 26/06/2019.End
if(printSeq == null || Integer.parseInt(printSeq) < 0)
......@@ -3063,9 +3079,10 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
}
valueXmlString.append("<retirement_age>").append(maval1).append("</retirement_age>");
String retDateStr = gbSetRetirementDate(dom, connection);
String protect= gbfGetRetdateProtectFlag(dom);
valueXmlString.append("<retirement_date protect=\""+protect+"\"><![CDATA[").append("]]></retirement_date>\r\n");
valueXmlString.append("<retirement_date protect=\""+protect+"\"><![CDATA[").append(retDateStr).append("]]></retirement_date>\r\n");
//gbf_itemchg_modifier_ds(dw_edit,"retirement_date","protect", gbf_get_retdate_protect_flag())
......@@ -3204,8 +3221,8 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
*/
if(trainPrd == null)
{
trainPrd=Integer.toString(0);
valueXmlString.append("<training_prd>").append("<![CDATA[" + trainPrd + "]]>").append("</training_prd>");
//trainPrd=Integer.toString(0);
valueXmlString.append("<training_prd>").append("<![CDATA[" + 0 + "]]>").append("</training_prd>");
}
if(probPrd == null)
{
......@@ -3329,8 +3346,11 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
// Modified by Yashwant on 05/07/2019[start]
String nationality=genericUtility.getColumnValue("nationality", dom2);
if(nationality ==null)
//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)
{
String mdescr=admCommon.getEnv("999999", "NATIONAL", connection);
if(mdescr!=null && mdescr.trim().length()>0)
......@@ -3340,8 +3360,9 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
}
contactCode=genericUtility.getColumnValue("contactCode", dom2);
//Modified by Jaffar S. on 26/07/19
//contactCode=genericUtility.getColumnValue("contactCode", dom2);
contactCode=checkNull(genericUtility.getColumnValue("contactCode", dom2));
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 =?";
......@@ -3374,7 +3395,9 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
}
}
lsState=genericUtility.getColumnValue("cur_state", dom2);
//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)
{
valueXmlString.append("<cur_state protect=\"1\">").append("<![CDATA[" ).append(lsState).append( "]]>").append("</cur_state>");
......@@ -3384,14 +3407,18 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
valueXmlString.append("<cur_state protect=\"0\">").append("<![CDATA[" ).append(lsState).append( "]]>").append("</cur_state>");
}
mcode=genericUtility.getColumnValue("emp_site", dom2);
//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 )
{
valueXmlString.append("<emp_site>").append(empSite).append("</emp_site>");
//dw_edit.setitem(1 , "emp_site" , login_site)
}
mcode=genericUtility.getColumnValue("emp_site", dom2);
//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)
{
valueXmlString.append("<emp_site protect=\"1\">").append("<![CDATA[" ).append(mcode).append( "]]>").append("</emp_site>");
......@@ -3401,30 +3428,36 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
valueXmlString.append("<emp_site protect=\"0\">").append("<![CDATA[" ).append(mcode).append( "]]>").append("</emp_site>");
}
mcode=genericUtility.getColumnValue("pay_site", dom2);
//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 )
{
valueXmlString.append("<pay_site>").append(loginSite).append("</pay_site>");
//dw_edit.setitem(1 , "pay_site" , login_site)
}
mcode=genericUtility.getColumnValue("work_site", dom2);
//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 )
{
valueXmlString.append("<work_site>").append(loginSite).append("</work_site>");
//dw_edit.setitem(1 , "work_site" , login_site)
}
mval1=genericUtility.getColumnValue("notice_prd", dom2);
if(mval1==null)
{
gradeCode=genericUtility.getColumnValue("grade", dom2);
if(gradeCode!=null && gradeCode.trim().length()>0)
//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)
{
//Modified by Jaffar S. on 26/07/19
//gradeCode=genericUtility.getColumnValue("grade", dom2);
gradeCode=checkNull(genericUtility.getColumnValue("grade", dom2));
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 =? ;";
sql="select grade.notice_prd as mval2 from grade where grade.grade_code = ? ";
pstmt = connection.prepareStatement(sql);
pstmt.setString(1, gradeCode);
rs = pstmt.executeQuery();
......@@ -3446,23 +3479,29 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
}
}
String trainingPrd=genericUtility.getColumnValue("training_prd", dom2);
int periodTraining = Integer.parseInt(checkInt(trainingPrd));
//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)
{
valueXmlString.append("<training_prd>").append(0).append("</training_prd>");
//dw_edit.setitem(1, "training_prd", 0)
}
String probationPrd=genericUtility.getColumnValue("probation_prd", dom2);
int periodProb = Integer.parseInt(checkInt(probationPrd));
//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)
{
valueXmlString.append("<probation_prd>").append(0).append("</probation_prd>");
//dw_edit.setitem(1, "probation_prd", 0)
}
shiftRot=genericUtility.getColumnValue("shift_rot", dom2);
//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 )
{
valueXmlString.append("<shift_rot>").append("N").append("</shift_rot>");
......@@ -3472,7 +3511,9 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
String date=checkNull(genericUtility.getColumnValue("date_join", dom2));
//Timestamp ts=Timestamp.valueOf(genericUtility.getValidDateTimeString(date,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())+"00:00:00.0");
empCode=genericUtility.getColumnValue("emp_code", dom2);
//Modified by Jaffar S. on 26/07/19
//empCode=genericUtility.getColumnValue("emp_code", dom2);
empCode=checkNull(genericUtility.getColumnValue("emp_code", dom2));
if(date == null)
{
valueXmlString.append("<date_join protect=\"0\">").append("<![CDATA[" ).append(date).append( "]]>").append("</date_join>");
......@@ -3509,13 +3550,18 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
}
}
probation=genericUtility.getColumnValue("probation", dom2);
confirmed=genericUtility.getColumnValue("confirmed", dom2);
//trainingPrd=genericUtility.getColumnValue("training_prd", dom2);
trainingPrd=genericUtility.getColumnValue("training_prd", dom2);
int liMval1 = Integer.parseInt(checkInt(trainingPrd));
probationPrd=genericUtility.getColumnValue("probation_prd", dom2);
int liMval2 = Integer.parseInt(checkInt(probationPrd));
//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);
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);
......@@ -3548,11 +3594,12 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
}
else
{
valueXmlString.append("<training_prd protect=\"0\">").append("<![CDATA[" ).append(date).append( "]]>").append("</training_prd>");
//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>");
}
}
sql="select count(*) as count_conf from emp_statuschg where emp_code=? and status_type = 'C' and case when confirm is null then 'N' else confirm end <> 'X'";
sql="select count(*) as count_conf from emp_statuschg where emp_code= ? and status_type = 'C' and case when confirm is null then 'N' else confirm end <> 'X'";
pstmt = connection.prepareStatement(sql);
pstmt.setString(1, empCode);
rs = pstmt.executeQuery();
......@@ -3588,20 +3635,26 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
}
}
String payType=genericUtility.getColumnValue("pay_type", dom2);
if(payType!=null)
//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)
{
valueXmlString.append("<pay_type>").append("<![CDATA[S]]>").append("</pay_type>");
}
payMode =genericUtility.getColumnValue("pay_mode", dom2);
if(payMode!=null)
//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)
{
valueXmlString.append("<pay_mode>").append("<![CDATA[C]]>").append("</pay_mode>");
}
String withHeld=genericUtility.getColumnValue("with_held", dom2);
if(withHeld!=null)
//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)
{
valueXmlString.append("<with_held>").append("<![CDATA[N]]>").append("</with_held>");
}
......@@ -3609,7 +3662,9 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
liMval1=0;
liMval2=0;
String state=genericUtility.getColumnValue("per_state", dom2);
//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)
{
valueXmlString.append("<per_state protect=\"1\">").append("<![CDATA[" ).append(state).append( "]]>").append("</per_state>");
......@@ -3620,7 +3675,9 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
}
String mStatus="";
mStatus=genericUtility.getColumnValue("m_status", dom2);
//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)
{
valueXmlString.append("<m_status>").append("U").append("</m_status>");
......@@ -3631,8 +3688,9 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
valueXmlString.append("<retirement_date protect=\""+protect+"\"><![CDATA[").append(maval1).append("]]></retirement_date>\r\n");*/
String retirmentDate=genericUtility.getColumnValue("retirement_date", dom);
//Modified by Jaffar S. on 26/07/19
//String retirmentDate=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");
......@@ -4021,7 +4079,7 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
cadreCode=rs.getString("CADRE_CODE");
valueXmlString.append("<grade_descr>").append("<![CDATA[" + rs.getString("DESCR") + "]]>").append("</grade_descr>");
if(gradeCodedoc == null || editFlg.equals("A"))
if(gradeCodedoc == null ||gradeCodedoc.trim().length() == 0 || editFlg.equals("A"))
{
valueXmlString.append("<cadre_code>").append("<![CDATA[" + cadreCode + "]]>").append("</cadre_code>");
sql = " SELECT DESCR FROM CADRE WHERE CADRE_CODE = ? " ;
......@@ -4566,19 +4624,23 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
probDate =checkNull( genericUtility.getColumnValue("probation_date", dom));
// Modified by Yashwant on 26/06/2019.End
if(trainPrd != null)
//Modified condition by Jaffar S. on 26/07/19 [Start]
//if(trainPrd != null)
if(trainPrd != null && trainPrd.trim().length() > 0)
{
trainPrdint = Float.parseFloat(trainPrd);
}
if(probPrd != null)
//if(probPrd != null)
if(probPrd != null && probPrd.trim().length() > 0)
{
probPrdint = Float.parseFloat(probPrd);
}
if(probDate != null)
//if(probDate != null)
if(probDate != null && probDate.trim().length() > 0)
{
probDt = sdf.parse(probDate);
}
//Modified condition by Jaffar S. on 26/07/19 [End]
if(probPrdint == 0)
{
if(probDt != null)
......@@ -4642,18 +4704,24 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
joinDate = checkNull(genericUtility.getColumnValue("date_join", dom));
probDate = checkNull(genericUtility.getColumnValue("probation_date", dom));
// Modified by Yashwant on 26/06/2019.End
if(trainPrd != null)
//Modified condition by Jaffar S. on 26/07/19 [Start]
//if(trainPrd != null)
if(trainPrd != null && trainPrd.trim().length() > 0)
{
trainPrdint = Float.parseFloat(trainPrd);
}
if(probPrd != null)
//if(probPrd != null)
if(probPrd != null && probPrd.trim().length() > 0)
{
probPrdint = Float.parseFloat(probPrd);
}
if(joinDate != null)
//if(joinDate != null)
if(joinDate != null && joinDate.trim().length() > 0)
{
joinDt = sdf.parse(joinDate);
}
//Modified condition by Jaffar S. on 26/07/19 [End]
if(joinDt != null)
{
joinDt1 = joinDt;
......@@ -4672,7 +4740,7 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
valueXmlString.append("<probation_date>").append("<![CDATA[" ).append(date).append( "]]>").append("</probation_date>");
}
if(probPrd != null)
if(probPrd != null && probPrd.trim().length() > 0)
{
joinDt1 = addMonths(joinDt1,probPrdint);
date=sdf.format(joinDt1);
......@@ -4730,12 +4798,12 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
probDate = checkNull(genericUtility.getColumnValue("probation_date", dom));
probPrd = checkNull(genericUtility.getColumnValue("probation_prd", dom));
// Modified by Yashwant on 26/06/2019.End
if(joinDate != null)
if(joinDate != null && joinDate.trim().length() > 0)
{
System.out.println("joinDate::::::::"+joinDate);
joinDt = sdf.parse(joinDate);
if(probDate != null)
if(probDate != null && probDate.trim().length() > 0)
{
probDt = sdf.parse(probDate);
}
......@@ -4745,11 +4813,11 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
trainPrd = checkNull(genericUtility.getColumnValue("training_prd", dom));
//trainPrd = genericUtility.getColumnValue("training_prd", dom);
// Modified by Yashwant on 26/06/2019.End
if(trainPrd != null)
if(trainPrd != null && trainPrd.trim().length() > 0)
{
trainPrdint = Float.parseFloat(trainPrd);
}
if(probPrd != null)
if(probPrd != null && probPrd.trim().length() > 0)
{
probPrdint = Float.parseFloat(probPrd);
}
......@@ -5109,7 +5177,7 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
{
// Modified by Yashwant on 26/06/2019.Start
//retAge = genericUtility.getColumnValue("retirement_age", dom);
retAge = checkNull(genericUtility.getColumnValue("retirement_age", dom));
retAge = checkInt(genericUtility.getColumnValue("retirement_age", dom));
// Modified by Yashwant on 26/06/2019.End
try
{
......@@ -5447,7 +5515,7 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
pfPerc = checkNull(genericUtility.getColumnValue("pf_perc", dom));
//pfPerc = genericUtility.getColumnValue("pf_perc", dom);
// Modified by Yashwant on 26/06/2019.End
if(pfPerc != null)
if(pfPerc != null && pfPerc.trim().length() > 0)
{
pfpercent=Float.parseFloat(pfPerc);
}
......@@ -5486,7 +5554,7 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
penPerc = checkNull(genericUtility.getColumnValue("pen_perc", dom));
// Modified by Yashwant on 26/06/2019.End
System.out.println("penPerc::::::::::::::"+penPerc);
if(penPerc != null)
if(penPerc != null && penPerc.trim().length() > 0)
{
penpercent=Float.parseFloat(penPerc);
}
......@@ -5892,10 +5960,6 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
{
input = "";
}
else
{
input =input.trim();
}
return input;
}
......@@ -5905,10 +5969,6 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
{
input = "0";
}
else
{
input =input.trim();
}
return input;
}
......@@ -6314,7 +6374,215 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
//Modified by Rohini T on 27/March/2019[Req ID:A18KSUN005][end]
//Modified by Yashwant on 03/07/2019[start]
private String gbfGetRetdateProtectFlag(Document dom) throws ITMException
//gbf_get_retdate_protect_flag()
{
String lsEmpSite="";
String lsCadreCode="";
String lsGradeCode="";
String lsVarValue="";
String lsProtVal="0";
String lsStatus="";
String lsEmpCode = "";
String ldtRelieveAge = "";
java.sql.Timestamp currentDate = null,today = null ;
String ldtRelieveDate="";
String ldbirthDate = "";
//int liProtVal=0;
Connection conn=null;
E12GenericUtility genericUtility = new E12GenericUtility();
AdmCommon admCommon = new AdmCommon();
try
{
conn=getConnection();
//Modified by Poonam B on 12/07/2019[START].To add checkNull method
//ldt_relieve_date = dw_edit.getitemdatetime(1,"relieve_date")
//lsStatus=genericUtility.getColumnValue("status", dom);
ldtRelieveDate=checkNull(genericUtility.getColumnValue("relieve_date", dom));
/*ldtRelieveAge = checkNull(genericUtility.getColumnValue("retirement_age", dom));// Added By Poonam B[25-07-2019
ldbirthDate = checkNull(genericUtility.getColumnValue("birth_date", dom)); // Added By Poonam B[25-07-2019
*/ lsStatus=checkNull(genericUtility.getColumnValue("status", dom));
//Modified by Poonam B on 12/07/2019[END].To add checkNull method
//Added by Poonam B on [25/07/2019][Start]
/*int ldtRelieveAgeInt = Integer.parseInt(ldtRelieveAge);
if(ldtRelieveAge == null || ldtRelieveAgeInt <= 0 || ldbirthDate == null)
{
return lsProtVal ;
}
//Added by Poonam B on [25/07/2019][END]
*/
if(ldtRelieveDate !=null || (lsStatus != null && lsStatus.equalsIgnoreCase("S")))
{
lsProtVal="1";
}
else
{
today = new java.sql.Timestamp(System.currentTimeMillis()) ;
SimpleDateFormat sdf1 = new SimpleDateFormat(genericUtility.getDBDateFormat());
currentDate = java.sql.Timestamp.valueOf(sdf1.format(today) + " 00:00:00.000");
//Modified by Poonam B on 12/07/2019[START].To add checkNull method
/*lsEmpSite= genericUtility.getColumnValue("emp_site", dom);
lsCadreCode= genericUtility.getColumnValue("cadre_code", dom);
lsGradeCode= genericUtility.getColumnValue("grade_code", dom);*/
lsEmpCode=checkNull(genericUtility.getColumnValue("emp_code", dom));// Added By Poonam [25-07-2019]
lsEmpSite=checkNull(genericUtility.getColumnValue("emp_site", dom));
lsCadreCode=checkNull(genericUtility.getColumnValue("cadre_code", dom));
lsGradeCode=checkNull(genericUtility.getColumnValue("grade_code", dom));
//Modified by Poonam B on 12/07/2019[END].To add checkNull method
}
lsVarValue=admCommon.getAdmEnv(lsEmpSite, lsCadreCode, lsGradeCode, "PROTECT_RETIRE_DATE",today, conn);
if("NULLFOUND".equalsIgnoreCase(lsVarValue))
{
lsVarValue=admCommon.getEnv("999999", "PROTECT_RETIRE_DATE", conn);
}
if(lsVarValue==null || !lsVarValue.toUpperCase().equalsIgnoreCase("Y"))
//if isnull(ls_var_value) or upper(ls_var_value) <> "Y" then
{
lsProtVal="0";
}
else
{
lsProtVal="1";
}
}
catch (Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
System.out.println("lsProtVal:["+lsProtVal+"]");
return lsProtVal;
}
//Modified by Yashwant on 03/07/2019[End]
//Modified by Yashwant on 04/07/2019[Start]
private String gbSetRetirementDate(Document dom,Connection conn) throws ITMException
{
int retAge=0;
String retAgeStr="";
String empCode="";
String retVal="";
String retirementVarvalue="";
String siteCode="";
String gradeCode="";
String cadreCode="";
String sql="";
String BirthDate= "";
ResultSet rs = null;
PreparedStatement pstmt = null;
//DateTime ldt_birth_date, ldt_retirement_date
java.sql.Timestamp birthDate = null,retirementDate = null,today=null , currentDate = null;
AdmCommon admCommon = new AdmCommon();
UtilMethods utilmethod=new UtilMethods();
String retDateStr = "";
try
{
SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
//Modified by Poonam B on 12/07/2019[START].To add checkNull method
/*empCode= genericUtility.getColumnValue("emp_code", dom);
siteCode= genericUtility.getColumnValue("emp_site", dom);
gradeCode= genericUtility.getColumnValue("grade_code", dom);
cadreCode= genericUtility.getColumnValue("cadre_code", dom);
retAgeStr= genericUtility.getColumnValue("retirement_age", dom);
String BirthDate=checkNull(genericUtility.getColumnValue("birth_date", dom);
*/
empCode=checkNull(genericUtility.getColumnValue("emp_code", dom));
siteCode=checkNull(genericUtility.getColumnValue("emp_site", dom));
gradeCode=checkNull(genericUtility.getColumnValue("grade_code", dom));
cadreCode=checkNull(genericUtility.getColumnValue("cadre_code", dom));
//retAgeStr=checkNull(genericUtility.getColumnValue("retirement_age", dom));
retAgeStr=checkInt(genericUtility.getColumnValue("retirement_age", dom));
BirthDate=checkNull(genericUtility.getColumnValue("birth_date", dom));
try
{
retAge = Integer.parseInt(retAgeStr);
}
catch(Exception e)
{
retAge = 0;
}
//Modified by Poonam B on 12/07/2019[END].To add checkNull method
if(BirthDate != null && BirthDate.trim().length() > 0)
{
birthDate=Timestamp.valueOf(genericUtility.getValidDateTimeString
(BirthDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())+"00:00:00.0");
}
if(retAge <= 0 || birthDate == null)
{
return retDateStr;
}
today = new java.sql.Timestamp(System.currentTimeMillis()) ;
SimpleDateFormat sdf1 = new SimpleDateFormat(genericUtility.getDBDateFormat());
currentDate = java.sql.Timestamp.valueOf(sdf1.format(today) + " 00:00:00.000");
retirementVarvalue=checkNull(admCommon.getAdmEnv(siteCode, cadreCode, gradeCode, "RETIREMENT_CALC_DBF",currentDate, conn));
if("NULLFOUND".equalsIgnoreCase(retirementVarvalue))
{
retirementVarvalue = admCommon.getEnv("999999", "RETIREMENT_CALC_DBF", conn);
if(retirementVarvalue.equalsIgnoreCase("NULLFOUND") || retirementVarvalue == null || retirementVarvalue.trim().length() == 0)
{
retirementVarvalue="";
}
else if(utilmethod.left(retirementVarvalue, 4).equalsIgnoreCase("ERR"))
{
retirementVarvalue="";
}
}
if(retirementVarvalue != null && retirementVarvalue.trim().length() > 0)
{
sql = "SELECT "+retirementVarvalue+"(?,?,?)as retDate FROM DUAL";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,empCode);
pstmt.setInt(2,retAge);
pstmt.setTimestamp(3,birthDate);
rs = pstmt.executeQuery();
if(rs.next())
{
retirementDate = rs.getTimestamp("retDate");
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
if(retirementDate == null)
{
retirementDate=utilmethod.AddMonths(birthDate, retAge);
}
retDateStr = sdf.format(new Date(retirementDate.getTime()));
//valueXmlString.append("<bank_name>").append("<![CDATA["+ rs.getString("BANK_NAME") +"]]>").append("</bank_name>");
}
catch (Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
return retDateStr;
}
//Modified by Yashwant on 04/07/2019[End]
/*//Modified by Yashwant on 03/07/2019[start]
private String gbfGetRetdateProtectFlag(Document dom) throws ITMException
//gbf_get_retdate_protect_flag()
{
......@@ -6337,10 +6605,13 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
{
conn=getConnection();
ldtRelieveDate=genericUtility.getColumnValue("relieve_date", dom);
//ldtRelieveDate=genericUtility.getColumnValue("relieve_date", dom);
ldtRelieveDate=checkNull(genericUtility.getColumnValue("relieve_date", dom));
//ldt_relieve_date = dw_edit.getitemdatetime(1,"relieve_date")
lsStatus=genericUtility.getColumnValue("status", dom);
if(ldtRelieveDate !=null || (lsStatus != null && lsStatus.equalsIgnoreCase("S")))
//lsStatus=genericUtility.getColumnValue("status", dom);
lsStatus=checkNull(genericUtility.getColumnValue("status", dom));
if(ldtRelieveDate !=null && ldtRelieveDate.trim().length() > 0 || (lsStatus != null && lsStatus.equalsIgnoreCase("S")))
{
lsProtVal="1";
}
......@@ -6352,6 +6623,9 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
lsEmpSite=genericUtility.getColumnValue("emp_site", dom);
lsCadreCode=genericUtility.getColumnValue("cadre_code", dom);
lsGradeCode=genericUtility.getColumnValue("grade_code", dom);
lsEmpSite=checkNull(genericUtility.getColumnValue("emp_site", dom));
lsCadreCode=checkNull(genericUtility.getColumnValue("cadre_code", dom));
lsGradeCode=checkNull(genericUtility.getColumnValue("grade_code", dom));
}
lsVarValue=admCommon.getAdmEnv(lsEmpSite, lsCadreCode, lsGradeCode, "PROTECT_RETIRE_DATE",today, conn);
......@@ -6380,8 +6654,6 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
}
//Modified by Yashwant on 03/07/2019[End]
//Modified by Yashwant on 04/07/2019[Start]
private String gbSetRetirementDate(Document dom) throws ITMException
{
......@@ -6410,8 +6682,15 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
gradeCode=genericUtility.getColumnValue("grade_code", dom);
cadreCode=genericUtility.getColumnValue("cadre_code", dom);
retAgeStr=genericUtility.getColumnValue("retirement_age", dom);
retAge=Integer.parseInt(retAgeStr);
String BirthDate=genericUtility.getColumnValue("birth_date", dom);
empCode=checkNull(genericUtility.getColumnValue("emp_code", dom));
siteCode=checkNull(genericUtility.getColumnValue("emp_site", dom));
gradeCode=checkNull(genericUtility.getColumnValue("grade_code", dom));
cadreCode=checkNull(genericUtility.getColumnValue("cadre_code", dom));
retAgeStr=checkInt(genericUtility.getColumnValue("retirement_age", dom));
retAge=Integer.parseInt(retAgeStr);
String BirthDate=checkNull(genericUtility.getColumnValue("birth_date", dom));
Timestamp ts=Timestamp.valueOf(genericUtility.getValidDateTimeString(BirthDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())+"00:00:00.0");
......@@ -6477,6 +6756,5 @@ public class EmployeeEJB extends ValidatorEJB implements EmployeeEJBLocal,Employ
}
//Modified by Yashwant on 04/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