Commit e129fab3 authored by akhokar's avatar akhokar

Changes done in shift validation to display error message when shift is not valid.

AttendanceDailyIC.java
attd_daily21.xml
A18LSUN010.sql
d_daily_attd_edit.srd


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@205145 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 07d789f7
...@@ -636,6 +636,10 @@ public class AttendanceDailyIC extends ValidatorEJB implements AttendanceDailyIC ...@@ -636,6 +636,10 @@ public class AttendanceDailyIC extends ValidatorEJB implements AttendanceDailyIC
String childNodeName = ""; String childNodeName = "";
int childNodeLength = 0; int childNodeLength = 0;
int ctr=0; int ctr=0;
//Modified by Azhar K. on [13-Aug-2019][To validate shift if not valid or blank][Start]
int cnt = 0;
String dayNo = "",empSiteCode = "";
//Modified by Azhar K. on [13-Aug-2019][To validate shift if not valid or blank][End]
String childNodeValue = ""; String childNodeValue = "";
String attdDateStr = ""; String attdDateStr = "";
String userId = "", loginSite = ""; String userId = "", loginSite = "";
...@@ -903,12 +907,83 @@ public class AttendanceDailyIC extends ValidatorEJB implements AttendanceDailyIC ...@@ -903,12 +907,83 @@ public class AttendanceDailyIC extends ValidatorEJB implements AttendanceDailyIC
{ {
System.out.println("Inside shift Validation:::::::"); System.out.println("Inside shift Validation:::::::");
mVal = checkNull(genericUtility.getColumnValue("shift", dom)); mVal = checkNull(genericUtility.getColumnValue("shift", dom));
if(mVal == null || mVal.trim().length() == 0) if(mVal == null || mVal.trim().length() == 0)
{ {
errCode = itmDBAccessEJB.getErrorString("", "VMSHIFT", userId, "", conn); errCode = itmDBAccessEJB.getErrorString("", "VMSHIFT", userId, "", conn);
break; break;
} }
//Modified by Azhar K. on [13-Aug-2019][To validate shift if not valid or blank][Start]
mVal1 = checkNull(genericUtility.getColumnValue("emp_code", dom));
attdDateStr= checkNull(genericUtility.getColumnValue("attd_date", dom));
if(attdDateStr != null && attdDateStr.trim().length() > 0)
{
mattdDate = Timestamp.valueOf(genericUtility.getValidDateString(attdDateStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
}
sql = "select to_char(to_date(?,'dd/MM/yy'),'D') day_no from dual";
System.out.println("The Value of the Query is :-->" + sql);
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, attdDateStr);
rs = pstmt.executeQuery();
while (rs.next())
{
dayNo = rs.getString("day_no");
}
System.out.println("::dayNo>>> " + dayNo);
close(rs, pstmt);
sql = "Select COUNT(*) AS CNT From Workshft Where shift = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,mVal);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt("CNT");
}
System.out.println("cnt value for shift valid or not>>"+cnt);
close(rs, pstmt);
if(cnt == 0)
{
errCode = itmDBAccessEJB.getErrorString("", "VTSHIFTINV", userId, "", conn);
break;
}
sql = "select ddf_hr_status(?,?,?) AS WORK_SITE from dual";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,mVal1);
pstmt.setTimestamp(2,mattdDate);
pstmt.setString(3,"S");
System.out.println("strSQlQuery::>>ddf_hr_status(?,?,?)"+sql);
rs = pstmt.executeQuery();
if(rs.next())
{
empSiteCode=checkNull(rs.getString("WORK_SITE"));
}
System.out.println("@vinay::value of empSiteCode>>"+empSiteCode);
close(rs, pstmt);
sql = "Select COUNT(*) AS CNT From Workshft Where shift=? AND Day_No=? AND SITE_CODE=? AND STATUS=? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,mVal);
pstmt.setString(2,dayNo);
pstmt.setString(3,empSiteCode);
pstmt.setString(4,"A");
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt("CNT");
}
System.out.println("value of CNT >>"+cnt);
close(rs, pstmt);
if(cnt == 0)
{
errCode = itmDBAccessEJB.getErrorString("", "VTSHIFTCOM", userId, "", conn);
break;
}
//Modified by Azhar K. on [13-Aug-2019][To validate shift if not valid or blank][End]
} }
if(errCode != null && errCode.trim().length() > 0) if(errCode != null && errCode.trim().length() > 0)
{ {
......
...@@ -83,6 +83,12 @@ Insert into pophelp (FIELD_NAME,MOD_NAME,SQL_STR,DW_OBJECT,MSG_TITLE,WIDTH,HEIGH ...@@ -83,6 +83,12 @@ Insert into pophelp (FIELD_NAME,MOD_NAME,SQL_STR,DW_OBJECT,MSG_TITLE,WIDTH,HEIGH
-------------For messages table--------------------------------------------
update messages set msg_type='E' where msg_no='VMSHIFT';
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 ('VTSHIFTINV','Invalid Shift','Shift not defined in master please define the shift in Master!','E','Y',null,null,null,to_timestamp('16-MAY-08','DD-MON-RR HH.MI.SSXFF AM'),'VISHAL ','VISHAL ',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 ('VTSHIFTCOM','Invalid workshift','Work shift not defined in master or site code of work shift doesn''t match with employee''s work site!','E','Y',null,null,null,to_timestamp('16-MAY-08','DD-MON-RR HH.MI.SSXFF AM'),'VISHAL ','VISHAL ',null,null);
......
...@@ -516,7 +516,7 @@ ...@@ -516,7 +516,7 @@
<band>Detail</band> <band>Detail</band>
<id>16</id> <id>16</id>
<alignment>0</alignment> <alignment>0</alignment>
<tabsequence>40</tabsequence> <tabsequence>50</tabsequence>
<border>5</border> <border>5</border>
<color>0</color> <color>0</color>
<x>360</x> <x>360</x>
...@@ -648,7 +648,7 @@ ...@@ -648,7 +648,7 @@
<band>Detail</band> <band>Detail</band>
<id>19</id> <id>19</id>
<alignment>0</alignment> <alignment>0</alignment>
<tabsequence>60</tabsequence> <tabsequence>70</tabsequence>
<border>5</border> <border>5</border>
<color>0</color> <color>0</color>
<x>361</x> <x>361</x>
...@@ -1037,7 +1037,7 @@ ...@@ -1037,7 +1037,7 @@
<band>Detail</band> <band>Detail</band>
<id>22</id> <id>22</id>
<alignment>0</alignment> <alignment>0</alignment>
<tabsequence>70</tabsequence> <tabsequence>80</tabsequence>
<border>0</border> <border>0</border>
<color>0</color> <color>0</color>
<x>143</x> <x>143</x>
...@@ -1176,7 +1176,7 @@ ...@@ -1176,7 +1176,7 @@
<band>Detail</band> <band>Detail</band>
<id>15</id> <id>15</id>
<alignment>0</alignment> <alignment>0</alignment>
<tabsequence>30</tabsequence> <tabsequence>40</tabsequence>
<border>5</border> <border>5</border>
<color>0</color> <color>0</color>
<x>146</x> <x>146</x>
...@@ -1242,7 +1242,7 @@ ...@@ -1242,7 +1242,7 @@
<band>Detail</band> <band>Detail</band>
<id>13</id> <id>13</id>
<alignment>0</alignment> <alignment>0</alignment>
<tabsequence>50</tabsequence> <tabsequence>60</tabsequence>
<border>5</border> <border>5</border>
<color>0</color> <color>0</color>
<x>146</x> <x>146</x>
...@@ -1564,7 +1564,7 @@ ...@@ -1564,7 +1564,7 @@
<band>Detail</band> <band>Detail</band>
<id>7</id> <id>7</id>
<alignment>0</alignment> <alignment>0</alignment>
<tabsequence>32766</tabsequence> <tabsequence>30</tabsequence>
<border>5</border> <border>5</border>
<color>255</color> <color>255</color>
<x>146</x> <x>146</x>
......
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