Commit fc5c5fd4 authored by ssalve's avatar ssalve

Sarita : Committed on 04th JUNE 2019

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@202941 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 395370a5
...@@ -232,7 +232,11 @@ public class EmployeeServicePrdAmdIC extends ValidatorEJB implements EmployeeSer ...@@ -232,7 +232,11 @@ public class EmployeeServicePrdAmdIC extends ValidatorEJB implements EmployeeSer
count = 0; count = 0;
//sql = "select count(*) as unconfirmed_record from EMP_SERVICEPRD_AMD where emp_code = ? and confirmed <> 'Y'"; //sql = "select count(*) as unconfirmed_record from EMP_SERVICEPRD_AMD where emp_code = ? and confirmed <> 'Y'";
sql = "SELECT COUNT(*) FROM EMP_SERVICEPRD_AMD WHERE EMP_CODE = ? AND(CASE WHEN CONFIRMED IS NULL THEN 'N' ELSE CONFIRMED END <> 'Y' AND CASE WHEN canceled IS NULL THEN 'N' ELSE canceled END = 'N')";
//Modified by Sarita s. on [27/06/2019][Start]
//sql = "SELECT COUNT(*) FROM EMP_SERVICEPRD_AMD WHERE EMP_CODE = ? AND(CASE WHEN CONFIRMED IS NULL THEN 'N' ELSE CONFIRMED END <> 'Y' AND CASE WHEN canceled IS NULL THEN 'N' ELSE canceled END = 'N')";
sql = "SELECT COUNT(*) FROM EMP_SERVICEPRD_AMD WHERE EMP_CODE = ? AND(CASE WHEN CONFIRMED IS NULL THEN 'N' ELSE CONFIRMED END <> 'Y' AND CASE WHEN cancelled IS NULL THEN 'N' ELSE cancelled END = 'N')";
//Modified by Sarita s. on [27/06/2019][End]
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode); pstmt.setString(1, empCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -566,9 +570,11 @@ public class EmployeeServicePrdAmdIC extends ValidatorEJB implements EmployeeSer ...@@ -566,9 +570,11 @@ public class EmployeeServicePrdAmdIC extends ValidatorEJB implements EmployeeSer
//Modified by Rohini T on[15/05/19][end] //Modified by Rohini T on[15/05/19][end]
//Modified by Rohini T on[17/06/19][start] //Modified by Rohini T on[17/06/19][start]
empCode = genericUtility.getColumnValue("emp_code", dom); empCode = checkNull(genericUtility.getColumnValue("emp_code", dom));
System.out.println("empCode====["+empCode+"]");
if(empCode != null && empCode.trim().length() > 0) if(empCode != null && empCode.trim().length() > 0)
{ {
//Called employee code itemchange if employee code is not null
StringBuffer retStr = new StringBuffer(); StringBuffer retStr = new StringBuffer();
valueXmlString.append("<emp_code><![CDATA[").append(empCode).append("]]></emp_code>\r\n"); valueXmlString.append("<emp_code><![CDATA[").append(empCode).append("]]></emp_code>\r\n");
retStr.append(valueXmlString); retStr.append(valueXmlString);
...@@ -611,9 +617,11 @@ public class EmployeeServicePrdAmdIC extends ValidatorEJB implements EmployeeSer ...@@ -611,9 +617,11 @@ public class EmployeeServicePrdAmdIC extends ValidatorEJB implements EmployeeSer
} }
retdateN = checkNull(genericUtility.getColumnValue("retirement_date_n", dom)); retdateN = checkNull(genericUtility.getColumnValue("retirement_date_n", dom));
retirementDateVarVal = checkNull(admCommon.getAdmEnv(siteCode, cadreCode, gradeCode, "PROTECT_RETIRE_DATE", new java.sql.Timestamp(System.currentTimeMillis()), conn)); retirementDateVarVal = checkNull(admCommon.getAdmEnv(siteCode, cadreCode, gradeCode, "PROTECT_RETIRE_DATE", new java.sql.Timestamp(System.currentTimeMillis()), conn));
System.out.println("PROTECT_RETIRE_DATE ::: ["+retirementDateVarVal+"]");
if(retirementDateVarVal.equalsIgnoreCase("NULLFOUND")) if(retirementDateVarVal.equalsIgnoreCase("NULLFOUND"))
{ {
retirementDateVarVal = checkNull(admCommon.getEnv("999999", "PROTECT_RETIRE_DATE", conn)); retirementDateVarVal = checkNull(admCommon.getEnv("999999", "PROTECT_RETIRE_DATE", conn));
System.out.println("PROTECT_RETIRE_DATE 111::: ["+retirementDateVarVal+"]");
} }
if("Y".equalsIgnoreCase(retirementDateVarVal) ) if("Y".equalsIgnoreCase(retirementDateVarVal) )
{ {
...@@ -730,8 +738,28 @@ public class EmployeeServicePrdAmdIC extends ValidatorEJB implements EmployeeSer ...@@ -730,8 +738,28 @@ public class EmployeeServicePrdAmdIC extends ValidatorEJB implements EmployeeSer
//System.out.println("amdNo--WHILE APPENDING["+amdNo+"]"); //System.out.println("amdNo--WHILE APPENDING["+amdNo+"]");
valueXmlString.append("<amendment_no><![CDATA[").append(amdNo).append("]]></amendment_no>\r\n"); valueXmlString.append("<amendment_no><![CDATA[").append(amdNo).append("]]></amendment_no>\r\n");
//Modified by Sarita s. on [27/06/2019][Start]
periodAmd = Integer.parseInt(genericUtility.getColumnValue("period_amended", dom));
amendmentType = checkNull(genericUtility.getColumnValue("amendment_type", dom));
System.out.println("Value of Period Amended is ::: ["+periodAmd+"] \n amendmentType ::: ["+amendmentType+"]");
StringBuffer retStr = new StringBuffer();
valueXmlString.append("<period_amended><![CDATA[").append(periodAmd).append("]]></period_amended>\r\n");
valueXmlString.append("<amendment_type><![CDATA[").append(amendmentType).append("]]></amendment_type>\r\n");
valueXmlString.append("<emp_code><![CDATA[").append(empCode).append("]]></emp_code>\r\n");
retStr.append(valueXmlString);
retStr.append("</Detail1>\r\n");
retStr.append("</Root>");
System.out.println("retStr222--["+retStr+"]");
String retString = itemChanged(retStr.toString(), "", retStr.toString(), objContext, "period_amended", editFlag, xtraParams);
System.out.println("retString::::222"+retString);
retString = retString.substring(retString.indexOf("<Detail1>")+1, retString.indexOf("</Detail1>"));
System.out.println("retString after manipulation---222["+retString+"]");
valueXmlString.append(retString);
//Modified by Rohini T on[14/06/19][start] //Modified by Rohini T on[14/06/19][start]
retdateN = checkNull(genericUtility.getColumnValue("retirement_date_n", dom)); /* retdateN = checkNull(genericUtility.getColumnValue("retirement_date_n", dom));
retirementDateVarVal = checkNull(admCommon.getAdmEnv(siteCode, cadreCode, gradeCode, "PROTECT_RETIRE_DATE", new java.sql.Timestamp(System.currentTimeMillis()), conn)); retirementDateVarVal = checkNull(admCommon.getAdmEnv(siteCode, cadreCode, gradeCode, "PROTECT_RETIRE_DATE", new java.sql.Timestamp(System.currentTimeMillis()), conn));
if(retirementDateVarVal.equalsIgnoreCase("NULLFOUND")) if(retirementDateVarVal.equalsIgnoreCase("NULLFOUND"))
{ {
...@@ -746,6 +774,8 @@ public class EmployeeServicePrdAmdIC extends ValidatorEJB implements EmployeeSer ...@@ -746,6 +774,8 @@ public class EmployeeServicePrdAmdIC extends ValidatorEJB implements EmployeeSer
valueXmlString.append("<retirement_date_n protect='0'>").append("<![CDATA[" + retdateN + "]]>").append("</retirement_date_n>\r\n"); valueXmlString.append("<retirement_date_n protect='0'>").append("<![CDATA[" + retdateN + "]]>").append("</retirement_date_n>\r\n");
} }
//Modified by Rohini T on[14/06/19][End] //Modified by Rohini T on[14/06/19][End]
*/
//Modified by Sarita s. on [27/06/2019][End]
} }
//Modified by Rohini T on[14/06/19][start] //Modified by Rohini T on[14/06/19][start]
/*else if(currentColumn.trim().equalsIgnoreCase("period_amended")) /*else if(currentColumn.trim().equalsIgnoreCase("period_amended"))
...@@ -1011,7 +1041,12 @@ public class EmployeeServicePrdAmdIC extends ValidatorEJB implements EmployeeSer ...@@ -1011,7 +1041,12 @@ public class EmployeeServicePrdAmdIC extends ValidatorEJB implements EmployeeSer
isVarValNull = true; isVarValNull = true;
} }
Calendar cal = null; Calendar cal = null;
SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy"); //Mdified by Sarita S. on [28/06/2019][Start]
//SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy");
System.out.println("birthDate==["+birthDate+"");
SimpleDateFormat format = new SimpleDateFormat(genericUtility.getDBDateFormat());
SimpleDateFormat format1 = new SimpleDateFormat(genericUtility.getApplDateFormat());
//Mdified by Sarita S. on [28/06/2019][End]
if("E".equalsIgnoreCase(amendmentType)) if("E".equalsIgnoreCase(amendmentType))
{ {
retAgeNew = retAgeOld + periodAmd; retAgeNew = retAgeOld + periodAmd;
...@@ -1020,12 +1055,17 @@ public class EmployeeServicePrdAmdIC extends ValidatorEJB implements EmployeeSer ...@@ -1020,12 +1055,17 @@ public class EmployeeServicePrdAmdIC extends ValidatorEJB implements EmployeeSer
cal = Calendar.getInstance(); cal = Calendar.getInstance();
if(retDtO != null ) if(retDtO != null )
{ {
retierDateOld = (Date) format.parse(retDtO); //Commented and Added by sarita as value comes from dom needs to format as applicationDateformat on 28 JUNE 2019 [START]
//retierDateOld = (Date) format.parse(retDtO);
format1.set2DigitYearStart(format1.parse(retDtO));
retierDateOld = (Date) (format1.parse(retDtO));
//Commented and Added by sarita as value comes from dom needs to format as applicationDateformat on 28 JUNE 2019 [END]
cal.setTime(retierDateOld); cal.setTime(retierDateOld);
cal.add(Calendar.MONTH, periodAmd); cal.add(Calendar.MONTH, periodAmd);
} }
else else
{ {
format.set2DigitYearStart(format.parse(birthDate.toString()));//Mdified by Sarita S. on [28/06/2019][Start]
retierDateOld = (Date) format.parse(birthDate.toString()); retierDateOld = (Date) format.parse(birthDate.toString());
cal.setTime(retierDateOld); cal.setTime(retierDateOld);
cal.add(Calendar.MONTH, retAgeNew); cal.add(Calendar.MONTH, retAgeNew);
...@@ -1043,12 +1083,17 @@ public class EmployeeServicePrdAmdIC extends ValidatorEJB implements EmployeeSer ...@@ -1043,12 +1083,17 @@ public class EmployeeServicePrdAmdIC extends ValidatorEJB implements EmployeeSer
cal = Calendar.getInstance(); cal = Calendar.getInstance();
if(retDtO != null) if(retDtO != null)
{ {
retierDateOld = (Date) format.parse(retDtO); //Commented and Added by sarita as value comes from dom needs to format as applicationDateformat on 28 JUNE 2019 [START]
//retierDateOld = (Date) format.parse(retDtO);
format1.set2DigitYearStart(format1.parse(retDtO));
retierDateOld = (Date) format1.parse(retDtO);
//Commented and Added by sarita as value comes from dom needs to format as applicationDateformat on 28 JUNE 2019 [END]
cal.setTime(retierDateOld); cal.setTime(retierDateOld);
cal.add(Calendar.MONTH, -periodAmd); cal.add(Calendar.MONTH, -periodAmd);
} }
else else
{ {
format.set2DigitYearStart(format1.parse(birthDate.toString()));//Mdified by Sarita S. on [28/06/2019][Start]
retierDateOld = (Date) format.parse(birthDate.toString()); retierDateOld = (Date) format.parse(birthDate.toString());
cal.setTime(retierDateOld); cal.setTime(retierDateOld);
cal.add(Calendar.MONTH, retAgeNew); cal.add(Calendar.MONTH, retAgeNew);
...@@ -1101,6 +1146,35 @@ public class EmployeeServicePrdAmdIC extends ValidatorEJB implements EmployeeSer ...@@ -1101,6 +1146,35 @@ public class EmployeeServicePrdAmdIC extends ValidatorEJB implements EmployeeSer
} }
} }
//Modified by Rohini T on[14/06/19][End] //Modified by Rohini T on[14/06/19][End]
//Added by sarita for amendment_type itemchange on 28 JUNE 2019 [START]
else if(currentColumn.trim().equalsIgnoreCase("amendment_type"))
{
System.out.println("Inside Amendment Type Itemchange...");
amendmentType = genericUtility.getColumnValue("amendment_type", dom);
empCode = genericUtility.getColumnValue("emp_code", dom);
periodAmended = genericUtility.getColumnValue("period_amended", dom);
System.out.println("periodAmended==["+periodAmended+"]");
retDtO = genericUtility.getColumnValue("retirement_date_o", dom);
retAgeO = genericUtility.getColumnValue("retirement_age_o", dom);
System.out.println("amendment_type is ["+amendmentType+"]");
StringBuffer retStr = new StringBuffer();
valueXmlString.append("<amendment_type><![CDATA[").append(amendmentType).append("]]></amendment_type>\r\n");
valueXmlString.append("<emp_code><![CDATA[").append(empCode).append("]]></emp_code>\r\n");
valueXmlString.append("<period_amended><![CDATA[").append(periodAmended).append("]]></period_amended>\r\n");
valueXmlString.append("<retirement_date_o><![CDATA[").append(retDtO).append("]]></retirement_date_o>\r\n");
valueXmlString.append("<retirement_age_o><![CDATA[").append(retAgeO).append("]]></retirement_age_o>\r\n");
retStr.append(valueXmlString);
retStr.append("</Detail1>\r\n");
retStr.append("</Root>");
System.out.println("retStr111--["+retStr+"]");
String retString = itemChanged(retStr.toString(), "", retStr.toString(), objContext, "period_amended", editFlag, xtraParams);
System.out.println("retString::::111"+retString);
retString = retString.substring(retString.indexOf("<Detail1>")+1, retString.indexOf("</Detail1>"));
System.out.println("retString after manipulation---111["+retString+"]");
valueXmlString.append(retString);
System.out.println("valueXmlString from itm_default 111--["+valueXmlString+"]");
}
//Added by sarita for amendment_type itemchange on 28 JUNE 2019 [END]
} }
valueXmlString.append("</Detail1>\r\n"); valueXmlString.append("</Detail1>\r\n");
break; break;
......
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