Commit a4ab8db2 authored by dpingle's avatar dpingle

* updated component on [15/10/19]

EmpLeaveConf.java
ItRetAdjProcIC.java
ItRetAdjProcPrc.java


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@209655 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 0f8cc7f0
......@@ -379,7 +379,7 @@ public class ItRetAdjProcIC extends ValidatorEJB implements ItRetAdjProcLocal, I
String descr = "";
String toDateDescr = "";
String frDateDescr = "";
String loginSite = = "";
String loginSite = "";
int qtrNo = 0;
int cnt = 0;
......
......@@ -50,6 +50,7 @@ public class ItRetAdjProcPrc extends ProcessEJB implements ItRetAdjProcPrcLoca
String loginSite = "";
String jobId = "";
String objName = "";
String errString = "";
String loginEmpCode = ""; // 10/10/2019
Connection logConn = null;
Connection conn = null;
......
package ibase.webitm.ejb.adm.adv;
//Changes done by Varsha V on 03-09-19 as per suggested by Sir
//import ibase.system.config.AppConnectParm;//Added by Anjali Rawankar on[21/08/2017][For ITMDBACCESS]
import ibase.system.config.*;
import ibase.system.config.AppConnectParm;//Added by Anjali Rawankar on[21/08/2017][For ITMDBACCESS]
import ibase.utility.CommonConstants;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ActionHandlerEJB;
......@@ -42,6 +40,21 @@ import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
//import org.drools.lang.DRLParser.normal_lhs_block_return;
import ibase.utility.CommonConstants;
import ibase.utility.E12GenericUtility;
import ibase.webitm.bean.sys.ProteusDataSource;
import ibase.webitm.ejb.ActionHandlerEJB;
import ibase.webitm.ejb.ITMDBAccessEJB;//Added by sarita on[20/07/2018][For ITMDBACCESS]
//import ibase.webitm.ejb.ITMDBAccessLocal;//Added by Anjali Rawankar on[21/08/2017][For ITMDBACCESS]
import ibase.webitm.ejb.adm.AdmCommon;
import ibase.webitm.ejb.adm.AttdProcess;
import ibase.webitm.ejb.adm.LeaveEncase;
import ibase.webitm.ejb.fin.FinCommon;
import ibase.webitm.ejb.hrp.leave.EmpLeaveIC;
import ibase.webitm.ejb.sys.UtilMethods;
import ibase.webitm.utility.DB2XMLGenerator;
import ibase.webitm.utility.ITMException;
@Stateless
public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,EmpLeaveConfRemote
......@@ -188,7 +201,7 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
//retString = postLogic(tranId, tranId, 2, xtraParams, conn); commented and added by Varsha V on 24-Jul-18
retString = postLogic(tranId, tranId, commitFlag, xtraParams, conn);
System.out.println("retString--["+retString+"]");
System.out.println("return Error List of Post Logic ::["+this.errList+"]===this.fldList["+this.fldList+"]");
System.out.println("return Error List of Post Logic :: "+this.errList);
//Modified by Anjali R. on [03/06/2019][Start]
if (retString != null && retString.trim().length() > 0)
{
......@@ -212,10 +225,7 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
for (cnt = 0; cnt < this.errList.size(); cnt++ )
{
errCode = (String)this.errList.get(cnt);
if(this.fldList.size() > 0)
{
errFldName = (String)this.fldList.get(cnt);
}
errFldName = (String)this.fldList.get(cnt);
System.out.println("errCode .........."+errCode);
/*Modified by Anjali Rawankar on[22/08/2017][Start]
......@@ -239,7 +249,6 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
this.errList = null;
this.fldList.clear();
this.fldList = null;
}
if (errString == null || errString.trim().length() == 0)
{
......@@ -682,7 +691,7 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
{
pstmt.close();
pstmt = null;
}
}
if(lsEncPrd != null && lsEncPrd.trim().length() > 0)
{
sql = "select to_date from period where code = ?";
......@@ -772,7 +781,7 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
{
errCode = "ERROR";
}*/
}
}
catch(Exception e)
{
e.printStackTrace();
......@@ -824,7 +833,7 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
*/
//Modified by Anjali R. on [03/06/2019][Start]
//returnValue = boEmpleave.checkNegAdvLveRules(leaveDom, allowAdvleave, workSite,cadre,grade,lveTable, "C",this.lveRuleList, conn);
returnValue = boEmpleave.checkNegAdvLveRules(allowAdvleave, workSite,cadre,grade,lveTable, "C",this.lveRuleList, conn);
returnValue = boEmpleave.checkNegAdvLveRules(leaveDom, allowAdvleave, workSite,cadre,grade,lveTable, "C",this.lveRuleList, conn);
//Modified by Anjali R. on [03/06/2019][End]
HashMap retHMap = boEmpleave.getClassVariables();
if( returnValue == -9 )
......@@ -1336,14 +1345,14 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
break;
}
}
else if(utilMethod.left(lveFrMth , 4).equals("ERR~t"))
{
errCode = utilMethod.mid(lveFrMth , 5);
this.errList.add(errCode);
this.fldList.add("");
isError = true;
break;
}
else if(utilMethod.left(lveFrMth , 4).equals("ERR~t"))
{
errCode = utilMethod.mid(lveFrMth , 5);
this.errList.add(errCode);
this.fldList.add("");
isError = true;
break;
}
lveToMth = admCommon.getAdmEnv(workSite ,cadre ,grade ,"LVE_TOMTH" , mlveDt,connectionObject);
if(lveToMth == null || lveToMth.trim().length() == 0 || lveToMth.indexOf("NULLFOUND") > 0)
......@@ -1435,9 +1444,7 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
noRows = 0;
sql ="sELECT COUNT(*) AS COUNT FROM EMPLEAVE WHERE EMP_CODE = ? AND LVE_DATE_FR >= ? "+
" AND LVE_DATE_TO <= ? AND LVE_CODE = ? AND STATUS = 'A' "+
//Commented and changed by Varsha V as per suggested by Piyush Sir on 03-09-2019
//" AND USE_FLAG = 'C' AND TRAN_ID <> NVL(?,' ')";
" AND USE_FLAG = 'C' AND TRAN_ID <> ?";
" AND USE_FLAG = 'C' AND TRAN_ID <> NVL(?,' ')";
pstmt = connectionObject.prepareStatement(sql);
pstmt.setString(1,memp);
pstmt.setTimestamp(2,lveFrDt);
......@@ -1916,12 +1923,8 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
System.out.println("holType---["+holType+"]");
if(holType != null && holType.trim().length() > 0)
{
//Modified by Anjali R. on[25/03/2019][Start]
/*System.out.println("utilMethod.pos(holType, \"HW\")--["+utilMethod.pos(holType, "HW")+"]");
if(utilMethod.pos(holType, "HW") == 0 )*/
System.out.println("utilMethod.pos(holType, \"HW\")--["+utilMethod.pos("HW",holType)+"]");
if(utilMethod.pos ("HW",holType) == 0 )
//Modified by Anjali R. on[25/03/2019][End]
System.out.println("utilMethod.pos(holType, \"HW\")--["+utilMethod.pos(holType, "HW")+"]");
if(utilMethod.pos(holType, "HW") == 0 )
{
errCode = holType;
return errCode;
......@@ -1963,10 +1966,7 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
lve = checkNull(rs.getString("lve_code"));
nextLveStart = checkNull(rs.getString("leave_ends"));
//Modified by sarita on 04-10-2019 [START]
//pstmt.setString(1, lve);
pstmt1.setString(1, lve);
//Modified by sarita on 04-10-2019 [END]
pstmt.setString(1, lve);
rs1 = pstmt1.executeQuery();
while(rs1.next())
{
......@@ -2065,10 +2065,7 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
System.out.println("holType--["+holType+"]");
if(holType != null && holType.trim().length() > 0)
{
//Modified by Anjali R. on[25/03/2019][Start]
//if(utilMethod.pos(holType , "HW") == 0)
if(utilMethod.pos("HW",holType) == 0)
//Modified by Anjali R. on[25/03/2019][End]
if(utilMethod.pos(holType , "HW") == 0)
{
errCode = holType;
}
......@@ -2103,10 +2100,8 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
lve = checkNull(rs.getString("lve_code"));
nextLveStart = checkNull(rs.getString("leave_starts"));
//Modified by sarita on 04-10-2019 [START]
//pstmt.setString(1, lve);
pstmt1.setString(1, lve);
//Modified by sarita on 04-10-2019 [END]
pstmt.setString(1, lve);
rs1 = pstmt1.executeQuery();
while(rs1.next())
{
......@@ -3497,8 +3492,7 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
double noDays1 = 0,days = 0;
boolean isError = false;
java.sql.Timestamp toDate = null,tempDate = null;
String sql = "";
PreparedStatement pstmt = null;
ResultSet resultSet = null;
......@@ -3508,7 +3502,6 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
days = noDays;
do
{
sql = "SELECT CODE,FR_DATE,TO_DATE FROM PERIOD WHERE FR_DATE <= ? AND TO_DATE >= ?";
pstmt = connectionObject.prepareStatement(sql);
pstmt.setTimestamp(1 ,tempDate);
......@@ -3516,13 +3509,10 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
resultSet = pstmt.executeQuery();
while(resultSet.next())
{
//Modified by Anjali R. on [18/07/2019][Start]
//period = resultSet.getString("");
period = resultSet.getString("CODE");
//Modified by Anjali R. on [18/07/2019][End]
toDate = resultSet.getTimestamp("TO_DATE");
}
if(resultSet != null)
{
resultSet.close();
......@@ -3533,8 +3523,6 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
pstmt.close();
pstmt = null;
}
if(toDate.after(lvedtTo))
{
toDate = lvedtTo;
......@@ -3558,6 +3546,7 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
{
noDays1 = resultSet.getDouble("NO_DAYS");
}
if(resultSet != null)
{
resultSet.close();
......@@ -3614,7 +3603,6 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
pstmt.close();
pstmt = null;
}
}
catch (Exception fe)
{
......@@ -3677,11 +3665,7 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
String lsstarttemp = "B" , lsendtemp = "E";
EmpLeaveIC empLeave = null;
// Modified by Piyush on 12/01/2018 [To update no of days considering weekly off/holidays as perleave rules. Sun CCF No: IT2016-073 - Request ID: A16ISUN003].End
// Modified by Anjali R. on 11/06/2019 [To track no of days adjusted in summary and balance days to be adjusted as some time weekly offs get changed afterwords][Start]
double lcLveSumTotdays = 0.0;
// Modified by Anjali R. on 11/06/2019 [To track no of days adjusted in summary and balance days to be adjusted as some time weekly offs get changed afterwords][End]
try
{
empLeave = new EmpLeaveIC();
......@@ -3720,6 +3704,7 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
lveStart = checkNull(resultSet.getString("LEAVE_STARTS"));
lveEnd = checkNull(resultSet.getString("LEAVE_ENDS"));
}
if(resultSet != null)
{
resultSet.close();
......@@ -3839,10 +3824,8 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
break;
}
}
System.out.println("========errCd=====["+errCd+"]");
noRows = 0;
if(errCd !=null && errCd.trim().length() > 0)
if(errCd.trim().length() > 0)
{
errCode = "VTDATE5";
this.errList.add(errCode);
......@@ -3882,7 +3865,7 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
//Modified by Anjali Rawankar on[20/09/2017][Start]
//if(balOpt.equals("Y"))
if("Y".equalsIgnoreCase(balOpt))
//Modified by Anjali Rawankar on[20/09/2017][End]
//Modified by Anjali Rawankar on[20/09/2017][End]
{
boolean allowUpdateNegLeave = (Boolean)this.lveRuleList.get("allow_update_negative_leave");
if(allowUpdateNegLeave == true && museFlag.equals("C"));
......@@ -4344,7 +4327,6 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
}
else
{
System.out.println("Inside ==[4318]");
errCode = "VTEMPLVE4";
this.errList.add(errCode);
this.fldList.add("");
......@@ -4354,7 +4336,6 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
}
else
{
System.out.println("Inside ==[4328]");
errCode = "VTEMPLVE4";
this.errList.add(errCode);
this.fldList.add("");
......@@ -4414,6 +4395,7 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
/*[Purpose : Used date method of UtilMethod.java]
*Modified by Anjali Rawankar on [20/09/2017][End]
*/
{
noDays = noDays - 0.5;
}
......@@ -4443,7 +4425,7 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
{
lsendtemp = "E";
}
lihwdays = Double.parseDouble( empLeave.gbfGetHwDay(mEmp, mDate, tempToDt, mLveCode, lsstarttemp, lsendtemp, mDate1, mDate2, connectionObject));
lihwdays = empLeave.gbfGetHwDay(mEmp, mDate, tempToDt, mLveCode, lsstarttemp, lsendtemp, mDate1, mDate2, connectionObject);
System.out.println("lihwdays===["+lihwdays+"]");
if(lihwdays < 0)
{
......@@ -4465,6 +4447,8 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
mDate2 = mDate1;
noDays = mDays;
}
noRows = 0;
System.out.println("tranId: ["+tranId+"]"+"mEmp: ["+mEmp+"] mLveCode: ["+mLveCode+"] noDays: ["
+noDays+"] period: ["+period+"] mDate1: ["+mDate1+"] mDate2: ["+mDate2+"] museFlag: ["+museFlag+"]");
......@@ -4498,10 +4482,6 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
isError = true;
break;
}
//Modified by Anjali R. on [28/06/2019][To track no of days adjusted in summary and balance days to be adjusted as some time weekly offs get changed afterwords][Start]
lcLveSumTotdays = lcLveSumTotdays + noDays;
//Modified by Anjali R. on [28/06/2019][To track no of days adjusted in summary and balance days to be adjusted as some time weekly offs get changed afterwords][End]
if (utilMethod.pos("ELVA" , museFlag) > 0)
{
break;
......@@ -4520,62 +4500,7 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
{
break;
}
//Modified by Anjali R. on [28/06/2019][To track no of days adjusted in summary and balance days to be adjusted as some time weekly offs get changed afterwords][Start]
if( utilMethod.pos("ELVA" , museFlag) == 0)
{
if (lcLveSumTotdays < mDays)
{
lcLveSumTotdays = mDays - lcLveSumTotdays;
period = "";
sql = "select max(prd_code) as max_period from empleave_summary where tran_id = ? and emp_code = ? and lve_code = ?";
pstmt = connectionObject.prepareStatement(sql);
pstmt.setString(1, tranId);
pstmt.setString(2, mEmp);
pstmt.setString(3, mLveCode);
resultSet = pstmt.executeQuery();
if(resultSet.next())
{
period = checkNull(resultSet.getString("max_period"));
}
if(resultSet != null)
{
resultSet.close();
resultSet = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(period == null || period.trim().length() == 0)
{
errCode = "DS000";
this.errList.add(errCode);
this.fldList.add("");
isError = true;
break;
}
sql = "update empleave_summary set no_days = no_days + ? where tran_id = ? and emp_code = ? and prd_code = ? and lve_code = ?";
pstmt = connectionObject.prepareStatement(sql);
pstmt.setDouble(1, noDays);
pstmt.setString(2, tranId);
pstmt.setString(3, mEmp);
pstmt.setString(4, period);
pstmt.setString(5, mLveCode);
int cnt = pstmt.executeUpdate();
if(cnt != 1)
{
errCode = "DS000NR";
this.errList.add(errCode);
this.fldList.add("");
isError = true;
break;
}
}
}
//Modified by Anjali R. on [28/06/2019][To track no of days adjusted in summary and balance days to be adjusted as some time weekly offs get changed afterwords][End]
if(museFlag.equalsIgnoreCase("V"))
if(museFlag.equals("V"))
{
sql = "";
sql = "SELECT LVE_CODE__CONVERT FROM LEAVES WHERE LVE_CODE = ?";
......@@ -4943,7 +4868,7 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
End if
End If*/
// end edi
}
catch(Exception e)
{
......@@ -5041,7 +4966,6 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
{
fe.printStackTrace();
}
}
return errCode;
......@@ -5124,6 +5048,7 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
cadre = resultSet.getString("CADRE");
grade = resultSet.getString("GRADE");
}
if(resultSet != null)
{
resultSet.close();
......@@ -5336,12 +5261,12 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
availFrom = dateJoin;
process = "Y";
}
else
{
availFrom = dateJoin;
process = "Y";
}
if (availAterMonths == 0)
{
availAterMonths = 0;
......@@ -5381,14 +5306,13 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
pstmt.close();
pstmt = null;
}
}
lveFrDt1 = utilMethod.dateTime(lveFrDate1);
lveToDt1 = utilMethod.dateTime(lveToDate1);
// Modified by Anjali R on 02/02/2019 [To restrict expiry date till '2034' because of no of months can be more then this].Start
// Modified by Piyush on 02/02/2019 [To restrict expiry date till '2034' because of no of months can be more then this].Start
int litempyear = 0;
litempyear = utilMethod.year(utilMethod.date(lveToDt1));
if (litempyear < 100)
......@@ -5400,7 +5324,7 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
{
accumulateMonths = 24408 - litempyear;
}
// Modified by Anjali R on 02/02/2019 [To restrict expiry date till '2036' because of no of months can be more then this].End
// Modified by Piyush on 02/02/2019 [To restrict expiry date till '2036' because of no of months can be more then this].End
if("Y".equalsIgnoreCase(accumulate))
{
......@@ -5413,8 +5337,6 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
expDate = lveToDt1;
}
}
if(lveFrDate1.before(newEffDate))
{
effDate = newEffDate;
......@@ -5461,16 +5383,10 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
break;
}
noRows = 0;
//Modified by Anjali R. on[18/07/2019][Start]
/*sql = "INSERT INTO LEAVEBAL"+
"(EMP_CODE,LVE_CODE,EFF_DATE,UPTO_DATE,EXP_DATE,EDIT_FLAG,AVAIL_DAYS, CONS_DAYS,"+
"ENCH_DAYS,BAL_DAYS,PREV_BAL,ENCASHABLE,ACCT_PRD,CHG_DATE,CHG_USER,CHG_TERM,CONV_DAYS)"+
"VALUES(?,?,?,?,?,'A',0,0,0,0,0,?,?,SYSDATE,?,?,0)";*/
sql = "INSERT INTO LEAVEBAL"+
"(EMP_CODE,LVE_CODE,EFF_DATE,UPTO_DATE,EXP_DATE,EDIT_FLAG,AVAIL_DAYS, CONS_DAYS,"+
"ENCH_DAYS,BAL_DAYS,PREV_BAL,ENCASHABLE,ACCT_PRD,CHG_DATE,CHG_USER,CHG_TERM,CONV_DAYS)"+
"VALUES(?,?,?,?,?,'P',0,0,0,0,0,?,?,SYSDATE,?,?,0)";
//Modified by Anjali R. on[18/07/2019][End]
pstmt = connectionObject.prepareStatement(sql);
pstmt.setString(1,empCode);
pstmt.setString(2,lveCode);
......
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