Commit b8e295ce authored by pbhosale's avatar pbhosale

* Poonam B changes done on Employeewise Paystructure obj_name : emp_ad

EmpAdPrs.java
EmployeeAdIC.java
EmployeeAdICRemote.java
w_emp_ad.sql
d_emp_allwdedn_brow.srd
d_emp_allwdedn_edit.srd


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@205046 ce508802-f39f-4f6c-b175-0d175dae99d5
parent e6487fac
......@@ -4,32 +4,36 @@
package ibase.webitm.ejb.adm;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.*;
import javax.ejb.*;
import org.w3c.dom.*;
import ibase.webitm.utility.ITMException;
import ibase.webitm.ejb.*;
import ibase.webitm.utility.GenericUtility;
import javax.ejb.Stateless; // added for ejb3
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@Stateless // added for ejb3
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.ITMException;
//Modified by Poonam Bhosale on [27/06/2019][Start]
//@Stateless // added for ejb3
//Modified by Poonam Bhosale on [27/06/2019][End]
public class EmpAdPrs extends ValidatorEJB implements EmpAdPrsLocal,EmpAdPrsRemote // SessionBean
{
/*
public void ejbCreate() throws RemoteException, CreateException
{
}
public void ejbRemove()
{
}
public void ejbActivate()
{
}
public void ejbPassivate()
{
}*/
......@@ -48,7 +52,10 @@ public class EmpAdPrs extends ValidatorEJB implements EmpAdPrsLocal,EmpAdPrsRemo
{
if (xmlString1 != null && xmlString1.trim().length() > 0)
{
dom = GenericUtility.getInstance().parseString(xmlString1);
//Modified by Poonam Bhosale on [27/06/2019][Start]
//dom = GenericUtility.getInstance().parseString(xmlString1);
dom = parseString(xmlString1);
//Modified by Poonam Bhosale on [27/06/2019][End]
retString = executepreSaveRec(dom,domId,objContext,editFlag,xtraParams,conn);
}
}
......@@ -66,18 +73,36 @@ public class EmpAdPrs extends ValidatorEJB implements EmpAdPrsLocal,EmpAdPrsRemo
Statement stmt = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
String empCode = "", adCode = "", effDate = "", expDate = "", periodFrom = "", periodTo = "";
String sqlStr = "", amt = "", keyString = "", errorCode = "";
String updateStatus = "", userId = "", retString = "";
double originalAmt = 0d, amount = 0d;
String empCode = "";
String adCode = "";
String effDate = "";
String expDate = "";
String periodFrom = "";
String periodTo = "";
String sqlStr = "";
String amt = "";
String keyString = "";
String errorCode = "";
String updateStatus = "";
String userId = "";
String retString = "";
double originalAmt = 0d;
double amount = 0d;
boolean empStatus = false;
int count = 0;
java.sql.Timestamp effectiveDate = null, expiryDate = null;
Node currDetail = null;
//Modified by Poonam Bhosale on [27/06/2019][Start]
ITMDBAccessEJB itmdbAccessEJB= new ITMDBAccessEJB();
//Modified by Poonam Bhosale on [27/06/2019][End]
try
{
conn.setAutoCommit(false);
GenericUtility genericUtility = GenericUtility.getInstance();
//Modified by Poonam Bhosale on [27/06/2019][Start]
//GenericUtility genericUtility = GenericUtility.getInstance();
E12GenericUtility genericUtility= new E12GenericUtility();
//Modified by Poonam Bhosale on [27/06/2019][End]
userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"userId");
AdmCommon admCommon = new AdmCommon();
System.out.println("dom.............:: "+ dom);
......@@ -174,7 +199,10 @@ public class EmpAdPrs extends ValidatorEJB implements EmpAdPrsLocal,EmpAdPrsRemo
if (errorCode.trim().length() > 0)
{
conn.rollback();
retString = getErrorString("",errorCode,userId);
//
//retString = getErrorString("",errorCode,userId);
retString = itmdbAccessEJB.getErrorString("", errorCode, userId, "", conn);
//
System.out.println("Ret String: " + retString);
}
else if (errorCode.trim().length() == 0)
......@@ -199,7 +227,10 @@ public class EmpAdPrs extends ValidatorEJB implements EmpAdPrsLocal,EmpAdPrsRemo
if (count != 0)
{
errorCode = "VTPAYFND";
retString = getErrorString("",errorCode,userId);
///Modified by Poonam Bhosale on [27/06/2019][Start]
//retString = getErrorString("",errorCode,userId);
retString = itmdbAccessEJB.getErrorString("", errorCode, userId, "", conn);
///Modified by Poonam Bhosale on [27/06/2019][End]
System.out.println("Ret String: " + retString);
}
}
......
......@@ -4,12 +4,14 @@ import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import java.sql.Timestamp;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.ITMException;
......@@ -59,14 +61,15 @@ public class EmployeeAdIC extends ValidatorEJB implements EmployeeAdICLocal,Empl
String mval="";
String mval3="";
String empCode="";
String effDateStr="" , expDateStr="";
Timestamp effDate= null;
Timestamp expDate= null;
String effDateStr="" ;
String expDateStr="";
String refType="";
String refNo="";
String balOpt="";
String paySite="";
String confirmed="";
Timestamp effDate= null;
Timestamp expDate= null;
long cnt = 0;
Connection conn = null;
String userId="";
......@@ -86,7 +89,8 @@ public class EmployeeAdIC extends ValidatorEJB implements EmployeeAdICLocal,Empl
ArrayList<String> errList = new ArrayList<String>();
ArrayList<String> errFields = new ArrayList<String>();
String errorType = "";
String errString="",loginSite="";
String errString="";
String loginSite="";
StringBuffer errStringXml = new StringBuffer("<?xml version = \"1.0\"?> \r\n <Root> <Errors>");
try {
......@@ -526,7 +530,7 @@ public class EmployeeAdIC extends ValidatorEJB implements EmployeeAdICLocal,Empl
}
else
{
sql = "select pay_site, nvl(status , ' ') as status from employee where emp_code = ?";
sql = "select pay_site, nvl(status ,' ') as status from employee where emp_code = ?";
pstmt= conn.prepareStatement(sql);
pstmt.setString(1,empCode);
rs = pstmt.executeQuery();
......@@ -546,7 +550,6 @@ public class EmployeeAdIC extends ValidatorEJB implements EmployeeAdICLocal,Empl
pstmt.close();
pstmt = null;
}
if((mval3 != null) && ("S".equalsIgnoreCase(mval3)))
{
errCode = "VTPAYSTR01";
......@@ -576,12 +579,12 @@ public class EmployeeAdIC extends ValidatorEJB implements EmployeeAdICLocal,Empl
}
}
}
}
//--------------Validation for Employee Code Ends here--------------------------
//--------------Validation for Confirmed Starts here--------------------------
else if(childNodeName.equalsIgnoreCase("confirmed"))
......@@ -604,9 +607,7 @@ public class EmployeeAdIC extends ValidatorEJB implements EmployeeAdICLocal,Empl
}
}
}
}
//--------------Validation for Confirmed Ends here--------------------------
//--------------Validation for Amount Starts here--------------------------
......@@ -629,15 +630,10 @@ public class EmployeeAdIC extends ValidatorEJB implements EmployeeAdICLocal,Empl
}
}
}
//--------------Validation for Amount Ends here--------------------------
}
break;
}
int errListSize = errList.size();
System.out.println("errListSize::::::::::"+errListSize);
int count = 0;
......@@ -674,19 +670,13 @@ public class EmployeeAdIC extends ValidatorEJB implements EmployeeAdICLocal,Empl
{
errStringXml = new StringBuffer("");
}
}
}
catch (Exception e)
{
System.out.println("::: EmployeeAdIC ::"+ e.getMessage());
e.getMessage();
throw new ITMException(e);
}
finally
{
......@@ -764,10 +754,15 @@ public class EmployeeAdIC extends ValidatorEJB implements EmployeeAdICLocal,Empl
PreparedStatement pstmt = null;
ResultSet rs = null ;
int childNodeListLength = 0;
String empCode = "", paySite = "";
String effDateStr="",todayDate ="", expDate="";
String empCode = "";
String paySite = "";
String effDateStr="";
String todayDate ="";
String expDate="";
Timestamp todayTm= null;
String refType="",refNo="", login_emp_code="";
String refType="";
String refNo="";
String login_emp_code="";
String confirmed="";
Timestamp joinDate = null, effDate = null;
String empName = "";
......@@ -779,7 +774,10 @@ public class EmployeeAdIC extends ValidatorEJB implements EmployeeAdICLocal,Empl
NodeList childNodeList = null;
Node parentNode = null;
Node childNode = null;
String childNodeName = null, columnValue = "", loginSiteCode = "",loginEmpCode="";
String childNodeName = null;
//String columnValue = "";
String loginSiteCode = "";
String loginEmpCode="";
SimpleDateFormat sdf = null;
String entryMode = "E";
......@@ -832,32 +830,6 @@ public class EmployeeAdIC extends ValidatorEJB implements EmployeeAdICLocal,Empl
valueXmlString.append("<exp_date>").append("<![CDATA["+expDate+"]]>").append("</exp_date>");
effDateStr = this.genericUtility.getValueFromXTRA_PARAMS(xtraParams, "eff_date");
// Modified by Piysuh on 25/07/2019 [Shifted outside from bellow if condition to set employee name].Start
sql = "select date_join, FN_GET_EMP_NAME(?,'FL1') as emp_name from employee where emp_code= ?";
pstmt= conn.prepareStatement(sql);
pstmt.setString(1,empCode);
pstmt.setString(2,empCode);
rs = pstmt.executeQuery();
if(rs.next())
{
joinDate = rs.getTimestamp("date_join");
empName = rs.getString("emp_name");
System.out.println("joinDate:::::"+ joinDate + " empName::::: "+empName);
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
valueXmlString.append("<emp_name>").append("<![CDATA["+empName+"]]>").append("</emp_name>");
// Modified by Piysuh on 25/07/2019 [Shifted outside from bellow if condition to set employee name].End
if((effDateStr == null || effDateStr.trim().length() == 0) && "E".equalsIgnoreCase(entryMode))
{
effDateStr = todayDate;
......@@ -867,8 +839,6 @@ public class EmployeeAdIC extends ValidatorEJB implements EmployeeAdICLocal,Empl
//----Modified by Jaffar S on 13th June 19
//sql = "select date_join from employee where emp_code= ?";
// Modified by Piysuh on 25/07/2019 [Shifted outside of if condition to set employee name].Start
/*
sql = "select date_join, FN_GET_EMP_NAME(?,'FL1') as emp_name from employee where emp_code= ?";
pstmt= conn.prepareStatement(sql);
pstmt.setString(1,empCode);
......@@ -893,8 +863,6 @@ public class EmployeeAdIC extends ValidatorEJB implements EmployeeAdICLocal,Empl
//Added by Jaffar for getting employee name
valueXmlString.append("<emp_name>").append("<![CDATA["+empName+"]]>").append("</emp_name>");
*/
// Modified by Piysuh on 25/07/2019 [Shifted outside of if condition to set employee name].End
if(joinDate != null)
{
......@@ -983,19 +951,13 @@ public class EmployeeAdIC extends ValidatorEJB implements EmployeeAdICLocal,Empl
}
}
else if(currentColumn.trim().equalsIgnoreCase("itm_defaultedit"))
{
System.out.println("Inside itm_defaultedit:::::");
System.out.println("Inside itm_default edit:::::");
effDateStr = checkNull(genericUtility.getColumnValue("eff_date", dom));
refType = checkNull(genericUtility.getColumnValue("ref_type", dom));
refNo = checkNull(genericUtility.getColumnValue("ref_no", dom));
valueXmlString.append("<eff_date protect=\"1\" >").append("<![CDATA["+effDateStr+"]]>").append("</eff_date>");
if("O".equalsIgnoreCase(refType) || "L".equalsIgnoreCase(refType))
{
valueXmlString.append("<ref_type protect=\"0\" ><![CDATA[").append(refType).append("]]></ref_type>\r\n");
......@@ -1039,7 +1001,6 @@ public class EmployeeAdIC extends ValidatorEJB implements EmployeeAdICLocal,Empl
{
descr= checkNull(rs.getString("descr"));
prop_yn= checkNull(rs.getString("prop_yn"));
}
if(rs != null)
......@@ -1067,18 +1028,14 @@ public class EmployeeAdIC extends ValidatorEJB implements EmployeeAdICLocal,Empl
effDate=todayTm;
System.out.println("effDateStr:::::"+ effDateStr + " effDate:::::" + effDate);
//-----Modified by Jaffar S. on 05-Jul-2019
//sql = "select pay_site,date_join from employee where emp_code = ?";
sql = "select pay_site,date_join, FN_GET_EMP_NAME(?,'FL1') as emp_name from employee where emp_code = ?";
sql = "select pay_site,date_join from employee where emp_code = ?";
pstmt= conn.prepareStatement(sql);
pstmt.setString(1,empCode);
pstmt.setString(2,empCode);
rs = pstmt.executeQuery();
if(rs.next())
{
paySite= checkNull(rs.getString("pay_site"));
joinDate= rs.getTimestamp("date_join");
empName = checkNull(rs.getString("emp_name"));//Added by Jaffar S. on 05th July 2019
}
......@@ -1134,7 +1091,6 @@ public class EmployeeAdIC extends ValidatorEJB implements EmployeeAdICLocal,Empl
}
}
valueXmlString.append("<emp_name>").append("<![CDATA["+empName+"]]>").append("</emp_name>");
valueXmlString.append("<pay_site>").append("<![CDATA["+paySite+"]]>").append("</pay_site>");
}
}
......@@ -1174,6 +1130,9 @@ public class EmployeeAdIC extends ValidatorEJB implements EmployeeAdICLocal,Empl
catch(Exception ex)
{
System.out.println("Exception in EJB[EmployeeAdIC]::itemChanged::["+ ex.getMessage() + "]");
//Added By Poonam Bhosale on [27/06/2019][Start]
throw new ITMException(ex);
//Added By Poonam Bhosale on [27/06/2019][End]
}
}
......@@ -1181,9 +1140,6 @@ public class EmployeeAdIC extends ValidatorEJB implements EmployeeAdICLocal,Empl
return valueXmlString.toString();
}
private String errorType(Connection conn, String errorCode) throws ITMException
{
String msgType = "";
......@@ -1243,7 +1199,6 @@ public class EmployeeAdIC extends ValidatorEJB implements EmployeeAdICLocal,Empl
{
return input == null ? "" : input;
}
}
}
package ibase.webitm.ejb.adm;
import java.rmi.RemoteException;
import java.sql.Connection;
import javax.ejb.Remote;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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