Commit 6c9bd666 authored by ssalve's avatar ssalve

Sarita : Committed on 18 July 2019

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@203710 ce508802-f39f-4f6c-b175-0d175dae99d5
parent fd62b962
......@@ -126,7 +126,7 @@ public class EmpWorkInfo extends ValidatorEJB implements EmpWorkInfoLocal ,EmpWo
String cadreCode = "";
String gradeCode = "";
//Modified by Rohini T on 27/March/2019[Req ID:A18KSUN005][end]
String siteCode = "" ; //Added by sarita on 18 July 2019
//Modified By Hemlata on[20/11/2014] [As per changes in framework to use genericUtility ][Start]
//GenericUtility genericUtility = GenericUtility.getInstance();
E12GenericUtility genericUtility = new E12GenericUtility();
......@@ -422,6 +422,45 @@ public class EmpWorkInfo extends ValidatorEJB implements EmpWorkInfoLocal ,EmpWo
valueXmlString.append("<probation_prd protect=\"0\"><![CDATA[").append(probationPrd).append("]]></probation_prd>\r\n");
}
}
//Added by sarita on 18 JULY 2019 to set protect/un-protect retirement_date [START]
dateAf = genericUtility.getColumnValue("retirement_date", dom);
System.out.println("retirement_date :: ["+dateAf+"]");
sql = "SELECT PAY_SITE, CADRE, GRADE,BIRTH_DATE FROM EMPLOYEE WHERE EMP_CODE = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,empCode);
rs = pstmt.executeQuery();
if(rs.next())
{
siteCode = checkNull(rs.getString("PAY_SITE"));
cadreCode = checkNull(rs.getString("CADRE"));
gradeCode = checkNull(rs.getString("GRADE"));
birthDateDT = rs.getDate("BIRTH_DATE");
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
retirementDateVarVal = checkNull(admCommon.getAdmEnv(siteCode, cadreCode, gradeCode, "PROTECT_RETIRE_DATE", new java.sql.Timestamp(System.currentTimeMillis()), conn));
if(retirementDateVarVal.equalsIgnoreCase("NULLFOUND"))
{
retirementDateVarVal = checkNull(admCommon.getEnv("999999", "PROTECT_RETIRE_DATE", conn));
}
if("Y".equalsIgnoreCase(retirementDateVarVal) )
{
valueXmlString.append("<retirement_date protect='1'>").append("<![CDATA[" + dateAf + "]]>").append("</retirement_date>\r\n");
}
else
{
valueXmlString.append("<retirement_date protect='0'>").append("<![CDATA[" + dateAf + "]]>").append("</retirement_date>\r\n");
}
//Added by sarita on 18 JULY 2019 to set protect/un-protect retirement_date[END]
}
else if (currentColumn.equalsIgnoreCase("emp_site"))
{
......@@ -642,7 +681,17 @@ public class EmpWorkInfo extends ValidatorEJB implements EmpWorkInfoLocal ,EmpWo
if(currentColumn.trim().equalsIgnoreCase("retirement_age"))
{
retAge = genericUtility.getColumnValue("retirement_age", dom);
retirementAge = Integer.parseInt(retAge);
//Modified by Rohini T on 18/07/19 [start]
try
{
retirementAge = (retAge != null && retAge.trim().length() > 0 ) ?Integer.parseInt(retAge):0;
}
catch (Exception e)
{
e.getMessage();
}
//retirementAge = Integer.parseInt(retAge);
//Modified by Rohini T on 18/07/19 [end]
//Modified by Rohini T on 26/04/19 [start]
//retireAge = retirementAge * 12;
retireAge = retirementAge ;
......@@ -651,7 +700,7 @@ public class EmpWorkInfo extends ValidatorEJB implements EmpWorkInfoLocal ,EmpWo
System.out.println("empCode:::::::"+empCode);
//Modified by Rohini T on[15/05/19][start]
//Modified by Rohini T on[15/05/19][start]
String siteCode = "" ;
//String siteCode = "" ; Commented by sarita on 18 JULY 2019
sql = "SELECT PAY_SITE, CADRE, GRADE,BIRTH_DATE FROM EMPLOYEE WHERE EMP_CODE = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,empCode);
......@@ -688,7 +737,7 @@ public class EmpWorkInfo extends ValidatorEJB implements EmpWorkInfoLocal ,EmpWo
retirementDateVarVal = checkNull(admCommon.getAdmEnv(siteCode, cadreCode, gradeCode, "PROTECT_RETIRE_DATE", new java.sql.Timestamp(System.currentTimeMillis()), conn));
if(retirementDateVarVal.equalsIgnoreCase("NULLFOUND"))
{
retirementDateVarVal = checkNull(admCommon.getEnv("999999", "PROTECT_RETIRE_DATE", conn));
retirementDateVarVal = checkNull(admCommon.getEnv("999999", "PROTECT_RETIRE_DATE", conn));
}
//Modified by Rohini T on [15/05/19][end]
......@@ -717,7 +766,7 @@ public class EmpWorkInfo extends ValidatorEJB implements EmpWorkInfoLocal ,EmpWo
}
else
{
dateAf = getCurrdateAppFormat(RetDateDT);
dateAf = getCurrdateAppFormat(RetDateDT);
}
if(rs != null)
{
......@@ -733,6 +782,8 @@ public class EmpWorkInfo extends ValidatorEJB implements EmpWorkInfoLocal ,EmpWo
{
dateAf = getCurrdateAppFormat(toDate);
}
//Modified by Rohini T on 18/07/19 [start]
/*
if("N".equalsIgnoreCase(retirementDateVarVal) )
{
valueXmlString.append("<retirement_date protect='1'>").append("<![CDATA[" + dateAf + "]]>").append("</retirement_date>\r\n");
......@@ -740,14 +791,19 @@ public class EmpWorkInfo extends ValidatorEJB implements EmpWorkInfoLocal ,EmpWo
else
{
valueXmlString.append("<retirement_date protect='0'>").append("<![CDATA[" + dateAf + "]]>").append("</retirement_date>\r\n");
}
}*/
//Modified by Rohini T on 18/07/19 [end]
}
}
else
{
sql = "select DBF_CALC_RETIRE_DATE( ?,?,?) as retirement_date" +
//Modified by Rohini T on 18/07/19 [start]
/*sql = "select DBF_CALC_RETIRE_DATE( ?,?,?) as retirement_date" +
" from dual";*/
sql = "select "+varValue+"( ?,?,?) as retirement_date" +
" from dual";
//Modified by Rohini T on 18/07/19 [end]
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,empCode);
pstmt.setDouble(2, retireAge);
......@@ -772,7 +828,10 @@ public class EmpWorkInfo extends ValidatorEJB implements EmpWorkInfoLocal ,EmpWo
if(RetDateDT != null )
{
dateAf = getCurrdateAppFormat(RetDateDT);
//System.out.println("dateAf:::"+dateAf);
}
//Modified by Rohini T on 18/07/19 [start]
/*
if("N".equalsIgnoreCase(retirementDateVarVal) )
{
valueXmlString.append("<retirement_date protect='1'>").append("<![CDATA[" + dateAf + "]]>").append("</retirement_date>\r\n");
......@@ -780,8 +839,20 @@ public class EmpWorkInfo extends ValidatorEJB implements EmpWorkInfoLocal ,EmpWo
else
{
valueXmlString.append("<retirement_date protect='0'>").append("<![CDATA[" + dateAf + "]]>").append("</retirement_date>\r\n");
}
}*/
//Modified by Rohini T on 18/07/19 [end]
}
//Modified by Rohini T on 18/07/19 [start]
System.out.println("PROTECT_RETIRE_DATE :: ["+retirementDateVarVal+"]");
if("Y".equalsIgnoreCase(retirementDateVarVal) )
{
valueXmlString.append("<retirement_date protect='1'>").append("<![CDATA[" + dateAf + "]]>").append("</retirement_date>\r\n");
}
else
{
valueXmlString.append("<retirement_date protect='0'>").append("<![CDATA[" + dateAf + "]]>").append("</retirement_date>\r\n");
}
//Modified by Rohini T on 18/07/19 [end]
}
//Modified by Rohini T on 27/March/2019[Req ID:A18KSUN005][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