Commit fbcfbeee authored by rtelang's avatar rtelang

EmployeeServicePrdAmdConf.java

EmployeeServicePrdAmdIC.java
-System should not allowed to entered decimal value in Period Amendment field.
-If Unconfirmed record is exists then system should not allow to add another record for employee.
emp_serviceprd_amd21.xml
A18LSUN006.sql
Added system entries in Messages table.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@201949 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 73a5b9f2
......@@ -123,6 +123,36 @@ public class EmployeeServicePrdAmdIC extends ValidatorEJB implements EmployeeSer
}
else
{
//Modified by Rohini R. on [12/06/2019][Start]
if("A".equalsIgnoreCase(editFlag))
{
int count = 0;
sql = "select count(*) as unconfirmed_record from EMP_SERVICEPRD_AMD where emp_code = ? and confirmed <> 'Y'";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode);
rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt(1);
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(count > 0)
{
errString = itmdbAccessEJB.getErrorString("", "VTEMPSPA15", "", "", conn);//Already Unconfirmed entry exists for employee.
return errString;
}
}
//Modified by Rohini R. on [12/06/2019][End]
sql = "select count(*) as count ,STATUS ,relieve_date from employee where emp_code = ? GROUP BY STATUS,relieve_date";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode);
......@@ -181,6 +211,20 @@ public class EmployeeServicePrdAmdIC extends ValidatorEJB implements EmployeeSer
if("period_amended".equalsIgnoreCase(childNodeName))
{
periodAmended = checkNull(genericUtility.getColumnValue("period_amended", dom));
System.out.println("periodAmended--["+periodAmended+"]");
//Modified by Rohini R. on [12/06/2019][Start]
if(periodAmended.contains("."))
{
errCode = "VTEMPSPA16";//Period amended should not be in decimal format.Please enter proper period for amendment
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
msgType = errorType(conn, errCode);
if (msgType.equalsIgnoreCase("E"))
{
break;
}
}
//Modified by Rohini R. on [12/06/2019][End]
System.out.println("");
try
{
......@@ -190,7 +234,7 @@ public class EmployeeServicePrdAmdIC extends ValidatorEJB implements EmployeeSer
{
periodAmd = 0;
e.getMessage();
throw new ITMException(e);
//throw new ITMException(e);
}
if(periodAmd <= 0)
......@@ -383,7 +427,7 @@ public class EmployeeServicePrdAmdIC extends ValidatorEJB implements EmployeeSer
SimpleDateFormat sdf = null;
int retAgeOld = 0;
Date retierDateOld = null;
double retAgeNew = 0;
int retAgeNew = 0;
Timestamp retDateOld = null,birthDate = null;
String empCode = "",fName = "",lName = "",mName = "",periodAmended = "",amendmentType = "",dateAf = "",retdateN = "",retdateO = "",birthDt = "";
String retDtO = "",retAgeO = "",retirementDateVarVal = "";
......@@ -522,6 +566,9 @@ public class EmployeeServicePrdAmdIC extends ValidatorEJB implements EmployeeSer
else if(currentColumn.trim().equalsIgnoreCase("period_amended"))
{
System.out.println("Inside period_amended itemchange:::::");
//Modified by Rohini R. on [12/06/2019][Start]
empCode = genericUtility.getColumnValue("emp_code", dom);
//Modified by Rohini R. on [12/06/2019][End]
periodAmended = genericUtility.getColumnValue("period_amended", dom);
amendmentType = genericUtility.getColumnValue("amendment_type", dom);
retDtO = genericUtility.getColumnValue("retirement_date_o", dom);
......@@ -535,7 +582,7 @@ public class EmployeeServicePrdAmdIC extends ValidatorEJB implements EmployeeSer
catch (Exception e)
{
e.getMessage();
throw new ITMException(e);
//throw new ITMException(e);
}
Timestamp todayDt = new Timestamp(System.currentTimeMillis());
//retirementDateVarVal = checkNull(admCommon.getSiteEnv("99999","ADM","X","ZZZZZ","RETIREMENT_DATE",todayDt,conn));
......
......@@ -115,7 +115,32 @@ public class EmployeeServicePrdAmdConf extends ActionHandlerEJB implements Emplo
}
else
{
//Modified by Rohini R. on [12/06/2019][Start]
int count = 0;
sql = "select count(*) as unconfirmed_record from EMP_SERVICEPRD_AMD where emp_code = ? and confirmed <> 'Y'";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode);
rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt(1);
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(count > 0)
{
errString = itmdbAccess.getErrorString("", "VTEMPSPA15", "", "", conn);//Already Unconfirmed entry exists for employee.
return errString;
}
//Modified by Rohini R. on [12/06/2019][End]
sql = "select status,relieve_date from employee where emp_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode);
......
......@@ -107,7 +107,16 @@ commit;
--------Modified by Rohini T on [19/04/19][End]---------------------------------------------------
--------Modified by Rohini T on [12/06/19][start]---------------------------------------------------
INSERT INTO messages (MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,MSG_TIME,ALARM,ERR_SOURCE,CHG_DATE,CHG_USER,CHG_TERM,OVERRIDE_INPUT,MAIL_OPTION) VALUES ('VTEMPSPA15','Unconfirmed Record Exists','Already Unconfirmed entry exists for employee.','E','Y',NULL,NULL,NULL,TO_DATE('10-03-15','DD-MM-RR'),'BASE ','BASE ',NULL,NULL);
INSERT INTO MESSAGES (MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,MSG_TIME,ALARM,ERR_SOURCE,CHG_DATE,CHG_USER,CHG_TERM,OVERRIDE_INPUT,MAIL_OPTION)
VALUES ('VTEMPSPA16','Invalid Period Amd','Period amended should not be in decimal format.Please enter proper period for amendment','E','Y',NULL,NULL,NULL,sysdate,'BASE ','BASE ',NULL,NULL);
--------Modified by Rohini T on [12/06/19][end]---------------------------------------------------
......@@ -636,7 +636,7 @@
<y>80</y>
<height>15</height>
<width>42</width>
<format>[general]</format>
<format>##0</format>
<html>
<valueishtml>0</valueishtml>
</html>
......@@ -646,8 +646,7 @@
<limit>3</limit>
<case>any</case>
<focusrectangle>no</focusrectangle>
<autoselect>yes</autoselect>
<autohscroll>yes</autohscroll>
<autoselect>no</autoselect>
<imemode>0</imemode>
</EditStyle>
<font>
......@@ -730,7 +729,7 @@
<y>122</y>
<height>15</height>
<width>42</width>
<format>[general]</format>
<format>##0</format>
<html>
<valueishtml>0</valueishtml>
</html>
......@@ -740,8 +739,7 @@
<limit>3</limit>
<case>any</case>
<focusrectangle>no</focusrectangle>
<autoselect>yes</autoselect>
<autohscroll>yes</autohscroll>
<autoselect>no</autoselect>
<imemode>0</imemode>
</EditStyle>
<font>
......@@ -796,13 +794,14 @@
<y>122</y>
<height>15</height>
<width>118</width>
<format>[general]</format>
<format>dd/mm/yy</format>
<html>
<valueishtml>0</valueishtml>
</html>
<name>retirement_date_n</name>
<visible>1</visible>
<EditStyle style="editmask">
<useformat>yes</useformat>
<mask>dd/mm/yy</mask>
<imemode>0</imemode>
<focusrectangle>no</focusrectangle>
......@@ -1356,7 +1355,7 @@
<y>80</y>
<height>15</height>
<width>118</width>
<format>[general]</format>
<format>dd/mm/yy</format>
<html>
<valueishtml>0</valueishtml>
</html>
......@@ -1867,7 +1866,7 @@
<y>101</y>
<height>15</height>
<width>96</width>
<format>[general]</format>
<format>##0</format>
<html>
<valueishtml>0</valueishtml>
</html>
......@@ -1877,8 +1876,7 @@
<limit>3</limit>
<case>any</case>
<focusrectangle>no</focusrectangle>
<autoselect>yes</autoselect>
<autohscroll>yes</autohscroll>
<autoselect>no</autoselect>
<imemode>0</imemode>
</EditStyle>
<font>
......
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