Commit 44f74062 authored by vvengurlekar's avatar vvengurlekar

EmpMthadIC.java - changes done by Sana shaikh to show employee name


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@204078 ce508802-f39f-4f6c-b175-0d175dae99d5
parent d47c37bb
...@@ -4,6 +4,7 @@ import java.rmi.RemoteException; ...@@ -4,6 +4,7 @@ import java.rmi.RemoteException;
import java.sql.Connection; import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.Timestamp;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
...@@ -541,10 +542,22 @@ public class EmpMthadIC extends ValidatorEJB implements EmpMthadLocal,EmpMthadRe ...@@ -541,10 +542,22 @@ public class EmpMthadIC extends ValidatorEJB implements EmpMthadLocal,EmpMthadRe
String paySite = ""; String paySite = "";
AdmCommon admCommon = new AdmCommon(); AdmCommon admCommon = new AdmCommon();
// Modified By Sana s on 25/07/2019 [start]
String effDateStr="";
Timestamp joinDate = null, effDate = null;
String empName = "";
String todayDate ="";
Timestamp todayTm= null;
long cnt = 0;
SimpleDateFormat sdf = null;
String entryMode = "E";
// Modified By Sana s on 25/07/2019 [end]
try try
{ {
genericUtility = new E12GenericUtility(); genericUtility = new E12GenericUtility();
sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());/////////////////
System.out.println("currentFormNo...." + currentFormNo); System.out.println("currentFormNo...." + currentFormNo);
conn = getConnection(); conn = getConnection();
if (objContext != null && objContext.trim().length() > 0) if (objContext != null && objContext.trim().length() > 0)
...@@ -565,16 +578,25 @@ public class EmpMthadIC extends ValidatorEJB implements EmpMthadLocal,EmpMthadRe ...@@ -565,16 +578,25 @@ public class EmpMthadIC extends ValidatorEJB implements EmpMthadLocal,EmpMthadRe
{ {
empCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "emp_code"); empCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "emp_code");
monthCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "month_code"); monthCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "month_code");
// Modified By Sana S on 25/07/2019 [start]
sql="select pay_site as pay_site from employee where emp_code =?"; //sql="select pay_site as pay_site from employee where emp_code =?";
sql="select date_join, FN_GET_EMP_NAME(?,'FL1') as emp_name,pay_site from employee where emp_code= ?";
// Modified By Sana S on 25/07/2019 [start]
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode); pstmt.setString(1, empCode);
pstmt.setString(2, empCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
paySite = rs.getString("pay_site"); paySite = rs.getString("pay_site");
// Modified By Sana S on 25/07/2019 [start]
joinDate = rs.getTimestamp("date_join");
empName = rs.getString("emp_name");
// Modified By Sana S on 25/07/2019 [start]
} }
System.out.println("date_join ["+joinDate+"]\t emp_name ["+empName+"]");
if (rs != null) if (rs != null)
{ {
rs.close(); rs.close();
...@@ -624,6 +646,55 @@ public class EmpMthadIC extends ValidatorEJB implements EmpMthadLocal,EmpMthadRe ...@@ -624,6 +646,55 @@ public class EmpMthadIC extends ValidatorEJB implements EmpMthadLocal,EmpMthadRe
valueXmlString.append("<eff_date ><![CDATA[").append(lsVarValue).append("]]></eff_date>\r\n"); valueXmlString.append("<eff_date ><![CDATA[").append(lsVarValue).append("]]></eff_date>\r\n");
valueXmlString.append("<exp_date ><![CDATA[").append(lsVarValues).append("]]></exp_date>\r\n"); valueXmlString.append("<exp_date ><![CDATA[").append(lsVarValues).append("]]></exp_date>\r\n");
//////////////
// Modified by Sana S on 25/07/2019 [Shifted outside from bellow if condition to set employee name].Start
valueXmlString.append("<emp_name>").append("<![CDATA["+empName+"]]>").append("</emp_name>");
if((effDateStr == null || effDateStr.trim().length() == 0) && "E".equalsIgnoreCase(entryMode))
{
effDateStr = todayDate;
effDate=todayTm;
System.out.println("effDateStr :::::"+ effDateStr +" effDate :::::"+ effDate);
cnt = 0;
if(joinDate != null)
{
sql = "select count(*) as count from employee_ad where emp_code = ? and eff_date > ?";
pstmt= conn.prepareStatement(sql);
pstmt.setString(1,empCode);
pstmt.setTimestamp(2,joinDate);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getLong("count");
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(cnt == 0)
{
effDate= joinDate;
effDateStr= sdf.format(joinDate);
}
}
cnt = 0;
}
valueXmlString.append("<eff_date>").append("<![CDATA["+effDateStr+"]]>").append("</eff_date>");
valueXmlString.append("<pay_site>").append("<![CDATA["+paySite+"]]>").append("</pay_site>");
////Modified By Sana S on 25/07/2019 [end]
} }
else if ("ad_code".equalsIgnoreCase(currentColumn)) else if ("ad_code".equalsIgnoreCase(currentColumn))
{ {
...@@ -654,14 +725,20 @@ public class EmpMthadIC extends ValidatorEJB implements EmpMthadLocal,EmpMthadRe ...@@ -654,14 +725,20 @@ public class EmpMthadIC extends ValidatorEJB implements EmpMthadLocal,EmpMthadRe
else if ("emp_code".equalsIgnoreCase(currentColumn)) else if ("emp_code".equalsIgnoreCase(currentColumn))
{ {
empCode = checkNull(genericUtility.getColumnValue("emp_code", dom)); empCode = checkNull(genericUtility.getColumnValue("emp_code", dom));
sql="select pay_site as pay_site from employee where emp_code = ?"; //sql="select pay_site as pay_site from employee where emp_code = ?";
pstmt = conn.prepareStatement(sql); sql = "select pay_site,date_join, FN_GET_EMP_NAME(?,'FL1') as emp_name from employee where emp_code = ?";
pstmt.setString(1, empCode); pstmt= conn.prepareStatement(sql);
pstmt.setString(1,empCode);
pstmt.setString(2,empCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
paySite = rs.getString("pay_site"); paySite = rs.getString("pay_site");
// Modified By Sana S on 25/07/2019 [start] to get datejoin and empname column
joinDate= rs.getTimestamp("date_join");
empName = checkNull(rs.getString("emp_name"));
// Modified By Sana S on 25/07/2019 [end] to get datejoin and empname column
} }
if (rs != null) if (rs != 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