Commit d06c2c00 authored by sghate's avatar sghate

Updated component on 14/02/2020

StatusChangeConfirm.java
StatusChangeIC.java


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@216628 ce508802-f39f-4f6c-b175-0d175dae99d5
parent aa7318a3
...@@ -28,25 +28,35 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang ...@@ -28,25 +28,35 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang
String retString = ""; String retString = "";
Connection conn = null; Connection conn = null;
boolean isError = false; boolean isError = false;
try try
{ {
conn = getConnection(); conn = getConnection();
retString = gbfPostLogic(tranId,xtraParams,forcedFlag,conn); retString = gbfPostLogic(tranId,xtraParams,forcedFlag,conn);
System.out.println("returning String from StatusChangeConfirm :confirm():==>[" + retString + "]"); System.out.println("returning String from StatusChangeConfirm :confirm():==>[" + retString + "]");
//Modified by shital on 14/02/2020 [Start]
if(retString == null || retString.trim().length() == 0) /*if(retString == null || retString.trim().length() == 0)
{ {
isError = false; isError = false;
retString = itmDBAccessEJB.getErrorString("", "VTINVCONF3", "", "", conn); retString = itmDBAccessEJB.getErrorString("", "VTINVCONF3", "", "", conn);
return retString; return retString;
} }
else else
{ {
isError = true; isError = true;
}*/
if(retString != null && retString.trim().length() > 0 && retString.indexOf("VTINVCONF3")<0)
{
conn.rollback();
}
else
{
conn.commit();
retString = itmDBAccessEJB.getErrorString("","VTINVCONF3" , "", "", conn);
} }
//Modified by shital on 14/02/2020 [End]
} }
catch(Exception e) catch(Exception e)
{ {
...@@ -58,9 +68,9 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang ...@@ -58,9 +68,9 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang
{ {
try try
{ {
if(conn != null) if(conn != null) //Modified by shital on 14/02/2020
{ {
if(isError) /*if(isError)
{ {
conn.rollback(); conn.rollback();
System.out.println("Connection rollback"); System.out.println("Connection rollback");
...@@ -70,7 +80,7 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang ...@@ -70,7 +80,7 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang
conn.commit(); conn.commit();
System.out.println("Connection committed"); System.out.println("Connection committed");
} }*/
conn.close(); conn.close();
conn = null; conn = null;
} }
...@@ -107,32 +117,32 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang ...@@ -107,32 +117,32 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang
String chgTerm = ""; String chgTerm = "";
String termId = "" , confirm = "",tranDateStr =""; String termId = "" , confirm = "",tranDateStr ="";
ArrayList tranIdList = new ArrayList(); ArrayList tranIdList = new ArrayList();
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
try try
{ {
System.out.println("Inside Post Logic Method..!!!!"); System.out.println("Inside Post Logic Method..!!!!");
sdf =new SimpleDateFormat(genericUtility.getApplDateFormat()); sdf =new SimpleDateFormat(genericUtility.getApplDateFormat());
userId = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode")); userId = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode"));
chgTerm = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "termId")); chgTerm = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "termId"));
loginEmpCode = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode")); loginEmpCode = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode"));
runMode = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "runMode")); runMode = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "runMode"));
System.out.println("userId["+userId+"]\t chgTerm["+chgTerm+"]\t loginEmpCode["+loginEmpCode+"]\t runMode["+runMode+"]"); System.out.println("userId["+userId+"]\t chgTerm["+chgTerm+"]\t loginEmpCode["+loginEmpCode+"]\t runMode["+runMode+"]");
tranIdList = GenericUtility.getInstance().getTokenList(tranId, ":"); tranIdList = GenericUtility.getInstance().getTokenList(tranId, ":");
System.out.println("tranIdList:::::::::::"+tranIdList); System.out.println("tranIdList:::::::::::"+tranIdList);
lsEmpCode = (String) tranIdList.get(0); lsEmpCode = (String) tranIdList.get(0);
tranDateStr = (String) tranIdList.get(1); tranDateStr = (String) tranIdList.get(1);
System.out.println("empCode:::::::::"+lsEmpCode); System.out.println("empCode:::::::::"+lsEmpCode);
System.out.println("tranIdStr:::::::::"+tranDateStr); System.out.println("tranIdStr:::::::::"+tranDateStr);
if(tranDateStr != null && tranDateStr.trim().length() > 0) if(tranDateStr != null && tranDateStr.trim().length() > 0)
{ {
ldTranDate = java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDateStr,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())); ldTranDate = java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDateStr,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()));
} }
System.out.println("ldTranDate:::::::::=="+ldTranDate);
sql = "select case when confirm is null then 'N' else confirm end as confirm ," sql = "select case when confirm is null then 'N' else confirm end as confirm ,"
+ " tran_id ," + " tran_id ,"
+ " remarks " + " remarks "
...@@ -177,12 +187,12 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang ...@@ -177,12 +187,12 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang
else if("X".equalsIgnoreCase(confirm)) else if("X".equalsIgnoreCase(confirm))
{ {
errString = itmDBAccessEJB.getErrorString("", "VTEMPSTS02", userId, "", conn); errString = itmDBAccessEJB.getErrorString("", "VTEMPSTS02", userId, "", conn);
return errString; //return errString;
} }
else else
{ {
errString = itmDBAccessEJB.getErrorString("", "VTMCONF1", userId, "", conn); errString = itmDBAccessEJB.getErrorString("", "VTMCONF1", userId, "", conn);
return errString; //return errString;
} }
if(errString == null || errString.trim().length() == 0) if(errString == null || errString.trim().length() == 0)
...@@ -240,6 +250,7 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang ...@@ -240,6 +250,7 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang
pstmt = null; pstmt = null;
} }
liCnt = 0;
if(liCnt > 0) if(liCnt > 0)
{ {
liCnt = 0; liCnt = 0;
...@@ -254,24 +265,26 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang ...@@ -254,24 +265,26 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang
pstmt.setString(1, tranId); pstmt.setString(1, tranId);
cnt = pstmt.executeUpdate(); cnt = pstmt.executeUpdate();
if(cnt > 0) if(cnt > 0)
{ {
System.out.println("Data Updated in obj_sign_trans table.."); System.out.println("Data Updated in obj_sign_trans table..");
} }
if(pstmt != null) if(pstmt != null)
{ {
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
} }
else /*else //Commented by shital on 14/02/2020
{ {
errString = itmDBAccessEJB.getErrorString("", "DS000", userId, "", conn); errString = itmDBAccessEJB.getErrorString("", "DS000", userId, "", conn);
} }*/
} }
else /*else
{ {
errString = itmDBAccessEJB.getErrorString("", "DS000", userId, "", conn); errString = itmDBAccessEJB.getErrorString("", "DS000", userId, "", conn);
} }*/ //Commented by shital on 14/02/2020
int cnt1 = 0;
sql = "update wf_prc_status " sql = "update wf_prc_status "
+ "set " + "set "
+ "process_status = 3, " + "process_status = 3, "
...@@ -281,11 +294,11 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang ...@@ -281,11 +294,11 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang
+ "and process_status < 3"; + "and process_status < 3";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId); pstmt.setString(1, tranId);
int cnt1 = pstmt.executeUpdate(); cnt1 = pstmt.executeUpdate();
if(cnt1 > 0) if(cnt1 > 0)
{ {
System.out.println("Data Updated in wf_prc_status table.."); System.out.println("Data Updated in wf_prc_status table..");
} }
if(pstmt != null) if(pstmt != null)
{ {
pstmt.close(); pstmt.close();
...@@ -305,7 +318,7 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang ...@@ -305,7 +318,7 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang
if(lsRemarks != null && lsRemarks.length() > 1500) if(lsRemarks != null && lsRemarks.length() > 1500)
{ {
lsRemarks = utilMethod.mid(lsRemarks, 1, 1500); lsRemarks = utilMethod.mid(lsRemarks, 1, 1500);
sql = "update emp_statuschg " sql = "update emp_statuschg "
+ "set remarks = ? " + "set remarks = ? "
+ "where " + "where "
...@@ -325,7 +338,7 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang ...@@ -325,7 +338,7 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang
} }
} }
} }
/* if(errString == null || errString.trim().length() == 0) /* if(errString == null || errString.trim().length() == 0)
{ {
errString = itmDBAccessEJB.getErrorString("", "VTMCONF2", userId, "", conn); errString = itmDBAccessEJB.getErrorString("", "VTMCONF2", userId, "", conn);
return errString; return errString;
...@@ -407,26 +420,26 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang ...@@ -407,26 +420,26 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang
ldToday = utilMethod.dateTime(utilMethod.today() , utilMethod.stringToTime("00:00")); ldToday = utilMethod.dateTime(utilMethod.today() , utilMethod.stringToTime("00:00"));
termId = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "termId")); termId = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "termId"));
userId = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode")); userId = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode"));
sql = "select " sql = "select "
+ "extend ," + "extend ,"
+ "status_type ," + "status_type ,"
+ "date__due_chg ," + "date__due_chg ,"
+ "months_extend ," + "months_extend ,"
+ "notice_prd ," + "notice_prd ,"
+ "date__effchg ," + "date__effchg ,"
+ "grade_n , " + "grade_n , "
+ "cadre_n , " + "cadre_n , "
+ "design_code_n , " + "design_code_n , "
+ "designation_n , " + "designation_n , "
+ "emp_code__aprv , " + "emp_code__aprv , "
+ "conf_date , " + "conf_date , "
+ "eligible_ot ," + "eligible_ot ,"
+ "case when confirm is null then 'N' else confirm end as confirm " + "case when confirm is null then 'N' else confirm end as confirm "
+ "from emp_statuschg " + "from emp_statuschg "
+ "where " + "where "
+ "emp_code = ? " + "emp_code = ? "
+ "and tran_date= ?"; + "and tran_date= ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode); pstmt.setString(1, empCode);
pstmt.setTimestamp(2, tranDate); pstmt.setTimestamp(2, tranDate);
...@@ -476,9 +489,9 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang ...@@ -476,9 +489,9 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang
if("P".equalsIgnoreCase(mstatus)) if("P".equalsIgnoreCase(mstatus))
{ {
sql = "select probation_prd as li_probprd " sql = "select probation_prd as li_probprd "
+ "from " + "from "
+ "employee " + "employee "
+ "where emp_code = ?"; + "where emp_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode); pstmt.setString(1, empCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -497,25 +510,25 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang ...@@ -497,25 +510,25 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
ldConf = utilmethod.AddMonths(meffdate, liProbprd); ldConf = utilmethod.AddMonths(meffdate, liProbprd);
System.out.println("ldConf :: ["+ldConf+"]"); System.out.println("ldConf :: ["+ldConf+"]");
sql = "UPDATE employee " sql = "UPDATE employee "
+ "set probation = 'Y', " + "set probation = 'Y', "
+ "probation_date = ? ," + "probation_date = ? ,"
+ "notice_prd = ? ," + "notice_prd = ? ,"
+ "date_conf = ? ," + "date_conf = ? ,"
+ "grade = ? , " + "grade = ? , "
+ "cadre = ? ," + "cadre = ? ,"
+ "design_code = ? ," + "design_code = ? ,"
+ "designation = ? ," + "designation = ? ,"
+ "chg_date = ? ," + "chg_date = ? ,"
+ "chg_user = ? ," + "chg_user = ? ,"
+ "chg_term = ? ," + "chg_term = ? ,"
+ "eligible_ot = ? " + "eligible_ot = ? "
+ "where emp_code = ?"; + "where emp_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1,meffdate); pstmt.setTimestamp(1,meffdate);
pstmt.setDouble(2,lcNoticePrd); pstmt.setDouble(2,lcNoticePrd);
...@@ -536,24 +549,24 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang ...@@ -536,24 +549,24 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
System.out.println("liProbprd222222"+liProbprd); System.out.println("liProbprd222222"+liProbprd);
if (liProbprd == 0) if (liProbprd == 0)
{ {
sql = "update employee " sql = "update employee "
+ "set " + "set "
+ "confirmed = 'Y', " + "confirmed = 'Y', "
+ "grade = ? , " + "grade = ? , "
+ "cadre = ? , " + "cadre = ? , "
+ "design_code = ? ," + "design_code = ? ,"
+ "designation = ? , " + "designation = ? , "
+ "notice_prd = ? , " + "notice_prd = ? , "
+ "chg_date= ? , " + "chg_date= ? , "
+ "chg_user = ? ," + "chg_user = ? ,"
+ "chg_term = ? ," + "chg_term = ? ,"
+ "eligible_ot = ? " + "eligible_ot = ? "
+ "where " + "where "
+ "emp_code = ?"; + "emp_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,lsGrade); pstmt.setString(1,lsGrade);
pstmt.setString(2,lsCadre); pstmt.setString(2,lsCadre);
...@@ -567,16 +580,16 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang ...@@ -567,16 +580,16 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang
pstmt.setString(10,empCode); pstmt.setString(10,empCode);
cnt = pstmt.executeUpdate(); cnt = pstmt.executeUpdate();
if(cnt > 0) if(cnt > 0)
{ {
System.out.println("Data Updated for employee"); System.out.println("Data Updated for employee");
} }
} }
if(pstmt != null) if(pstmt != null)
{ {
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
} }
else else
{ {
...@@ -585,20 +598,20 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang ...@@ -585,20 +598,20 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang
if("C".equalsIgnoreCase(mstatus)) if("C".equalsIgnoreCase(mstatus))
{ {
sql = "UPDATE employee " sql = "UPDATE employee "
+ "set " + "set "
+ "confirmed = 'Y'," + "confirmed = 'Y',"
+ "date_conf = ? ," + "date_conf = ? ,"
+ "notice_prd = ? ," + "notice_prd = ? ,"
+ "grade = ? ," + "grade = ? ,"
+ "cadre = ? ," + "cadre = ? ,"
+ "design_code = ? ," + "design_code = ? ,"
+ "designation = ? ," + "designation = ? ,"
+ "chg_date= ? ," + "chg_date= ? ,"
+ "chg_user = ? ," + "chg_user = ? ,"
+ "chg_term = ? ," + "chg_term = ? ,"
+ "eligible_ot = ? " + "eligible_ot = ? "
+ "where " + "where "
+ "emp_code = ?"; + "emp_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1,meffdate); pstmt.setTimestamp(1,meffdate);
pstmt.setDouble(2,lcNoticePrd); pstmt.setDouble(2,lcNoticePrd);
...@@ -627,11 +640,11 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang ...@@ -627,11 +640,11 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang
if("Y".equalsIgnoreCase(mexten)) if("Y".equalsIgnoreCase(mexten))
{ {
sql = "update " sql = "update "
+ "emp_statuschg " + "emp_statuschg "
+ "set date__effchg = ? " + "set date__effchg = ? "
+ "where " + "where "
+ "emp_code = ? " + "emp_code = ? "
+ "and tran_date = ?"; + "and tran_date = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1,mduedtchg); pstmt.setTimestamp(1,mduedtchg);
pstmt.setString(2,empCode); pstmt.setString(2,empCode);
...@@ -639,9 +652,9 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang ...@@ -639,9 +652,9 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang
int cnt3 = pstmt.executeUpdate(); int cnt3 = pstmt.executeUpdate();
System.out.println("cnt333333333"+cnt3); System.out.println("cnt333333333"+cnt3);
if(cnt3 > 0) if(cnt3 > 0)
{ {
System.out.println("Data Updated for emp_statuschg"); System.out.println("Data Updated for emp_statuschg");
} }
} }
if(pstmt != null) if(pstmt != null)
{ {
...@@ -655,14 +668,14 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang ...@@ -655,14 +668,14 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang
{ {
mduedt = utilmethod.AddMonths(mduedtchg, mmonth); mduedt = utilmethod.AddMonths(mduedtchg, mmonth);
System.out.println("mduedt is ["+mduedt+"]"); System.out.println("mduedt is ["+mduedt+"]");
sql = "select " sql = "select "
+ "training_prd, " + "training_prd, "
+ "date_conf " + "date_conf "
+ "from " + "from "
+ "employee " + "employee "
+ "where " + "where "
+ "emp_code = ?"; + "emp_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode); pstmt.setString(1, empCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -685,23 +698,23 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang ...@@ -685,23 +698,23 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang
mextprd = mmonth + mVal; mextprd = mmonth + mVal;
ldConf = utilmethod.AddMonths(ldConf, mmonth); ldConf = utilmethod.AddMonths(ldConf, mmonth);
System.out.println("mextprd ["+mextprd+"] \t ldConf ["+ldConf+"]"); System.out.println("mextprd ["+mextprd+"] \t ldConf ["+ldConf+"]");
sql = "Update " sql = "Update "
+ "employee " + "employee "
+ "set " + "set "
+ "probation_date = ? ," + "probation_date = ? ,"
+ "training_prd = ? , " + "training_prd = ? , "
+ "grade = ? ," + "grade = ? ,"
+ "cadre = ?," + "cadre = ?,"
+ "design_code = ? ," + "design_code = ? ,"
+ "designation = ? ," + "designation = ? ,"
+ "notice_prd = ? ," + "notice_prd = ? ,"
+ "chg_date= ? ," + "chg_date= ? ,"
+ "chg_user = ? ," + "chg_user = ? ,"
+ "chg_term = ? ," + "chg_term = ? ,"
+ "eligible_ot = ? " + "eligible_ot = ? "
+ "Where " + "Where "
+ "emp_code = ?"; + "emp_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1,mduedt); pstmt.setTimestamp(1,mduedt);
pstmt.setInt(2,mextprd); pstmt.setInt(2,mextprd);
...@@ -718,9 +731,9 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang ...@@ -718,9 +731,9 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang
int cnt4 = pstmt.executeUpdate(); int cnt4 = pstmt.executeUpdate();
System.out.println("cnt4"+cnt4); System.out.println("cnt4"+cnt4);
if(cnt4 > 0) if(cnt4 > 0)
{ {
System.out.println("Data Updated for emp_statuschg"); System.out.println("Data Updated for emp_statuschg");
} }
if(pstmt != null) if(pstmt != null)
{ {
pstmt.close(); pstmt.close();
...@@ -737,18 +750,18 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang ...@@ -737,18 +750,18 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang
System.out.println("mduedt-----"+mduedt); System.out.println("mduedt-----"+mduedt);
sql = "select " sql = "select "
+ "probation_prd " + "probation_prd "
+ "from " + "from "
+ "employee " + "employee "
+ "where " + "where "
+ "emp_code = ?"; + "emp_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode); pstmt.setString(1, empCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
mVal = rs.getInt("probation_prd"); mVal = rs.getInt("probation_prd");
} }
System.out.println("mVal:::::"+mVal); System.out.println("mVal:::::"+mVal);
if(rs != null) if(rs != null)
...@@ -762,26 +775,26 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang ...@@ -762,26 +775,26 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang
pstmt = null; pstmt = null;
} }
} }
mextprd = mmonth + mVal; mextprd = mmonth + mVal;
System.out.println("mextprd ::: ["+mextprd+"]"); System.out.println("mextprd ::: ["+mextprd+"]");
sql = "Update " sql = "Update "
+ "employee " + "employee "
+ "set " + "set "
+ "date_conf = ? , " + "date_conf = ? , "
+ "probation_prd = ? ," + "probation_prd = ? ,"
+ "grade = ? ," + "grade = ? ,"
+ "cadre = ? ," + "cadre = ? ,"
+ "design_code = ? ," + "design_code = ? ,"
+ "designation = ? , " + "designation = ? , "
+ "notice_prd = ? ," + "notice_prd = ? ,"
+ "chg_date= ? ," + "chg_date= ? ,"
+ "chg_user = ? , " + "chg_user = ? , "
+ "chg_term = ? ," + "chg_term = ? ,"
+ "eligible_ot = ? " + "eligible_ot = ? "
+ "where " + "where "
+ "emp_code = ?"; + "emp_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1,mduedt); pstmt.setTimestamp(1,mduedt);
pstmt.setInt(2,mextprd); pstmt.setInt(2,mextprd);
...@@ -798,9 +811,9 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang ...@@ -798,9 +811,9 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang
int cnt5 = pstmt.executeUpdate(); int cnt5 = pstmt.executeUpdate();
System.out.println("cnt5"+cnt5); System.out.println("cnt5"+cnt5);
if(cnt5 > 0) if(cnt5 > 0)
{ {
System.out.println("Data Updated for employee"); System.out.println("Data Updated for employee");
} }
if(pstmt != null) if(pstmt != null)
{ {
pstmt.close(); pstmt.close();
...@@ -808,17 +821,17 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang ...@@ -808,17 +821,17 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang
} }
} }
} }
sql = "update " sql = "update "
+ "emp_statuschg " + "emp_statuschg "
+ "set " + "set "
+ "confirm = 'Y' , " + "confirm = 'Y' , "
+ "conf_date = ? , " + "conf_date = ? , "
+ "emp_code__aprv = ? " + "emp_code__aprv = ? "
+ "where " + "where "
+ "emp_code = ? " + "emp_code = ? "
+ "and " + "and "
+ "tran_date = ?"; + "tran_date = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1,ldConfDate); pstmt.setTimestamp(1,ldConfDate);
pstmt.setString(2,lsEmpAprv); pstmt.setString(2,lsEmpAprv);
...@@ -827,9 +840,9 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang ...@@ -827,9 +840,9 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang
int cnt6 = pstmt.executeUpdate(); int cnt6 = pstmt.executeUpdate();
System.out.println("cnt6"+cnt6); System.out.println("cnt6"+cnt6);
if(cnt6 > 0) if(cnt6 > 0)
{ {
System.out.println("Data Updated for emp_statuschg"); System.out.println("Data Updated for emp_statuschg");
} }
if(pstmt != null) if(pstmt != null)
{ {
pstmt.close(); pstmt.close();
...@@ -866,7 +879,7 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang ...@@ -866,7 +879,7 @@ public class StatusChangeConfirm extends ActionHandlerEJB implements StatusChang
} }
return lsErrcode; return lsErrcode;
} }
private String checkNull(String input) private String checkNull(String input)
{ {
if (input == null) if (input == null)
......
...@@ -25,7 +25,7 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal, ...@@ -25,7 +25,7 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal,
E12GenericUtility genericUtility = new E12GenericUtility(); E12GenericUtility genericUtility = new E12GenericUtility();
AdmCommon adm = new AdmCommon(); AdmCommon adm = new AdmCommon();
FinCommon finCommon = new FinCommon(); FinCommon finCommon = new FinCommon();
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException, ITMException public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException, ITMException
{ {
Document dom = null; Document dom = null;
...@@ -115,7 +115,7 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal, ...@@ -115,7 +115,7 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal,
ArrayList<String> errList = new ArrayList<String>(); ArrayList<String> errList = new ArrayList<String>();
ArrayList<String> errFields = new ArrayList<String>(); ArrayList<String> errFields = new ArrayList<String>();
Timestamp dateEffchg = null , tranDate = null , ldTrandateO = null , ldStatusDateX = null , ldProbDate = null , Timestamp dateEffchg = null , tranDate = null , ldTrandateO = null , ldStatusDateX = null , ldProbDate = null ,
ldConfDate = null , reliveDate = null; ldConfDate = null , reliveDate = null;
try try
{ {
conn = getConnection(); conn = getConnection();
...@@ -130,48 +130,169 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal, ...@@ -130,48 +130,169 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal,
switch (currentFormNo) switch (currentFormNo)
{ {
case 1: case 1:
{
parentNodeList = dom.getElementsByTagName("Detail1");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength();
for (int ctr = 0; ctr < childNodeListLength; ctr++)
{ {
parentNodeList = dom.getElementsByTagName("Detail1"); childNode = childNodeList.item(ctr);
parentNode = parentNodeList.item(0); if (childNode.getNodeType() != Node.ELEMENT_NODE)
childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength();
for (int ctr = 0; ctr < childNodeListLength; ctr++)
{ {
childNode = childNodeList.item(ctr); continue;
if (childNode.getNodeType() != Node.ELEMENT_NODE) }
childNodeName = childNode.getNodeName();
System.out.println("childNodeName.editFlag." + childNodeName + "@V@ Edit flag :-" + editFlag);
if("date__effchg".equalsIgnoreCase(childNodeName))
{
empCode = checkNull(genericUtility.getColumnValue("emp_code",dom));
dateEffchgStr = checkNull(genericUtility.getColumnValue("date__effchg",dom));
System.out.println("dateEffchgStr::::::::::::::::"+dateEffchgStr);
System.out.println("empCode::::::::::::::::"+empCode);
if(dateEffchgStr != null && dateEffchgStr.trim().length() > 0)
{
dateEffchg = Timestamp.valueOf(genericUtility.getValidDateString(dateEffchgStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
}
if(dateEffchgStr == null || dateEffchgStr.trim().length() == 0 )
{
errList.add("VTEMPSTS04"); //Effective date is blank, please specify effective date
errFields.add(childNodeName.toLowerCase());
}
else
{
sql = " select pay_site as ls_site from employee where emp_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode);
rs = pstmt.executeQuery();
if(rs.next())
{
lsSite = checkNull(rs.getString("ls_site"));
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
if(dateEffchgStr != null && dateEffchgStr.trim().length() > 0)
{
errCode = checkNull(finCommon.nfCheckPeriod("ADM", dateEffchg, lsSite, conn));
}
else if(errCode != null && errCode.trim().length() > 0)
{ {
continue; if("VTPRD2".equalsIgnoreCase(errCode))
{
errList.add("VTPRDTEMP1");//This is a temporary error for status change
errFields.add(childNodeName.toLowerCase());
}
else if("VTPRDADM".equalsIgnoreCase(errCode))
{
errList.add("VTPRDTEMP2");//Period status not defined for Admin
errFields.add(childNodeName.toLowerCase());
}
} }
childNodeName = childNode.getNodeName(); }
System.out.println("childNodeName.editFlag." + childNodeName + "@V@ Edit flag :-" + editFlag);
else if("emp_code".equalsIgnoreCase(childNodeName))
{
System.out.println("empCode:::::::::"+empCode);
if("date__effchg".equalsIgnoreCase(childNodeName)) empCode = checkNull(genericUtility.getColumnValue("emp_code", dom));
lsEmpcodeO = checkNull(genericUtility.getColumnValue("emp_code_orig", dom));
dateEffchgStr = checkNull(genericUtility.getColumnValue("date__effchg", dom));
tranDateStr = checkNull(genericUtility.getColumnValue("tran_date", dom));
ldTrandateOStr = checkNull(genericUtility.getColumnValue("tran_date_orig", dom));
if(dateEffchgStr != null && dateEffchgStr.trim().length() > 0)
{ {
empCode = checkNull(genericUtility.getColumnValue("emp_code",dom)); dateEffchg = Timestamp.valueOf(genericUtility.getValidDateString(dateEffchgStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
dateEffchgStr = checkNull(genericUtility.getColumnValue("date__effchg",dom)); }
System.out.println("dateEffchgStr::::::::::::::::"+dateEffchgStr); if(tranDateStr != null && tranDateStr.trim().length() > 0)
System.out.println("empCode::::::::::::::::"+empCode); {
tranDate = Timestamp.valueOf(genericUtility.getValidDateString(tranDateStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
}
if(ldTrandateOStr != null && ldTrandateOStr.trim().length() > 0)
{
ldTrandateO = Timestamp.valueOf(genericUtility.getValidDateString(ldTrandateOStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
}
System.out.println("dateEffchgStr:::::::::"+dateEffchgStr);
System.out.println("tranDateStr:::::::::"+tranDateStr);
System.out.println("ldTrandateOStr:::::::::"+ldTrandateOStr);
if(dateEffchgStr != null && dateEffchgStr.trim().length() > 0) if(empCode == null || empCode.trim().length() == 0)
{
errList.add("VTEMPSTS05");//Employee code is blank, please specify employee code
errFields.add(childNodeName.toLowerCase());
}
else
{
liCnt = 0;
sql = "select confirmed, "
+ "probation, "
+ "probation_date, "
+ "date_conf, "
+ "1 as li_cnt "
+ "from "
+ "employee "
+ "where "
+ "emp_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode);
rs = pstmt.executeQuery();
if(rs.next())
{ {
dateEffchg = Timestamp.valueOf(genericUtility.getValidDateString(dateEffchgStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); lsConfStatus = checkNull(rs.getString("confirmed"));
lsProbStatus = checkNull(rs.getString("probation"));
ldProbDate = rs.getTimestamp("probation_date");
ldConfDate = rs.getTimestamp("date_conf");
liCnt = rs.getInt("li_cnt");
} }
if(dateEffchgStr == null || dateEffchgStr.trim().length() == 0 ) if (rs != null)
{ {
errList.add("VTEMPSTS04"); //Effective date is blank, please specify effective date rs.close();
errFields.add(childNodeName.toLowerCase()); rs = null;
} }
else if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
if(liCnt == 0)
{
errList.add("VTEMPSTS03");//Employee code entered does not existing in master, please enter valid employee code
errFields.add(childNodeName.toLowerCase());
}
else
{
liCnt = 0;
if("A".equalsIgnoreCase(editFlag))
{ {
sql = " select pay_site as ls_site from employee where emp_code = ? "; sql = "select count(*) as li_cnt "
+ "from "
+ "emp_statuschg "
+ "where "
+ "emp_code = ? "
+ "and "
+ "case when confirm is null then 'N' else confirm end <> 'X' "
+ "and "
+ "tran_date = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode); pstmt.setString(1, empCode);
pstmt.setTimestamp(2, tranDate);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
lsSite = checkNull(rs.getString("ls_site")); liCnt = rs.getInt("li_cnt");
} }
if (rs != null) if (rs != null)
{ {
...@@ -183,79 +304,34 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal, ...@@ -183,79 +304,34 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal,
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
} if(liCnt > 0)
if(dateEffchgStr != null && dateEffchgStr.trim().length() > 0)
{
errCode = checkNull(finCommon.nfCheckPeriod("ADM", dateEffchg, lsSite, conn));
}
if(errCode != null && errCode.trim().length() > 0)
{
if("VTPRD2".equalsIgnoreCase(errCode))
{
errList.add("VTPRDTEMP1");//This is a temporary error for status change
errFields.add(childNodeName.toLowerCase());
}
else if("VTPRDADM".equalsIgnoreCase(errCode))
{ {
errList.add("VTPRDTEMP2");//Period status not defined for Admin errList.add("VTEMPSTS08");
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
} else
else if("emp_code".equalsIgnoreCase(childNodeName))
{
System.out.println("empCode:::::::::"+empCode);
empCode = checkNull(genericUtility.getColumnValue("emp_code", dom));
lsEmpcodeO = checkNull(genericUtility.getColumnValue("emp_code_orig", dom));
dateEffchgStr = checkNull(genericUtility.getColumnValue("date__effchg", dom));
tranDateStr = checkNull(genericUtility.getColumnValue("tran_date", dom));
ldTrandateOStr = checkNull(genericUtility.getColumnValue("tran_date_orig", dom));
if(dateEffchgStr != null && dateEffchgStr.trim().length() > 0)
{
dateEffchg = Timestamp.valueOf(genericUtility.getValidDateString(dateEffchgStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
}
if(tranDateStr != null && tranDateStr.trim().length() > 0)
{
tranDate = Timestamp.valueOf(genericUtility.getValidDateString(tranDateStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
}
if(ldTrandateOStr != null && ldTrandateOStr.trim().length() > 0)
{
ldTrandateO = Timestamp.valueOf(genericUtility.getValidDateString(ldTrandateOStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
}
System.out.println("dateEffchgStr:::::::::"+dateEffchgStr);
System.out.println("tranDateStr:::::::::"+tranDateStr);
System.out.println("ldTrandateOStr:::::::::"+ldTrandateOStr);
if(empCode == null || empCode.trim().length() == 0)
{
errList.add("VTEMPSTS05");//Employee code is blank, please specify employee code
errFields.add(childNodeName.toLowerCase());
}
else
{ {
liCnt = 0; liCnt = 0;
sql = "select confirmed, " sql = "select count(*) as li_cnt "
+ "probation, " + "from "
+ "probation_date, " + "emp_statuschg "
+ "date_conf, " + "where "
+ "1 as li_cnt " + "emp_code = ? "
+ "from " + "and case when confirm is null then 'N' else confirm end <> 'X' "
+ "employee " + "and tran_date = ? "
+ "where " + "and (emp_code <> ? or tran_date <> ?)";
+ "emp_code = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode); pstmt.setString(1, empCode);
pstmt.setTimestamp(2, tranDate);
pstmt.setString(3, lsEmpcodeO);
pstmt.setTimestamp(4, ldTrandateO);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
lsConfStatus = checkNull(rs.getString("confirmed"));
lsProbStatus = checkNull(rs.getString("probation"));
ldProbDate = rs.getTimestamp("probation_date");
ldConfDate = rs.getTimestamp("date_conf");
liCnt = rs.getInt("li_cnt"); liCnt = rs.getInt("li_cnt");
} }
System.out.println("liCnt:::::::::"+liCnt);
if (rs != null) if (rs != null)
{ {
rs.close(); rs.close();
...@@ -266,180 +342,104 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal, ...@@ -266,180 +342,104 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal,
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
}
if(liCnt == 0) if(liCnt > 0)
{
errList.add("VTEMPSTS03");//Employee code entered does not existing in master, please enter valid employee code
errFields.add(childNodeName.toLowerCase());
}
else
{
liCnt = 0;
if("A".equalsIgnoreCase(editFlag))
{ {
sql = "select count(*) as li_cnt " errList.add("VTEMPSTS08");
+ "from " errFields.add(childNodeName.toLowerCase());
+ "emp_statuschg "
+ "where "
+ "emp_code = ? "
+ "and "
+ "case when confirm is null then 'N' else confirm end <> 'X' "
+ "and "
+ "tran_date = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode);
pstmt.setTimestamp(2, tranDate);
rs = pstmt.executeQuery();
if(rs.next())
{
liCnt = rs.getInt("li_cnt");
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(liCnt > 0)
{
errList.add("VTEMPSTS08");
errFields.add(childNodeName.toLowerCase());
}
} }
else else
{ {
liCnt = 0; if("A".equalsIgnoreCase(editFlag))
sql = "select count(*) as li_cnt "
+ "from "
+ "emp_statuschg "
+ "where "
+ "emp_code = ? "
+ "and case when confirm is null then 'N' else confirm end <> 'X' "
+ "and tran_date = ? "
+ "and (emp_code <> ? or tran_date <> ?)";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode);
pstmt.setTimestamp(2, tranDate);
pstmt.setString(3, lsEmpcodeO);
pstmt.setTimestamp(4, ldTrandateO);
rs = pstmt.executeQuery();
if(rs.next())
{
liCnt = rs.getInt("li_cnt");
}
System.out.println("liCnt:::::::::"+liCnt);
if (rs != null)
{ {
rs.close(); liCnt = 0;
rs = null; sql = "select count(*) as li_cnt "
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(liCnt > 0)
{
errList.add("VTEMPSTS08");
errFields.add(childNodeName.toLowerCase());
}
else
{
if("A".equalsIgnoreCase(editFlag))
{
liCnt = 0;
sql = "select count(*) as li_cnt "
+ "from " + "from "
+ "emp_statuschg " + "emp_statuschg "
+ "where " + "where "
+ "emp_code = ? " + "emp_code = ? "
+ "and case when confirm is null then 'N' else confirm end = 'N' "; + "and case when confirm is null then 'N' else confirm end = 'N' ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode); pstmt.setString(1, empCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
liCnt = rs.getInt("li_cnt"); liCnt = rs.getInt("li_cnt");
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
} }
if (rs != null)
else
{ {
liCnt = 0; rs.close();
sql = "select count(*) as li_cnt " rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
else
{
liCnt = 0;
sql = "select count(*) as li_cnt "
+ "from " + "from "
+ "emp_statuschg " + "emp_statuschg "
+ "where " + "where "
+ "emp_code = ? " + "emp_code = ? "
+ "and case when confirm is null then 'N' else confirm end = 'N' " + "and case when confirm is null then 'N' else confirm end = 'N' "
+ "and (emp_code <> ? or tran_date <> ?)"; + "and (emp_code <> ? or tran_date <> ?)";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode); pstmt.setString(1, empCode);
pstmt.setString(2, lsEmpcodeO); pstmt.setString(2, lsEmpcodeO);
pstmt.setTimestamp(3, ldTrandateO); pstmt.setTimestamp(3, ldTrandateO);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
liCnt = rs.getInt("li_cnt"); liCnt = rs.getInt("li_cnt");
} }
if (rs != null) if (rs != null)
{ {
rs.close(); rs.close();
rs = null; rs = null;
} }
if (pstmt != null) if (pstmt != null)
{ {
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
if(liCnt > 0) if(liCnt > 0)
{
errList.add("VTEMPSTS09");
errFields.add(childNodeName.toLowerCase());
}
else
{
lsStatusType = checkNull(genericUtility.getColumnValue("status_type", dom));
if("N".equalsIgnoreCase(lsProbStatus))
{ {
errList.add("VTEMPSTS09"); lsStatusTypeX = "P";
errFields.add(childNodeName.toLowerCase()); ldStatusDateX = ldProbDate;
} }
else else
{ {
lsStatusType = checkNull(genericUtility.getColumnValue("status_type", dom)); if("Y".equalsIgnoreCase(lsProbStatus) && "N".equalsIgnoreCase(lsConfStatus))
if("N".equalsIgnoreCase(lsProbStatus))
{ {
lsStatusTypeX = "P"; lsStatusTypeX = "C";
ldStatusDateX = ldProbDate; ldStatusDateX = ldConfDate;
}
else
{
if("Y".equalsIgnoreCase(lsProbStatus) && "N".equalsIgnoreCase(lsConfStatus))
{
lsStatusTypeX = "C";
ldStatusDateX = ldConfDate;
}
} }
} }
if(!lsStatusTypeX.equalsIgnoreCase(lsStatusType)) }
{ if(!lsStatusTypeX.equalsIgnoreCase(lsStatusType))
errList.add("VTEMPSTS10"); {
errFields.add(childNodeName.toLowerCase()); errList.add("VTEMPSTS10");
} errFields.add(childNodeName.toLowerCase());
else }
else
{
if("A".equalsIgnoreCase(editFlag))
{ {
if("A".equalsIgnoreCase(editFlag)) liCnt = 0;
{ sql = "select count(*) as li_cnt "
liCnt = 0;
sql = "select count(*) as li_cnt "
+ "from " + "from "
+ "emp_statuschg " + "emp_statuschg "
+ "where " + "where "
...@@ -447,278 +447,197 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal, ...@@ -447,278 +447,197 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal,
+ "and " + "and "
+ "tran_date >= ? " + "tran_date >= ? "
+ "and case when confirm is null then 'N' else confirm end <> 'X'"; + "and case when confirm is null then 'N' else confirm end <> 'X'";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode); pstmt.setString(1, empCode);
pstmt.setTimestamp(2, tranDate); pstmt.setTimestamp(2, tranDate);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
liCnt = rs.getInt("li_cnt"); liCnt = rs.getInt("li_cnt");
} }
if (rs != null) if (rs != null)
{ {
rs.close(); rs.close();
rs = null; rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
} }
else if (pstmt != null)
{ {
liCnt = 0; pstmt.close();
sql = "select count(*) as li_cnt " pstmt = null;
}
}
else
{
liCnt = 0;
sql = "select count(*) as li_cnt "
+ "from " + "from "
+ "emp_statuschg " + "emp_statuschg "
+ "where emp_code = ? " + "where emp_code = ? "
+ "and tran_date >= ? " + "and tran_date >= ? "
+ "and case when confirm is null then 'N' else confirm end <> 'X' " + "and case when confirm is null then 'N' else confirm end <> 'X' "
+ "and (emp_code <> ? or tran_date <> ?)"; + "and (emp_code <> ? or tran_date <> ?)";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode); pstmt.setString(1, empCode);
pstmt.setTimestamp(2, tranDate); pstmt.setTimestamp(2, tranDate);
pstmt.setString(3, lsEmpcodeO); pstmt.setString(3, lsEmpcodeO);
pstmt.setTimestamp(4, ldTrandateO); pstmt.setTimestamp(4, ldTrandateO);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
liCnt = rs.getInt("li_cnt"); liCnt = rs.getInt("li_cnt");
} }
if (rs != null) if (rs != null)
{ {
rs.close(); rs.close();
rs = null; rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
} }
if(liCnt == 0) if (pstmt != null)
{ {
sql = "select " pstmt.close();
pstmt = null;
}
}
if(liCnt == 0)
{
sql = "select "
+ "emp_site as ls_site " + "emp_site as ls_site "
+ "from " + "from "
+ "employee " + "employee "
+ "where " + "where "
+ "emp_code = ?"; + "emp_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode); pstmt.setString(1, empCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
lsSite = rs.getString("ls_site"); lsSite = rs.getString("ls_site");
} }
if (rs != null) if (rs != null)
{ {
rs.close(); rs.close();
rs = null; rs = null;
} }
if (pstmt != null) if (pstmt != null)
{ {
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
if(lsSite != null && lsSite.trim().length() > 0) if(lsSite != null && lsSite.trim().length() > 0)
{
errCode = adm.gbfEmp(empCode, dateEffchg, lsSite, loginSite, conn);
System.out.println("error Code is ====" + errCode);
if(errCode != null && errCode.trim().length() > 0)
{ {
errCode = adm.gbfEmp(empCode, dateEffchg, lsSite, loginSite, conn); errList.add(errCode);
System.out.println("error Code is ====" + errCode); errFields.add(childNodeName.toLowerCase());
if(errCode != null && errCode.trim().length() > 0)
{
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
} }
sql = "select " }
sql = "select "
+ "confirmed " + "confirmed "
+ "from " + "from "
+ "employee " + "employee "
+ "where " + "where "
+ "emp_code = ?"; + "emp_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode); pstmt.setString(1, empCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
confirmed = rs.getString("confirmed"); confirmed = rs.getString("confirmed");
} }
if (rs != null) if (rs != null)
{ {
rs.close(); rs.close();
rs = null; rs = null;
} }
if (pstmt != null) if (pstmt != null)
{ {
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
}
if("Y".equalsIgnoreCase(confirmed))
{
errList.add("VMEMP3");
errFields.add(childNodeName.toLowerCase());
}
} }
else
if("Y".equalsIgnoreCase(confirmed))
{ {
errList.add("VDEMP1"); errList.add("VMEMP3");
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
else
{
errList.add("VDEMP1");
errFields.add(childNodeName.toLowerCase());
}
} }
} }
} }
} }
} }
else if("extend".equalsIgnoreCase(childNodeName)) }
{ else if("extend".equalsIgnoreCase(childNodeName))
extend = checkNull(genericUtility.getColumnValue("extend", dom)); {
dateEffchgStr = checkNull(genericUtility.getColumnValue("date__effchg", dom)); extend = checkNull(genericUtility.getColumnValue("extend", dom));
dateDueChgStr = checkNull(genericUtility.getColumnValue("date__due_chg", dom)); dateEffchgStr = checkNull(genericUtility.getColumnValue("date__effchg", dom));
dateDueChgStr = checkNull(genericUtility.getColumnValue("date__due_chg", dom));
if(dateEffchgStr != null && dateEffchgStr.trim().length() > 0)
{
dateEffchg = Timestamp.valueOf(genericUtility.getValidDateString(dateEffchgStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
} if(dateEffchgStr != null && dateEffchgStr.trim().length() > 0)
if(dateDueChgStr != null && dateDueChgStr.trim().length() > 0) {
{ dateEffchg = Timestamp.valueOf(genericUtility.getValidDateString(dateEffchgStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
dateDue = Timestamp.valueOf(genericUtility.getValidDateString(dateDueChgStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
}
if("N".equalsIgnoreCase(extend))
{
if((dateEffchg != null && dateDue != null) && dateEffchg.before(dateDue))
{
errList.add("VMDATE20");//effective date can not be prior to due date
errFields.add(childNodeName.toLowerCase());
}
else if("Y".equalsIgnoreCase(extend))
{
lcMonthsStr = checkNull(genericUtility.getColumnValue("months_extend", dom));
try
{
lcMonths = Integer.parseInt(lcMonthsStr);
}
catch(Exception e)
{
lcMonths = 0;
}
if(lcMonths <= 0)
{
errList.add("VTEXT");//Extend Months cannot be zero or negative
errFields.add(childNodeName.toLowerCase());
}
}
}
} }
else if("emp_code__aprv".equalsIgnoreCase(childNodeName)) if(dateDueChgStr != null && dateDueChgStr.trim().length() > 0)
{ {
empCodeAprv = checkNull(genericUtility.getColumnValue("emp_code__aprv", dom)); dateDue = Timestamp.valueOf(genericUtility.getValidDateString(dateDueChgStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
empCode = checkNull(genericUtility.getColumnValue("emp_code", dom));
if(empCodeAprv != null && empCodeAprv.trim().length() > 0)
{
sql = "select count(*) as cnt , "
+ "RELIEVE_DATE "
+ "from "
+ "employee "
+ "where "
+ "emp_code = ? group by RELIEVE_DATE";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt("cnt");
reliveDate = rs.getTimestamp("RELIEVE_DATE");
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
if((cnt == 0))
{
errList.add("VMEMP1");
errFields.add(childNodeName.toLowerCase());
}
if(reliveDate != null)
{
errList.add("VMEMPV");
errFields.add(childNodeName.toLowerCase());
}
if(empCodeAprv.equalsIgnoreCase(empCode))
{
errList.add("VMEMP4");
errFields.add(childNodeName.toLowerCase());
}
} }
else if("design_code".equalsIgnoreCase(childNodeName))
if("N".equalsIgnoreCase(extend))
{ {
designCode = checkNull(genericUtility.getColumnValue("design_code", dom)); if((dateEffchg != null && dateDue != null) && dateEffchg.before(dateDue))
if(designCode == null || designCode.trim().length() == 0)
{ {
errList.add("VMDESIGN2"); errList.add("VMDATE20");//effective date can not be prior to due date
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
else else if("Y".equalsIgnoreCase(extend))
{ {
cnt = 0; lcMonthsStr = checkNull(genericUtility.getColumnValue("months_extend", dom));
sql = "select count(*) as cnt " try
+ "from "
+ "designation "
+ "where "
+ "design_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, designCode);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt("cnt");
}
if (rs != null)
{ {
rs.close(); lcMonths = Integer.parseInt(lcMonthsStr);
rs = null;
} }
if (pstmt != null) catch(Exception e)
{ {
pstmt.close(); lcMonths = 0;
pstmt = null;
} }
if(cnt == 0)
if(lcMonths <= 0)
{ {
errList.add("VMDESIGN"); errList.add("VTEXT");//Extend Months cannot be zero or negative
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
sql = "select " }
+ "status " }
+ "from " else if("emp_code__aprv".equalsIgnoreCase(childNodeName))
+ "designation " {
+ "where " empCodeAprv = checkNull(genericUtility.getColumnValue("emp_code__aprv", dom));
+ "design_code = ?"; empCode = checkNull(genericUtility.getColumnValue("emp_code", dom));
if(empCodeAprv != null && empCodeAprv.trim().length() > 0)
{
sql = "select count(*) as cnt , "
+ "RELIEVE_DATE "
+ "from "
+ "employee "
+ "where "
+ "emp_code = ? group by RELIEVE_DATE";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, designCode); pstmt.setString(1, empCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
status = rs.getString("status"); cnt = rs.getInt("cnt");
reliveDate = rs.getTimestamp("RELIEVE_DATE");
} }
if (rs != null) if (rs != null)
{ {
...@@ -730,24 +649,43 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal, ...@@ -730,24 +649,43 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal,
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
if(!"A".equalsIgnoreCase(status))
{
errList.add("VTDGINAC");
errFields.add(childNodeName.toLowerCase());
}
} }
else if("cadre_code".equalsIgnoreCase(childNodeName))
if((cnt == 0))
{
errList.add("VMEMP1");
errFields.add(childNodeName.toLowerCase());
}
if(reliveDate != null)
{
errList.add("VMEMPV");
errFields.add(childNodeName.toLowerCase());
}
if(empCodeAprv.equalsIgnoreCase(empCode))
{
errList.add("VMEMP4");
errFields.add(childNodeName.toLowerCase());
}
}
else if("design_code".equalsIgnoreCase(childNodeName))
{
designCode = checkNull(genericUtility.getColumnValue("design_code", dom));
if(designCode == null || designCode.trim().length() == 0)
{
errList.add("VMDESIGN2");
errFields.add(childNodeName.toLowerCase());
}
else
{ {
cnt = 0; cnt = 0;
cadreCode = checkNull(genericUtility.getColumnValue("cadre_code", dom)); sql = "select count(*) as cnt "
sql = "select " + "from "
+ "count(*) as cnt " + "designation "
+ "from " + "where "
+ "cadre " + "design_code = ?";
+ "where "
+ "cadre_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, cadreCode); pstmt.setString(1, designCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
...@@ -765,22 +703,132 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal, ...@@ -765,22 +703,132 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal,
} }
if(cnt == 0) if(cnt == 0)
{ {
errList.add("VMCAD1");//err = "Invalid cadre code, not defined in master" errList.add("VMDESIGN");
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
else if("grade_code".equalsIgnoreCase(childNodeName)) sql = "select "
+ "status "
+ "from "
+ "designation "
+ "where "
+ "design_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, designCode);
rs = pstmt.executeQuery();
if(rs.next())
{
status = rs.getString("status");
}
if (rs != null)
{ {
cnt = 0; rs.close();
gradeCode = checkNull(genericUtility.getColumnValue("grade_code", dom)); rs = null;
sql = "select " }
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(!"A".equalsIgnoreCase(status))
{
errList.add("VTDGINAC");
errFields.add(childNodeName.toLowerCase());
}
}
else if("cadre_code".equalsIgnoreCase(childNodeName))
{
cnt = 0;
cadreCode = checkNull(genericUtility.getColumnValue("cadre_code", dom));
sql = "select "
+ "count(*) as cnt "
+ "from "
+ "cadre "
+ "where "
+ "cadre_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, cadreCode);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt("cnt");
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(cnt == 0)
{
errList.add("VMCAD1");//err = "Invalid cadre code, not defined in master"
errFields.add(childNodeName.toLowerCase());
}
}
else if("grade_code".equalsIgnoreCase(childNodeName))
{
cnt = 0;
gradeCode = checkNull(genericUtility.getColumnValue("grade_code", dom));
sql = "select "
+ "count(*) as cnt " + "count(*) as cnt "
+ "from " + "from "
+ "grade " + "grade "
+ "where " + "where "
+ "grade_code = ? "; + "grade_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, gradeCode);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt("cnt");
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(cnt == 0)
{
errList.add("VMGRA1");//err = "Invalid grade code, not defined in master"
errFields.add(childNodeName.toLowerCase());
}
}
else if("reason_code".equalsIgnoreCase(childNodeName))
{
cnt = 0;
reasonCode = checkNull(genericUtility.getColumnValue("reason_code", dom));
if(reasonCode == null || reasonCode.trim().length() == 0)
{
errList.add("VTEMPSTS06");
errFields.add(childNodeName.toLowerCase());
}
else
{
cnt = 0;
statusType = checkNull(genericUtility.getColumnValue("status_type", dom));
extend = checkNull(genericUtility.getColumnValue("extend", dom));
sql = "select count(1) as cnt "
+ "from "
+ "gencodes "
+ "where "
+ "fld_name = 'REASON_CODE' "
+ "and "
+ "mod_name in ('W_EMP_STATUS') "
+ "and case when active is null then 'Y' else active end = 'Y' "
+ "and fld_value = ? and udf_str1 = ? and udf_str2 = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, gradeCode); pstmt.setString(1, reasonCode);
pstmt.setString(2, statusType);
pstmt.setString(3, extend);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
...@@ -798,99 +846,53 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal, ...@@ -798,99 +846,53 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal,
} }
if(cnt == 0) if(cnt == 0)
{ {
errList.add("VMGRA1");//err = "Invalid grade code, not defined in master" errList.add("VTEMPSTS07");
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
else if("reason_code".equalsIgnoreCase(childNodeName)) }
else if("notice_prd".equalsIgnoreCase(childNodeName))
{
lcNoticePrd = genericUtility.getColumnValue("notice_prd", dom);
try
{ {
cnt = 0; noticePrd = Integer.parseInt(lcNoticePrd);
reasonCode = checkNull(genericUtility.getColumnValue("reason_code", dom));
if(reasonCode == null || reasonCode.trim().length() == 0)
{
errList.add("VTEMPSTS06");
errFields.add(childNodeName.toLowerCase());
}
else
{
cnt = 0;
statusType = checkNull(genericUtility.getColumnValue("status_type", dom));
extend = checkNull(genericUtility.getColumnValue("extend", dom));
sql = "select count(1) as cnt "
+ "from "
+ "gencodes "
+ "where "
+ "fld_name = 'REASON_CODE' "
+ "and "
+ "mod_name in ('W_EMP_STATUS') "
+ "and case when active is null then 'Y' else active end = 'Y' "
+ "and fld_value = ? and udf_str1 = ? and udf_str2 = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, statusType);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt("cnt");
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(cnt == 0)
{
errList.add("VTEMPSTS07");
errFields.add(childNodeName.toLowerCase());
}
}
} }
else if("notice_prd".equalsIgnoreCase(childNodeName)) catch(Exception e)
{ {
lcNoticePrd = genericUtility.getColumnValue("notice_prd", dom); errList.add("VTEMPSTS13");// Please enter proper value
try errFields.add(childNodeName.toLowerCase());
{
noticePrd = Integer.parseInt(lcNoticePrd);
}
catch(Exception e)
{
errList.add("VTEMPSTS13");// Please enter proper value
errFields.add(childNodeName.toLowerCase());
}
if(noticePrd < 0)
{
errList.add("VTEMPSTS11");
errFields.add(childNodeName.toLowerCase());
}
} }
else if("months_extend".equalsIgnoreCase(childNodeName))
if(noticePrd < 0)
{ {
monthsExtend1 = genericUtility.getColumnValue("months_extend", dom); errList.add("VTEMPSTS11");
System.out.println("months_extend :: ["+monthsExtend1+"]"); errFields.add(childNodeName.toLowerCase());
try }
{ }
monthsExtend = Integer.parseInt(monthsExtend1); else if("months_extend".equalsIgnoreCase(childNodeName))
} {
catch(Exception e) monthsExtend1 = genericUtility.getColumnValue("months_extend", dom);
{ System.out.println("months_extend :: ["+monthsExtend1+"]");
errList.add("VTEMPSTS13");// Please enter proper value try
errFields.add(childNodeName.toLowerCase()); {
} monthsExtend = Integer.parseInt(monthsExtend1);
} }
if(monthsExtend < 0) catch(Exception e)
{ {
errList.add("VTEMPSTS12"); errList.add("VTEMPSTS13");// Please enter proper value
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
}
} }
} }
if(monthsExtend < 0)
{
errList.add("VTEMPSTS12");
errFields.add(childNodeName.toLowerCase());
}
} }
}
}
System.out.println("errStringXml.toString()---1= "+errStringXml.toString()); System.out.println("errStringXml.toString()---1= "+errStringXml.toString());
if (errList != null && errList.size() > 0) if (errList != null && errList.size() > 0)
{ {
...@@ -1012,7 +1014,7 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal, ...@@ -1012,7 +1014,7 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal,
String confirmed = ""; String confirmed = "";
String probation = ""; String probation = "";
String noticePrd = ""; String noticePrd = "";
String grade = ""; String grade = "";
String cadre = ""; String cadre = "";
String designCode = ""; String designCode = "";
...@@ -1025,7 +1027,9 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal, ...@@ -1025,7 +1027,9 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal,
String lsDesignCode = ""; String lsDesignCode = "";
String lsDesignation = ""; String lsDesignation = "";
String lsEligibleOt = ""; String lsEligibleOt = "";
String tranDate = ""; //String tranDate = "";
String tranDateStr = "";
Timestamp tranDate = null;
String extend = ""; String extend = "";
String gradeCode = ""; String gradeCode = "";
String cadreCode = ""; String cadreCode = "";
...@@ -1040,7 +1044,7 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal, ...@@ -1040,7 +1044,7 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal,
StringBuffer valueXmlString = null; StringBuffer valueXmlString = null;
SimpleDateFormat sdf = null; SimpleDateFormat sdf = null;
//Added by Shital on 13/12/2019 [End] //Added by Shital on 13/12/2019 [End]
try try
{ {
conn = getConnection(); conn = getConnection();
...@@ -1062,42 +1066,44 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal, ...@@ -1062,42 +1066,44 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal,
if("itm_default".equalsIgnoreCase(currentColumn)) if("itm_default".equalsIgnoreCase(currentColumn))
{ {
System.out.println("Inside item default ===========");
monthsExtend = checkNull(genericUtility.getColumnValue("months_extend", dom)); monthsExtend = checkNull(genericUtility.getColumnValue("months_extend", dom));
System.out.println("tranDateStr####"+tranDateStr);
System.out.println("months_extend :: ["+monthsExtend+"]"); System.out.println("months_extend :: ["+monthsExtend+"]");
valueXmlString.append("<extend>").append("<![CDATA[N]]>").append("</extend>"); valueXmlString.append("<extend>").append("<![CDATA[N]]>").append("</extend>");
valueXmlString.append("<tran_date><![CDATA[").append(sdf.format(new java.util.Date())).append("]]></tran_date>\r\n"); valueXmlString.append("<tran_date><![CDATA[").append(sdf.format(new java.util.Date())).append("]]></tran_date>\r\n");
//valueXmlString.append("<tran_date>").append(tranDateStr).append("</tran_date>");
valueXmlString.append("<months_extend protect='1'>").append("<![CDATA[" + monthsExtend + "]]>").append("</months_extend>\r\n"); valueXmlString.append("<months_extend protect='1'>").append("<![CDATA[" + monthsExtend + "]]>").append("</months_extend>\r\n");
valueXmlString.append("<confirm>").append("<![CDATA[N]]>").append("</confirm>"); valueXmlString.append("<confirm>").append("<![CDATA[N]]>").append("</confirm>");
valueXmlString.append("<notice_prd>").append("<![CDATA[0]]>").append("</notice_prd>"); valueXmlString.append("<notice_prd>").append("<![CDATA[0]]>").append("</notice_prd>");
} }
else if("emp_code".equalsIgnoreCase(currentColumn)) else if("emp_code".equalsIgnoreCase(currentColumn))
{ {
empCode = genericUtility.getColumnValue("emp_code", dom); empCode = genericUtility.getColumnValue("emp_code", dom);
System.out.println("::::::::::inside emp_code ITEMCHANGED::::::::"+empCode); System.out.println("::::::::::inside emp_code ITEMCHANGED::::::::"+empCode);
sql = "select " sql = "select "
+ "emp_lname ," + "emp_lname ,"
+ "emp_fname ," + "emp_fname ,"
+ "confirmed ," + "confirmed ,"
+ "probation ," + "probation ,"
+ "probation_date ," + "probation_date ,"
+ "date_conf ," + "date_conf ,"
+ "notice_prd , " + "notice_prd , "
+ "date_join ," + "date_join ,"
+ "grade ," + "grade ,"
+ "cadre ," + "cadre ,"
+ "design_code ," + "design_code ,"
+ "designation , " + "designation , "
+ "case when eligible_ot is null then 'N' else eligible_ot end , " + "case when eligible_ot is null then 'N' else eligible_ot end , "
+ "emp_fname_long , " + "emp_fname_long , "
+ "emp_lname_long " + "emp_lname_long "
+ "from " + "from "
+ "employee " + "employee "
+ "where " + "where "
+ "emp_code = ?"; + "emp_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode); pstmt.setString(1, empCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -1155,7 +1161,7 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal, ...@@ -1155,7 +1161,7 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal,
empLname = lsEmpLnameLong; empLname = lsEmpLnameLong;
} }
System.out.println("probationDate:["+probationDate+"] \t dateConf["+dateConf+"] \t ldJoinDate["+ldJoinDate+"]"); System.out.println("probationDate:["+probationDate+"] \t dateConf["+dateConf+"] \t ldJoinDate["+ldJoinDate+"]");
//Added by Shital on 13/12/2019 [Start] //Added by Shital on 13/12/2019 [Start]
if(ldJoinDate != null ) if(ldJoinDate != null )
{ {
...@@ -1166,7 +1172,7 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal, ...@@ -1166,7 +1172,7 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal,
{ {
ldJoinDateStr = ""; ldJoinDateStr = "";
} }
if(probationDate != null ) if(probationDate != null )
{ {
probationDateStr = sdf.format(probationDate); probationDateStr = sdf.format(probationDate);
...@@ -1176,7 +1182,7 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal, ...@@ -1176,7 +1182,7 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal,
{ {
probationDateStr = ""; probationDateStr = "";
} }
if(dateConf != null ) if(dateConf != null )
{ {
dateConfStr = sdf.format(dateConf); dateConfStr = sdf.format(dateConf);
...@@ -1186,7 +1192,8 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal, ...@@ -1186,7 +1192,8 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal,
{ {
dateConfStr = ""; dateConfStr = "";
} }
//Added by Shital on 13/12/2019 [End]
/*if(probationDateStr != null && probationDateStr.trim().length() > 0) /*if(probationDateStr != null && probationDateStr.trim().length() > 0)
{ {
probationDateStr = genericUtility.getValidDateString(probationDateStr,"yyyy-MM-dd", genericUtility.getApplDateFormat()); probationDateStr = genericUtility.getValidDateString(probationDateStr,"yyyy-MM-dd", genericUtility.getApplDateFormat());
...@@ -1206,7 +1213,7 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal, ...@@ -1206,7 +1213,7 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal,
{ {
dateConfStr = ""; dateConfStr = "";
}*/ }*/
/*if(ldJoinDateStr != null && ldJoinDateStr.trim().length() > 0) /*if(ldJoinDateStr != null && ldJoinDateStr.trim().length() > 0)
{ {
ldJoinDate = (Timestamp) sdf.parse(ldJoinDateStr); ldJoinDate = (Timestamp) sdf.parse(ldJoinDateStr);
...@@ -1251,11 +1258,12 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal, ...@@ -1251,11 +1258,12 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal,
{ {
if("Y".equalsIgnoreCase(probation) && "N".equalsIgnoreCase(confirmed)) if("Y".equalsIgnoreCase(probation) && "N".equalsIgnoreCase(confirmed))
{ {
System.out.println("dateConfStr111111111"+dateConfStr);
valueXmlString.append("<status_type>").append("<![CDATA[C]]>").append("</status_type>"); valueXmlString.append("<status_type>").append("<![CDATA[C]]>").append("</status_type>");
valueXmlString.append("<date__due_chg>").append("<![CDATA[" + dateConfStr + "]]>").append("</date__due_chg>"); valueXmlString.append("<date__due_chg>").append("<![CDATA[" + dateConfStr + "]]>").append("</date__due_chg>");
valueXmlString.append("<date__effchg>").append("<![CDATA[" + dateConfStr + "]]>").append("</date__effchg>"); valueXmlString.append("<date__effchg>").append("<![CDATA[" + dateConfStr + "]]>").append("</date__effchg>");
} }
System.out.println("dateConfStr111111111"+dateConfStr);
} }
if("A".equalsIgnoreCase(editFlag)) if("A".equalsIgnoreCase(editFlag))
{ {
...@@ -1264,14 +1272,19 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal, ...@@ -1264,14 +1272,19 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal,
} }
else if("tran_date".equalsIgnoreCase(currentColumn)) else if("tran_date".equalsIgnoreCase(currentColumn))
{ {
System.out.println("::::: Inside Tran_Date :::::");
if("A".equalsIgnoreCase(editFlag)) if("A".equalsIgnoreCase(editFlag))
{ {
tranDate = checkNull(genericUtility.getColumnValue("tran_date", dom)); //tranDate = checkNull(genericUtility.getColumnValue("tran_date", dom));
valueXmlString.append("<tran_date_orig>").append("<![CDATA[" + tranDate + "]]>").append("</tran_date_orig>"); tranDateStr = checkNull(genericUtility.getColumnValue("tran_date", dom));
valueXmlString.append("<tran_date_orig><![CDATA[").append(tranDateStr).append("]]></tran_date_orig>\r\n");
//valueXmlString.append("<tran_date_orig>").append("<![CDATA[" + tranDate + "]]>").append("</tran_date_orig>");
} }
System.out.println("tranDateStr=========="+tranDateStr);
} }
else if("extend".equalsIgnoreCase(currentColumn)) else if("extend".equalsIgnoreCase(currentColumn))
{ {
System.out.println("=====extend====");
extend = checkNull(genericUtility.getColumnValue("extend", dom)); extend = checkNull(genericUtility.getColumnValue("extend", dom));
monthsExtend = checkNull(genericUtility.getColumnValue("months_extend", dom)); monthsExtend = checkNull(genericUtility.getColumnValue("months_extend", dom));
if("N".equalsIgnoreCase(extend)) if("N".equalsIgnoreCase(extend))
...@@ -1288,11 +1301,11 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal, ...@@ -1288,11 +1301,11 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal,
{ {
gradeCode = checkNull(genericUtility.getColumnValue("grade_code", dom)); gradeCode = checkNull(genericUtility.getColumnValue("grade_code", dom));
sql = "select " sql = "select "
+ "cadre_code " + "cadre_code "
+ "from " + "from "
+ "grade " + "grade "
+ "where " + "where "
+ "grade_code = ?"; + "grade_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, gradeCode); pstmt.setString(1, gradeCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -1316,11 +1329,11 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal, ...@@ -1316,11 +1329,11 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal,
{ {
designCode = checkNull(genericUtility.getColumnValue("design_code", dom)); designCode = checkNull(genericUtility.getColumnValue("design_code", dom));
sql = "select " sql = "select "
+ "designation " + "designation "
+ "from " + "from "
+ "designation " + "designation "
+ "where " + "where "
+ "design_code = ?"; + "design_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, designCode); pstmt.setString(1, designCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -1349,11 +1362,11 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal, ...@@ -1349,11 +1362,11 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal,
reasonCode = ""; reasonCode = "";
} }
sql = "select " sql = "select "
+ "descr from gencodes " + "descr from gencodes "
+ "where fld_name = 'REASON_CODE' " + "where fld_name = 'REASON_CODE' "
+ "and mod_name in ('W_EMP_STATUS') " + "and mod_name in ('W_EMP_STATUS') "
+ "and case when active is null then 'Y' else active end = 'Y' " + "and case when active is null then 'Y' else active end = 'Y' "
+ "and fld_value = ?"; + "and fld_value = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, designCode); pstmt.setString(1, designCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -1373,8 +1386,8 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal, ...@@ -1373,8 +1386,8 @@ public class StatusChangeIC extends ValidatorEJB //implements StatusChangeLocal,
} }
valueXmlString.append("<reason_code_descr>").append("<![CDATA[" + reasonCodeDescr + "]]>").append("</reason_code_descr>"); valueXmlString.append("<reason_code_descr>").append("<![CDATA[" + reasonCodeDescr + "]]>").append("</reason_code_descr>");
} }
} }
valueXmlString.append("</Detail1>"); valueXmlString.append("</Detail1>");
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