Commit c3dbdc92 authored by arawankar's avatar arawankar

Changes made in EmpLeaveCancel.java

1.Changes made to cancel the approve and unapproved leave

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@185915 ce508802-f39f-4f6c-b175-0d175dae99d5
parent f87928bb
...@@ -573,7 +573,7 @@ public class EmpLeaveCancel extends ActionHandlerEJB implements EmpLeaveCancelL ...@@ -573,7 +573,7 @@ public class EmpLeaveCancel extends ActionHandlerEJB implements EmpLeaveCancelL
double val5 = 0 , lveDays = 0 ; double val5 = 0 , lveDays = 0 ;
int ediOption = 0; int ediOption = 0;
java.sql.Timestamp val3 = null , val4 = null , date3 = null; java.sql.Timestamp val3 = null , val4 = null , date3 = null;
java.sql.Timestamp lveFromDate = null,lveToDate = null;
String empCode = "" , lveCode = "" , sql1 = ""; String empCode = "" , lveCode = "" , sql1 = "";
String empStatus = "",empCodeApprv = ""; String empStatus = "",empCodeApprv = "";
java.sql.Timestamp lveDateFr = null , lveDateTo = null, statusDate = null; java.sql.Timestamp lveDateFr = null , lveDateTo = null, statusDate = null;
...@@ -678,15 +678,20 @@ public class EmpLeaveCancel extends ActionHandlerEJB implements EmpLeaveCancelL ...@@ -678,15 +678,20 @@ public class EmpLeaveCancel extends ActionHandlerEJB implements EmpLeaveCancelL
this.fldList.add(""); this.fldList.add("");
break; break;
} }
String empCodeAprv = "",lveType = "",prdCode = "",remarks = "",tranIdPayr="", String empCodeAprv = "",lveType = "",prdCode = "",remarks = "",tranIdPayr="",
authEmp = "",applDate = "",authEmpAlternate = "",chgdate = "",chguser = "",chgterm = "", authEmp = "",applDate = "",authEmpAlternate = "",chgdate = "",chguser = "",chgterm = "",
leaveStarts = "",leaveEnds = "",lvefrdate1 = "",lvetodate1 = "",statusDate1 = "",aprvDate1= ""; leaveStarts = "",leaveEnds = "",aprvDate1= "";
String startTime = "",endTime = "",aprvDate = ""; java.sql.Timestamp statusDate1 = null,lvefrdate1 = null,lvetodate1 = null;
//String startTime = "",endTime = "",aprvDate = "";
java.sql.Timestamp startTime = null,endTime = null,aprvDate = null,chgDate = null;
double enchAmt = 0,noDays = 0,noDaysAdv = 0; double enchAmt = 0,noDays = 0,noDaysAdv = 0;
PreparedStatement ps = null;String txt = "";ResultSet rs1 = null;int cnt1 = 0; PreparedStatement ps = null;String txt = "";
ResultSet rs1 = null;int cnt1 = 0;
txt = " Select TRAN_ID ,EMP_CODE, LVE_DATE_FR, LVE_DATE_TO,LVE_CODE,EMP_CODE__APRV,APRV_DATE,LVE_TYPE,"+ txt = " Select TRAN_ID ,EMP_CODE, LVE_DATE_FR, LVE_DATE_TO,LVE_CODE,EMP_CODE__APRV,APRV_DATE,LVE_TYPE,"+
" USE_FLAG,ENCH_AMT,NO_DAYS,STATUS,STATUS_DATE,PRD_CODE,REMARKS,TRAN_ID__PAYR,NO_DAYS_ADV,APPL_DATE,"+ " USE_FLAG,ENCH_AMT,NO_DAYS,STATUS,STATUS_DATE,PRD_CODE,REMARKS,TRAN_ID__PAYR,NO_DAYS_ADV,APPL_DATE,"+
" AUTH_EMP,AUTH_EMP_ALTERNATE,DBSYSDATE(),?,?,LEAVE_STARTS, LEAVE_ENDS, START_TIME, END_TIME "+ " AUTH_EMP,AUTH_EMP_ALTERNATE,DBSYSDATE() as current_date,?,?,LEAVE_STARTS, LEAVE_ENDS, START_TIME, END_TIME "+
" FROM EMPLEAVE WHERE TRAN_ID = ?"; " FROM EMPLEAVE WHERE TRAN_ID = ?";
ps = connectionObject.prepareStatement(txt); ps = connectionObject.prepareStatement(txt);
ps.setString(1, userId); ps.setString(1, userId);
...@@ -698,8 +703,12 @@ public class EmpLeaveCancel extends ActionHandlerEJB implements EmpLeaveCancelL ...@@ -698,8 +703,12 @@ public class EmpLeaveCancel extends ActionHandlerEJB implements EmpLeaveCancelL
cnt1++; cnt1++;
tranId = checkNull(rs1.getString("TRAN_ID")); tranId = checkNull(rs1.getString("TRAN_ID"));
empCode = checkNull(rs1.getString("EMP_CODE")); empCode = checkNull(rs1.getString("EMP_CODE"));
lvefrdate1 = checkNull(rs1.getString("LVE_DATE_FR")); //Modified by Anjali R. on [04/06/2018][To take LVE_DATE_FR,LVE_DATE_TO in timestamp data type][Start]
lvetodate1 = checkNull(rs1.getString("LVE_DATE_TO")); //lvefrdate1 = checkNull(rs1.getString("LVE_DATE_FR"));
//lvetodate1 = checkNull(rs1.getString("LVE_DATE_TO"));
lveFromDate = rs1.getTimestamp("LVE_DATE_FR");
lveToDate = rs1.getTimestamp("LVE_DATE_TO");
//Modified by Anjali R. on [04/06/2018][To take LVE_DATE_FR,LVE_DATE_TO in timestamp data type][End]
lveCode = checkNull(rs1.getString("LVE_CODE")); lveCode = checkNull(rs1.getString("LVE_CODE"));
empCodeAprv = checkNull(rs1.getString("EMP_CODE__APRV")); empCodeAprv = checkNull(rs1.getString("EMP_CODE__APRV"));
aprvDate1 = checkNull(rs1.getString("APRV_DATE")); aprvDate1 = checkNull(rs1.getString("APRV_DATE"));
...@@ -708,7 +717,12 @@ public class EmpLeaveCancel extends ActionHandlerEJB implements EmpLeaveCancelL ...@@ -708,7 +717,12 @@ public class EmpLeaveCancel extends ActionHandlerEJB implements EmpLeaveCancelL
enchAmt = rs1.getDouble("ENCH_AMT"); enchAmt = rs1.getDouble("ENCH_AMT");
noDays = rs1.getDouble("NO_DAYS"); noDays = rs1.getDouble("NO_DAYS");
status = checkNull(rs1.getString("STATUS")); status = checkNull(rs1.getString("STATUS"));
statusDate1 = checkNull(rs1.getString("STATUS_DATE"));
//Modified by Anjali R. on[04/06/2018][To take status date in timestamp data type][Start]
//statusDate1 = checkNull(rs1.getString("STATUS_DATE"));
statusDate1 = rs1.getTimestamp("STATUS_DATE");
//Modified by Anjali R. on[04/06/2018][To take status date in timestamp data type][End]
prdCode = checkNull(rs1.getString("PRD_CODE")); prdCode = checkNull(rs1.getString("PRD_CODE"));
remarks = checkNull(rs1.getString("REMARKS")); remarks = checkNull(rs1.getString("REMARKS"));
tranIdPayr = checkNull(rs1.getString("TRAN_ID__PAYR")); tranIdPayr = checkNull(rs1.getString("TRAN_ID__PAYR"));
...@@ -718,8 +732,15 @@ public class EmpLeaveCancel extends ActionHandlerEJB implements EmpLeaveCancelL ...@@ -718,8 +732,15 @@ public class EmpLeaveCancel extends ActionHandlerEJB implements EmpLeaveCancelL
authEmpAlternate = checkNull(rs1.getString("AUTH_EMP_ALTERNATE")); authEmpAlternate = checkNull(rs1.getString("AUTH_EMP_ALTERNATE"));
leaveStarts = checkNull(rs1.getString("LEAVE_STARTS")); leaveStarts = checkNull(rs1.getString("LEAVE_STARTS"));
leaveEnds = checkNull(rs1.getString("LEAVE_ENDS")); leaveEnds = checkNull(rs1.getString("LEAVE_ENDS"));
startTime = checkNull(rs1.getString("START_TIME"));
endTime = checkNull(rs1.getString("END_TIME")); //Modified by Anjali R. on[04/06/2018][To take START_TIME,END_TIME in timestamp data type][Start]
//startTime = checkNull(rs1.getString("START_TIME"));
//endTime = checkNull(rs1.getString("END_TIME"));
startTime = rs1.getTimestamp("START_TIME");
endTime = rs1.getTimestamp("END_TIME");
chgDate = rs1.getTimestamp("current_date");
//Modified by Anjali R. on[04/06/2018][To take START_TIME,END_TIME in timestamp data type][End]
} }
if(rs1 != null) if(rs1 != null)
{ {
...@@ -737,12 +758,18 @@ public class EmpLeaveCancel extends ActionHandlerEJB implements EmpLeaveCancelL ...@@ -737,12 +758,18 @@ public class EmpLeaveCancel extends ActionHandlerEJB implements EmpLeaveCancelL
newSql = "INSERT INTO EMPLEAVE_CANCEL(TRAN_ID ,EMP_CODE, LVE_DATE_FR, LVE_DATE_TO,LVE_CODE,EMP_CODE__APRV,APRV_DATE,LVE_TYPE,"+ newSql = "INSERT INTO EMPLEAVE_CANCEL(TRAN_ID ,EMP_CODE, LVE_DATE_FR, LVE_DATE_TO,LVE_CODE,EMP_CODE__APRV,APRV_DATE,LVE_TYPE,"+
" USE_FLAG,ENCH_AMT,NO_DAYS,STATUS,STATUS_DATE,PRD_CODE,REMARKS,TRAN_ID__PAYR,NO_DAYS_ADV,APPL_DATE,"+ " USE_FLAG,ENCH_AMT,NO_DAYS,STATUS,STATUS_DATE,PRD_CODE,REMARKS,TRAN_ID__PAYR,NO_DAYS_ADV,APPL_DATE,"+
" AUTH_EMP,AUTH_EMP_ALTERNATE,CHG_DATE,CHG_USER,CHG_TERM,LEAVE_STARTS,LEAVE_ENDS,START_TIME,END_TIME) "+ " AUTH_EMP,AUTH_EMP_ALTERNATE,CHG_DATE,CHG_USER,CHG_TERM,LEAVE_STARTS,LEAVE_ENDS,START_TIME,END_TIME) "+
" values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,DBSYSDATE(),?,?,?,?,?,? )"; " values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,? )";
ps2 = connectionObject.prepareStatement(newSql); ps2 = connectionObject.prepareStatement(newSql);
ps2.setString(1, tranId); ps2.setString(1, tranId);
ps2.setString(2, empCode); ps2.setString(2, empCode);
ps2.setString(3, lvefrdate1.length() > 0?genericUtility.getValidDateString(lvefrdate1, genericUtility.getDBDateFormat(),genericUtility.getApplDateFormat()):null);
ps2.setString(4, lvetodate1.length() > 0?genericUtility.getValidDateString(lvetodate1, genericUtility.getDBDateFormat(),genericUtility.getApplDateFormat()):null); //Modified by Anjali R. on[04/06/2018][To set timestamp values in lve from and to][Start]
//ps2.setString(3, lvefrdate1.length() > 0?genericUtility.getValidDateString(lvefrdate1, genericUtility.getDBDateFormat(),genericUtility.getApplDateFormat()):null);
//ps2.setString(4, lvetodate1.length() > 0?genericUtility.getValidDateString(lvetodate1, genericUtility.getDBDateFormat(),genericUtility.getApplDateFormat()):null);
ps2.setTimestamp(3, lveFromDate);
ps2.setTimestamp(4, lveToDate);
//Modified by Anjali R. on[04/06/2018][To set timestamp values in lve from and to][End]
ps2.setString(5, lveCode); ps2.setString(5, lveCode);
ps2.setString(6, empCodeAprv); ps2.setString(6, empCodeAprv);
ps2.setString(7,aprvDate1.length() > 0?genericUtility.getValidDateString(aprvDate1, genericUtility.getDBDateFormat(),genericUtility.getApplDateFormat()):null); ps2.setString(7,aprvDate1.length() > 0?genericUtility.getValidDateString(aprvDate1, genericUtility.getDBDateFormat(),genericUtility.getApplDateFormat()):null);
...@@ -751,7 +778,12 @@ public class EmpLeaveCancel extends ActionHandlerEJB implements EmpLeaveCancelL ...@@ -751,7 +778,12 @@ public class EmpLeaveCancel extends ActionHandlerEJB implements EmpLeaveCancelL
ps2.setDouble(10, enchAmt); ps2.setDouble(10, enchAmt);
ps2.setDouble(11, noDays); ps2.setDouble(11, noDays);
ps2.setString(12, status); ps2.setString(12, status);
ps2.setString(13, statusDate1.length() > 0?genericUtility.getValidDateString(statusDate1,genericUtility.getDBDateFormat(), genericUtility.getApplDateFormat()):null);
//Modified by Anjali R. on[04/06/2018][To set status date in timestamp data type][Start]
//ps2.setString(13, statusDate1.length() > 0?genericUtility.getValidDateString(statusDate1,genericUtility.getDBDateFormat(), genericUtility.getApplDateFormat()):null);
ps2.setTimestamp(13, statusDate1);
//Modified by Anjali R. on[04/06/2018][To set status date in timestamp data type][End]
ps2.setString(14, prdCode); ps2.setString(14, prdCode);
ps2.setString(15, remarks); ps2.setString(15, remarks);
ps2.setString(16, tranIdPayr); ps2.setString(16, tranIdPayr);
...@@ -759,12 +791,17 @@ public class EmpLeaveCancel extends ActionHandlerEJB implements EmpLeaveCancelL ...@@ -759,12 +791,17 @@ public class EmpLeaveCancel extends ActionHandlerEJB implements EmpLeaveCancelL
ps2.setString(18, applDate.length() > 0?genericUtility.getValidDateString(applDate, genericUtility.getDBDateFormat(), genericUtility.getApplDateFormat()):null); ps2.setString(18, applDate.length() > 0?genericUtility.getValidDateString(applDate, genericUtility.getDBDateFormat(), genericUtility.getApplDateFormat()):null);
ps2.setString(19, authEmp); ps2.setString(19, authEmp);
ps2.setString(20, authEmpAlternate); ps2.setString(20, authEmpAlternate);
ps2.setString(21, userId); ps2.setTimestamp(21, chgDate);
ps2.setString(22, termId); ps2.setString(22, userId);
ps2.setString(23, leaveStarts); ps2.setString(23, termId);
ps2.setString(24, leaveEnds); ps2.setString(24, leaveStarts);
ps2.setString(25,startTime.length() > 0?genericUtility.getValidDateString(startTime, genericUtility.getDBDateFormat(), genericUtility.getApplDateFormat()):null); ps2.setString(25, leaveEnds);
ps2.setString(26,endTime.length() > 0?genericUtility.getValidDateString(endTime,genericUtility.getDBDateFormat(), genericUtility.getApplDateFormat()):null); //Modified by Anjali R. on[04/06/2018][To set START_TIME,END_TIME in timestamp data type][Start]
//ps2.setString(25,startTime.length() > 0?genericUtility.getValidDateString(startTime, genericUtility.getDBDateFormat(), genericUtility.getApplDateFormat()):null);
//ps2.setString(26,endTime.length() > 0?genericUtility.getValidDateString(endTime,genericUtility.getDBDateFormat(), genericUtility.getApplDateFormat()):null);
ps2.setTimestamp(26,startTime);
ps2.setTimestamp(27,endTime);
//Modified by Anjali R. on[04/06/2018][To set START_TIME,END_TIME in timestamp data type][End]
rowsUpdate = ps2.executeUpdate(); rowsUpdate = ps2.executeUpdate();
if(ps2 != null) if(ps2 != null)
......
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