Commit 8cd7a961 authored by pbhosale's avatar pbhosale

Changes made by Poonam B[16-OCT-2019]

emp_separation11.xml
emp_separation21.xml
d_emp_separation_brow.srd
d_emp_separation_edit.srd
EmployeeSepConfirm.java
EmpSeparationCnc.java
EmpSeparationEJB.java
w_emp_separation.sql
EmpSeparationRelieve.java
EmpSeparationRelieveLocal.java
EmpSeparationRelieveRemote.java
separation.png
separationwht.png


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@209723 ce508802-f39f-4f6c-b175-0d175dae99d5
parent d5e99f77
This diff is collapsed.
...@@ -9,15 +9,17 @@ ...@@ -9,15 +9,17 @@
package ibase.webitm.ejb.adm.adv; package ibase.webitm.ejb.adm.adv;
import java.rmi.RemoteException; import java.rmi.RemoteException;
import java.sql.*; import java.sql.Connection;
import javax.ejb.*; import java.sql.PreparedStatement;
import java.sql.ResultSet;
import ibase.webitm.utility.ITMException;
import ibase.webitm.ejb.*;
import ibase.webitm.utility.GenericUtility;
import ibase.system.config.*;
import javax.ejb.Stateless; // added for ejb3 import javax.ejb.Stateless; // added for ejb3
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ActionHandlerEJB;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.utility.ITMException;
@Stateless // added for ejb3 @Stateless // added for ejb3
public class EmpSeparationCnc extends ActionHandlerEJB implements EmpSeparationCncLocal,EmpSeparationCncRemote //SessionBean public class EmpSeparationCnc extends ActionHandlerEJB implements EmpSeparationCncLocal,EmpSeparationCncRemote //SessionBean
...@@ -38,6 +40,8 @@ public class EmpSeparationCnc extends ActionHandlerEJB implements EmpSeparationC ...@@ -38,6 +40,8 @@ public class EmpSeparationCnc extends ActionHandlerEJB implements EmpSeparationC
{ {
} }
*/ */
E12GenericUtility genericUtility = new E12GenericUtility(); // Added By Poonam B[26-SEP-2019]
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();// Added By Poonam B[26-SEP-2019]
public String actionHandler() throws RemoteException,ITMException public String actionHandler() throws RemoteException,ITMException
{ {
return ""; return "";
...@@ -47,7 +51,7 @@ public class EmpSeparationCnc extends ActionHandlerEJB implements EmpSeparationC ...@@ -47,7 +51,7 @@ public class EmpSeparationCnc extends ActionHandlerEJB implements EmpSeparationC
{ {
String retString = null; String retString = null;
GenericUtility genericUtility = GenericUtility.getInstance(); //GenericUtility genericUtility = GenericUtility.getInstance(); //Commented By Poonam B[26-SEP-2019]
try try
{ {
retString = actionCancel(tranId, xtraParams, forcedFlag); retString = actionCancel(tranId, xtraParams, forcedFlag);
...@@ -68,19 +72,19 @@ public class EmpSeparationCnc extends ActionHandlerEJB implements EmpSeparationC ...@@ -68,19 +72,19 @@ public class EmpSeparationCnc extends ActionHandlerEJB implements EmpSeparationC
String errCode = "", errString = ""; String errCode = "", errString = "";
String empCode = ""; String empCode = "";
String resiDateStr = ""; String resiDateStr = "";
java.sql.Date resiDate = null; /*java.sql.Date resiDate = null;
String loginCode = ""; String loginCode = "";
Connection conn = null; */Connection conn = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
ConnDriver connDriver = new ConnDriver(); //ConnDriver connDriver = new ConnDriver();//Commented By Poonam B[26-SEP-2019]
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB(); //ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();//Commented By Poonam B[26-SEP-2019]
GenericUtility genericUtility = GenericUtility.getInstance(); //GenericUtility genericUtility = GenericUtility.getInstance();//Commented By Poonam B[26-SEP-2019]
int cnt = 0; int cnt = 0;
try try
{ {
conn = connDriver.getConnectDB("DriverITM"); //conn = connDriver.getConnectDB("DriverITM"); //Commented By Poonam B[26-SEP-2019]
conn = getConnection(); //Added By Poonam B[26-SEP-2019]
System.out.println("########### Inside EmpSeparationCncEJB[actionCancel] ###########"); System.out.println("########### Inside EmpSeparationCncEJB[actionCancel] ###########");
System.out.println("Tran ID : "+ tranId); System.out.println("Tran ID : "+ tranId);
...@@ -109,7 +113,10 @@ public class EmpSeparationCnc extends ActionHandlerEJB implements EmpSeparationC ...@@ -109,7 +113,10 @@ public class EmpSeparationCnc extends ActionHandlerEJB implements EmpSeparationC
pstmt.clearParameters(); pstmt.clearParameters();
if (rs.next()) if (rs.next())
{ {
status = rs.getString(1); //Modified By Poonam B[26-SEP-2019][START]
//status = rs.getString(1);
status = E12GenericUtility.checkNull(rs.getString(1));
//Modified By Poonam B[26-SEP-2019][END]
} }
System.out.println("Status :"+status); System.out.println("Status :"+status);
...@@ -137,7 +144,8 @@ public class EmpSeparationCnc extends ActionHandlerEJB implements EmpSeparationC ...@@ -137,7 +144,8 @@ public class EmpSeparationCnc extends ActionHandlerEJB implements EmpSeparationC
catch (Exception e) catch (Exception e)
{ {
System.out.println("The Exception occure in EmpSeparationCncEJB :"+e); System.out.println("The Exception occure in EmpSeparationCncEJB :"+e);
throw e; //throw e;
throw new ITMException(e); //Added By Poonam B[26-SEP-2019]
} }
finally finally
{ {
...@@ -153,6 +161,7 @@ public class EmpSeparationCnc extends ActionHandlerEJB implements EmpSeparationC ...@@ -153,6 +161,7 @@ public class EmpSeparationCnc extends ActionHandlerEJB implements EmpSeparationC
catch (Exception e) catch (Exception e)
{ {
System.out.println("Exception in finally: " + e); System.out.println("Exception in finally: " + e);
throw new ITMException(e); //Added By Poonam B[26-SEP-2019]
} }
} }
return errString; return errString;
......
//AUTHOR : Poonam B
// COMPONENET : nvo_business_object_adm_empstat_relieve
// DATE : 23/09/2019
package ibase.webitm.ejb.adm.adv;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Timestamp;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ActionHandlerEJB;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.sys.UtilMethods;
import ibase.webitm.utility.ITMException;
public class EmpSeparationRelieve extends ActionHandlerEJB implements EmpSeparationRelieveLocal ,EmpSeparationRelieveRemote
{
E12GenericUtility genericUtility = new E12GenericUtility();
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
UtilMethods utilMethod = new UtilMethods();
String userId = "",loginEmpCode = "",runMode = "",chgTerm = "";
public String confirm(String tranId, String xtraParams, String forcedFlag) throws RemoteException,ITMException
{
String retString = null;
Connection conn = null;
try
{
conn = getConnection();
System.out.println("Conn==>[" + conn + "]");
retString = gbfPostLogic(tranId, tranId,xtraParams,forcedFlag,conn);
System.out.println("returning String from EmpSeparationRelieve :gbfPostLogic():==>[" + retString + "]");
if(retString == null || retString.trim().length() == 0)
{
conn.commit();
}
else
{
conn.rollback();
}
}
catch(Exception e)
{
System.out.println("Exception :EmpSeparationRelieve :gbfPostLogic() :" + e.getMessage() + ":");
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
if(conn != null)
{
conn.close();
conn = null;
}
}
catch (Exception e)
{
e.printStackTrace();
}
}
return retString;
}
public String gbfPostLogic(String asTranidFr, String asTranidTo, String xtraParams, String forcedFlag,
Connection conn) throws ITMException
{
String lsEmpCode = "" ,lsKeyVal = "",errString = "", sql = "";
String lsDate = "";
String status = "" , code = "";
Timestamp relieveDate = null;
Timestamp ldResiDate = null ;
int liCnt = 0 , cnt = 0;
PreparedStatement pstmt = null;
ResultSet rs = null;
try
{
System.out.println("Inside Post Logic Method..!!!!");
userId = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode"));
chgTerm = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "termId"));
loginEmpCode = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode"));
runMode = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "runMode"));
System.out.println("userId==>" + userId);
System.out.println("loginEmpCode==>" + loginEmpCode + " runMode==>" + runMode);
if(asTranidFr.equalsIgnoreCase(asTranidTo))
{
lsKeyVal = asTranidFr;
System.out.println("Initial lsKeyVal==>::[" + lsKeyVal + "]");
String[] tempArr = lsKeyVal.split(":");
if(tempArr != null && tempArr.length > 0 )
{
lsEmpCode = tempArr[0];
lsDate = tempArr[1];
}
System.out.println("lsKeyVal==>" + lsKeyVal + " lsEmpCode==>" + lsEmpCode + " lsDate==>" + lsDate);
ldResiDate = Timestamp.valueOf(genericUtility.getValidDateString(lsDate, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
System.out.println("ldResiDate==>" + ldResiDate);
do
{
sql = "select relieve_date, status from separation where emp_code = ? and resi_date = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsEmpCode);
pstmt.setTimestamp(2, ldResiDate);
rs = pstmt.executeQuery();
if(rs.next())
{
relieveDate = rs.getTimestamp("relieve_date");
status = checkNull(rs.getString("status"));
System.out.println("relieve_date::: " + relieveDate + " status::: " + status );
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
//if("C".equalsIgnoreCase(status) == false)
if(!"C".equalsIgnoreCase(status))
{
errString = itmDBAccessEJB.getErrorString("", "VTCONF3", userId, "", conn);// not confirmed
return errString;//Added by Jaffar
}
sql = "select status from employee where emp_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsEmpCode);
rs = pstmt.executeQuery();
if(rs.next())
{
status = checkNull(rs.getString("status"));
System.out.println(" status::: " +status );
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
//if("S".equalsIgnoreCase(status) == true)
if("S".equalsIgnoreCase(status))
{
errString = itmDBAccessEJB.getErrorString("", "VMEMP5", userId, "", conn);
//break;
return errString;
}
sql = "select code as ls_relieve_prd from period where fr_date <= ? and to_date >= ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1, relieveDate);
pstmt.setTimestamp(2, relieveDate);
rs = pstmt.executeQuery();
if(rs.next())
{
code = checkNull(rs.getString("ls_relieve_prd"));
System.out.println(" code::: " +code );
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
sql = "select count(*) as li_count from payroll where prd_code > ? and emp_code = ? " +
" and paid_days > 0 and prd_code not in (select prd_code from arrears" +
" where prd_code > ? and emp_code = ? )";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, code);
pstmt.setString(2, lsEmpCode);
pstmt.setString(3, code);
pstmt.setString(4, lsEmpCode);
rs = pstmt.executeQuery();
if(rs.next())
{
liCnt = rs.getInt("li_count");
System.out.println(" liCnt::: " +liCnt );
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(liCnt > 0)
{
errString = itmDBAccessEJB.getErrorString("", "VTEMPREL", userId, "", conn);
//break;
return errString;
}
sql = "update employee set relieve_date = ?, status = 'S' where emp_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1, relieveDate);
pstmt.setString(2, lsEmpCode);
cnt = pstmt.executeUpdate();
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(cnt != 1)
{
errString = itmDBAccessEJB.getErrorString("", "VRLDTUPDT", userId, "", conn);
//break;
return errString;
}
System.out.println("cnt of employee table::: " +cnt );
cnt = 0;
sql = "update users set status = 'C' where emp_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsEmpCode);
cnt = pstmt.executeUpdate();
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(cnt != 1)
{
errString = itmDBAccessEJB.getErrorString("", "VTEMPUID01", userId, "", conn);
//break;
return errString;
}
System.out.println(" cnt of users table ::: " +cnt );
sql = "update sales_pers set active = 'N' where emp_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsEmpCode);
cnt = pstmt.executeUpdate();
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(cnt != 1)
{
errString = itmDBAccessEJB.getErrorString("", "DRMUPDFAIL", userId, "", conn);
//break;
return errString;
}
System.out.println(" cnt of sales_pers table::: " +cnt );
break;
}while(true);
}
if(errString.trim().length() > 0)
{
conn.rollback();
}
else
{
conn.commit();
errString = itmDBAccessEJB.getErrorString("", "VTSUCC", userId, "", conn);
}
}
catch (Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
catch(Exception e1)
{
e1.printStackTrace();
}
}
return errString;
}
private String checkNull(String input)
{
if (input == null)
{
input = "";
}
else
{
input = input.trim();
}
return input;
}
}
\ No newline at end of file
package ibase.webitm.ejb.adm.adv;
import java.rmi.RemoteException;
import java.sql.Connection;
import ibase.webitm.utility.ITMException;
public interface EmpSeparationRelieveLocal
{
public String confirm(String tranId, String xtraParams, String forcedFlag)throws RemoteException,ITMException;
public String gbfPostLogic(String asTranidFr,String asTranidTo, String xtraParams,String forcedFlag,Connection conn) throws ITMException;
}
package ibase.webitm.ejb.adm.adv;
import java.rmi.RemoteException;
import java.sql.Connection;
import ibase.webitm.utility.ITMException;
public interface EmpSeparationRelieveRemote
{
public String confirm(String tranId, String xtraParams, String forcedFlag)throws RemoteException,ITMException;
public String gbfPostLogic(String asTranidFr,String asTranidTo, String xtraParams,String forcedFlag,Connection conn) throws ITMException;
}
...@@ -36,25 +36,22 @@ public class EmployeeSepConfirm extends ActionHandlerEJB implements EmployeeSepC ...@@ -36,25 +36,22 @@ public class EmployeeSepConfirm extends ActionHandlerEJB implements EmployeeSepC
try try
{ {
conn = getConnection(); conn = getConnection();
System.out.println("Conn==>[" + conn + "]"); System.out.println("Conn ==>[" + conn + "]");
//Modified By Azhar K. on [24-Sep-2019][Start]
userId = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode"));
//Modified By Azhar K. on [24-Sep-2019][End]
retString = gbfPostLogic(tranId, tranId,xtraParams,forcedFlag,conn); retString = gbfPostLogic(tranId, tranId,xtraParams,forcedFlag,conn);
System.out.println("returning String from EmployeeSepConfirm :confirm():==>[" + retString + "]"); System.out.println("returning String from EmployeeSepConfirm :confirm():==>[" + retString + "]");
if(retString == null || retString.trim().length() == 0) if(retString == null || retString.trim().length() == 0)
{ {
conn.commit(); conn.commit();
//Modified By Azhar K. on [24-Sep-2019][To flash msg on successful confirmation][Start] //Added By Poonam B [04-OCT-2019][START]
retString = itmDBAccessEJB.getErrorString("", "VTRSTCNF3", userId, "", conn); retString = itmDBAccessEJB.getErrorString("", "VTCONFIRM", userId, "", conn);
return retString; //Added By Poonam B [04-OCT-2019][END]
//Modified By Azhar K. on [24-Sep-2019][To flash msg on successful confirmation][End]
} }
else else
{ {
conn.rollback(); conn.rollback();
} }
System.out.println("retString:::::" +retString);
} }
catch(Exception e) catch(Exception e)
{ {
...@@ -501,9 +498,8 @@ public class EmployeeSepConfirm extends ActionHandlerEJB implements EmployeeSepC ...@@ -501,9 +498,8 @@ public class EmployeeSepConfirm extends ActionHandlerEJB implements EmployeeSepC
ResultSet rs = null; ResultSet rs = null;
int cntRows = 0,cntInsert = 0; int cntRows = 0,cntInsert = 0;
double totalAmt = 0.00,itAmt = 0.00,amount = 0.00; double totalAmt = 0.00,itAmt = 0.00,amount = 0.00;
//Modified by Azhar K. on[24-Sep-2019][Start]
String siteCode = "",grade = "",cadre = "";
//Modified by Azhar K. on[24-Sep-2019][End]
try try
{ {
...@@ -658,12 +654,9 @@ public class EmployeeSepConfirm extends ActionHandlerEJB implements EmployeeSepC ...@@ -658,12 +654,9 @@ public class EmployeeSepConfirm extends ActionHandlerEJB implements EmployeeSepC
pstmtTranId.close(); pstmtTranId.close();
pstmtTranId = null; pstmtTranId = null;
} }
//Modified by Azhar K. on[24-Sep-2019][Start]
/*sql = "select c.curr_code from employee e,site s,currency c,finent f where emp_code = ? and e.emp_site = s.site_code and f.fin_entity = s.fin_entity " + sql = "select c.curr_code from employee e,site s,currency c,finent f where emp_code = ? and e.emp_site = s.site_code and f.fin_entity = s.fin_entity " +
" and f.curr_code = c.curr_code ";*/
sql = "select c.curr_code,e.pay_site,e.grade,e.cadre from employee e,site s,currency c,finent f where emp_code = ? and e.emp_site = s.site_code and f.fin_entity = s.fin_entity " +
" and f.curr_code = c.curr_code "; " and f.curr_code = c.curr_code ";
//Modified by Azhar K. on[24-Sep-2019][End]
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, asEmpCode); pstmt.setString(1, asEmpCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -672,11 +665,6 @@ public class EmployeeSepConfirm extends ActionHandlerEJB implements EmployeeSepC ...@@ -672,11 +665,6 @@ public class EmployeeSepConfirm extends ActionHandlerEJB implements EmployeeSepC
{ {
currCode = checkNull(rs.getString("curr_code")); currCode = checkNull(rs.getString("curr_code"));
System.out.println("currency Code==> " + currCode); System.out.println("currency Code==> " + currCode);
//Modified by Azhar K. on[24-Sep-2019][Start]
siteCode = checkNull(rs.getString("pay_site"));
grade = checkNull(rs.getString("grade"));
cadre = checkNull(rs.getString("cadre"));
//Modified by Azhar K. on[24-Sep-2019][End]
} }
if(rs != null) if(rs != null)
...@@ -690,10 +678,8 @@ public class EmployeeSepConfirm extends ActionHandlerEJB implements EmployeeSepC ...@@ -690,10 +678,8 @@ public class EmployeeSepConfirm extends ActionHandlerEJB implements EmployeeSepC
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
//Modified by Azhar K. on[24-Sep-2019][Start]
//varValue = checkNull(admCommon.getSiteEnv("99999", "ADM", "X", "ZZZZZ", "GEN_FFSHDR_ONSEPCONF", ldToday, conn)); varValue = checkNull(admCommon.getSiteEnv("99999", "ADM", "X", "ZZZZZ", "GEN_FFSHDR_ONSEPCONF", ldToday, conn));
varValue = checkNull(admCommon.getAdmEnv(siteCode, cadre, grade, "GEN_FFSHDR_ONSEPCONF", ldToday, conn));
//Modified by Azhar K. on[24-Sep-2019][End]
System.out.println("varValue::==>[" + varValue + "]"); System.out.println("varValue::==>[" + varValue + "]");
if(varValue == null || varValue.trim().length() == 0 || "NULLFOUND".equalsIgnoreCase(varValue)) if(varValue == null || varValue.trim().length() == 0 || "NULLFOUND".equalsIgnoreCase(varValue))
......
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