Commit 721c5504 authored by dpingle's avatar dpingle

* Migration done for Employeewise Monthly Paystructure- obj_name: emp_mthad

EmpMthadIC.java
EmpMthadPrs.java
emp_mthad21.xml
d_emp_mthad_brow.srd
d_emp_mthad_edit.srd


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@205064 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 8cb63968
......@@ -4,7 +4,6 @@ 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 java.util.Date;
......@@ -25,6 +24,7 @@ public class EmpMthadIC extends ValidatorEJB implements EmpMthadLocal,EmpMthadRe
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String editFlag,
String xtraParams) throws RemoteException, ITMException
{
System.out.println(xmlString);
Document dom = null;
Document dom1 = null;
......@@ -375,47 +375,39 @@ public class EmpMthadIC extends ValidatorEJB implements EmpMthadLocal,EmpMthadRe
}
else if ("min_basic".equalsIgnoreCase(childNodeName))
{
//Aded by varsha on 31 July 2019 [START]
minBasic = Double.parseDouble(checkInt(genericUtility.getColumnValue("min_basic",dom)));
if(genericUtility.getColumnValue("min_basic",dom) == null || minBasic < 0)
minBasic = Double.parseDouble(checkNull(genericUtility.getColumnValue("min_basic",dom)));
if(minBasic == 0 || minBasic < 0)
{
errList.add("VMPAYSTR01");
errFields.add(childNodeName.toLowerCase());
}
//Aded by varsha on 31 July 2019 [END]
}
else if ("max_basic".equalsIgnoreCase(childNodeName))
{
//Aded by varsha on 31 July 2019 [START]
maxBasic = Double.parseDouble(checkInt(genericUtility.getColumnValue("max_basic",dom)));
if(genericUtility.getColumnValue("max_basic",dom) == null || maxBasic < 0)
maxBasic = Double.parseDouble(checkNull(genericUtility.getColumnValue("max_basic",dom)));
if(maxBasic == 0 || maxBasic < 0)
{
errList.add("VMPAYSTR02");
errFields.add(childNodeName.toLowerCase());
}
//Aded by varsha on 31 July 2019 [END]
}
else if ("min_amt".equalsIgnoreCase(childNodeName))
{
//Aded by varsha on 31 July 2019 [START]
minAmt = Double.parseDouble(checkInt(genericUtility.getColumnValue("min_amt",dom)));
if(genericUtility.getColumnValue("min_amt",dom) == null || minAmt < 0)
minAmt = Double.parseDouble(checkNull(genericUtility.getColumnValue("min_amt",dom)));
if(minAmt == 0 || minAmt < 0)
{
errList.add("VMPAYSTR03");
errFields.add(childNodeName.toLowerCase());
}
//Aded by varsha on 31 July 2019 [END]
}
else if ("max_amt".equalsIgnoreCase(childNodeName))
{
//Aded by varsha on 31 July 2019 [START]
maxAmt = Double.parseDouble(checkInt(genericUtility.getColumnValue("max_amt",dom)));
if(genericUtility.getColumnValue("max_amt",dom) == null || maxAmt < 0)
maxAmt = Double.parseDouble(checkNull(genericUtility.getColumnValue("max_amt",dom)));
if(maxAmt == 0 || maxAmt < 0)
{
errList.add("VMPAYSTR04");
errFields.add(childNodeName.toLowerCase());
}
//Aded by varsha on 31 July 2019 [END]
}
}
break;
......@@ -549,22 +541,10 @@ public class EmpMthadIC extends ValidatorEJB implements EmpMthadLocal,EmpMthadRe
String paySite = "";
AdmCommon admCommon = new AdmCommon();
// Modified By Sana s on 25/07/2019 [start]
String effDateStr="";
Timestamp joinDate = null, effDate = null;
String empName = "";
String todayDate ="";
Timestamp todayTm= null;
long cnt = 0;
SimpleDateFormat sdf = null;
String entryMode = "E";
// Modified By Sana s on 25/07/2019 [end]
try
{
genericUtility = new E12GenericUtility();
sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());/////////////////
System.out.println("currentFormNo...." + currentFormNo);
conn = getConnection();
if (objContext != null && objContext.trim().length() > 0)
......@@ -585,25 +565,16 @@ public class EmpMthadIC extends ValidatorEJB implements EmpMthadLocal,EmpMthadRe
{
empCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "emp_code");
monthCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "month_code");
// Modified By Sana S on 25/07/2019 [start]
//sql="select pay_site as pay_site from employee where emp_code =?";
sql="select date_join, FN_GET_EMP_NAME(?,'FL1') as emp_name,pay_site from employee where emp_code= ?";
// Modified By Sana S on 25/07/2019 [start]
sql="select pay_site as pay_site from employee where emp_code =?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode);
pstmt.setString(2, empCode);
rs = pstmt.executeQuery();
if (rs.next())
{
paySite = rs.getString("pay_site");
// Modified By Sana S on 25/07/2019 [start]
joinDate = rs.getTimestamp("date_join");
empName = rs.getString("emp_name");
// Modified By Sana S on 25/07/2019 [start]
}
System.out.println("date_join ["+joinDate+"]\t emp_name ["+empName+"]");
if (rs != null)
{
rs.close();
......@@ -645,67 +616,14 @@ public class EmpMthadIC extends ValidatorEJB implements EmpMthadLocal,EmpMthadRe
lsVarValue = admCommon.getEnv("999999", "AD_EFFDATE", conn);
System.out.println("lsVarValue==["+lsVarValue+"]");
System.out.println("genericUtility.getApplDateFormat()==["+genericUtility.getApplDateFormat()+"]");
//Modify by Varsha V on 30-07-19 for formating payparm date
//lsVarValue = genericUtility.getValidDateString(lsVarValue, genericUtility.getApplDateFormat());
lsVarValue = genericUtility.getValidDateString(lsVarValue,"dd-MM-yy", genericUtility.getApplDateFormat());
lsVarValue = genericUtility.getValidDateString(lsVarValue, genericUtility.getApplDateFormat());
System.out.println("lsVarValue==after["+lsVarValue+"]");
lsVarValues = admCommon.getEnv("999999", "AD_EXPDATE", conn);
//Modify by Varsha V on 30-07-19 for formating payparm date
//lsVarValues = genericUtility.getValidDateString(lsVarValues, genericUtility.getApplDateFormat());
lsVarValues = genericUtility.getValidDateString(lsVarValues,"dd-MM-yy", genericUtility.getApplDateFormat());
lsVarValues = genericUtility.getValidDateString(lsVarValues, genericUtility.getApplDateFormat());
valueXmlString.append("<eff_date ><![CDATA[").append(lsVarValue).append("]]></eff_date>\r\n");
valueXmlString.append("<exp_date ><![CDATA[").append(lsVarValues).append("]]></exp_date>\r\n");
//////////////
// Modified by Sana S on 25/07/2019 [Shifted outside from bellow if condition to set employee name].Start
valueXmlString.append("<emp_name>").append("<![CDATA["+empName+"]]>").append("</emp_name>");
if((effDateStr == null || effDateStr.trim().length() == 0) && "E".equalsIgnoreCase(entryMode))
{
effDateStr = todayDate;
effDate=todayTm;
System.out.println("effDateStr :::::"+ effDateStr +" effDate :::::"+ effDate);
cnt = 0;
if(joinDate != null)
{
sql = "select count(*) as count from employee_ad where emp_code = ? and eff_date > ?";
pstmt= conn.prepareStatement(sql);
pstmt.setString(1,empCode);
pstmt.setTimestamp(2,joinDate);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getLong("count");
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(cnt == 0)
{
effDate= joinDate;
effDateStr= sdf.format(joinDate);
}
}
cnt = 0;
}
valueXmlString.append("<eff_date>").append("<![CDATA["+effDateStr+"]]>").append("</eff_date>");
valueXmlString.append("<pay_site>").append("<![CDATA["+paySite+"]]>").append("</pay_site>");
////Modified By Sana S on 25/07/2019 [end]
}
else if ("ad_code".equalsIgnoreCase(currentColumn))
{
......@@ -736,20 +654,14 @@ public class EmpMthadIC extends ValidatorEJB implements EmpMthadLocal,EmpMthadRe
else if ("emp_code".equalsIgnoreCase(currentColumn))
{
empCode = checkNull(genericUtility.getColumnValue("emp_code", dom));
//sql="select pay_site as pay_site from employee where emp_code = ?";
sql = "select pay_site,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);
sql="select pay_site as pay_site from employee where emp_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode);
rs = pstmt.executeQuery();
if (rs.next())
{
paySite = rs.getString("pay_site");
// Modified By Sana S on 25/07/2019 [start] to get datejoin and empname column
joinDate= rs.getTimestamp("date_join");
empName = checkNull(rs.getString("emp_name"));
// Modified By Sana S on 25/07/2019 [end] to get datejoin and empname column
}
if (rs != null)
{
......@@ -876,14 +788,4 @@ public class EmpMthadIC extends ValidatorEJB implements EmpMthadLocal,EmpMthadRe
}
return input;
}
//Added by varsha on 31 July 2019 [START]
private String checkInt(String input)
{
if (input == null)
{
input = "0";
}
return input;
}
//Added by varsha on 31 July 2019 [END]
}
......@@ -6,12 +6,11 @@ package ibase.webitm.ejb.adm;
import java.rmi.RemoteException;
import java.sql.*;
//import javax.ejb.*;
import javax.ejb.*;
import org.w3c.dom.*;
import ibase.webitm.utility.ITMException;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.*;
//import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.GenericUtility;
import javax.ejb.Stateless; // added for ejb3
@Stateless // added for ejb3
......@@ -33,7 +32,7 @@ public class EmpMthadPrs extends ValidatorEJB implements EmpMthadPrsLocal,EmpMth
public void ejbPassivate()
{
}*/
E12GenericUtility genericUtility = new E12GenericUtility();
public String preSaveRec() throws RemoteException,ITMException
{
return "";
......@@ -47,9 +46,7 @@ public class EmpMthadPrs extends ValidatorEJB implements EmpMthadPrsLocal,EmpMth
{
if (xmlString1 != null && xmlString1.trim().length() > 0)
{
//Changed by Varsha V on 30-07-19
//dom = GenericUtility.getInstance().parseString(xmlString1);
dom = genericUtility.parseString(xmlString1);
dom = GenericUtility.getInstance().parseString(xmlString1);
executepreSaveRec(dom,domId,objContext,editFlag,xtraParams,conn);
}
}
......@@ -77,8 +74,7 @@ public class EmpMthadPrs extends ValidatorEJB implements EmpMthadPrsLocal,EmpMth
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
try
{
//Removed by Varsha V on 30-07-19
//GenericUtility genericUtility = GenericUtility.getInstance();
GenericUtility genericUtility = GenericUtility.getInstance();
userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"userId");
AdmCommon admCommon = new AdmCommon();
System.out.println("dom.............:: "+ dom);
......
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