Commit 8873ac06 authored by dpingle's avatar dpingle

* update leave balance component and sql file on [13/11/19]

w_leavebal.sql
leaveBalIC.java


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@211868 ce508802-f39f-4f6c-b175-0d175dae99d5
parent ced78be9
...@@ -205,6 +205,8 @@ update ITM2MENU set ICON_PATH='LeaveBalance.png' ,OPEN_ICON='LeaveBalancewht.png ...@@ -205,6 +205,8 @@ update ITM2MENU set ICON_PATH='LeaveBalance.png' ,OPEN_ICON='LeaveBalancewht.png
Insert into MESSAGES (MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,MSG_TIME,ALARM,ERR_SOURCE,CHG_DATE,CHG_USER,CHG_TERM,OVERRIDE_INPUT,MAIL_OPTION) Insert into MESSAGES (MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,MSG_TIME,ALARM,ERR_SOURCE,CHG_DATE,CHG_USER,CHG_TERM,OVERRIDE_INPUT,MAIL_OPTION)
values ('INVLVDATA4','Already existed!!','Already Existed Employee Code in leavebal table','E','Y',null,null,null,to_date('24-03-06','DD-MM-RR'),'BASE ','01BASE215 ',null,null); values ('INVLVDATA4','Already existed!!','Already Existed Employee Code in leavebal table','E','Y',null,null,null,to_date('24-03-06','DD-MM-RR'),'BASE ','01BASE215 ',null,null);
update transetup set tran_id_col='emp_code,lve_code,eff_date,upto_date' where tran_window='w_leavebal';
----------------------------------------------------- Dipesh[11/11/19]End ----------------------------------------------------- Dipesh[11/11/19]End
......
...@@ -98,6 +98,8 @@ public class leaveBalIC extends ValidatorEJB implements leaveBalRemote,leaveBalL ...@@ -98,6 +98,8 @@ public class leaveBalIC extends ValidatorEJB implements leaveBalRemote,leaveBalL
int noOfChilds = 0; int noOfChilds = 0;
int counter; int counter;
int cnt = 0; int cnt = 0;
Timestamp effDates = null;
Timestamp upToDates = null;
Date expDate = null; Date expDate = null;
Date uptoDate = null; Date uptoDate = null;
java.sql.Timestamp effectiveDate = null , upToDate = null; java.sql.Timestamp effectiveDate = null , upToDate = null;
...@@ -157,7 +159,17 @@ public class leaveBalIC extends ValidatorEJB implements leaveBalRemote,leaveBalL ...@@ -157,7 +159,17 @@ public class leaveBalIC extends ValidatorEJB implements leaveBalRemote,leaveBalL
if ("emp_code".equalsIgnoreCase(childNodeName)) if ("emp_code".equalsIgnoreCase(childNodeName))
{ {
uptoDateStr = checkNull(genericUtility.getColumnValue("upto_date", dom)); uptoDateStr = checkNull(genericUtility.getColumnValue("upto_date", dom));
uptoDate = uptoDateStr!= null && uptoDateStr.length() > 0 ? sdf.parse(uptoDateStr) : uptoDate; if(uptoDateStr != null && uptoDateStr.trim().length() > 0)
{
upToDates = Timestamp.valueOf(genericUtility.getValidDateString(uptoDateStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
}
effDateStr = checkNull(genericUtility.getColumnValue("eff_date", dom));
if(effDateStr != null && effDateStr.trim().length() > 0)
{
effDates = Timestamp.valueOf(genericUtility.getValidDateString(effDateStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
}
empCode = checkNull(genericUtility.getColumnValue("emp_code", dom)); empCode = checkNull(genericUtility.getColumnValue("emp_code", dom));
lveCode = checkNull(genericUtility.getColumnValue("lve_code", dom)); lveCode = checkNull(genericUtility.getColumnValue("lve_code", dom));
...@@ -180,24 +192,30 @@ public class leaveBalIC extends ValidatorEJB implements leaveBalRemote,leaveBalL ...@@ -180,24 +192,30 @@ public class leaveBalIC extends ValidatorEJB implements leaveBalRemote,leaveBalL
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
lsErrorCode = admCommon.gbfEmp(empCode, uptoDate, lsSite, loginSite, conn); lsErrorCode = admCommon.gbfEmp(empCode, upToDates, lsSite, loginSite, conn);
if(lsErrorCode != null && lsErrorCode.trim().length() >0) if(lsErrorCode != null && lsErrorCode.trim().length() >0)
{ {
errList.add(lsErrorCode); errList.add(lsErrorCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
System.out.println("lsErrorCode::::"+lsErrorCode);
} }
else else
{ {
sql = "select count(*) as cnt from leavebal where emp_code = ? and lve_code= ?"; cnt=0;
sql = "select count(*) as cnt from leavebal where emp_code = ? and lve_code= ? and eff_date=? and upto_date=? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode); pstmt.setString(1, empCode);
pstmt.setString(2, lveCode); pstmt.setString(2, lveCode);
pstmt.setTimestamp(3, effDates);
pstmt.setTimestamp(4, upToDates);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
cnt = rs.getInt("cnt"); cnt = rs.getInt("cnt");
} }
System.out.println("cnt::"+cnt);
if (rs != null) if (rs != null)
{ {
rs.close(); rs.close();
......
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