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 ...@@ -123,6 +123,36 @@ public class EmployeeServicePrdAmdIC extends ValidatorEJB implements EmployeeSer
} }
else 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"; sql = "select count(*) as count ,STATUS ,relieve_date from employee where emp_code = ? GROUP BY STATUS,relieve_date";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode); pstmt.setString(1, empCode);
...@@ -181,6 +211,20 @@ public class EmployeeServicePrdAmdIC extends ValidatorEJB implements EmployeeSer ...@@ -181,6 +211,20 @@ public class EmployeeServicePrdAmdIC extends ValidatorEJB implements EmployeeSer
if("period_amended".equalsIgnoreCase(childNodeName)) if("period_amended".equalsIgnoreCase(childNodeName))
{ {
periodAmended = checkNull(genericUtility.getColumnValue("period_amended", dom)); 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(""); System.out.println("");
try try
{ {
...@@ -190,7 +234,7 @@ public class EmployeeServicePrdAmdIC extends ValidatorEJB implements EmployeeSer ...@@ -190,7 +234,7 @@ public class EmployeeServicePrdAmdIC extends ValidatorEJB implements EmployeeSer
{ {
periodAmd = 0; periodAmd = 0;
e.getMessage(); e.getMessage();
throw new ITMException(e); //throw new ITMException(e);
} }
if(periodAmd <= 0) if(periodAmd <= 0)
...@@ -383,7 +427,7 @@ public class EmployeeServicePrdAmdIC extends ValidatorEJB implements EmployeeSer ...@@ -383,7 +427,7 @@ public class EmployeeServicePrdAmdIC extends ValidatorEJB implements EmployeeSer
SimpleDateFormat sdf = null; SimpleDateFormat sdf = null;
int retAgeOld = 0; int retAgeOld = 0;
Date retierDateOld = null; Date retierDateOld = null;
double retAgeNew = 0; int retAgeNew = 0;
Timestamp retDateOld = null,birthDate = null; Timestamp retDateOld = null,birthDate = null;
String empCode = "",fName = "",lName = "",mName = "",periodAmended = "",amendmentType = "",dateAf = "",retdateN = "",retdateO = "",birthDt = ""; String empCode = "",fName = "",lName = "",mName = "",periodAmended = "",amendmentType = "",dateAf = "",retdateN = "",retdateO = "",birthDt = "";
String retDtO = "",retAgeO = "",retirementDateVarVal = ""; String retDtO = "",retAgeO = "",retirementDateVarVal = "";
...@@ -522,6 +566,9 @@ public class EmployeeServicePrdAmdIC extends ValidatorEJB implements EmployeeSer ...@@ -522,6 +566,9 @@ public class EmployeeServicePrdAmdIC extends ValidatorEJB implements EmployeeSer
else if(currentColumn.trim().equalsIgnoreCase("period_amended")) else if(currentColumn.trim().equalsIgnoreCase("period_amended"))
{ {
System.out.println("Inside period_amended itemchange:::::"); 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); periodAmended = genericUtility.getColumnValue("period_amended", dom);
amendmentType = genericUtility.getColumnValue("amendment_type", dom); amendmentType = genericUtility.getColumnValue("amendment_type", dom);
retDtO = genericUtility.getColumnValue("retirement_date_o", dom); retDtO = genericUtility.getColumnValue("retirement_date_o", dom);
...@@ -535,7 +582,7 @@ public class EmployeeServicePrdAmdIC extends ValidatorEJB implements EmployeeSer ...@@ -535,7 +582,7 @@ public class EmployeeServicePrdAmdIC extends ValidatorEJB implements EmployeeSer
catch (Exception e) catch (Exception e)
{ {
e.getMessage(); e.getMessage();
throw new ITMException(e); //throw new ITMException(e);
} }
Timestamp todayDt = new Timestamp(System.currentTimeMillis()); Timestamp todayDt = new Timestamp(System.currentTimeMillis());
//retirementDateVarVal = checkNull(admCommon.getSiteEnv("99999","ADM","X","ZZZZZ","RETIREMENT_DATE",todayDt,conn)); //retirementDateVarVal = checkNull(admCommon.getSiteEnv("99999","ADM","X","ZZZZZ","RETIREMENT_DATE",todayDt,conn));
......
...@@ -115,7 +115,32 @@ public class EmployeeServicePrdAmdConf extends ActionHandlerEJB implements Emplo ...@@ -115,7 +115,32 @@ public class EmployeeServicePrdAmdConf extends ActionHandlerEJB implements Emplo
} }
else 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 = ?"; sql = "select status,relieve_date from employee where emp_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode); pstmt.setString(1, empCode);
......
...@@ -107,7 +107,16 @@ commit; ...@@ -107,7 +107,16 @@ commit;
--------Modified by Rohini T on [19/04/19][End]--------------------------------------------------- --------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 @@ ...@@ -636,7 +636,7 @@
<y>80</y> <y>80</y>
<height>15</height> <height>15</height>
<width>42</width> <width>42</width>
<format>[general]</format> <format>##0</format>
<html> <html>
<valueishtml>0</valueishtml> <valueishtml>0</valueishtml>
</html> </html>
...@@ -646,8 +646,7 @@ ...@@ -646,8 +646,7 @@
<limit>3</limit> <limit>3</limit>
<case>any</case> <case>any</case>
<focusrectangle>no</focusrectangle> <focusrectangle>no</focusrectangle>
<autoselect>yes</autoselect> <autoselect>no</autoselect>
<autohscroll>yes</autohscroll>
<imemode>0</imemode> <imemode>0</imemode>
</EditStyle> </EditStyle>
<font> <font>
...@@ -730,7 +729,7 @@ ...@@ -730,7 +729,7 @@
<y>122</y> <y>122</y>
<height>15</height> <height>15</height>
<width>42</width> <width>42</width>
<format>[general]</format> <format>##0</format>
<html> <html>
<valueishtml>0</valueishtml> <valueishtml>0</valueishtml>
</html> </html>
...@@ -740,8 +739,7 @@ ...@@ -740,8 +739,7 @@
<limit>3</limit> <limit>3</limit>
<case>any</case> <case>any</case>
<focusrectangle>no</focusrectangle> <focusrectangle>no</focusrectangle>
<autoselect>yes</autoselect> <autoselect>no</autoselect>
<autohscroll>yes</autohscroll>
<imemode>0</imemode> <imemode>0</imemode>
</EditStyle> </EditStyle>
<font> <font>
...@@ -796,13 +794,14 @@ ...@@ -796,13 +794,14 @@
<y>122</y> <y>122</y>
<height>15</height> <height>15</height>
<width>118</width> <width>118</width>
<format>[general]</format> <format>dd/mm/yy</format>
<html> <html>
<valueishtml>0</valueishtml> <valueishtml>0</valueishtml>
</html> </html>
<name>retirement_date_n</name> <name>retirement_date_n</name>
<visible>1</visible> <visible>1</visible>
<EditStyle style="editmask"> <EditStyle style="editmask">
<useformat>yes</useformat>
<mask>dd/mm/yy</mask> <mask>dd/mm/yy</mask>
<imemode>0</imemode> <imemode>0</imemode>
<focusrectangle>no</focusrectangle> <focusrectangle>no</focusrectangle>
...@@ -1356,7 +1355,7 @@ ...@@ -1356,7 +1355,7 @@
<y>80</y> <y>80</y>
<height>15</height> <height>15</height>
<width>118</width> <width>118</width>
<format>[general]</format> <format>dd/mm/yy</format>
<html> <html>
<valueishtml>0</valueishtml> <valueishtml>0</valueishtml>
</html> </html>
...@@ -1867,7 +1866,7 @@ ...@@ -1867,7 +1866,7 @@
<y>101</y> <y>101</y>
<height>15</height> <height>15</height>
<width>96</width> <width>96</width>
<format>[general]</format> <format>##0</format>
<html> <html>
<valueishtml>0</valueishtml> <valueishtml>0</valueishtml>
</html> </html>
...@@ -1877,8 +1876,7 @@ ...@@ -1877,8 +1876,7 @@
<limit>3</limit> <limit>3</limit>
<case>any</case> <case>any</case>
<focusrectangle>no</focusrectangle> <focusrectangle>no</focusrectangle>
<autoselect>yes</autoselect> <autoselect>no</autoselect>
<autohscroll>yes</autohscroll>
<imemode>0</imemode> <imemode>0</imemode>
</EditStyle> </EditStyle>
<font> <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