Commit b61ba0a5 authored by ysawant's avatar ysawant

*Added updated metadata , srd and components of Employee details change[15-01-2020]

emp_det_chg21.xml
d_emp_det_chg_edit.srd
EmpDetChg.java


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@215149 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 2d4d680e
......@@ -10812,7 +10812,7 @@
<y>793</y>
<height>16</height>
<width>68</width>
<format>dd/mm/yyyy</format>
<format>dd/mm/yy</format>
<html>
<valueishtml>0</valueishtml>
</html>
......
......@@ -504,7 +504,7 @@ column(band=detail id=8 alignment="0" tabsequence=32766 border="5" color="255" x
column(band=detail id=66 alignment="0" tabsequence=200 border="5" color="0" x="508" y="769" height="16" width="55" format="[general]" html.valueishtml="0" name=sex visible="1" ddlb.limit=0 ddlb.allowedit=no ddlb.case=any ddlb.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="1090519039" )
column(band=detail id=15 alignment="0" tabsequence=32766 border="5" color="255" x="166" y="793" height="16" width="60" format="dd/mm/yyyy" html.valueishtml="0" name=birth_date_o visible="1" editmask.mask="dd/mm/yyyy" editmask.imemode=0 editmask.focusrectangle=no font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="79741120" )
column(band=detail id=63 alignment="0" tabsequence=190 border="5" color="0" x="233" y="769" height="16" width="58" format="[general]" html.valueishtml="0" name=name_prefix visible="1" ddlb.limit=0 ddlb.allowedit=yes ddlb.case=any ddlb.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="1090519039" )
column(band=detail id=70 alignment="0" tabsequence=210 border="5" color="0" x="233" y="793" height="16" width="68" format="dd/mm/yyyy" html.valueishtml="0" name=birth_date visible="1" editmask.mask="dd/mm/yyyy" editmask.imemode=0 editmask.focusrectangle=no font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="1090519039" )
column(band=detail id=70 alignment="0" tabsequence=210 border="5" color="0" x="233" y="793" height="16" width="68" format="dd/mm/yy" html.valueishtml="0" name=birth_date visible="1" editmask.mask="dd/mm/yyyy" editmask.imemode=0 editmask.focusrectangle=no font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="1090519039" )
column(band=detail id=71 alignment="0" tabsequence=220 border="5" color="0" x="508" y="793" height="16" width="55" format="[general]" html.valueishtml="0" name=blood_grp visible="1" ddlb.limit=0 ddlb.allowedit=no ddlb.case=any ddlb.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="1090519039" )
column(band=detail id=100 alignment="0" tabsequence=240 border="5" color="0" x="482" y="817" height="16" width="81" format="[general]" html.valueishtml="0" name=hobby2 visible="1" edit.limit=10 edit.case=upper edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="1090519039" )
column(band=detail id=102 alignment="0" tabsequence=260 border="5" color="0" x="482" y="841" height="16" width="81" format="[general]" html.valueishtml="0" name=hobby4 visible="1" edit.limit=10 edit.case=upper edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes edit.imemode=0 font.face="Times New Roman" font.height="-10" font.weight="400" font.family="1" font.pitch="2" font.charset="0" background.mode="2" background.color="1090519039" )
......
......@@ -160,17 +160,24 @@ public class EmpDetChg extends ValidatorEJB implements EmpDetChgLocal,EmpDetChgR
String userId = "";
String loginSiteCode = "";
String loginEmpCode = "";
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 = "";
String lsCode2 = "";
String lsCode3 = "";*/
//Added By Poonam B[09-01-2020][Changes done as per Nvo component][END]
try
{
System.out.println("xtraParams -->"+xtraParams);
genericUtility = new E12GenericUtility();
utilMethod = new UtilMethods();
SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
todayDate = utilMethod.date(utilMethod.today());
System.out.println("TodayDate ==>"+todayDate);
todayDate = utilMethod.today();
ldToday = sdf.format(todayDate);
System.out.println("Value of ldToday == "+ldToday);
......@@ -622,9 +629,38 @@ public class EmpDetChg extends ValidatorEJB implements EmpDetChgLocal,EmpDetChgR
lsEmpFnameLong = (String) empDetMap.get("EMP_FNAME_LONG");
lsEmpMnameLong = (String) empDetMap.get("EMP_MNAME_LONG");
lsEmpLnameLong = (String) empDetMap.get("EMP_LNAME_LONG");
roleProfile = (String) empDetMap.get("ROLE_PROFILES");
}
//Modified by Yashwant on 05-11-19[End][Calling admCommon method to get employee information]
//Added by Yashwant on 11-11-19[START][To fetch role profile from employee master]
sql = "select FN_GET_ROLEPROF_DESCR(?) as roleDesr from dual";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,roleProfile);
rs = pstmt.executeQuery();
if(rs.next())
{
roleProfDescr = checkNull(rs.getString("roleDesr"));
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
valueXmlString.append("<role_profiles__o ><![CDATA[").append(roleProfile).append("]]></role_profiles__o>\r\n");
valueXmlString.append("<role_profiles_descr_o ><![CDATA[").append(roleProfDescr).append("]]></role_profiles_descr_o>\r\n");
valueXmlString.append("<role_profiles ><![CDATA[").append(roleProfile).append("]]></role_profiles>\r\n");
valueXmlString.append("<role_profiles_descr ><![CDATA[").append(roleProfDescr).append("]]></role_profiles_descr>\r\n");
//Added by Yashwant on 11-11-19[END][To fetch role profile from employee master]
sql="select descr from department where dept_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsDeptCode);
......@@ -650,6 +686,7 @@ public class EmpDetChg extends ValidatorEJB implements EmpDetChgLocal,EmpDetChgR
lsEligibleOt = "N";
}
valueXmlString.append("<emp_code ><![CDATA[").append(lsEmpCode).append("]]></emp_code>\r\n");
valueXmlString.append("<eligible_ot__o ><![CDATA[").append(lsEligibleOt).append("]]></eligible_ot__o>\r\n");
valueXmlString.append("<eligible_ot ><![CDATA[").append(lsEligibleOt).append("]]></eligible_ot>\r\n");
valueXmlString.append("<stan_code__hq_o ><![CDATA[").append(lsStanCodeHq).append("]]></stan_code__hq_o>\r\n");
......@@ -1338,7 +1375,7 @@ public class EmpDetChg extends ValidatorEJB implements EmpDetChgLocal,EmpDetChgR
valueXmlString.append("<pos_code_descr ><![CDATA[").append(lsDescr).append("]]></pos_code_descr>\r\n");
}
if(currentColumn.trim().equalsIgnoreCase("parent_dept__n"))
if("parent_dept__n".equalsIgnoreCase(currentColumn))
{
System.out.println(":::::::::::Inside parent_dept__n:::::::::::::::");
lsParentDept = checkNull(genericUtility.getColumnValue("parent_dept__n", dom));
......@@ -1481,13 +1518,13 @@ public class EmpDetChg extends ValidatorEJB implements EmpDetChgLocal,EmpDetChgR
{
System.out.println(":::::::::::Inside bu_code:::::::::::::::");
lsBuCode = checkNull(genericUtility.getColumnValue("bu_code", dom));
System.out.println("lsBuCode -->"+lsBuCode);
lsEmpCodeBuhead = "";
lsBuheadName = "";
sql= "select descr, emp_code__head,FN_GET_EMP_NAME(? , 'X1') as buhead_name from business_units where bu_code = ?";
sql= "select descr, emp_code__head,FN_GET_EMP_NAME( emp_code__head , 'X1') as buhead_name from business_units where bu_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsEmpCodeBuhead);
pstmt.setString(2, lsBuCode);
pstmt.setString(1, lsBuCode);
rs = pstmt.executeQuery();
if (rs.next())
{
......@@ -1505,9 +1542,10 @@ public class EmpDetChg extends ValidatorEJB implements EmpDetChgLocal,EmpDetChgR
pstmt.close();
pstmt = null;
}
valueXmlString.append("<bu_code_descr ><![CDATA[").append(lsBuCodeDescr).append("]]></bu_code_descr>\r\n");
valueXmlString.append("<emp_code__buhead ><![CDATA[").append(lsEmpCodeBuhead).append("]]></emp_code__buhead>\r\n");
valueXmlString.append("<ls_buhead_name ><![CDATA[").append(lsBuheadName).append("]]></ls_buhead_name>\r\n");
valueXmlString.append("<buhead_name ><![CDATA[").append(lsBuheadName).append("]]></buhead_name>\r\n");
}
if ("mother_tongue".equalsIgnoreCase(currentColumn))
......@@ -1557,6 +1595,7 @@ public class EmpDetChg extends ValidatorEJB implements EmpDetChgLocal,EmpDetChgR
valueXmlString.append("<religion ><![CDATA[").append(lsReligion).append("]]></religion>\r\n");
}
}
if(("emp_fname_long".equalsIgnoreCase(currentColumn)) || ("emp_mname_long".equalsIgnoreCase(currentColumn)) || ("emp_lname_long".equalsIgnoreCase(currentColumn)))
{
System.out.println(":::::::::::Inside emp_fname_long:::::::::::::::");
......@@ -1569,6 +1608,63 @@ public class EmpDetChg extends ValidatorEJB implements EmpDetChgLocal,EmpDetChgR
lsEmpMnameLong = utilmethod.left(lsEmpMnameLong,15);
valueXmlString.append("<ls_emp_fname_long ><![CDATA[").append(lsEmpMnameLong).append("]]></ls_emp_fname_long>\r\n");
}
//Added by Yashwant on 11-11-19[START][Added itemchange for Role Profile]
if("role_profiles".equalsIgnoreCase(currentColumn))
{
System.out.println(":::::::::::Inside role_profile:::::::::::");
roleProfile = checkNull(genericUtility.getColumnValue("role_profiles", dom));
/*
//Added By Poonam B[09-01-2020][Changes done as per Nvo component][START]
lsCode2 = roleProfile;
System.out.println("lsCode2 -->"+lsCode2);
do
{
lsCode1 = admCommon.getToken(lsCode2, ",");
System.out.println("lsCode1 -->"+lsCode1);
if(lsCode1 != null && lsCode1.trim().length() > 0)
{
i = i + 1;
if( i > 1 )
{
lsCode3 = lsCode3 + ",";
}
lsCode3 = lsCode3 + lsCode1.trim();
System.out.println("lsCode3 -->"+lsCode3);
}
}while(lsCode2 != null && lsCode2.trim().length() > 0);
roleProfile = lsCode3;
System.out.println("roleProfile -->"+roleProfile);
valueXmlString.append("<role_profiles><![CDATA[").append(roleProfile).append("]]></role_profiles>\r\n");
//Added By Poonam B[09-01-2020][Changes done as per Nvo component][END]
*/
sql = "select fn_get_roleprof_descr (?) as descr from dual";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,roleProfile);
rs = pstmt.executeQuery();
if(rs.next())
{
roleProfDescr = checkNull(rs.getString("descr"));
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
System.out.println("roleProfDescr -->"+roleProfDescr);
valueXmlString.append("<role_profiles_descr><![CDATA[").append(roleProfDescr).append("]]></role_profiles_descr>\r\n");
}
//Added by Yashwant on 11-11-19[END][Added itemchange for Role Profile]
}
valueXmlString.append("</Detail1>");
break;
......@@ -1658,6 +1754,10 @@ public class EmpDetChg extends ValidatorEJB implements EmpDetChgLocal,EmpDetChgR
{
PreparedStatement pstmt = null;
ResultSet rs = null;
String sql = "";
PreparedStatement pstmt1 = null;
ResultSet rs1 = null;
String sql1 = "";
String childNodeName = null;
StringBuffer errStringXml = null;
ITMDBAccessEJB itmDbAcess = null;
......@@ -1670,7 +1770,6 @@ public class EmpDetChg extends ValidatorEJB implements EmpDetChgLocal,EmpDetChgR
int noOfChilds = 0;
int cnt = 0;
String errString="";
String sql = "";
String empCode="";
String lsSite="";
String empLname="";
......@@ -1723,6 +1822,10 @@ public class EmpDetChg extends ValidatorEJB implements EmpDetChgLocal,EmpDetChgR
String loginSiteCode = "";
String loginEmpCode = "";
String errCode = "";
String roleProfiles = "";
String[] roleProfilesList;
//String mval1 = "";
String actStatus = "";
Timestamp ldRelieveDate =null;
Timestamp ldDate=null;
......@@ -2669,6 +2772,9 @@ public class EmpDetChg extends ValidatorEJB implements EmpDetChgLocal,EmpDetChgR
{
mDate1= Timestamp.valueOf(genericUtility.getValidDateString(dateJoin, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
}
if(ldDate != null && mDate1 != null)
{
if(ldDate.before(mDate1))
{
errList.add("VTGRADATE");
......@@ -2680,6 +2786,8 @@ public class EmpDetChg extends ValidatorEJB implements EmpDetChgLocal,EmpDetChgR
}
}
}
}
if("pos_code".equalsIgnoreCase(childNodeName))
{
System.out.println("::::validation of pos_code::::");
......@@ -2717,7 +2825,7 @@ public class EmpDetChg extends ValidatorEJB implements EmpDetChgLocal,EmpDetChgR
{
System.out.println("::::validation of emp_code__hod::::");
lsempCodeHod=checkNull(genericUtility.getColumnValue("emp_code__hod", dom));
lsempCodeHod = checkNull(genericUtility.getColumnValue("emp_code__hod", dom));
if(lsempCodeHod != null && lsempCodeHod.trim().length() > 0)
{
ldRelieveDate = null;
......@@ -2952,7 +3060,6 @@ public class EmpDetChg extends ValidatorEJB implements EmpDetChgLocal,EmpDetChgR
}
}
if("handicap_category".equalsIgnoreCase(childNodeName))
{
System.out.println("::::validation of handicap_category::::");
......@@ -3397,6 +3504,235 @@ public class EmpDetChg extends ValidatorEJB implements EmpDetChgLocal,EmpDetChgR
}
}
}
//Added by Yashwant on 11-11-19[START][Added validation for Role Profile]
if("role_profiles".equalsIgnoreCase(childNodeName))
{
System.out.println("::::validation of role_profiles::::");
roleProfiles = checkNull(genericUtility.getColumnValue("role_profiles", dom));
buCode = checkNull(genericUtility.getColumnValue("bu_code", dom));
if(roleProfiles != null && roleProfiles.trim().length() > 0)
{
roleProfilesList = roleProfiles.split(",");
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);
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++)
{
pstmt.setString( 1, roleProfilesList[i] );
rs = pstmt.executeQuery();
pstmt.clearParameters();
if(rs.next())
{
actStatus = rs.getString("mval2");
System.out.println("roleProfile actStatus -->"+actStatus);
}
else
{
errList.add("VMROLPRF01");
errFields.add(childNodeName.toLowerCase());
errorType = errorType(conn, "VMROLPRF01");
if(errorType.equalsIgnoreCase("E"))
{
break;
}
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if (rs != null)
{
rs.close();
rs = null;
}
if("N".equalsIgnoreCase(actStatus))
{
errList.add("VMROLPRF02");
errFields.add(childNodeName.toLowerCase());
errorType = errorType(conn, "VMROLPRF02");
if(errorType.equalsIgnoreCase("E"))
{
break;
}
}
else if(buCode != null && buCode.trim().length() > 0)
{
actStatus = "";
pstmt1.setString( 1, buCode );
pstmt1.setString( 2, roleProfilesList[i] );
rs1 = pstmt1.executeQuery();
pstmt1.clearParameters();
if(rs1.next())
{
actStatus = rs1.getString("mval2");
System.out.println("Bu Role Profile actStatus -->"+actStatus);
}
else
{
errList.add("VMBUROLE01");
errFields.add(childNodeName.toLowerCase());
errorType = errorType(conn, "VMBUROLE01");
if(errorType.equalsIgnoreCase("E"))
{
break;
}
}
if (pstmt1 != null)
{
pstmt1.close();
pstmt1 = null;
}
if (rs1 != null)
{
rs1.close();
rs1 = null;
}
if("N".equalsIgnoreCase(actStatus))
{
errList.add("VMBUROLE02");
errFields.add(childNodeName.toLowerCase());
errorType = errorType(conn, "VMBUROLE02");
if(errorType.equalsIgnoreCase("E"))
{
break;
}
}
}
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if (rs != null)
{
rs.close();
rs = null;
}
}
//Modified By Poonam b[09-01-2020][Changes done as per Nvo component][Start]
/*
if(roleProfiles != null && roleProfiles.trim().length() > 0)
{
do
{
mval1 = admCommon.getToken(roleProfiles, ",");
if(mval1.length() == 0)
{
continue;
}
cnt = 0;
System.out.println("mval1 -->"+mval1);
//select case when act_status is null then 'Y' else act_status end into :mval2 from role_profile where role_profile = :mval1;
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);
pstmt.setString( 1, mval1);
rs = pstmt.executeQuery();
pstmt.clearParameters();
if(rs.next())
{
actStatus = rs.getString("mval2");
System.out.println("actStatus (1) -->"+actStatus);
}
else
{
errList.add("VMROLPRF01");
errFields.add(childNodeName.toLowerCase());
errorType = errorType(conn, "VMROLPRF01");
if(errorType.equalsIgnoreCase("E"))
{
break;
}
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if (rs != null)
{
rs.close();
rs = null;
}
if("N".equalsIgnoreCase(actStatus))
{
errList.add("VMROLPRF02");
errFields.add(childNodeName.toLowerCase());
errorType = errorType(conn, "VMROLPRF02");
if(errorType.equalsIgnoreCase("E"))
{
break;
}
}
else if(buCode != null && buCode.trim().length() > 0)
{
cnt = 0;
actStatus = "";
//select case when act_status is null then 'Y' else act_status end into :mval2 from bu_role_profile where bu_code = :ls_bu_code and role_profile = :mval1;
sql = "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 = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString( 1, buCode );
pstmt.setString( 2, mval1 );
rs = pstmt.executeQuery();
pstmt.clearParameters();
if(rs.next())
{
actStatus = rs.getString("mval2");
System.out.println("actStatus (2) -->"+actStatus);
}
else
{
errList.add("VMBUROLE01");
errFields.add(childNodeName.toLowerCase());
errorType = errorType(conn, "VMBUROLE01");
if(errorType.equalsIgnoreCase("E"))
{
break;
}
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if (rs != null)
{
rs.close();
rs = null;
}
if("N".equalsIgnoreCase(actStatus))
{
errList.add("VMBUROLE02");
errFields.add(childNodeName.toLowerCase());
errorType = errorType(conn, "VMBUROLE02");
if(errorType.equalsIgnoreCase("E"))
{
break;
}
}
}
}while(roleProfiles.trim().length() > 0);
}
//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]
}
if (errList != null && errList.size() > 0)
......@@ -3588,8 +3924,6 @@ public class EmpDetChg extends ValidatorEJB implements EmpDetChgLocal,EmpDetChgR
}
private String errorType(Connection conn, String errorCode) throws ITMException
{
String msgType = "";
......@@ -3661,7 +3995,7 @@ public class EmpDetChg extends ValidatorEJB implements EmpDetChgLocal,EmpDetChgR
{
input = "";
}
return input;
return input.trim();
}
private String checkInt(String value)
......@@ -3672,7 +4006,5 @@ public class EmpDetChg extends ValidatorEJB implements EmpDetChgLocal,EmpDetChgR
}
return value;
}
}
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