Commit 583d939f authored by ysawant's avatar ysawant

*updated components of Employee Details Change

EmpDetChg.java


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@215378 ce508802-f39f-4f6c-b175-0d175dae99d5
parent a2f7cca2
......@@ -8,6 +8,7 @@ import java.sql.ResultSet;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import org.w3c.dom.Document;
......@@ -163,6 +164,7 @@ public class EmpDetChg extends ValidatorEJB implements EmpDetChgLocal,EmpDetChgR
String roleProfile = "";
String roleProfDescr = "";
HashMap empDetMap = new HashMap();
//Added By Poonam B[09-01-2020][Changes done as per Nvo component][START]
/*int i = 0;
String lsCode1 = "";
......@@ -1823,7 +1825,7 @@ public class EmpDetChg extends ValidatorEJB implements EmpDetChgLocal,EmpDetChgR
String loginEmpCode = "";
String errCode = "";
String roleProfiles = "";
String[] roleProfilesList;
String[] roleProfilesArr;
//String mval1 = "";
String actStatus = "";
Timestamp ldRelieveDate =null;
......@@ -1835,7 +1837,7 @@ public class EmpDetChg extends ValidatorEJB implements EmpDetChgLocal,EmpDetChgR
ArrayList<String> errList = new ArrayList<String>();
ArrayList<String> errFields = new ArrayList<String>();
String errorType="";
String errorType = "";
errStringXml = new StringBuffer("<?xml version=\"1.0\"?>\r\n<Root><Errors>");
E12GenericUtility genericUtility = null;
......@@ -1846,13 +1848,7 @@ public class EmpDetChg extends ValidatorEJB implements EmpDetChgLocal,EmpDetChgR
itmDbAcess = new ITMDBAccessEJB();
conn = getConnection();
AdmCommon admCommon = new AdmCommon();
//UtilMethods utilMethods = new UtilMethods();
/*SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
todayDate = sdf.format(new java.util.Date());
System.out.println("todayDate::: "+ todayDate);*/
todayDate = utilMethod.date(utilMethod.today());
System.out.println("TodayDate ==>"+todayDate);
......@@ -2284,7 +2280,7 @@ public class EmpDetChg extends ValidatorEJB implements EmpDetChgLocal,EmpDetChgR
System.out.println("::::validation of date_join::::");
dateJoin=checkNull(genericUtility.getColumnValue("date_join", dom));
//ldDate = Timestamp.valueOf(genericUtility.getValidDateString(dateJoin, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
if(dateJoin == null || dateJoin.trim().length() == 0)
{
errList.add("VMJOIN");
......@@ -2728,7 +2724,7 @@ public class EmpDetChg extends ValidatorEJB implements EmpDetChgLocal,EmpDetChgR
{
sql=" select relieve_date from employee where emp_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, bankCode); //que
pstmt.setString(1, bankCode);
rs = pstmt.executeQuery();
if (rs.next())
{
......@@ -2832,7 +2828,7 @@ public class EmpDetChg extends ValidatorEJB implements EmpDetChgLocal,EmpDetChgR
sql="select relieve_date from employee where emp_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsempCodeHod); //que
pstmt.setString(1, lsempCodeHod);
rs = pstmt.executeQuery();
if (rs.next())
{
......@@ -3511,12 +3507,17 @@ public class EmpDetChg extends ValidatorEJB implements EmpDetChgLocal,EmpDetChgR
System.out.println("::::validation of role_profiles::::");
roleProfiles = checkNull(genericUtility.getColumnValue("role_profiles", dom));
System.out.println("roleProfiles -->"+roleProfiles);
buCode = checkNull(genericUtility.getColumnValue("bu_code", dom));
if(roleProfiles != null && roleProfiles.trim().length() > 0)
{
roleProfilesList = roleProfiles.split(",");
System.out.println("===========///===========");
roleProfilesArr = roleProfiles.split(",");
System.out.println("roleProfilesList -->"+Arrays.toString(roleProfilesArr) );
sql = "select case when act_status is null then 'Y' else act_status end as mval2 from role_profile where role_profile = ? ";
pstmt = conn.prepareStatement(sql);
......@@ -3524,9 +3525,10 @@ public class EmpDetChg extends ValidatorEJB implements EmpDetChgLocal,EmpDetChgR
sql1 = "select case when act_status is null then 'Y' else act_status end as mval2 from bu_role_profile where bu_code = ? and role_profile = ?";
pstmt1 = conn.prepareStatement(sql1);
for(int i = 0; i < roleProfilesList.length; i++)
for(int i = 0; i < roleProfilesArr.length; i++)
{
pstmt.setString( 1, roleProfilesList[i] );
System.out.println("roleProfilesList[i] -->["+i+"]"+roleProfilesArr[i]);
pstmt.setString( 1, roleProfilesArr[i]);
rs = pstmt.executeQuery();
pstmt.clearParameters();
if(rs.next())
......@@ -3544,16 +3546,7 @@ public class EmpDetChg extends ValidatorEJB implements EmpDetChgLocal,EmpDetChgR
break;
}
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if (rs != null)
{
rs.close();
rs = null;
}
if("N".equalsIgnoreCase(actStatus))
{
errList.add("VMROLPRF02");
......@@ -3569,7 +3562,7 @@ public class EmpDetChg extends ValidatorEJB implements EmpDetChgLocal,EmpDetChgR
actStatus = "";
pstmt1.setString( 1, buCode );
pstmt1.setString( 2, roleProfilesList[i] );
pstmt1.setString( 2, roleProfilesArr[i] );
rs1 = pstmt1.executeQuery();
pstmt1.clearParameters();
if(rs1.next())
......@@ -3587,16 +3580,6 @@ public class EmpDetChg extends ValidatorEJB implements EmpDetChgLocal,EmpDetChgR
break;
}
}
if (pstmt1 != null)
{
pstmt1.close();
pstmt1 = null;
}
if (rs1 != null)
{
rs1.close();
rs1 = null;
}
if("N".equalsIgnoreCase(actStatus))
{
errList.add("VMBUROLE02");
......@@ -3619,6 +3602,16 @@ public class EmpDetChg extends ValidatorEJB implements EmpDetChgLocal,EmpDetChgR
rs.close();
rs = null;
}
if (pstmt1 != null)
{
pstmt1.close();
pstmt1 = null;
}
if (rs1 != null)
{
rs1.close();
rs1 = null;
}
}
//Modified By Poonam b[09-01-2020][Changes done as per Nvo component][Start]
......@@ -3730,7 +3723,6 @@ public class EmpDetChg extends ValidatorEJB implements EmpDetChgLocal,EmpDetChgR
}
//Modified By Poonam b[09-01-2020][Changes done as per Nvo component][End]
*/
}
//Added by Yashwant on 11-11-19[END][Added validation for Role Profile]
}
......@@ -3878,9 +3870,7 @@ public class EmpDetChg extends ValidatorEJB implements EmpDetChgLocal,EmpDetChgR
{
lsVersionId =checkNull(rs.getString("version_id"));
}
//select emp_code into :ls_emp_code_org from org_structure
//where version_id = :ls_version_id and table_no = :ls_tableno and pos_code = :as_pos_code;
sql="select emp_code from org_structure"+
" where version_id = ? and table_no = ? and pos_code = ?";
pstmt = conn.prepareStatement(sql);
......@@ -3988,7 +3978,6 @@ public class EmpDetChg extends ValidatorEJB implements EmpDetChgLocal,EmpDetChgR
return msgType;
}
private String checkNull(String input)
{
if (input == 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