Commit 3f8caab7 authored by bsatyanarayana-nisum-com's avatar bsatyanarayana-nisum-com Committed by rbonthala-nisum-com

MT-167_1 :SNS :: Able_to_see_attendance_report_shift_wiseChanges (#170)

parent a54c15af
...@@ -38,29 +38,29 @@ public class AttendanceServiceImpl implements AttendanceService { ...@@ -38,29 +38,29 @@ public class AttendanceServiceImpl implements AttendanceService {
} }
private List<AttendenceData> getEmpsAttendenceByShiftWise(String reportDate,String shift) throws MyTimeException { private List<AttendenceData> getEmpsAttendenceByShiftWise(String reportDate,String shift) throws MyTimeException {
String query = null;
List<String> presentList = null;
List<String> empIdList = null;
List<AttendenceData> listOfEmployees = new ArrayList<AttendenceData>(); List<AttendenceData> listOfEmployees = new ArrayList<AttendenceData>();
Optional<List<ProjectTeamMate>> list = findEmpIdsByShiftWise(shift); Optional<List<ProjectTeamMate>> list = findEmpIdsByShiftWise(shift);
if(list.isPresent()) { if(list.isPresent()) {
empIdList = list.get().stream() List<String> empIdList = list.get().stream()
.map(ProjectTeamMate::getEmployeeId) .map(ProjectTeamMate::getEmployeeId)
.collect(Collectors.toList()); .collect(Collectors.toList());
if(null != empIdList && empIdList.size() == MyTimeUtils.INT_ZERO) {
return listOfEmployees;
}
String query = buildSqlQuery(reportDate,empIdList.toString().substring(1, empIdList.toString().length()-1),MyTimeUtils.PRESENT);
listOfEmployees.addAll(getAttendenceData(query));
List<String> presentList = listOfEmployees.stream().map(AttendenceData :: getEmployeeId).collect(Collectors.toList());
empIdList.removeAll(presentList);
if(empIdList.size()>0) {
query = buildSqlQuery(reportDate, empIdList.toString().substring(1, empIdList.toString().length()-1), MyTimeUtils.ABSENT);
listOfEmployees .addAll(getAttendenceData(query));
}
} }
query = buildSqlQuery(reportDate,empIdList.toString().substring(1, empIdList.toString().length()-1),MyTimeUtils.PRESENT);
listOfEmployees .addAll(getAttendenceData(query));
presentList = listOfEmployees.stream().map(AttendenceData :: getEmployeeId).collect(Collectors.toList());
empIdList.removeAll(presentList);
System.out.println("Absent List :: "+empIdList);
query = buildSqlQuery(reportDate, empIdList.toString().substring(1, empIdList.toString().length()-1), MyTimeUtils.ABSENT);
listOfEmployees .addAll(getAttendenceData(query));
return listOfEmployees; return listOfEmployees;
} }
......
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