Commit 886af51a authored by sghate's avatar sghate

Updated component :

EmpMaritalStatusConfIC.java
EmpMaritalStatusConfPrc.java
EmpMaritalStatusIC.java


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@216795 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 115d1a36
...@@ -3,8 +3,9 @@ ...@@ -3,8 +3,9 @@
* Component Name : EmpMaritalStatusConfIC * Component Name : EmpMaritalStatusConfIC
*/ */
package ibase.webitm.ejb.adm; package ibase.webitm.ejb.adm;
//modified by Shital on 09/08/2019 [Start]
import ibase.system.config.ConnDriver; //import ibase.system.config.ConnDriver;
//modified by Shital on 09/08/2019 [End]
import ibase.utility.E12GenericUtility; import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ITMDBAccessEJB; import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ValidatorEJB; import ibase.webitm.ejb.ValidatorEJB;
...@@ -17,39 +18,45 @@ import java.sql.ResultSet; ...@@ -17,39 +18,45 @@ import java.sql.ResultSet;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
//modified by Shital on 09/08/2019 [Start]
import javax.ejb.Stateless; //import javax.ejb.Stateless;
//modified by Shital on 09/08/2019 [End]
import org.w3c.dom.Document; import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap; import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node; import org.w3c.dom.Node;
import org.w3c.dom.NodeList; import org.w3c.dom.NodeList;
@Stateless //modified by Shital on 09/08/2019 [Start]
//@Stateless
//modified by Shital on 09/08/2019 [End]
public class EmpMaritalStatusConfIC extends ValidatorEJB implements EmpMaritalStatusConfICLocal , EmpMaritalStatusConfICRemote public class EmpMaritalStatusConfIC extends ValidatorEJB implements EmpMaritalStatusConfICLocal , EmpMaritalStatusConfICRemote
{ {
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
E12GenericUtility genericUtility = new E12GenericUtility();
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException, ITMException public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException, ITMException
{ {
Document dom = null; Document dom = null;
Document dom1 = null; Document dom1 = null;
Document dom2 = null; Document dom2 = null;
String errString = ""; String errString = "";
E12GenericUtility genericUtility = new E12GenericUtility();
try try
{ {
System.out.println("EmpMaritalStatusConfIC:wfValData value of xmlString ["+xmlString+"]"); System.out.println("EmpMaritalStatusConfIC:wfValData value of xmlString ["+xmlString+"]");
System.out.println("EmpMaritalStatusConfIC:wfValData value of xmlString ["+xmlString1+"]"); System.out.println("EmpMaritalStatusConfIC:wfValData value of xmlString ["+xmlString1+"]");
System.out.println("EmpMaritalStatusConfIC:wfValData value of xmlString ["+xmlString2+"]"); System.out.println("EmpMaritalStatusConfIC:wfValData value of xmlString ["+xmlString2+"]");
if (xmlString != null && xmlString.trim().length()!=0) if (xmlString != null && xmlString.trim().length() != 0)
{ {
dom = genericUtility.parseString(xmlString); dom = genericUtility.parseString(xmlString);
} }
if (xmlString1 != null && xmlString1.trim().length()!=0) if (xmlString1 != null && xmlString1.trim().length() != 0)
{ {
dom1 = genericUtility.parseString(xmlString1); dom1 = genericUtility.parseString(xmlString1);
} }
if (xmlString2 != null && xmlString2.trim().length()!=0) if (xmlString2 != null && xmlString2.trim().length() != 0)
{ {
dom2 = genericUtility.parseString(xmlString2); dom2 = genericUtility.parseString(xmlString2);
} }
...@@ -74,24 +81,34 @@ public class EmpMaritalStatusConfIC extends ValidatorEJB implements EmpMaritalSt ...@@ -74,24 +81,34 @@ public class EmpMaritalStatusConfIC extends ValidatorEJB implements EmpMaritalSt
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
java.sql.Timestamp tranDate = null; java.sql.Timestamp tranDate = null;
NodeList parentList = null , childList = null; NodeList parentList = null;
Node parentNode = null , childNode = null ; NodeList childList = null;
int noOfChilds = 0 , counterChild = 0; Node parentNode = null;
String sql = "", empCode = "", confirm = "", errString = "", tranDateStr = ""; Node childNode = null;
int noOfChilds = 0;
int counterChild = 0;
String sql = "";
String empCode = "";
String confirm = "";
String errString = "";
String tranDateStr = "";
String childNodeName = ""; String childNodeName = "";
int currentFormNo = 0; int currentFormNo = 0;
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB(); String genVoucher = "";
E12GenericUtility genericUtility = new E12GenericUtility();
try try
{ {
ConnDriver connDriver = new ConnDriver(); //modified by Shital on 09/08/2019 [Start]
conn = connDriver.getConnectDB("Driver"); //ConnDriver connDriver = new ConnDriver();
//conn = connDriver.getConnectDB("Driver");
conn = getConnection();
//modified by Shital on 09/08/2019 [End]
if(objContext != null && objContext.trim().length()>0) if(objContext != null && objContext.trim().length()>0)
{ {
currentFormNo = Integer.parseInt(objContext); currentFormNo = Integer.parseInt(objContext);
} }
parentList = dom.getElementsByTagName("Detail" + currentFormNo); parentList = dom.getElementsByTagName("Detail" + currentFormNo);
parentNode = parentList.item(0); parentNode = parentList.item(0);
childList = parentNode.getChildNodes(); childList = parentNode.getChildNodes();
...@@ -109,11 +126,18 @@ public class EmpMaritalStatusConfIC extends ValidatorEJB implements EmpMaritalSt ...@@ -109,11 +126,18 @@ public class EmpMaritalStatusConfIC extends ValidatorEJB implements EmpMaritalSt
{ {
case 1: case 1:
System.out.println("In case 1 ::::::::"); System.out.println("In case 1 ::::::::");
empCode = genericUtility.getColumnValue("emp_code", dom); //modified by Shital on 09/08/2019 [Start]
//empCode = genericUtility.getColumnValue("emp_code", dom);
empCode = checkNull(genericUtility.getColumnValue("emp_code", dom));
System.out.println("empCode from Dom::"+empCode); System.out.println("empCode from Dom::"+empCode);
tranDateStr = genericUtility.getColumnValue("tran_date", dom); //tranDateStr = genericUtility.getColumnValue("tran_date", dom);
tranDateStr = checkNull(genericUtility.getColumnValue("tran_date", dom));
//modified by Shital on 09/08/2019 [End]
System.out.println("tranDateStr from Dom::"+tranDateStr); System.out.println("tranDateStr from Dom::"+tranDateStr);
if(tranDateStr != null && tranDateStr.trim().length() > 0) //modified by Shital on 27/01/2020
{
tranDate = java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDateStr, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())); tranDate = java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDateStr, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()));
}
System.out.println("tranDate after parsing::"+tranDate); System.out.println("tranDate after parsing::"+tranDate);
if("emp_code".equalsIgnoreCase(childNodeName)) if("emp_code".equalsIgnoreCase(childNodeName))
...@@ -128,18 +152,29 @@ public class EmpMaritalStatusConfIC extends ValidatorEJB implements EmpMaritalSt ...@@ -128,18 +152,29 @@ public class EmpMaritalStatusConfIC extends ValidatorEJB implements EmpMaritalSt
confirm = checkNull( rs.getString( "CONFIRM" ) ); confirm = checkNull( rs.getString( "CONFIRM" ) );
} }
close(pstmt, rs); close(pstmt, rs);
if( "Y".equalsIgnoreCase(confirm.trim()) ) if( "Y".equalsIgnoreCase(confirm.trim()) )
{ {
errString = itmDBAccessEJB.getErrorString("","VTMARSCH01","","",conn); //errString = itmDBAccessEJB.getErrorString("","VTMARSCH01","","",conn);
errString = itmDBAccessEJB.getErrorString("","VTMARSCH01", "", "", conn);
return errString; return errString;
} }
} }
else if("generate_voucher".equalsIgnoreCase(childNodeName)) else if("generate_voucher".equalsIgnoreCase(childNodeName))
//else if("voucher_no".equalsIgnoreCase(childNodeName)) //modified by Shital on 09/08/2019
{ {
String genVoucher = genericUtility.getColumnValue("generate_voucher", dom); //modified by Shital on 09/08/2019 [Start]
//String genVoucher = genericUtility.getColumnValue("generate_voucher", dom);
genVoucher = checkNull(genericUtility.getColumnValue("generate_voucher", dom));
//modified by Shital on 09/08/2019 [End]
System.out.println("::::genVoucher:::::"+genVoucher);
if(genVoucher == null || genVoucher.trim().length() == 0) if(genVoucher == null || genVoucher.trim().length() == 0)
{ {
errString = itmDBAccessEJB.getErrorString("","VTMARSCH04","","",conn); //modified by Shital on 09/08/2019 [Start]
//errString = itmDBAccessEJB.getErrorString("","VTMARSCH04","","",conn);
errString = itmDBAccessEJB.getErrorString("","VTMARSCH04", "", "", conn);
//modified by Shital on 09/08/2019 [End]
return errString; return errString;
} }
} }
...@@ -166,21 +201,21 @@ public class EmpMaritalStatusConfIC extends ValidatorEJB implements EmpMaritalSt ...@@ -166,21 +201,21 @@ public class EmpMaritalStatusConfIC extends ValidatorEJB implements EmpMaritalSt
catch (Exception e) catch (Exception e)
{ {
e.printStackTrace(); e.printStackTrace();
//modified by Shital on 09/08/2019 [Start]
throw new ITMException(e);
//modified by Shital on 09/08/2019 [End]
} }
} }
return errString; return errString;
} }
public String itemChanged(String xmlString, String xmlString1, String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException, ITMException public String itemChanged(String xmlString, String xmlString1, String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException, ITMException
{ {
Document dom = null; Document dom = null;
Document dom1 = null; Document dom1 = null;
Document dom2 = null; Document dom2 = null;
String errString = null; String errString = null;
E12GenericUtility genericUtility = new E12GenericUtility();
try try
{ {
System.out.println("EmpMaritalStatusConfIC:itemChanged value of xmlString ["+xmlString+"]"); System.out.println("EmpMaritalStatusConfIC:itemChanged value of xmlString ["+xmlString+"]");
...@@ -190,15 +225,15 @@ public class EmpMaritalStatusConfIC extends ValidatorEJB implements EmpMaritalSt ...@@ -190,15 +225,15 @@ public class EmpMaritalStatusConfIC extends ValidatorEJB implements EmpMaritalSt
System.out.println("currentColumn ..:: ["+currentColumn+"]"); System.out.println("currentColumn ..:: ["+currentColumn+"]");
System.out.println("editFlag ..:: ["+editFlag+"]"); System.out.println("editFlag ..:: ["+editFlag+"]");
if (xmlString != null && xmlString.trim().length()!=0) if (xmlString != null && xmlString.trim().length() != 0)
{ {
dom = genericUtility.parseString(xmlString); dom = genericUtility.parseString(xmlString);
} }
if (xmlString1 != null && xmlString1.trim().length()!=0) if (xmlString1 != null && xmlString1.trim().length() != 0)
{ {
dom1 = genericUtility.parseString(xmlString1); dom1 = genericUtility.parseString(xmlString1);
} }
if (xmlString2 != null && xmlString2.trim().length()!=0) if (xmlString2 != null && xmlString2.trim().length() != 0)
{ {
dom2 = genericUtility.parseString(xmlString2); dom2 = genericUtility.parseString(xmlString2);
} }
...@@ -207,6 +242,9 @@ public class EmpMaritalStatusConfIC extends ValidatorEJB implements EmpMaritalSt ...@@ -207,6 +242,9 @@ public class EmpMaritalStatusConfIC extends ValidatorEJB implements EmpMaritalSt
} }
catch (Exception e) catch (Exception e)
{ {
//modified by Shital on 09/08/2019 [Start]
e.printStackTrace();
//modified by Shital on 09/08/2019 [End]
System.out.println ("EmpMaritalStatusConfIC::Exception :itemChanged(String,String):" + e.getMessage() + ":"); System.out.println ("EmpMaritalStatusConfIC::Exception :itemChanged(String,String):" + e.getMessage() + ":");
errString = genericUtility.createErrorString(e); errString = genericUtility.createErrorString(e);
throw new ITMException(e); throw new ITMException(e);
...@@ -218,66 +256,97 @@ public class EmpMaritalStatusConfIC extends ValidatorEJB implements EmpMaritalSt ...@@ -218,66 +256,97 @@ public class EmpMaritalStatusConfIC extends ValidatorEJB implements EmpMaritalSt
public String itemChanged(Document dom, Document dom1, Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException, ITMException public String itemChanged(Document dom, Document dom1, Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException, ITMException
{ {
int currentFormNo = 0; int currentFormNo = 0;
StringBuffer valueXmlString = null; StringBuffer valueXmlString = null;
String objNameDefault = "" ; String objNameDefault = "";
String sql = "", empCode = "", oldStatus = "", newStatus = "", empName = "", confirm = "", tranDateStr = "", statusDateStr = ""; String sql = "";
String empCode = "";
String oldStatus = "";
String newStatus = "";
String empName = "";
String confirm = "";
String tranDateStr = "";
String statusDateStr = "";
double amount = 0.0d; double amount = 0.0d;
Connection conn = null; Connection conn = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
Timestamp tranDate = null; Timestamp tranDate = null;
Date statusDate = null; Date statusDate = null;
String prdCode = "", giftCode = ""; String prdCode = "";
String giftCode = "";
AdmCommon admCommon = null; AdmCommon admCommon = null;
SimpleDateFormat sdf = null; SimpleDateFormat sdf = null;
try try
{ {
sdf = new SimpleDateFormat(getApplDateFormat()); sdf = new SimpleDateFormat(getApplDateFormat());
ConnDriver connDriver = new ConnDriver(); //modified by Shital on 09/08/2019 [Start]
conn = connDriver.getConnectDB("Driver"); //ConnDriver connDriver = new ConnDriver();
//conn = connDriver.getConnectDB("Driver");
conn = getConnection();
//modified by Shital on 09/08/2019 [End]
E12GenericUtility genericUtility = new E12GenericUtility(); E12GenericUtility genericUtility = new E12GenericUtility();
if (objContext != null && objContext.trim().length() > 0 ) if (objContext != null && objContext.trim().length() > 0 )
{ {
currentFormNo = Integer.parseInt(objContext); currentFormNo = Integer.parseInt(objContext);
} }
System.out.println("dom ..:: ["+genericUtility.serializeDom(dom)+"]");
valueXmlString = new StringBuffer("<?xml version=\"1.0\"?><Root><header><editFlag>"); valueXmlString = new StringBuffer("<?xml version=\"1.0\"?><Root><header><editFlag>");
valueXmlString.append(editFlag).append("</editFlag></header>"); valueXmlString.append(editFlag).append("</editFlag></header>");
objNameDefault = checkNull(getObjName(dom ,"1")); objNameDefault = checkNull(getObjName(dom ,"1"));
System.out.println("objNameDefault ..:: ["+objNameDefault+"]");
switch (currentFormNo) switch (currentFormNo)
{ {
case 1: case 1:
{ {
System.out.println("current form::::::::::::"+currentFormNo); System.out.println("current form::::::::::::"+currentFormNo);
empCode = genericUtility.getColumnValue("emp_code", dom); //modified by Shital on 09/08/2019 [Start]
//empCode = genericUtility.getColumnValue("emp_code", dom);
empCode = checkNull(genericUtility.getColumnValue("emp_code", dom));
System.out.println("empCode from Dom::"+empCode); System.out.println("empCode from Dom::"+empCode);
tranDateStr = genericUtility.getColumnValue("tran_date", dom); //tranDateStr = genericUtility.getColumnValue("tran_date", dom);
tranDateStr = checkNull(genericUtility.getColumnValue("tran_date", dom));
//modified by Shital on 09/08/2019 [End]
System.out.println("tranDateStr from Dom::"+tranDateStr); System.out.println("tranDateStr from Dom::"+tranDateStr);
if(tranDateStr != null && tranDateStr.trim().length() > 0) //modified by Shital on 27/01/2020
{
tranDate = java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDateStr, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())); tranDate = java.sql.Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDateStr, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()));
}
System.out.println("tranDate after parsing::"+tranDate); System.out.println("tranDate after parsing::"+tranDate);
valueXmlString.append("<Detail>\r\n"); valueXmlString.append("<Detail>\r\n");
if(currentColumn.equalsIgnoreCase("itm_default")) if(currentColumn.equalsIgnoreCase("itm_default"))
{ {
sql = "SELECT STATUS_DATE, OLD_STATUS, NEW_STATUS, SHORT_NAME, CONFIRM FROM EMP_MARITALCHG WHERE EMP_CODE = ? AND TRAN_DATE = ? "; sql = "SELECT STATUS_DATE, OLD_STATUS, NEW_STATUS, SHORT_NAME, CONFIRM FROM EMP_MARITALCHG WHERE EMP_CODE = ? AND TRAN_DATE = ? ";
pstmt=conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode); pstmt.setString(1, empCode);
pstmt.setTimestamp(2, tranDate); pstmt.setTimestamp(2, tranDate);
rs=pstmt.executeQuery(); rs = pstmt.executeQuery();
while(rs.next()) while(rs.next())
{ {
statusDate = rs.getDate("STATUS_DATE"); statusDate = rs.getDate("STATUS_DATE");
oldStatus=checkNull(rs.getString("OLD_STATUS")); oldStatus = checkNull(rs.getString("OLD_STATUS"));
newStatus = checkNull(rs.getString("NEW_STATUS")); newStatus = checkNull(rs.getString("NEW_STATUS"));
empName = checkNull(rs.getString("SHORT_NAME")); empName = checkNull(rs.getString("SHORT_NAME"));
confirm = checkNull(rs.getString("CONFIRM")); confirm = checkNull(rs.getString("CONFIRM"));
} }
System.out.println("statusDate:::::::::::"+statusDate);
System.out.println("oldStatus:::::::::::"+oldStatus);
System.out.println("newStatus:::::::::::"+newStatus);
System.out.println("empName:::::::::::"+empName);
System.out.println("confirm:::::::::::"+confirm);
close(pstmt, rs); close(pstmt, rs);
valueXmlString.append("<emp_code><![CDATA[" + empCode + "]]></emp_code>\r\n");
valueXmlString.append("<tran_date><![CDATA[" + tranDateStr + "]]></tran_date>\r\n");
valueXmlString.append("<status_date><![CDATA[" + statusDateStr + "]]></status_date>\r\n");
valueXmlString.append("<old_status><![CDATA[" + oldStatus + "]]></old_status>\r\n");
valueXmlString.append("<new_status><![CDATA[" + newStatus + "]]></new_status>\r\n");
valueXmlString.append("<emp_name><![CDATA[" + empName + "]]></emp_name>\r\n");
if(statusDate != null) if(statusDate != null)
{ {
statusDateStr = sdf.format(statusDate); statusDateStr = sdf.format(statusDate);
...@@ -291,6 +360,7 @@ public class EmpMaritalStatusConfIC extends ValidatorEJB implements EmpMaritalSt ...@@ -291,6 +360,7 @@ public class EmpMaritalStatusConfIC extends ValidatorEJB implements EmpMaritalSt
{ {
prdCode = checkNull(rs.getString("CODE")); prdCode = checkNull(rs.getString("CODE"));
} }
close(pstmt, rs); close(pstmt, rs);
admCommon = new AdmCommon(); admCommon = new AdmCommon();
...@@ -313,12 +383,15 @@ public class EmpMaritalStatusConfIC extends ValidatorEJB implements EmpMaritalSt ...@@ -313,12 +383,15 @@ public class EmpMaritalStatusConfIC extends ValidatorEJB implements EmpMaritalSt
} }
close(pstmt, rs); close(pstmt, rs);
valueXmlString.append("<emp_code><![CDATA[" + empCode + "]]></emp_code>\r\n");
valueXmlString.append("<tran_date><![CDATA[" + tranDateStr + "]]></tran_date>\r\n"); //modified by Shital on 09/08/2019 [Start]
valueXmlString.append("<status_date><![CDATA[" + statusDateStr + "]]></status_date>\r\n"); admCommon.setNodeValue(dom, "emp_code", empCode);
valueXmlString.append("<old_status><![CDATA[" + oldStatus + "]]></old_status>\r\n"); admCommon.setNodeValue(dom, "tran_date", tranDateStr);
valueXmlString.append("<new_status><![CDATA[" + newStatus + "]]></new_status>\r\n"); admCommon.setNodeValue(dom, "status_date", statusDateStr);
valueXmlString.append("<emp_name><![CDATA[" + empName + "]]></emp_name>\r\n"); admCommon.setNodeValue(dom, "old_status", oldStatus);
admCommon.setNodeValue(dom, "new_status", newStatus);
admCommon.setNodeValue(dom, "emp_name", empName);
//modified by Shital on 09/08/2019 [End]
//if(!("Y".equalsIgnoreCase(confirm))) //if(!("Y".equalsIgnoreCase(confirm)))
if(!("Y".equalsIgnoreCase(confirm)) && !("X".equalsIgnoreCase(confirm)))//Modified by Ahmed on 19-Jun-2017 to set blank value in dropdown if(!("Y".equalsIgnoreCase(confirm)) && !("X".equalsIgnoreCase(confirm)))//Modified by Ahmed on 19-Jun-2017 to set blank value in dropdown
...@@ -328,18 +401,35 @@ public class EmpMaritalStatusConfIC extends ValidatorEJB implements EmpMaritalSt ...@@ -328,18 +401,35 @@ public class EmpMaritalStatusConfIC extends ValidatorEJB implements EmpMaritalSt
valueXmlString.append("<gift_amount><![CDATA[" + amount + "]]></gift_amount>\r\n"); valueXmlString.append("<gift_amount><![CDATA[" + amount + "]]></gift_amount>\r\n");
//valueXmlString.append("<generate_voucher protect=\"0\"><![CDATA[N]]></generate_voucher>\r\n"); //valueXmlString.append("<generate_voucher protect=\"0\"><![CDATA[N]]></generate_voucher>\r\n");
valueXmlString.append("<generate_voucher protect=\"0\"><![CDATA[]]></generate_voucher>\r\n");//Modified by Ahmed on 19-Jun-2017 to set blank value in dropdown valueXmlString.append("<generate_voucher protect=\"0\"><![CDATA[]]></generate_voucher>\r\n");//Modified by Ahmed on 19-Jun-2017 to set blank value in dropdown
//valueXmlString.append("<voucher_no protect=\"0\"><![CDATA[]]></voucher_no>\r\n"); //modified by Shital on 09/08/2019
//modified by Shital on 09/08/2019 [Start]
admCommon.setNodeValue(dom, "gift_amount", amount+"");
//admCommon.setNodeValue(dom, "voucher_no", "");
//modified by Shital on 09/08/2019 [End]
} }
else else
{ {
valueXmlString.append("<gift_amount><![CDATA[0]]></gift_amount>\r\n"); valueXmlString.append("<gift_amount><![CDATA[0]]></gift_amount>\r\n");
valueXmlString.append("<generate_voucher protect=\"1\"><![CDATA[N]]></generate_voucher>\r\n"); valueXmlString.append("<generate_voucher protect=\"1\"><![CDATA[N]]></generate_voucher>\r\n");
//valueXmlString.append("<voucher_no protect=\"1\"><![CDATA[N]]></voucher_no>\r\n"); //modified by Shital on 09/08/2019
//modified by Shital on 09/08/2019 [Start]
admCommon.setNodeValue(dom, "gift_amount", 0+"");
//admCommon.setNodeValue(dom, "voucher_no", "N");
//modified by Shital on 09/08/2019 [End]
} }
} }
else else
{ {
valueXmlString.append("<gift_amount><![CDATA[" +amount+ "]]></gift_amount>\r\n"); valueXmlString.append("<gift_amount><![CDATA[" +amount+ "]]></gift_amount>\r\n");
valueXmlString.append("<generate_voucher protect=\"1\"><![CDATA[N]]></generate_voucher>\r\n"); valueXmlString.append("<generate_voucher protect=\"1\"><![CDATA[N]]></generate_voucher>\r\n");
//valueXmlString.append("<voucher_no protect=\"1\"><![CDATA[N]]></voucher_no>\r\n"); //modified by Shital on 09/08/2019
//modified by Shital on 09/08/2019 [Start]
admCommon.setNodeValue(dom, "gift_amount", amount+"");
admCommon.setNodeValue(dom, "generate_voucher", "N");
//modified by Shital on 09/08/2019 [End]
} }
} }
valueXmlString.append ("</Detail>\r\n"); valueXmlString.append ("</Detail>\r\n");
...@@ -349,6 +439,9 @@ public class EmpMaritalStatusConfIC extends ValidatorEJB implements EmpMaritalSt ...@@ -349,6 +439,9 @@ public class EmpMaritalStatusConfIC extends ValidatorEJB implements EmpMaritalSt
} }
catch(Exception e) catch(Exception e)
{ {
//modified by Shital on 09/08/2019 [Start]
e.printStackTrace();
//modified by Shital on 09/08/2019 [End]
throw new ITMException(e); throw new ITMException(e);
} }
finally finally
...@@ -361,18 +454,21 @@ public class EmpMaritalStatusConfIC extends ValidatorEJB implements EmpMaritalSt ...@@ -361,18 +454,21 @@ public class EmpMaritalStatusConfIC extends ValidatorEJB implements EmpMaritalSt
conn.close(); conn.close();
conn = null; conn = null;
} }
} }
catch (Exception e) catch (Exception e)
{ {
e.printStackTrace(); e.printStackTrace();
//modified by Shital on 09/08/2019 [Start]
throw new ITMException(e);
//modified by Shital on 09/08/2019 [End]
} }
} }
valueXmlString.append("</Root>\r\n"); valueXmlString.append("</Root>\r\n");
System.out.println("valueXmlString"+valueXmlString); System.out.println("valueXmlString"+valueXmlString);
return valueXmlString.toString(); return valueXmlString.toString();
} }
private String getObjName(Document dom,String objContext)
private String getObjName(Document dom,String objContext)throws ITMException
{ {
Node elementName = null; Node elementName = null;
NodeList elementList = null; NodeList elementList = null;
...@@ -399,6 +495,9 @@ public class EmpMaritalStatusConfIC extends ValidatorEJB implements EmpMaritalSt ...@@ -399,6 +495,9 @@ public class EmpMaritalStatusConfIC extends ValidatorEJB implements EmpMaritalSt
catch(Exception e) catch(Exception e)
{ {
e.printStackTrace(); e.printStackTrace();
//modified by Shital on 09/08/2019 [Start]
throw new ITMException(e);
//modified by Shital on 09/08/2019 [End]
} }
return objName; return objName;
} }
...@@ -417,7 +516,7 @@ public class EmpMaritalStatusConfIC extends ValidatorEJB implements EmpMaritalSt ...@@ -417,7 +516,7 @@ public class EmpMaritalStatusConfIC extends ValidatorEJB implements EmpMaritalSt
return input; return input;
} }
private void close(PreparedStatement pstmt,ResultSet rs) //Method to close PreparedStatement & ResultSet private void close(PreparedStatement pstmt,ResultSet rs) throws ITMException//Method to close PreparedStatement & ResultSet
{ {
try try
{ {
...@@ -435,6 +534,9 @@ public class EmpMaritalStatusConfIC extends ValidatorEJB implements EmpMaritalSt ...@@ -435,6 +534,9 @@ public class EmpMaritalStatusConfIC extends ValidatorEJB implements EmpMaritalSt
catch(Exception ex) catch(Exception ex)
{ {
ex.printStackTrace(); ex.printStackTrace();
//modified by Shital on 09/08/2019 [Start]
throw new ITMException(ex);
//modified by Shital on 09/08/2019 [End]
} }
} }
} }
\ No newline at end of file
...@@ -12,6 +12,7 @@ import ibase.utility.E12GenericUtility; ...@@ -12,6 +12,7 @@ import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ITMDBAccessEJB; import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ITMDBAccessLocal; import ibase.webitm.ejb.ITMDBAccessLocal;
import ibase.webitm.ejb.ProcessEJB; import ibase.webitm.ejb.ProcessEJB;
import ibase.webitm.ejb.adm.adv.EmpMaritalStatusConf;
import ibase.webitm.ejb.adm.adv.EmpMaritalStatusConfLocal; import ibase.webitm.ejb.adm.adv.EmpMaritalStatusConfLocal;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
...@@ -87,8 +88,8 @@ public class EmpMaritalStatusConfPrc extends ProcessEJB implements EmpMaritalSta ...@@ -87,8 +88,8 @@ public class EmpMaritalStatusConfPrc extends ProcessEJB implements EmpMaritalSta
//modified by Shital on 09/08/2019 [End] //modified by Shital on 09/08/2019 [End]
AppConnectParm appConnect = null; AppConnectParm appConnect = null;
InitialContext initialCtx = null; InitialContext initialCtx = null;
EmpMaritalStatusConfLocal empMaritalStatusConf = null; //EmpMaritalStatusConfLocal empMaritalStatusConf = null;
ITMDBAccessLocal itmDBAccess = null; //ITMDBAccessLocal itmDBAccess = null;
PreparedStatement pstmt=null; PreparedStatement pstmt=null;
ResultSet rs=null; ResultSet rs=null;
...@@ -101,15 +102,18 @@ public class EmpMaritalStatusConfPrc extends ProcessEJB implements EmpMaritalSta ...@@ -101,15 +102,18 @@ public class EmpMaritalStatusConfPrc extends ProcessEJB implements EmpMaritalSta
conn = getConnection(); conn = getConnection();
//modified by Shital on 09/08/2019 [End] //modified by Shital on 09/08/2019 [End]
conn.setAutoCommit(false); conn.setAutoCommit(false);
appConnect = new AppConnectParm(); /*appConnect = new AppConnectParm();
initialCtx = new InitialContext(appConnect.getProperty()); initialCtx = new InitialContext(appConnect.getProperty());
itmDBAccess = (ITMDBAccessLocal)initialCtx.lookup("ibase/ITMDBAccessEJB/local"); itmDBAccess = (ITMDBAccessLocal)initialCtx.lookup("ibase/ITMDBAccessEJB/local");*/
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB(); //modified by Shital on 27/01/2020
empCode = checkNull(genericUtility.getColumnValue("emp_code", headerDom)); empCode = checkNull(genericUtility.getColumnValue("emp_code", headerDom));
tranDate = checkNull(genericUtility.getColumnValue("tran_date", headerDom)); tranDate = checkNull(genericUtility.getColumnValue("tran_date", headerDom));
System.out.println("@V@ VALLABH empCode :- ["+empCode+"]"); System.out.println("@V@ VALLABH empCode :- ["+empCode+"]");
System.out.println("@V@ VALLABH tranDate :- ["+tranDate+"]"); System.out.println("@V@ VALLABH tranDate :- ["+tranDate+"]");
if(tranDate != null && tranDate.trim().length() > 0) //modified by Shital on 27/01/2020
{
tranDateTimestamp = Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())); tranDateTimestamp = Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()));
}
sql = "SELECT CONFIRM FROM EMP_MARITALCHG WHERE EMP_CODE = ? AND TRAN_DATE = ? "; sql = "SELECT CONFIRM FROM EMP_MARITALCHG WHERE EMP_CODE = ? AND TRAN_DATE = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode); pstmt.setString(1, empCode);
...@@ -139,7 +143,8 @@ public class EmpMaritalStatusConfPrc extends ProcessEJB implements EmpMaritalSta ...@@ -139,7 +143,8 @@ public class EmpMaritalStatusConfPrc extends ProcessEJB implements EmpMaritalSta
System.out.println("@V@ VALLABH confirm :- ["+confirm+"]"); System.out.println("@V@ VALLABH confirm :- ["+confirm+"]");
if(!"X".equalsIgnoreCase(confirm)) if(!"X".equalsIgnoreCase(confirm))
{ {
empMaritalStatusConf = (EmpMaritalStatusConfLocal)initialCtx.lookup("ibase/EmpMaritalStatusConf/local"); /*empMaritalStatusConf = (EmpMaritalStatusConfLocal)initialCtx.lookup("ibase/EmpMaritalStatusConf/local");*/
EmpMaritalStatusConf empMaritalStatusConf = new EmpMaritalStatusConf();
returnString = checkNull(empMaritalStatusConf.actionHandler("", headerDom, detailDom, xtraParams, "N", conn)); returnString = checkNull(empMaritalStatusConf.actionHandler("", headerDom, detailDom, xtraParams, "N", conn));
System.out.println("EmpMaritalStatusConfPrc returnString ::[" + returnString + "]"); System.out.println("EmpMaritalStatusConfPrc returnString ::[" + returnString + "]");
} }
......
...@@ -9,17 +9,14 @@ import java.sql.Timestamp; ...@@ -9,17 +9,14 @@ import java.sql.Timestamp;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
//modified by Shital on 09/08/2019 [Start]
//import ibase.system.config.ConnDriver; //import ibase.system.config.ConnDriver; //commented by Shital on 09/08/2019
import ibase.utility.E12GenericUtility; import ibase.utility.E12GenericUtility;
//import ibase.utility.GenericUtility; //import ibase.utility.GenericUtility; //commented by Shital on 09/08/2019
//modified by Shital on 09/08/2019 [End]
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ValidatorEJB; import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
//modified by Shital on 09/08/2019 [Start]
//import javax.ejb.Stateless; //import javax.ejb.Stateless; //commented by Shital on 09/08/2019
//modified by Shital on 09/08/2019 [End]
import org.w3c.dom.Document; import org.w3c.dom.Document;
import org.w3c.dom.Node; import org.w3c.dom.Node;
...@@ -28,14 +25,9 @@ import org.w3c.dom.NodeList; ...@@ -28,14 +25,9 @@ import org.w3c.dom.NodeList;
/** /**
* Session Bean implementation class BusinessUnits * Session Bean implementation class BusinessUnits
*/ */
//modified by Shital on 09/08/2019 [Start] //@Stateless //commented by Shital on 09/08/2019
//@Stateless
//modified by Shital on 09/08/2019 [End]
public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatusICLocal, EmpMaritalStatusICRemote public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatusICLocal, EmpMaritalStatusICRemote
{ {
E12GenericUtility genericUtility = new E12GenericUtility();
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
public String itemChanged() throws RemoteException, ITMException public String itemChanged() throws RemoteException, ITMException
{ {
return ""; return "";
...@@ -68,52 +60,28 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus ...@@ -68,52 +60,28 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus
{ {
System.out.println("Exception : BusinessUnits : [itemChanged(String, xmlString)] :==>\n" + e.getMessage()); System.out.println("Exception : BusinessUnits : [itemChanged(String, xmlString)] :==>\n" + e.getMessage());
e.printStackTrace(); e.printStackTrace();
//modified by Shital on 09/08/2019 [Start]
throw new ITMException(e);
//modified by Shital on 09/08/2019 [End]
} }
return valueXmlString; return valueXmlString;
} }
public String itemChanged(Document dom, Document dom1, Document dom2,String objContext, String currentColumn, String editFlag,String xtraParams) throws RemoteException, ITMException public String itemChanged(Document dom, Document dom1, Document dom2,
String objContext, String currentColumn, String editFlag,
String xtraParams) throws RemoteException, ITMException
{ {
System.out.println("@V@ In Item change..."); System.out.println("@V@ In Item change...");
//modified by Shital on 09/08/2019 [Start] E12GenericUtility genericUtility = new E12GenericUtility(); //modified by Shital on 09/08/2019
//GenericUtility genericUtility = null; //GenericUtility genericUtility = null;
//modified by Shital on 09/08/2019 [End]
Connection conn = null; Connection conn = null;
int currentFormNo = 0; int currentFormNo = 0;
ResultSet rs = null; ResultSet rs = null;
String empCodeHead = ""; String empCodeHead = "", empFName = "", empMName = "", empLName = "",empMaritalChgEmpFname="",empMaritalChgEmpMname="",empMaritalChgEmpLname="",
String empFName = ""; shortName="",empFnameO="",empMnameO="",empLnameO="",shortNameO="",lsSex="",lsNewStatus="",empCode="",sql="",mStatus="",sex="",
String empMName = ""; spouseName="",mStatDate="";
String empLName = ""; String mStatDateStr="";
String empMaritalChgEmpFname = "";
String empMaritalChgEmpMname = "";
String empMaritalChgEmpLname = "";
String shortName = "";
String empFnameO = "";
String empMnameO = "";
String empLnameO = "";
String shortNameO ="";
String lsSex = "";
String lsNewStatus = "";
String empCode = "";
String sql = "";
String mStatus = "";
String sex = "";
String spouseName = "";
String mStatDate = "";
String mStatDateStr = "";
//Added By sanket J on 01/March/18 //Added By sanket J on 01/March/18
String empFNameLong = ""; String empFNameLong="",empMNameLong="",empLNameLong="";
String empMNameLong = "";
String empLNameLong = "";
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
StringBuffer valueXmlString; StringBuffer valueXmlString;
AdmCommon admCommon = new AdmCommon();
try try
{ {
valueXmlString = new StringBuffer(); valueXmlString = new StringBuffer();
...@@ -129,7 +97,8 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus ...@@ -129,7 +97,8 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus
SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat()); SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
String sysDateStr = sdf.format(currentDate.getTime()); String sysDateStr = sdf.format(currentDate.getTime());
valueXmlString = new StringBuffer("<?xml version=\"1.0\"?><Root><header><editFlag>"); valueXmlString = new StringBuffer(
"<?xml version=\"1.0\"?><Root><header><editFlag>");
valueXmlString.append(editFlag).append("</editFlag></header>"); valueXmlString.append(editFlag).append("</editFlag></header>");
if (objContext != null && objContext.trim().length() > 0) if (objContext != null && objContext.trim().length() > 0)
...@@ -144,7 +113,7 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus ...@@ -144,7 +113,7 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus
if(currentColumn.trim().equalsIgnoreCase("itm_defaultedit")) if(currentColumn.trim().equalsIgnoreCase("itm_defaultedit"))
{ {
//Modified by Ahmed on 03/May/2017 to only replace for null value [start] //Modified by Ahmed on 03/May/2017 to only replace for null value [start]
/* empMaritalChgEmpFname=checkNull(genericUtility.getColumnValue("emp_maritalchg_emp_fname", dom)); /* empMaritalChgEmpFname=checkNull(genericUtility.getColumnValue("emp_maritalchg_emp_fname", dom));
empMaritalChgEmpMname=checkNull(genericUtility.getColumnValue("emp_maritalchg_emp_mname", dom)); empMaritalChgEmpMname=checkNull(genericUtility.getColumnValue("emp_maritalchg_emp_mname", dom));
empMaritalChgEmpLname=checkNull(genericUtility.getColumnValue("emp_maritalchg_emp_lname", dom)); empMaritalChgEmpLname=checkNull(genericUtility.getColumnValue("emp_maritalchg_emp_lname", dom));
shortName=checkNull(genericUtility.getColumnValue("short_name", dom)); shortName=checkNull(genericUtility.getColumnValue("short_name", dom));
...@@ -153,15 +122,15 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus ...@@ -153,15 +122,15 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus
empLnameO=checkNull(genericUtility.getColumnValue("emp_lname__o", dom)); empLnameO=checkNull(genericUtility.getColumnValue("emp_lname__o", dom));
shortNameO=checkNull(genericUtility.getColumnValue("short_name__o", dom)); shortNameO=checkNull(genericUtility.getColumnValue("short_name__o", dom));
spouseName=checkNull(genericUtility.getColumnValue("spouse_name", dom));*/ spouseName=checkNull(genericUtility.getColumnValue("spouse_name", dom));*/
empMaritalChgEmpFname = replaceNull(genericUtility.getColumnValue("emp_maritalchg_emp_fname", dom)); empMaritalChgEmpFname=replaceNull(genericUtility.getColumnValue("emp_maritalchg_emp_fname", dom));
empMaritalChgEmpMname = replaceNull(genericUtility.getColumnValue("emp_maritalchg_emp_mname", dom)); empMaritalChgEmpMname=replaceNull(genericUtility.getColumnValue("emp_maritalchg_emp_mname", dom));
empMaritalChgEmpLname = replaceNull(genericUtility.getColumnValue("emp_maritalchg_emp_lname", dom)); empMaritalChgEmpLname=replaceNull(genericUtility.getColumnValue("emp_maritalchg_emp_lname", dom));
shortName = replaceNull(genericUtility.getColumnValue("short_name", dom)); shortName=replaceNull(genericUtility.getColumnValue("short_name", dom));
empFnameO = replaceNull(genericUtility.getColumnValue("emp_fname__o", dom)); empFnameO=replaceNull(genericUtility.getColumnValue("emp_fname__o", dom));
empMnameO = replaceNull(genericUtility.getColumnValue("emp_mname__o", dom)); empMnameO=replaceNull(genericUtility.getColumnValue("emp_mname__o", dom));
empLnameO = replaceNull(genericUtility.getColumnValue("emp_lname__o", dom)); empLnameO=replaceNull(genericUtility.getColumnValue("emp_lname__o", dom));
shortNameO = replaceNull(genericUtility.getColumnValue("short_name__o", dom)); shortNameO=replaceNull(genericUtility.getColumnValue("short_name__o", dom));
spouseName = replaceNull(genericUtility.getColumnValue("spouse_name", dom)); spouseName=replaceNull(genericUtility.getColumnValue("spouse_name", dom));
//Modified by Ahmed on 03/AMY/2017 to only replace for null value[end] //Modified by Ahmed on 03/AMY/2017 to only replace for null value[end]
valueXmlString.append("<emp_maritalchg_emp_fname protect=\"1\">").append("<![CDATA[" + empMaritalChgEmpFname+ "]]>").append("</emp_maritalchg_emp_fname>"); valueXmlString.append("<emp_maritalchg_emp_fname protect=\"1\">").append("<![CDATA[" + empMaritalChgEmpFname+ "]]>").append("</emp_maritalchg_emp_fname>");
...@@ -173,52 +142,26 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus ...@@ -173,52 +142,26 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus
valueXmlString.append("<emp_lname__o protect=\"1\">").append("<![CDATA[" + empLnameO+ "]]>").append("</emp_lname__o>"); valueXmlString.append("<emp_lname__o protect=\"1\">").append("<![CDATA[" + empLnameO+ "]]>").append("</emp_lname__o>");
valueXmlString.append("<short_name__o protect=\"1\">").append("<![CDATA[" + shortNameO+ "]]>").append("</short_name__o>"); valueXmlString.append("<short_name__o protect=\"1\">").append("<![CDATA[" + shortNameO+ "]]>").append("</short_name__o>");
//modified by Shital on 09/08/2019 [Start] lsSex=checkNull(genericUtility.getColumnValue("sex", dom));
admCommon.setNodeValue(dom, "emp_maritalchg_emp_fname", empMaritalChgEmpFname); lsNewStatus=checkNull(genericUtility.getColumnValue("new_status", dom));
admCommon.setNodeValue(dom, "emp_maritalchg_emp_mname", empMaritalChgEmpMname);
admCommon.setNodeValue(dom, "emp_maritalchg_emp_lname", empMaritalChgEmpLname);
admCommon.setNodeValue(dom, "short_name", shortName);
admCommon.setNodeValue(dom, "emp_fname__o", empFnameO);
admCommon.setNodeValue(dom, "emp_mname__o", empMnameO);
admCommon.setNodeValue(dom, "emp_lname__o", empLnameO);
admCommon.setNodeValue(dom, "short_name__o", shortNameO);
//modified by Shital on 09/08/2019 [End]
lsSex = checkNull(genericUtility.getColumnValue("sex", dom));
lsNewStatus = checkNull(genericUtility.getColumnValue("new_status", dom));
System.out.println("@V@ SEX of employee :- ["+lsSex+"]"); System.out.println("@V@ SEX of employee :- ["+lsSex+"]");
if((lsSex!=null && lsSex.trim().length()>0) && ("F".equalsIgnoreCase(lsSex)))
if((lsSex != null && lsSex.trim().length() > 0) && ("F".equalsIgnoreCase(lsSex)))
{ {
if((lsNewStatus != null && lsNewStatus.trim().length() > 0) && ("M".equalsIgnoreCase(lsNewStatus) || "D".equalsIgnoreCase(lsNewStatus))) if((lsNewStatus!=null && lsNewStatus.trim().length()>0) && ("M".equalsIgnoreCase(lsNewStatus) || "D".equalsIgnoreCase(lsNewStatus)))
//if((lsNewStatus!=null && lsNewStatus.trim().length()>0) && ("M".equalsIgnoreCase(lsNewStatus))) // CHANGE done as per suggested by P Jain. //if((lsNewStatus!=null && lsNewStatus.trim().length()>0) && ("M".equalsIgnoreCase(lsNewStatus))) // CHANGE done as per suggested by P Jain.
{ {
valueXmlString.append("<emp_maritalchg_emp_fname protect=\"0\">").append("<![CDATA[" + empMaritalChgEmpFname+ "]]>").append("</emp_maritalchg_emp_fname>"); valueXmlString.append("<emp_maritalchg_emp_fname protect=\"0\">").append("<![CDATA[" + empMaritalChgEmpFname+ "]]>").append("</emp_maritalchg_emp_fname>");
valueXmlString.append("<emp_maritalchg_emp_mname protect=\"0\">").append("<![CDATA[" + empMaritalChgEmpMname+ "]]>").append("</emp_maritalchg_emp_mname>"); valueXmlString.append("<emp_maritalchg_emp_mname protect=\"0\">").append("<![CDATA[" + empMaritalChgEmpMname+ "]]>").append("</emp_maritalchg_emp_mname>");
valueXmlString.append("<emp_maritalchg_emp_lname protect=\"0\">").append("<![CDATA[" + empMaritalChgEmpLname+ "]]>").append("</emp_maritalchg_emp_lname>"); valueXmlString.append("<emp_maritalchg_emp_lname protect=\"0\">").append("<![CDATA[" + empMaritalChgEmpLname+ "]]>").append("</emp_maritalchg_emp_lname>");
valueXmlString.append("<short_name protect=\"0\">").append("<![CDATA[" + shortName+ "]]>").append("</short_name>"); valueXmlString.append("<short_name protect=\"0\">").append("<![CDATA[" + shortName+ "]]>").append("</short_name>");
//modified by Shital on 09/08/2019 [Start]
admCommon.setNodeValue(dom, "emp_maritalchg_emp_fname", empMaritalChgEmpFname);
admCommon.setNodeValue(dom, "emp_maritalchg_emp_mname", empMaritalChgEmpMname);
admCommon.setNodeValue(dom, "emp_maritalchg_emp_lname", empMaritalChgEmpLname);
admCommon.setNodeValue(dom, "short_name", shortName);
//modified by Shital on 09/08/2019 [End]
//valueXmlString.append("<spouse_name protect=\"0\">").append("<![CDATA["+spouseName+"]]>").append("</spouse_name>"); //valueXmlString.append("<spouse_name protect=\"0\">").append("<![CDATA["+spouseName+"]]>").append("</spouse_name>");
if("M".equalsIgnoreCase(lsNewStatus)) if("M".equalsIgnoreCase(lsNewStatus))
{ {
valueXmlString.append("<spouse_name protect=\"0\">").append("<![CDATA["+spouseName+"]]>").append("</spouse_name>"); valueXmlString.append("<spouse_name protect=\"0\">").append("<![CDATA["+spouseName+"]]>").append("</spouse_name>");
//modified by Shital on 09/08/2019 [Start]
admCommon.setNodeValue(dom, "spouse_name", spouseName);
//modified by Shital on 09/08/2019 [End]
} }
else else
{ {
valueXmlString.append("<spouse_name protect=\"1\">").append("<![CDATA["+spouseName+"]]>").append("</spouse_name>"); valueXmlString.append("<spouse_name protect=\"1\">").append("<![CDATA["+spouseName+"]]>").append("</spouse_name>");
//modified by Shital on 09/08/2019 [Start]
admCommon.setNodeValue(dom, "spouse_name", spouseName);
//modified by Shital on 09/08/2019 [End]
} }
} }
else else
...@@ -228,35 +171,20 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus ...@@ -228,35 +171,20 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus
valueXmlString.append("<emp_maritalchg_emp_lname protect=\"1\">").append("<![CDATA[" + empMaritalChgEmpLname+ "]]>").append("</emp_maritalchg_emp_lname>"); valueXmlString.append("<emp_maritalchg_emp_lname protect=\"1\">").append("<![CDATA[" + empMaritalChgEmpLname+ "]]>").append("</emp_maritalchg_emp_lname>");
valueXmlString.append("<short_name protect=\"1\">").append("<![CDATA[" + shortName+ "]]>").append("</short_name>"); valueXmlString.append("<short_name protect=\"1\">").append("<![CDATA[" + shortName+ "]]>").append("</short_name>");
valueXmlString.append("<spouse_name protect=\"1\">").append("<![CDATA["+spouseName+"]]>").append("</spouse_name>"); valueXmlString.append("<spouse_name protect=\"1\">").append("<![CDATA["+spouseName+"]]>").append("</spouse_name>");
//modified by Shital on 09/08/2019 [Start]
admCommon.setNodeValue(dom, "emp_maritalchg_emp_fname", empMaritalChgEmpFname);
admCommon.setNodeValue(dom, "emp_maritalchg_emp_mname", empMaritalChgEmpMname);
admCommon.setNodeValue(dom, "emp_maritalchg_emp_lname", empMaritalChgEmpLname);
admCommon.setNodeValue(dom, "short_name", shortName);
admCommon.setNodeValue(dom, "spouse_name", spouseName);
//modified by Shital on 09/08/2019 [End]
} }
} }
else else
{ {
if((lsNewStatus != null && lsNewStatus.trim().length() > 0) && ("M".equalsIgnoreCase(lsNewStatus))) // Chnage done as per suggested by P Jain, if((lsNewStatus!=null && lsNewStatus.trim().length()>0) && ("M".equalsIgnoreCase(lsNewStatus))) // Chnage done as per suggested by P Jain,
{ {
valueXmlString.append("<spouse_name protect=\"0\">").append("<![CDATA["+spouseName+"]]>").append("</spouse_name>"); valueXmlString.append("<spouse_name protect=\"0\">").append("<![CDATA["+spouseName+"]]>").append("</spouse_name>");
//modified by Shital on 09/08/2019 [Start]
AdmCommon.setNodeValue(dom, "spouse_name", spouseName);
//modified by Shital on 09/08/2019 [End]
} }
else else
{ {
valueXmlString.append("<spouse_name protect=\"1\">").append("<![CDATA["+spouseName+"]]>").append("</spouse_name>"); valueXmlString.append("<spouse_name protect=\"1\">").append("<![CDATA["+spouseName+"]]>").append("</spouse_name>");
//modified by Shital on 09/08/2019 [Start]
admCommon.setNodeValue(dom, "spouse_name", spouseName);
//modified by Shital on 09/08/2019 [End]
} }
} }
} }
else if(currentColumn.trim().equalsIgnoreCase("itm_default")) else if(currentColumn.trim().equalsIgnoreCase("itm_default"))
{ {
System.out.println("@V@ In Item default .."); System.out.println("@V@ In Item default ..");
...@@ -269,73 +197,42 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus ...@@ -269,73 +197,42 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus
valueXmlString.append("<emp_mname__o protect=\"1\">").append("<![CDATA[]]>").append("</emp_mname__o>"); valueXmlString.append("<emp_mname__o protect=\"1\">").append("<![CDATA[]]>").append("</emp_mname__o>");
valueXmlString.append("<emp_lname__o protect=\"1\">").append("<![CDATA[]]>").append("</emp_lname__o>"); valueXmlString.append("<emp_lname__o protect=\"1\">").append("<![CDATA[]]>").append("</emp_lname__o>");
valueXmlString.append("<short_name__o protect=\"1\">").append("<![CDATA[]]>").append("</short_name__o>"); valueXmlString.append("<short_name__o protect=\"1\">").append("<![CDATA[]]>").append("</short_name__o>");
//modified by Shital on 09/08/2019 [Start]
admCommon.setNodeValue(dom, "tran_date", sysDateStr);
admCommon.setNodeValue(dom, "emp_maritalchg_emp_fname", "");
admCommon.setNodeValue(dom, "emp_maritalchg_emp_mname", "");
admCommon.setNodeValue(dom, "emp_maritalchg_emp_lname", "");
admCommon.setNodeValue(dom, "short_name", "");
admCommon.setNodeValue(dom, "emp_fname__o", "");
admCommon.setNodeValue(dom, "emp_mname__o", "");
admCommon.setNodeValue(dom, "emp_lname__o", "");
admCommon.setNodeValue(dom, "short_name__o", "");
//modified by Shital on 09/08/2019 [End]
} }
else if(currentColumn.trim().equalsIgnoreCase("emp_code")) else if(currentColumn.trim().equalsIgnoreCase("emp_code"))
{ {
System.out.println("@V@ In emp code Item change .."); System.out.println("@V@ In emp code Item change ..");
empCode = checkNull(genericUtility.getColumnValue("emp_code", dom)); empCode=checkNull(genericUtility.getColumnValue("emp_code", dom));
lsNewStatus = checkNull(genericUtility.getColumnValue("new_status", dom)); lsNewStatus=checkNull(genericUtility.getColumnValue("new_status", dom));
//Changed By Sanket J on 01/March/18 for [new column to handle long value employee names] //Changed By Sanket J on 01/March/18 for [new column to handle long value employee names]
//sql="select emp_lname, emp_fname,m_status, emp_mname, short_name,sex,m_status_date from employee where emp_code =?"; //sql="select emp_lname, emp_fname,m_status, emp_mname, short_name,sex,m_status_date from employee where emp_code =?";
sql = "select emp_lname, emp_fname,m_status, emp_mname,emp_fname_long, emp_mname_long, emp_lname_long, short_name,sex,m_status_date from employee where emp_code =?"; sql="select emp_lname, emp_fname,m_status, emp_mname,emp_fname_long, emp_mname_long, emp_lname_long, short_name,sex,m_status_date from employee where emp_code =?";
pstmt = conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
pstmt.setString(1, empCode); pstmt.setString(1, empCode);
rs = pstmt.executeQuery(); rs=pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
//modified by Shital on 09/08/2019 [Start] empLName=rs.getString("emp_lname");
//empLName=rs.getString("emp_lname"); empFName=rs.getString("emp_fname");
//empFName=rs.getString("emp_fname"); empMName=rs.getString("emp_mname");
//empMName=rs.getString("emp_mname"); mStatus=rs.getString("m_status");
//mStatus=rs.getString("m_status"); shortName=rs.getString("short_name");
//shortName=rs.getString("short_name"); shortName=shortName==null?"":shortName;
empLName = checkNull(rs.getString("emp_lname")); sex=rs.getString("sex");
empFName = checkNull(rs.getString("emp_fname")); mStatDate=rs.getString("m_status_date");
empMName = checkNull(rs.getString("emp_mname"));
mStatus = checkNull(rs.getString("m_status"));
shortName = checkNull(rs.getString("short_name"));
shortName = shortName == null?"":shortName;
//sex = rs.getString("sex");
sex = checkNull(rs.getString("sex"));
//modified by Shital on 09/08/2019 [End]
//mStatDate=rs.getString("m_status_date");
mStatDate = checkNull(rs.getString("m_status_date"));
//Changed By Sanket J on 01/March/18 for [new column to handle long value employee names]-[Start] //Changed By Sanket J on 01/March/18 for [new column to handle long value employee names]-[Start]
//modified by Shital on 09/08/2019 [Start] empFNameLong=rs.getString("emp_fname_long");
//empFNameLong=rs.getString("emp_fname_long"); empMNameLong=rs.getString("emp_mname_long");
//empMNameLong=rs.getString("emp_mname_long"); empLNameLong=rs.getString("emp_lname_long");
//empLNameLong=rs.getString("emp_lname_long");
empFNameLong = checkNull(rs.getString("emp_fname_long"));
empMNameLong = checkNull(rs.getString("emp_mname_long"));
empLNameLong = checkNull(rs.getString("emp_lname_long"));
//modified by Shital on 09/08/2019 [End]
if(empFNameLong == null || empFNameLong == "") if(empFNameLong == null || empFNameLong == "")
{ {
empFNameLong = empFName; empFNameLong = empFName;
System.out.println("Inside empFnameLong is null or blank--["+empFNameLong+"]"); System.out.println("Inside empFnameLong is null or blank--["+empFNameLong+"]");
} }
if(empMNameLong == null || empMNameLong == "") if(empMNameLong == null || empMNameLong == "")
{ {
empMNameLong = empMName; empMNameLong = empMName;
System.out.println("Inside empMnameLong is null or blank--["+empMNameLong+"]"); System.out.println("Inside empMnameLong is null or blank--["+empMNameLong+"]");
} }
if(empLNameLong == null || empLNameLong == "") if(empLNameLong == null || empLNameLong == "")
{ {
empLNameLong = empLName; empLNameLong = empLName;
...@@ -369,50 +266,27 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus ...@@ -369,50 +266,27 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus
//ADDED BY AMIT SHRIVASTAVA ON 191218 FOR PRINT EMP_LONG_NAME[END.] //ADDED BY AMIT SHRIVASTAVA ON 191218 FOR PRINT EMP_LONG_NAME[END.]
valueXmlString.append("<old_status protect=\"1\">").append("<![CDATA[" + mStatus+ "]]>").append("</old_status>"); valueXmlString.append("<old_status protect=\"1\">").append("<![CDATA[" + mStatus+ "]]>").append("</old_status>");
//modified by Shital on 09/08/2019 [Start]
admCommon.setNodeValue(dom, "emp_fname_long", empFNameLong);
admCommon.setNodeValue(dom, "emp_lname_long", empLNameLong);
admCommon.setNodeValue(dom, "old_status", mStatus);
//modified by Shital on 09/08/2019 [End]
//modified by santosh .end //modified by santosh .end
if("U".equalsIgnoreCase(lsNewStatus)) if("U".equalsIgnoreCase(lsNewStatus))
{ {
valueXmlString.append("spouse_name >").append("<![CDATA[]]>").append("</spouse_name>"); valueXmlString.append("<spouse_name >").append("<![CDATA[]]>").append("</spouse_name>");
//modified by Shital on 09/08/2019 [Start]
admCommon.setNodeValue(dom, "spouse_name", "");
//modified by Shital on 09/08/2019 [End]
} }
if((sex != null && sex.trim().length() > 0) && ("F".equalsIgnoreCase(sex))) if((sex!=null && sex.trim().length()>0) && ("F".equalsIgnoreCase(sex)))
{ {
// if((lsNewStatus!=null && lsNewStatus.trim().length()>0) && ("M".equalsIgnoreCase(lsNewStatus) || "D".equalsIgnoreCase(lsNewStatus))) // if((lsNewStatus!=null && lsNewStatus.trim().length()>0) && ("M".equalsIgnoreCase(lsNewStatus) || "D".equalsIgnoreCase(lsNewStatus)))
if((lsNewStatus != null && lsNewStatus.trim().length() > 0) && ("M".equalsIgnoreCase(lsNewStatus) || "D".equalsIgnoreCase(lsNewStatus))) if((lsNewStatus!=null && lsNewStatus.trim().length()>0) && ("M".equalsIgnoreCase(lsNewStatus) || "D".equalsIgnoreCase(lsNewStatus)))
{ {
valueXmlString.append("<emp_maritalchg_emp_fname protect=\"0\">").append("<![CDATA["+empFNameLong+"]]>").append("</emp_maritalchg_emp_fname>"); valueXmlString.append("<emp_maritalchg_emp_fname protect=\"0\">").append("<![CDATA["+empFNameLong+"]]>").append("</emp_maritalchg_emp_fname>");
valueXmlString.append("<emp_maritalchg_emp_mname protect=\"0\">").append("<![CDATA["+empMNameLong+"]]>").append("</emp_maritalchg_emp_mname>"); valueXmlString.append("<emp_maritalchg_emp_mname protect=\"0\">").append("<![CDATA["+empMNameLong+"]]>").append("</emp_maritalchg_emp_mname>");
valueXmlString.append("<emp_maritalchg_emp_lname protect=\"0\">").append("<![CDATA["+empLNameLong+"]]>").append("</emp_maritalchg_emp_lname>"); valueXmlString.append("<emp_maritalchg_emp_lname protect=\"0\">").append("<![CDATA["+empLNameLong+"]]>").append("</emp_maritalchg_emp_lname>");
valueXmlString.append("<short_name protect=\"0\">").append("<![CDATA["+shortName+"]]>").append("</short_name>"); valueXmlString.append("<short_name protect=\"0\">").append("<![CDATA["+shortName+"]]>").append("</short_name>");
//modified by Shital on 09/08/2019 [Start]
admCommon.setNodeValue(dom, "emp_maritalchg_emp_fname", empFNameLong);
admCommon.setNodeValue(dom, "emp_maritalchg_emp_mname", empMNameLong);
admCommon.setNodeValue(dom, "emp_maritalchg_emp_lname", empLNameLong);
admCommon.setNodeValue(dom, "short_name", shortName);
//modified by Shital on 09/08/2019 [End]
if("M".equalsIgnoreCase(lsNewStatus)) if("M".equalsIgnoreCase(lsNewStatus))
{ {
valueXmlString.append("<spouse_name protect=\"0\">").append("<![CDATA["+spouseName+"]]>").append("</spouse_name>"); valueXmlString.append("<spouse_name protect=\"0\">").append("<![CDATA["+spouseName+"]]>").append("</spouse_name>");
//modified by Shital on 09/08/2019 [Start]
admCommon.setNodeValue(dom, "spouse_name", spouseName);
//modified by Shital on 09/08/2019 [End]
} }
else else
{ {
valueXmlString.append("<spouse_name protect=\"1\">").append("<![CDATA["+spouseName+"]]>").append("</spouse_name>"); valueXmlString.append("<spouse_name protect=\"1\">").append("<![CDATA["+spouseName+"]]>").append("</spouse_name>");
//modified by Shital on 09/08/2019 [Start]
admCommon.setNodeValue(dom, "spouse_name", spouseName);
//modified by Shital on 09/08/2019 [End]
} }
} }
else else
...@@ -422,46 +296,23 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus ...@@ -422,46 +296,23 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus
valueXmlString.append("<emp_maritalchg_emp_lname protect=\"1\">").append("<![CDATA["+empLNameLong+"]]>").append("</emp_maritalchg_emp_lname>"); valueXmlString.append("<emp_maritalchg_emp_lname protect=\"1\">").append("<![CDATA["+empLNameLong+"]]>").append("</emp_maritalchg_emp_lname>");
valueXmlString.append("<short_name protect=\"1\">").append("<![CDATA["+shortName+"]]>").append("</short_name>"); valueXmlString.append("<short_name protect=\"1\">").append("<![CDATA["+shortName+"]]>").append("</short_name>");
valueXmlString.append("<spouse_name protect=\"1\">").append("<![CDATA["+spouseName+"]]>").append("</spouse_name>"); valueXmlString.append("<spouse_name protect=\"1\">").append("<![CDATA["+spouseName+"]]>").append("</spouse_name>");
//modified by Shital on 09/08/2019 [Start]
admCommon.setNodeValue(dom, "emp_maritalchg_emp_fname", empFNameLong);
admCommon.setNodeValue(dom, "emp_maritalchg_emp_mname", empMNameLong);
admCommon.setNodeValue(dom, "emp_maritalchg_emp_lname", empLNameLong);
admCommon.setNodeValue(dom, "short_name", shortName);
admCommon.setNodeValue(dom, "spouse_name", spouseName);
//modified by Shital on 09/08/2019 [End]
} }
} }
else else
{ {
if((lsNewStatus != null && lsNewStatus.trim().length() > 0) && ("M".equalsIgnoreCase(lsNewStatus))) if((lsNewStatus!=null && lsNewStatus.trim().length()>0) && ("M".equalsIgnoreCase(lsNewStatus)))
{ {
valueXmlString.append("<spouse_name protect=\"0\">").append("<![CDATA["+spouseName+"]]>").append("</spouse_name>"); valueXmlString.append("<spouse_name protect=\"0\">").append("<![CDATA["+spouseName+"]]>").append("</spouse_name>");
//modified by Shital on 09/08/2019 [Start]
admCommon.setNodeValue(dom, "spouse_name", spouseName);
//modified by Shital on 09/08/2019 [End]
} }
else else
{ {
valueXmlString.append("<spouse_name protect=\"1\">").append("<![CDATA["+spouseName+"]]>").append("</spouse_name>"); valueXmlString.append("<spouse_name protect=\"1\">").append("<![CDATA["+spouseName+"]]>").append("</spouse_name>");
//modified by Shital on 09/08/2019 [Start]
admCommon.setNodeValue(dom, "spouse_name", spouseName);
//modified by Shital on 09/08/2019 [End]
} }
//modified by santosh 30/MAR/2018 .start //modified by santosh 30/MAR/2018 .start
valueXmlString.append("<emp_maritalchg_emp_fname protect=\"1\">").append("<![CDATA["+empFNameLong+"]]>").append("</emp_maritalchg_emp_fname>"); valueXmlString.append("<emp_maritalchg_emp_fname protect=\"1\">").append("<![CDATA["+empFNameLong+"]]>").append("</emp_maritalchg_emp_fname>");
valueXmlString.append("<emp_maritalchg_emp_mname protect=\"1\">").append("<![CDATA["+empMNameLong+"]]>").append("</emp_maritalchg_emp_mname>"); valueXmlString.append("<emp_maritalchg_emp_mname protect=\"1\">").append("<![CDATA["+empMNameLong+"]]>").append("</emp_maritalchg_emp_mname>");
valueXmlString.append("<emp_maritalchg_emp_lname protect=\"1\">").append("<![CDATA["+empLNameLong+"]]>").append("</emp_maritalchg_emp_lname>"); valueXmlString.append("<emp_maritalchg_emp_lname protect=\"1\">").append("<![CDATA["+empLNameLong+"]]>").append("</emp_maritalchg_emp_lname>");
valueXmlString.append("<short_name protect=\"1\">").append("<![CDATA["+shortName+"]]>").append("</short_name>"); valueXmlString.append("<short_name protect=\"1\">").append("<![CDATA["+shortName+"]]>").append("</short_name>");
//modified by Shital on 09/08/2019 [Start]
admCommon.setNodeValue(dom, "emp_maritalchg_emp_fname", empFNameLong);
admCommon.setNodeValue(dom, "emp_maritalchg_emp_mname", empMNameLong);
admCommon.setNodeValue(dom, "emp_maritalchg_emp_lname", empLNameLong);
admCommon.setNodeValue(dom, "short_name", shortName);
//modified by Shital on 09/08/2019 [End]
//modified by santosh 30/MAR/2018 .end //modified by santosh 30/MAR/2018 .end
} }
...@@ -478,20 +329,15 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus ...@@ -478,20 +329,15 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus
//Changed By Sanket J on 01/March/18 for [new column to handle long value employee names]-[End] //Changed By Sanket J on 01/March/18 for [new column to handle long value employee names]-[End]
valueXmlString.append("<short_name protect=\"1\">").append("<![CDATA[" + shortName+ "]]>").append("</short_name>");*/ valueXmlString.append("<short_name protect=\"1\">").append("<![CDATA[" + shortName+ "]]>").append("</short_name>");*/
if(mStatDate != null && mStatDate.trim().length() > 0) if(mStatDate!=null && mStatDate.trim().length()>0)
{ {
mStatDateStr=genericUtility.getValidDateString(mStatDate, genericUtility.getDBDateFormat(),genericUtility.getApplDateFormat()); mStatDateStr=genericUtility.getValidDateString(mStatDate, genericUtility.getDBDateFormat(),
genericUtility.getApplDateFormat());
valueXmlString.append("<status_date__o protect=\"1\">").append("<![CDATA[" + mStatDateStr+ "]]>").append("</status_date__o>"); valueXmlString.append("<status_date__o protect=\"1\">").append("<![CDATA[" + mStatDateStr+ "]]>").append("</status_date__o>");
//modified by Shital on 09/08/2019 [Start]
admCommon.setNodeValue(dom, "status_date__o", mStatDateStr);
//modified by Shital on 09/08/2019 [End]
} }
else else
{ {
valueXmlString.append("<status_date__o protect=\"1\">").append("<![CDATA[]]>").append("</status_date__o>"); valueXmlString.append("<status_date__o protect=\"1\">").append("<![CDATA[]]>").append("</status_date__o>");
//modified by Shital on 09/08/2019 [Start]
admCommon.setNodeValue(dom, "status_date__o", "");
//modified by Shital on 09/08/2019 [End]
} }
//Changed By Sanket J on 01/March/18 for [new column to handle long value employee names]-[Start] //Changed By Sanket J on 01/March/18 for [new column to handle long value employee names]-[Start]
//valueXmlString.append("<emp_fname__o protect=\"1\">").append("<![CDATA[" + empFName+ "]]>").append("</emp_fname__o>"); //valueXmlString.append("<emp_fname__o protect=\"1\">").append("<![CDATA[" + empFName+ "]]>").append("</emp_fname__o>");
...@@ -503,125 +349,79 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus ...@@ -503,125 +349,79 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus
//Changed By Sanket J on 01/March/18 for [new column to handle long value employee names]-[End] //Changed By Sanket J on 01/March/18 for [new column to handle long value employee names]-[End]
valueXmlString.append("<short_name__o protect=\"1\">").append("<![CDATA[" + shortName+ "]]>").append("</short_name__o>"); valueXmlString.append("<short_name__o protect=\"1\">").append("<![CDATA[" + shortName+ "]]>").append("</short_name__o>");
valueXmlString.append("<sex>").append("<![CDATA[" + sex+ "]]>").append("</sex>"); valueXmlString.append("<sex>").append("<![CDATA[" + sex+ "]]>").append("</sex>");
//modified by Shital on 09/08/2019 [Start]
admCommon.setNodeValue(dom, "emp_fname__o", empFNameLong);
admCommon.setNodeValue(dom, "emp_mname__o", empMNameLong);
admCommon.setNodeValue(dom, "emp_lname__o", empLNameLong);
admCommon.setNodeValue(dom, "short_name__o", shortName);
admCommon.setNodeValue(dom, "sex", sex);
//modified by Shital on 09/08/2019 [End]
} }
else if(currentColumn.trim().equalsIgnoreCase("new_status")) else if(currentColumn.trim().equalsIgnoreCase("new_status"))
{ {
lsNewStatus = checkNull(genericUtility.getColumnValue("new_status", dom)); lsNewStatus=checkNull(genericUtility.getColumnValue("new_status", dom));
//Modified by Ahmed on 03/MAY/2017 to only replace for null value[start] //Modified by Ahmed on 03/MAY/2017 to only replace for null value[start]
/*empMaritalChgEmpFname=checkNull(genericUtility.getColumnValue("emp_maritalchg_emp_fname", dom)); /*empMaritalChgEmpFname=checkNull(genericUtility.getColumnValue("emp_maritalchg_emp_fname", dom));
empMaritalChgEmpMname=checkNull(genericUtility.getColumnValue("emp_maritalchg_emp_mname", dom)); empMaritalChgEmpMname=checkNull(genericUtility.getColumnValue("emp_maritalchg_emp_mname", dom));
empMaritalChgEmpLname=checkNull(genericUtility.getColumnValue("emp_maritalchg_emp_lname", dom)); empMaritalChgEmpLname=checkNull(genericUtility.getColumnValue("emp_maritalchg_emp_lname", dom));
shortName=checkNull(genericUtility.getColumnValue("short_name", dom)); shortName=checkNull(genericUtility.getColumnValue("short_name", dom));
spouseName=checkNull(genericUtility.getColumnValue("spouse_name", dom));*/ spouseName=checkNull(genericUtility.getColumnValue("spouse_name", dom));*/
empMaritalChgEmpFname = replaceNull(genericUtility.getColumnValue("emp_maritalchg_emp_fname", dom)); empMaritalChgEmpFname=replaceNull(genericUtility.getColumnValue("emp_maritalchg_emp_fname", dom));
empMaritalChgEmpMname = replaceNull(genericUtility.getColumnValue("emp_maritalchg_emp_mname", dom)); empMaritalChgEmpMname=replaceNull(genericUtility.getColumnValue("emp_maritalchg_emp_mname", dom));
empMaritalChgEmpLname = replaceNull(genericUtility.getColumnValue("emp_maritalchg_emp_lname", dom)); empMaritalChgEmpLname=replaceNull(genericUtility.getColumnValue("emp_maritalchg_emp_lname", dom));
shortName = replaceNull(genericUtility.getColumnValue("short_name", dom)); shortName=replaceNull(genericUtility.getColumnValue("short_name", dom));
spouseName = replaceNull(genericUtility.getColumnValue("spouse_name", dom)); System.out.println("shortName::::::"+shortName);
spouseName=replaceNull(genericUtility.getColumnValue("spouse_name", dom));
//Modified by Ahmed on 03/MAY/2017 to only replace for null value[end] //Modified by Ahmed on 03/MAY/2017 to only replace for null value[end]
sex = checkNull(genericUtility.getColumnValue("sex", dom)); sex=checkNull(genericUtility.getColumnValue("sex", dom));
System.out.println("@S@ sex from dom["+sex+"]"); System.out.println("@S@ sex from dom["+sex+"]");
if("U".equalsIgnoreCase(lsNewStatus)) if("U".equalsIgnoreCase(lsNewStatus))
{ {
valueXmlString.append("<spouse_name >").append("<![CDATA[]]>").append("</spouse_name>"); valueXmlString.append("<spouse_name >").append("<![CDATA[]]>").append("</spouse_name>");
//modified by Shital on 09/08/2019 [Start]
admCommon.setNodeValue(dom, "spouse_name", "");
//modified by Shital on 09/08/2019 [End]
} }
if((sex != null && sex.trim().length() > 0) && ("F".equalsIgnoreCase(sex))) if((sex!=null && sex.trim().length()>0) && ("F".equalsIgnoreCase(sex)))
{ {
// if((lsNewStatus!=null && lsNewStatus.trim().length()>0) && ("M".equalsIgnoreCase(lsNewStatus) || "D".equalsIgnoreCase(lsNewStatus))) // if((lsNewStatus!=null && lsNewStatus.trim().length()>0) && ("M".equalsIgnoreCase(lsNewStatus) || "D".equalsIgnoreCase(lsNewStatus)))
if((lsNewStatus != null && lsNewStatus.trim().length() > 0) && ("M".equalsIgnoreCase(lsNewStatus))) // Chnage done as per suggested by P Jain, if((lsNewStatus!=null && lsNewStatus.trim().length()>0) && ("M".equalsIgnoreCase(lsNewStatus))) // Chnage done as per suggested by P Jain,
{ {
valueXmlString.append("<emp_maritalchg_emp_fname protect=\"0\">").append("<![CDATA["+empMaritalChgEmpFname+"]]>").append("</emp_maritalchg_emp_fname>"); valueXmlString.append("<emp_maritalchg_emp_fname protect=\"0\">").append("<![CDATA["+empMaritalChgEmpFname+"]]>").append("</emp_maritalchg_emp_fname>");
valueXmlString.append("<emp_maritalchg_emp_mname protect=\"0\">").append("<![CDATA["+empMaritalChgEmpMname+"]]>").append("</emp_maritalchg_emp_mname>"); valueXmlString.append("<emp_maritalchg_emp_mname protect=\"0\">").append("<![CDATA["+empMaritalChgEmpMname+"]]>").append("</emp_maritalchg_emp_mname>");
valueXmlString.append("<emp_maritalchg_emp_lname protect=\"0\">").append("<![CDATA["+empMaritalChgEmpLname+"]]>").append("</emp_maritalchg_emp_lname>"); valueXmlString.append("<emp_maritalchg_emp_lname protect=\"0\">").append("<![CDATA["+empMaritalChgEmpLname+"]]>").append("</emp_maritalchg_emp_lname>");
valueXmlString.append("<short_name protect=\"0\">").append("<![CDATA["+shortName+"]]>").append("</short_name>"); valueXmlString.append("<short_name protect=\"0\">").append("<![CDATA["+shortName+"]]>").append("</short_name>");
//modified by Shital on 09/08/2019 [Start]
admCommon.setNodeValue(dom, "emp_maritalchg_emp_fname", empMaritalChgEmpFname);
admCommon.setNodeValue(dom, "emp_maritalchg_emp_mname", empMaritalChgEmpMname);
admCommon.setNodeValue(dom, "emp_maritalchg_emp_lname", empMaritalChgEmpLname);
admCommon.setNodeValue(dom, "short_name", shortName);
//modified by Shital on 09/08/2019 [End]
//valueXmlString.append("<spouse_name protect=\"0\">").append("<![CDATA["+spouseName+"]]>").append("</spouse_name>"); //valueXmlString.append("<spouse_name protect=\"0\">").append("<![CDATA["+spouseName+"]]>").append("</spouse_name>");
if("M".equalsIgnoreCase(lsNewStatus)) if("M".equalsIgnoreCase(lsNewStatus))
{ {
valueXmlString.append("<spouse_name protect=\"0\">").append("<![CDATA["+spouseName+"]]>").append("</spouse_name>"); valueXmlString.append("<spouse_name protect=\"0\">").append("<![CDATA["+spouseName+"]]>").append("</spouse_name>");
//modified by Shital on 09/08/2019 [Start]
admCommon.setNodeValue(dom, "spouse_name", spouseName);
//modified by Shital on 09/08/2019 [End]
} }
else else
{ {
valueXmlString.append("<spouse_name protect=\"1\">").append("<![CDATA["+spouseName+"]]>").append("</spouse_name>"); valueXmlString.append("<spouse_name protect=\"1\">").append("<![CDATA["+spouseName+"]]>").append("</spouse_name>");
//modified by Shital on 09/08/2019 [Start]
admCommon.setNodeValue(dom, "spouse_name", spouseName);
//modified by Shital on 09/08/2019 [End]
} }
} }
else else
{ {
empCode = checkNull(genericUtility.getColumnValue("emp_code", dom)); empCode=checkNull(genericUtility.getColumnValue("emp_code", dom));
//Changed By Sanket J on 01/March/18 for [new column to handle long value employee names] //Changed By Sanket J on 01/March/18 for [new column to handle long value employee names]
//sql="select emp_lname, emp_fname,m_status, emp_mname, short_name,sex,m_status_date from employee where emp_code =?"; //sql="select emp_lname, emp_fname,m_status, emp_mname, short_name,sex,m_status_date from employee where emp_code =?";
sql = "select emp_lname, emp_fname,m_status, emp_mname,emp_fname_long, emp_mname_long, emp_lname_long, short_name,sex,m_status_date from employee where emp_code =?"; sql="select emp_lname, emp_fname,m_status, emp_mname,emp_fname_long, emp_mname_long, emp_lname_long, short_name,sex,m_status_date from employee where emp_code =?";
pstmt = conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
pstmt.setString(1, empCode); pstmt.setString(1, empCode);
rs = pstmt.executeQuery(); rs=pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
//modified by Shital on 09/08/2019 [Start] empLName=rs.getString("emp_lname");
//empLName=rs.getString("emp_lname"); empFName=rs.getString("emp_fname");
//empFName=rs.getString("emp_fname"); empMName=rs.getString("emp_mname");
//empMName=rs.getString("emp_mname"); mStatus=rs.getString("m_status");
//mStatus=rs.getString("m_status"); shortName=rs.getString("short_name");
//shortName=rs.getString("short_name"); shortName=shortName==null?"":shortName;//Modified by Ahmed on 26-Apr-2018 to filter out null as value for short name on display
empLName = checkNull(rs.getString("emp_lname")); sex=rs.getString("sex");
empFName = checkNull(rs.getString("emp_fname")); mStatDate=rs.getString("m_status_date");
empMName = checkNull(rs.getString("emp_mname"));
mStatus = checkNull(rs.getString("m_status"));
shortName = checkNull(rs.getString("short_name"));
shortName = shortName == null?"":shortName;//Modified by Ahmed on 26-Apr-2018 to filter out null as value for short name on display
//sex=rs.getString("sex");
sex = checkNull(rs.getString("sex"));
//mStatDate = rs.getString("m_status_date");
mStatDate = checkNull(rs.getString("m_status_date"));
//modified by Shital on 09/08/2019 [End]
//Changed By Sanket J on 01/March/18 for [new column to handle long value employee names]-[Start] //Changed By Sanket J on 01/March/18 for [new column to handle long value employee names]-[Start]
empFNameLong=rs.getString("emp_fname_long");
//modified by Shital on 09/08/2019 [Start] empMNameLong=rs.getString("emp_mname_long");
//empFNameLong=rs.getString("emp_fname_long"); empLNameLong=rs.getString("emp_lname_long");
//empMNameLong=rs.getString("emp_mname_long");
//empLNameLong=rs.getString("emp_lname_long");
empFNameLong = checkNull(rs.getString("emp_fname_long"));
empMNameLong = checkNull(rs.getString("emp_mname_long"));
empLNameLong = checkNull(rs.getString("emp_lname_long"));
//modified by Shital on 09/08/2019 [End]
if(empFNameLong == null || empFNameLong == "") if(empFNameLong == null || empFNameLong == "")
{ {
empFNameLong = empFName; empFNameLong = empFName;
} }
if(empMNameLong == null || empMNameLong == "") if(empMNameLong == null || empMNameLong == "")
{ {
empMNameLong = empMName; empMNameLong = empMName;
} }
if(empLNameLong == null || empLNameLong == "") if(empLNameLong == null || empLNameLong == "")
{ {
empLNameLong = empLName; empLNameLong = empLName;
...@@ -645,32 +445,17 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus ...@@ -645,32 +445,17 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus
//Changed By Sanket J on 01/March/18 for [new column to handle long value employee names]-[End] //Changed By Sanket J on 01/March/18 for [new column to handle long value employee names]-[End]
valueXmlString.append("<short_name protect=\"1\">").append("<![CDATA["+shortName+"]]>").append("</short_name>"); valueXmlString.append("<short_name protect=\"1\">").append("<![CDATA["+shortName+"]]>").append("</short_name>");
valueXmlString.append("<spouse_name protect=\"1\">").append("<![CDATA["+spouseName+"]]>").append("</spouse_name>"); valueXmlString.append("<spouse_name protect=\"1\">").append("<![CDATA["+spouseName+"]]>").append("</spouse_name>");
//modified by Shital on 09/08/2019 [Start]
admCommon.setNodeValue(dom, "emp_maritalchg_emp_fname", empFNameLong);
admCommon.setNodeValue(dom, "emp_maritalchg_emp_mname", empMNameLong);
admCommon.setNodeValue(dom, "emp_maritalchg_emp_lname", empLNameLong);
admCommon.setNodeValue(dom, "short_name", shortName);
admCommon.setNodeValue(dom, "spouse_name", spouseName);
//modified by Shital on 09/08/2019 [End]
} }
} }
else else
{ {
if((lsNewStatus != null && lsNewStatus.trim().length() > 0) && ("M".equalsIgnoreCase(lsNewStatus))) // Chnage done as per suggested by P Jain, if((lsNewStatus!=null && lsNewStatus.trim().length()>0) && ("M".equalsIgnoreCase(lsNewStatus))) // Chnage done as per suggested by P Jain,
{ {
valueXmlString.append("<spouse_name protect=\"0\">").append("<![CDATA["+spouseName+"]]>").append("</spouse_name>"); valueXmlString.append("<spouse_name protect=\"0\">").append("<![CDATA["+spouseName+"]]>").append("</spouse_name>");
//modified by Shital on 09/08/2019 [Start]
admCommon.setNodeValue(dom, "spouse_name", spouseName);
//modified by Shital on 09/08/2019 [End]
} }
else else
{ {
valueXmlString.append("<spouse_name protect=\"1\">").append("<![CDATA["+spouseName+"]]>").append("</spouse_name>"); valueXmlString.append("<spouse_name protect=\"1\">").append("<![CDATA["+spouseName+"]]>").append("</spouse_name>");
//modified by Shital on 09/08/2019 [Start]
admCommon.setNodeValue(dom, "spouse_name", spouseName);
//modified by Shital on 09/08/2019 [End]
} }
} }
} }
...@@ -694,13 +479,9 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus ...@@ -694,13 +479,9 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus
conn.close(); conn.close();
conn = null; conn = null;
} }
} } catch (Exception e1)
catch (Exception e1)
{ {
e1.printStackTrace(); e1.printStackTrace();
//modified by Shital on 09/08/2019 [Start]
throw new ITMException(e1);
//modified by Shital on 09/08/2019 [End]
} }
} }
valueXmlString.append("</Root>\r\n"); valueXmlString.append("</Root>\r\n");
...@@ -719,9 +500,8 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus ...@@ -719,9 +500,8 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus
Document dom1 = null; Document dom1 = null;
Document dom2 = null; Document dom2 = null;
String errString = ""; String errString = "";
//modified by Shital on 09/08/2019 [Start] //GenericUtility genericUtility = GenericUtility.getInstance(); //modified by Shital on 09/08/2019
//GenericUtility genericUtility = GenericUtility.getInstance(); E12GenericUtility genericUtility = new E12GenericUtility();
//modified by Shital on 09/08/2019 [End]
try try
{ {
if (xmlString != null && xmlString.trim().length() != 0) if (xmlString != null && xmlString.trim().length() != 0)
...@@ -743,63 +523,52 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus ...@@ -743,63 +523,52 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus
System.out.println("Exception : StdPayStru : wfValData(String xmlString) : ==>" + e.getMessage()); System.out.println("Exception : StdPayStru : wfValData(String xmlString) : ==>" + e.getMessage());
errString = genericUtility.createErrorString(e); errString = genericUtility.createErrorString(e);
e.printStackTrace(); e.printStackTrace();
//modified by Shital on 09/08/2019 [Start]
throw new ITMException(e);
//modified by Shital on 09/08/2019 [End]
} }
return (errString); return (errString);
} }
public String wfValData(Document dom, Document dom1, Document dom2,String objContext, String editFlag, String xtraParams)throws RemoteException, ITMException public String wfValData(Document dom, Document dom1, Document dom2,
String objContext, String editFlag, String xtraParams)
throws RemoteException, ITMException
{ {
NodeList parentNodeList = null; NodeList parentNodeList = null;
NodeList childNodeList = null; NodeList childNodeList = null;
Node parentNode = null; Node parentNode = null;
Node childNode = null; Node childNode = null;
int currentFormNo = 0; int currentFormNo = 0, childNodeListLength = 0;
int childNodeListLength = 0;
String userId = ""; String userId = "";
String childNodeName = null; String childNodeName = null;
String errString = ""; String errString = "";
Connection conn = null; Connection conn = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
String msgType = "";
String empCode = ""; String msgType = "",empCode="",tranDateStr="",sql="",lsSite="",newStatus="",oldStatus="",lsStatus="",empCodeAprv="",relieveDate="";
String tranDateStr = ""; int count=0;
String sql = ""; Timestamp tranDate=null;
String lsSite = "";
String newStatus = "";
String oldStatus = "";
String lsStatus = "";
String empCodeAprv = "";
String relieveDate = "";
int count = 0;
Timestamp tranDate = null;
//modified by Shital on 09/08/2019 [Start]
//GenericUtility genericUtility = null; //GenericUtility genericUtility = null;
//modified by Shital on 09/08/2019 [End] E12GenericUtility genericUtility = new E12GenericUtility(); //modified by Shital on 09/08/2019
ArrayList<String> errList = new ArrayList<String>(); ArrayList<String> errList = new ArrayList<String>();
ArrayList<String> errFields = new ArrayList<String>(); ArrayList<String> errFields = new ArrayList<String>();
try try
{ {
//modified by Shital on 09/08/2019 [Start] //modified by Shital on 09/08/2019[Start]
//ConnDriver connDriver = new ConnDriver(); //ConnDriver connDriver = new ConnDriver();
//conn = connDriver.getConnectDB("DriverITM"); //conn = connDriver.getConnectDB("DriverITM");
conn = getConnection(); conn = getConnection();
conn.setAutoCommit(false); conn.setAutoCommit(false);
//genericUtility = GenericUtility.getInstance();
//modified by Shital on 09/08/2019 [End]
//genericUtility = GenericUtility.getInstance();
//modified by Shital on 09/08/2019[End]
userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode"); userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
if (objContext != null && objContext.trim().length() > 0) if (objContext != null && objContext.trim().length() > 0)
{ {
currentFormNo = Integer.parseInt(objContext); currentFormNo = Integer.parseInt(objContext);
} }
switch (currentFormNo) switch (currentFormNo)
{ {
case 1: case 1:
...@@ -822,8 +591,9 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus ...@@ -822,8 +591,9 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus
if (childNodeName.equalsIgnoreCase("emp_code")) if (childNodeName.equalsIgnoreCase("emp_code"))
{ {
empCode = checkNull(genericUtility.getColumnValue("emp_code", dom)); empCode = checkNull(genericUtility.getColumnValue("emp_code", dom));
tranDateStr = checkNull(genericUtility.getColumnValue("tran_date", dom)); tranDateStr=checkNull(genericUtility.getColumnValue("tran_date", dom));
tranDate = Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDateStr, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())); tranDate= Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDateStr, genericUtility.getApplDateFormat()
,genericUtility.getDBDateFormat()));
if("A".equalsIgnoreCase(editFlag)) if("A".equalsIgnoreCase(editFlag))
{ {
...@@ -847,7 +617,7 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus ...@@ -847,7 +617,7 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus
rs=null;*/ rs=null;*/
close( pstmt, rs); close( pstmt, rs);
if(count > 0) if(count>0)
{ {
errList.add("VTUNCFPND"); errList.add("VTUNCFPND");
errFields.add("emp_code"); errFields.add("emp_code");
...@@ -858,14 +628,14 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus ...@@ -858,14 +628,14 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus
* for emp_code and tran_date * for emp_code and tran_date
* for employee * for employee
* */ * */
sql = "select count(*) as cnt from emp_maritalchg where emp_code =? and tran_date=?"; sql="select count(*) as cnt from emp_maritalchg where emp_code =? and tran_date=?";
pstmt = conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
pstmt.setString(1, empCode); pstmt.setString(1, empCode);
pstmt.setTimestamp(2, tranDate); pstmt.setTimestamp(2, tranDate);
rs = pstmt.executeQuery(); rs=pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
count = rs.getInt("cnt"); count=rs.getInt("cnt");
} }
//Changed By sanket on 08/MAR/18 [for proper closing connection] //Changed By sanket on 08/MAR/18 [for proper closing connection]
/*pstmt.close(); /*pstmt.close();
...@@ -873,24 +643,20 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus ...@@ -873,24 +643,20 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus
rs.close(); rs.close();
rs=null;*/ rs=null;*/
close( pstmt, rs); close( pstmt, rs);
if(count>0)
if(count > 0)
{ {
errList.add("VTALEXIST"); errList.add("VTALEXIST");
errFields.add("emp_code"); errFields.add("emp_code");
} }
} }
sql = "select emp_site from employee where emp_code = ?"; sql="select emp_site from employee where emp_code =?";
pstmt = conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
pstmt.setString(1, empCode); pstmt.setString(1, empCode);
rs = pstmt.executeQuery(); rs=pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
//modified by Shital on 09/08/2019 [Start] lsSite=rs.getString("emp_site");
//lsSite=rs.getString("emp_site");
lsSite = checkNull(rs.getString("emp_site"));
//modified by Shital on 09/08/2019 [End]
} }
//Changed By sanket on 08/MAR/18 [for proper closing connection] //Changed By sanket on 08/MAR/18 [for proper closing connection]
/*pstmt.close(); /*pstmt.close();
...@@ -899,21 +665,20 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus ...@@ -899,21 +665,20 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus
rs=null;*/ rs=null;*/
close( pstmt, rs); close( pstmt, rs);
// Need method to find out. // Need method to find out.
String errCode = gbfEmp(empCode,tranDate,lsSite,conn); String errCode=gbfEmp(empCode,tranDate,lsSite,conn);
if(errCode != null && errCode.trim().length() > 0) if(errCode!=null && errCode.trim().length()>0)
{ {
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
else if (childNodeName.equalsIgnoreCase("new_status")) else if (childNodeName.equalsIgnoreCase("new_status"))
{ {
newStatus = checkNull(genericUtility.getColumnValue("new_status", dom)); newStatus = checkNull(genericUtility.getColumnValue("new_status", dom));
oldStatus = checkNull(genericUtility.getColumnValue("old_status", dom)); oldStatus = checkNull(genericUtility.getColumnValue("old_status", dom));
empCode = checkNull(genericUtility.getColumnValue("emp_code", dom)); empCode = checkNull(genericUtility.getColumnValue("emp_code", dom));
if(newStatus != null && newStatus.trim().length() > 0) if(newStatus!=null && newStatus.trim().length()>0)
{ {
if("U".equalsIgnoreCase(oldStatus)) if("U".equalsIgnoreCase(oldStatus))
{ {
...@@ -945,20 +710,17 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus ...@@ -945,20 +710,17 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus
errList.add("VTSTAT"); errList.add("VTSTAT");
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
if(errList.size() == 0) if(errList.size()==0)
{ {
//Changed By Sanket J on 01/March/18 for [new column to handle long value employee names]-[Start] //Changed By Sanket J on 01/March/18 for [new column to handle long value employee names]-[Start]
//sql="select case when status is null then ' ' else status end from employee where EMP_CODE =?"; //sql="select case when status is null then ' ' else status end from employee where EMP_CODE =?";
sql = "select case when status is null then ' ' else status end as status from employee where EMP_CODE =?"; sql="select case when status is null then ' ' else status end as status from employee where EMP_CODE =?";
pstmt = conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
pstmt.setString(1, empCode); pstmt.setString(1, empCode);
rs = pstmt.executeQuery(); rs=pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
//modified by Shital on 09/08/2019 [Start] lsStatus=rs.getString("status");
//lsStatus=rs.getString("status");
lsStatus = checkNull(rs.getString("status"));
//modified by Shital on 09/08/2019 [End]
} }
//Changed By sanket on 08/MAR/18 [for proper closing connection] //Changed By sanket on 08/MAR/18 [for proper closing connection]
/*pstmt.close(); /*pstmt.close();
...@@ -967,7 +729,7 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus ...@@ -967,7 +729,7 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus
rs=null;*/ rs=null;*/
close( pstmt, rs); close( pstmt, rs);
if(lsStatus != null && lsStatus.trim().length() != 0) if(lsStatus!=null && lsStatus.trim().length() !=0)
{ {
errList.add("VTINAEMP"); errList.add("VTINAEMP");
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
...@@ -979,19 +741,16 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus ...@@ -979,19 +741,16 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus
empCodeAprv = checkNull(genericUtility.getColumnValue("emp_code__aprv", dom)); empCodeAprv = checkNull(genericUtility.getColumnValue("emp_code__aprv", dom));
empCode = checkNull(genericUtility.getColumnValue("emp_code", dom)); empCode = checkNull(genericUtility.getColumnValue("emp_code", dom));
if(empCodeAprv != null && empCodeAprv.trim().length() > 0) if(empCodeAprv!=null && empCodeAprv.trim().length()>0)
{ {
sql = "select count(*) as cnt,RELIEVE_DATE from employee where emp_code = ? group by RELIEVE_DATE"; sql="select count(*) as cnt,RELIEVE_DATE from employee where emp_code = ? group by RELIEVE_DATE";
pstmt = conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
pstmt.setString(1, empCodeAprv); pstmt.setString(1, empCodeAprv);
rs = pstmt.executeQuery(); rs=pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
count = rs.getInt("cnt"); count=rs.getInt("cnt");
//modified by Shital on 09/08/2019 [Start] relieveDate=rs.getString("RELIEVE_DATE");
//relieveDate = rs.getString("RELIEVE_DATE");
relieveDate = checkNull(rs.getString("RELIEVE_DATE"));
//modified by Shital on 09/08/2019 [End]
} }
//Changed By sanket on 08/MAR/18 [for proper closing connection] //Changed By sanket on 08/MAR/18 [for proper closing connection]
/*pstmt.close(); /*pstmt.close();
...@@ -1000,12 +759,12 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus ...@@ -1000,12 +759,12 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus
rs=null;*/ rs=null;*/
close( pstmt, rs); close( pstmt, rs);
if(count == 0) if(count==0)
{ {
errList.add("VMEMP1"); errList.add("VMEMP1");
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
if(relieveDate != null && relieveDate.trim().length() != 0) if(relieveDate!=null && relieveDate.trim().length()!=0)
{ {
errList.add("VMEMPV"); errList.add("VMEMPV");
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
...@@ -1033,12 +792,9 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus ...@@ -1033,12 +792,9 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus
String errFldName = (String) errFields.get(cnt); String errFldName = (String) errFields.get(cnt);
System.out.println("errCode .........." + errCode); System.out.println("errCode .........." + errCode);
//modified by Shital on 09/08/2019 [Start] errString = getErrorString(errFldName, errCode, userId);
//errString = getErrorString(errFldName, errCode, userId);
errString = itmDBAccessEJB.getErrorString(errFldName, errCode, userId, "", conn);
System.out.println("errString is : ::::>>>> " + errString); System.out.println("errString is : ::::>>>> " + errString);
msgType = errorType(conn, errCode); msgType = errorType(conn, errCode);
if (errString.length() > 0) if (errString.length() > 0)
{ {
String bifurErrString = errString.substring(errString.indexOf("<Errors>") + 8, errString.indexOf("<trace>")); String bifurErrString = errString.substring(errString.indexOf("<Errors>") + 8, errString.indexOf("<trace>"));
...@@ -1071,16 +827,12 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus ...@@ -1071,16 +827,12 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus
System.out.println("Exception ::" + e); System.out.println("Exception ::" + e);
e.printStackTrace(); e.printStackTrace();
errString = e.getMessage(); errString = e.getMessage();
//modified by Shital on 09/08/2019 [Start]
throw new ITMException(e);
//modified by Shital on 09/08/2019 [End]
} }
finally finally
{ {
try try
{ {
//modified by Shital on 09/08/2019 [Start] if (conn != null)
/*if (conn != null)
{ {
if (rs != null) if (rs != null)
{ {
...@@ -1094,81 +846,52 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus ...@@ -1094,81 +846,52 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus
} }
conn.close(); conn.close();
} }
conn = null;*/
if (rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if (conn != null)
{
conn.close();
conn = null; conn = null;
} }
//modified by Shital on 09/08/2019 [End]
}
catch (Exception d) catch (Exception d)
{ {
d.printStackTrace(); d.printStackTrace();
//modified by Shital on 09/08/2019 [Start]
throw new ITMException(d);
//modified by Shital on 09/08/2019 [End]
} }
} }
System.out.println("ErrString ::" + errString); System.out.println("ErrString ::" + errString);
return errString; return errString;
} }
private String gbfEmp(String empCode, Timestamp tranDate, String lsSite, Connection conn) throws ITMException private String gbfEmp(String empCode, Timestamp tranDate, String lsSite, Connection conn)
{ {
// TODO Auto-generated method stub // TODO Auto-generated method stub
String errCode = ""; String errCode="",sql="",status="";
String sql = ""; Timestamp relieveDate=null;
String status = ""; PreparedStatement pstmt=null;
Timestamp relieveDate = null; ResultSet rs=null;
PreparedStatement pstmt = null;
ResultSet rs = null; try {
sql="select relieve_date, status from employee where emp_code = ?";
try pstmt=conn.prepareStatement(sql);
{
sql = "select relieve_date, status from employee where emp_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode); pstmt.setString(1, empCode);
rs = pstmt.executeQuery(); rs=pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
relieveDate=rs.getTimestamp("relieve_date"); relieveDate=rs.getTimestamp("relieve_date");
//modified by Shital on 09/08/2019 [Start] status=rs.getString("status");
//status=rs.getString("status");
status = checkNull(rs.getString("status"));
//modified by Shital on 09/08/2019 [End]
} }
else else
{ {
errCode = "VMEMP1"; errCode="VMEMP1";
} }
//Changed By sanket on 08/MAR/18 [for proper closing connection] //Changed By sanket on 08/MAR/18 [for proper closing connection]
close( pstmt, rs); close( pstmt, rs);
if(relieveDate !=null && relieveDate.before(tranDate) && "S".equalsIgnoreCase(status)) if(relieveDate !=null && relieveDate.before(tranDate) && "S".equalsIgnoreCase(status))
{ {
errCode = "VMEMP2"; errCode="VMEMP2";
} }
}
catch (SQLException e) } catch (SQLException e) {
{
// TODO Auto-generated catch block // TODO Auto-generated catch block
e.printStackTrace(); e.printStackTrace();
//modified by Shital on 09/08/2019 [Start]
throw new ITMException(e);
//modified by Shital on 09/08/2019 [End]
} }
return errCode; return errCode;
} }
...@@ -1177,20 +900,16 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus ...@@ -1177,20 +900,16 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus
String msgType = ""; String msgType = "";
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
String sql = "";
try try
{ {
sql = " SELECT MSG_TYPE FROM MESSAGES WHERE MSG_NO = ? "; String sql = " SELECT MSG_TYPE FROM MESSAGES WHERE MSG_NO = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, errorCode); pstmt.setString(1, errorCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while (rs.next()) while (rs.next())
{ {
//modified by Shital on 09/08/2019 [Start] msgType = rs.getString("MSG_TYPE");
//msgType = rs.getString("MSG_TYPE");
msgType = checkNull(rs.getString("MSG_TYPE"));
//modified by Shital on 09/08/2019 [End]
} }
} }
catch (Exception ex) catch (Exception ex)
...@@ -1246,28 +965,21 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus ...@@ -1246,28 +965,21 @@ public class EmpMaritalStatusIC extends ValidatorEJB implements EmpMaritalStatus
} }
// Modified by Ahmed on 03/MAY/2017[This method is used to only replace for null value][END] // Modified by Ahmed on 03/MAY/2017[This method is used to only replace for null value][END]
// Added by Sanket on 08/MAR/2018[Closing result set and prepared stmt][Start] // Added by Sanket on 08/MAR/2018[Closing result set and prepared stmt][Start]
private void close(PreparedStatement pstmt, ResultSet rs)
private void close(PreparedStatement pstmt, ResultSet rs) throws ITMException
{ {
try try
{ {
if (rs != null) if (rs != null) {
{
rs.close(); rs.close();
rs = null; rs = null;
} }
if (pstmt != null) if (pstmt != null) {
{
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
} } catch (Exception ex)
catch (Exception ex)
{ {
ex.printStackTrace(); ex.printStackTrace();
//modified by Shital on 09/08/2019 [Start]
throw new ITMException(ex);
//modified by Shital on 09/08/2019 [End]
} }
} }
// Added by Sanket on 08/MAR/2018[Closing result set and prepared stmt][END] // Added by Sanket on 08/MAR/2018[Closing result set and prepared stmt][END]
......
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