Commit 118b2b68 authored by sanashaikh's avatar sanashaikh

Sana S: Modified on 02/01/2020

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@214450 ce508802-f39f-4f6c-b175-0d175dae99d5
parent c6ad40cf
......@@ -167,7 +167,7 @@ public class LeaveConvertPrc extends ProcessEJB implements LeaveConvertPrcLocal,
String tranId = "";
String userId = "";
String balDays="";
Date expDate=null;
String expDate=null;
Timestamp ldProcess = null,nextEff=null,nextEff1=null;
......@@ -238,8 +238,10 @@ public class LeaveConvertPrc extends ProcessEJB implements LeaveConvertPrcLocal,
pstmt.close();
pstmt = null;
}
Timestamp chg_time=utilMethod.dateTime(utilMethod.today(), utilMethod.now());
//Modified by Sana S on 02/01/2020 [start]
// String chg_time=utilMethod.dateTime(utilMethod.today(), utilMethod.now());
String chg_time=sdf.format(utilMethod.dateTime(utilMethod.today(), utilMethod.now()));
//Modified by Sana S on 02/01/2020 [end]
Timestamp mtrandate=utilMethod.dateTime(utilMethod.today(), utilMethod.now());
sql="select key_string from transetup where upper(tran_window) = ? ";
......@@ -318,7 +320,10 @@ public class LeaveConvertPrc extends ProcessEJB implements LeaveConvertPrcLocal,
}
procDate = checkNull(genericUtility.getColumnValue("proc_date", headerDom));
ldProcess = Timestamp.valueOf(genericUtility.getValidDateString(procDate, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
//Modified by Sana S on 31/12/19 [start]
// ldProcess = Timestamp.valueOf(genericUtility.getValidDateString(procDate, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
ldProcess = Timestamp.valueOf(genericUtility.getValidDateString(procDate, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat())+ " 00:00:00.0");
//Modified by Sana S on 31/12/19 [end]
System.out.print("procDate:["+procDate+"]");
System.out.print("ldProcess:["+ldProcess+"]");
......@@ -371,14 +376,19 @@ public class LeaveConvertPrc extends ProcessEJB implements LeaveConvertPrcLocal,
pstmt.setString(3, lveCodeOf);
pstmt.setString(4, siteCodeFr);
pstmt.setString(5, siteCodeTo);
pstmt.setString(6, procDate);
//Modified by Sana S on 31/12/19 [start]
// pstmt.setString(6, procDate);
pstmt.setTimestamp(6, ldProcess);
//Modified by Sana S on 31/12/19 [end]
pstmt.setString(7, deptCodeFr);
pstmt.setString(8, deptCodeTo);
pstmt.setString(9, procGroupFr);
pstmt.setString(10, procGroupTo);
pstmt.setString(11, lsProcResEmp);
pstmt.setString(12, procDate);
//Modified by Sana S on 31/12/19 [start]
//pstmt.setString(12, procDate);
pstmt.setTimestamp(12, ldProcess);
//Modified by Sana S on 31/12/19 [end]
rs = pstmt.executeQuery();
while(rs.next())
......@@ -392,17 +402,19 @@ public class LeaveConvertPrc extends ProcessEJB implements LeaveConvertPrcLocal,
dwDataMap.put("upto_date",rs.getDate("upto_date"));
dwDataMap.put("bal_days", checkNull(rs.getString("bal_days")));
expDate=rs.getDate("exp_date");
nextEff=utilMethod.dateTime(utilMethod.RelativeDate(utilMethod.date(expDate), 1));
dwDataMap.put("work_site", checkNull(rs.getString("work_site")));
//expDate=rs.getDate("exp_date");// Commented by Sana S on 31/12/19
expDate=sdf.format(rs.getDate("exp_date"));
System.out.println("expDate>>>>"+expDate);
nextEff1=utilMethod.dateTime(utilMethod.RelativeDate(utilMethod.date(nextEff), 365));
chg_time=utilMethod.dateTime(utilMethod.today(), utilMethod.now());
//nextEff=utilMethod.dateTime(utilMethod.RelativeDate(utilMethod.date(Date.valueOf(expDate)), 1));// Commented by Sana S on 02/01/2020
String a=sdf.format(chg_time);
dwDataMap.put("work_site", checkNull(rs.getString("work_site")));
System.out.print("chg_time:"+a);
//nextEff1=utilMethod.dateTime(utilMethod.RelativeDate(utilMethod.date(nextEff), 365));// Commented by Sana S on 02/01/2020
//Modified by Sana S on 02/01/2020 [start]
// chg_time=utilMethod.dateTime(utilMethod.today(), utilMethod.now());
chg_time=sdf.format(utilMethod.dateTime(utilMethod.today(), utilMethod.now()));
//Modified by Sana S on 02/01/2020 [end]
dataMap.put(rowCnt, dwDataMap);
dwDataMap = null;
......@@ -419,7 +431,7 @@ public class LeaveConvertPrc extends ProcessEJB implements LeaveConvertPrcLocal,
}
String lveCode=null;
System.out.println("ldProcess ===> "+ldProcess+"\n expDate: "+sdf.format(expDate));
//System.out.println("ldProcess ===> "+ldProcess+"\n expDate: "+sdf.format(expDate));
llRowCnt=dataMap.size();
for(int i = 1; i <= llRowCnt; i++)
......@@ -438,8 +450,13 @@ public class LeaveConvertPrc extends ProcessEJB implements LeaveConvertPrcLocal,
xmlValues = xmlValues + "<Header></Header>";
xmlValues = xmlValues + "<Detail1>";
xmlValues = xmlValues + "<tran_id></tran_id>";
xmlValues = xmlValues + "<lve_date_fr>" + sdf.format(expDate) + "</lve_date_fr>";
xmlValues = xmlValues + "<lve_date_to>" + sdf.format(expDate) + "</lve_date_to>";
//Modified by Sana S on 02/01/2020 [start]
/*xmlValues = xmlValues + "<lve_date_fr>" + sdf.format(expDate) + "</lve_date_fr>";
xmlValues = xmlValues + "<lve_date_to>" + sdf.format(expDate) + "</lve_date_to>";*/
xmlValues = xmlValues + "<lve_date_fr>" + expDate + "</lve_date_fr>";
xmlValues = xmlValues + "<lve_date_to>" + expDate + "</lve_date_to>";
//Modified by Sana S on 02/01/2020 [end]
xmlValues = xmlValues + "<emp_code>" + lsEmpCode + "</emp_code>";
xmlValues = xmlValues + "<work_site>" + workSite + "</work_site>";
xmlValues = xmlValues + "<lve_code>" + lveCode + "</lve_code>";
......@@ -463,22 +480,44 @@ public class LeaveConvertPrc extends ProcessEJB implements LeaveConvertPrcLocal,
return errString;
}
//Added by Sana S on 31/12/19 [start]
// Timestamp expDate1=Timestamp.valueOf(genericUtility.getValidDateString(String.valueOf(expDate), genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat())+ " 00:00:00.0");
Timestamp expDate1=Timestamp.valueOf(genericUtility.getValidDateString(String.valueOf(expDate), genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat())+ " 00:00:00.0");
Timestamp chg_time1=Timestamp.valueOf(genericUtility.getValidDateString(String.valueOf(chg_time), genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat())+ " 00:00:00.0");
System.out.println("expDate1>>>>>>>"+expDate1);
//Added by Sana S on 31/12/19 [end]
sql="insert into empleave(tran_id,emp_code,lve_date_fr,lve_date_to,lve_code,use_flag,no_days,chg_date,chg_term,chg_user,status,status_date,aprv_date,leave_starts,leave_ends) "
+ "values (?, ?, ?, ?, ? ,? ,? , ? , ? , ? , ? , ? , ? , ? , ?) ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId);
pstmt.setString(2, lsEmpCode);
pstmt.setString(3, sdf.format(expDate));
pstmt.setString(4, sdf.format(expDate));
//Added by Sana S on 31/12/19 [start]
/*pstmt.setString(3, sdf.format(expDate));
pstmt.setString(4, sdf.format(expDate));*/
pstmt.setTimestamp(3, expDate1);
pstmt.setTimestamp(4, expDate1);
//Added by Sana S on 31/12/19 [end]
pstmt.setString(5, lveCode);
pstmt.setString(6, "V");
pstmt.setString(7, balDays);
pstmt.setString(8, sdf.format(chg_time));
//Added by Sana S on 31/12/19 [start]
// pstmt.setString(8, sdf.format(chg_time));
pstmt.setTimestamp(8, chg_time1);
//Added by Sana S on 31/12/19 [start]
pstmt.setString(9, "SYSTEM");
pstmt.setString(10, userId);
pstmt.setString(11, "R");
pstmt.setString(12, sdf.format(chg_time));
pstmt.setString(13, sdf.format(chg_time));
//Added by Sana S on 31/12/19 [start]
/*pstmt.setString(12, sdf.format(chg_time));
pstmt.setString(13, sdf.format(chg_time));*/
pstmt.setTimestamp(12, chg_time1);
pstmt.setTimestamp(13, chg_time1);
//Added by Sana S on 31/12/19 [end]
pstmt.setString(14, "B");
pstmt.setString(15, "E");
......@@ -604,7 +643,7 @@ public class LeaveConvertPrc extends ProcessEJB implements LeaveConvertPrcLocal,
ResultSet rs = null,rs1=null,rs2=null,rs3=null;
PreparedStatement pstmt = null,pstmt1 = null,pstmt2 = null,pstmt3 = null;
String resultString="";
StringBuffer valueXmlString = null;
//StringBuffer valueXmlString = null;
String cadre=null,grade=null,workSite=null,empCode=null,lveCodeConvert=null;
......@@ -626,6 +665,7 @@ public class LeaveConvertPrc extends ProcessEJB implements LeaveConvertPrcLocal,
String empCodeTo = null,lveCode=null;
String fName= null,lName= null,mName= null,balDays= null,paySite= null,temp= null,procDate = null;
Timestamp ldProcess=null;//Added by Sana S on 31/12/19
SimpleDateFormat sdf=new SimpleDateFormat("dd/MM/yy");
Map dwDataMap = null;
......@@ -697,11 +737,14 @@ public class LeaveConvertPrc extends ProcessEJB implements LeaveConvertPrcLocal,
}
procDate = genericUtility.getColumnValue("proc_date",headerDom);
//Added by Sana S on 31/12/19
ldProcess = Timestamp.valueOf(genericUtility.getValidDateString(procDate, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat())+ " 00:00:00.0");
if ( procDate == null )
{
procDate = String.valueOf(utilMethod.dateTime(utilMethod.today()));
System.out.println("Process Date :"+procDate);
ldProcess = Timestamp.valueOf(genericUtility.getValidDateString(procDate, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat())+ " 00:00:00.0");
System.out.println("Process Date :"+ldProcess);
}
procGroupTo = genericUtility.getColumnValue("proc_group__to",headerDom);
......@@ -720,7 +763,6 @@ public class LeaveConvertPrc extends ProcessEJB implements LeaveConvertPrcLocal,
resignEmp = genericUtility.getColumnValue("resign_emp",headerDom);
sql="select lve_code__convert from leaves where lve_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lveCodeOf);
......@@ -767,13 +809,17 @@ public class LeaveConvertPrc extends ProcessEJB implements LeaveConvertPrcLocal,
pstmt.setString(3, lveCodeOf);
pstmt.setString(4, siteCodeFrom);
pstmt.setString(5, siteCodeTo);
pstmt.setString(6, procDate);
//Modified by Sana S on 31/12/19
// pstmt.setString(6, procDate);
pstmt.setTimestamp(6, ldProcess);
pstmt.setString(7, deptCodeFrom);
pstmt.setString(8, deptCodeTo);
pstmt.setString(9, procGroupFrom);
pstmt.setString(10, procGroupTo);
pstmt.setString(11,resignEmp );
pstmt.setString(12, procDate);
//Modified by Sana S on 31/12/19
//pstmt.setString(12, procDate);
pstmt.setTimestamp(12, ldProcess);
rs = pstmt.executeQuery();
......
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