diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/GccAttendanceApplication.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/GccAttendanceApplication.java index a7a93dd..0124786 100644 --- a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/GccAttendanceApplication.java +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/GccAttendanceApplication.java @@ -1,15 +1,20 @@ package com.gcc.biometric.api.GccBioMetricApi; + import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; + + + @SpringBootApplication public class GccAttendanceApplication{ + public static void main(String[] args) { SpringApplication.run(GccAttendanceApplication.class, args); diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMRAbsenteesEmpListDataController.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMRAbsenteesEmpListDataController.java index 98d010b..4ee3572 100644 --- a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMRAbsenteesEmpListDataController.java +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMRAbsenteesEmpListDataController.java @@ -15,7 +15,6 @@ import org.springframework.web.bind.annotation.RestController; import com.gcc.biometric.api.GccBioMetricApi.repo.nmr.NMRAbsenteesEmpListDataRepository; - @RestController @RequestMapping("/gcc.com/NMR") public class NMRAbsenteesEmpListDataController { @@ -59,9 +58,10 @@ public class NMRAbsenteesEmpListDataController { System.out.println(AbsentUserId.size()); for (int i = 0; i < AbsentUserId.size(); i++) { - + AbsentUserName.add(nMRAbsenteesEmpListDataRepository.getAbsentDivUserName(AbsentUserId.get(i)).trim()); - AbsentUserDesignation.add(nMRAbsenteesEmpListDataRepository.getAbsentDivDesignation(AbsentUserId.get(i)).trim()); + AbsentUserDesignation + .add(nMRAbsenteesEmpListDataRepository.getAbsentDivDesignation(AbsentUserId.get(i)).trim()); } // System.out.println(PunchedUserName); @@ -348,7 +348,7 @@ public class NMRAbsenteesEmpListDataController { // // ----------------------Department office Enrolled--------------------------- - @GetMapping({"/getDeptAbsentEmpList/{dept}/{tempDate}" }) + @GetMapping({ "/getDeptAbsentEmpList/{dept}/{tempDate}" }) public List> getDeptPunchedEmpList(@PathVariable String dept, @PathVariable final String tempDate) { @@ -427,7 +427,7 @@ public class NMRAbsenteesEmpListDataController { // // ----------------------RDC office Enrolled--------------------------- - @GetMapping({"/getRDCAbsentEmpList/{zone}/{tempDate}" }) + @GetMapping({ "/getRDCAbsentEmpList/{zone}/{tempDate}" }) public List> getRDCPunchedEmpList(@PathVariable Integer zone, @PathVariable final String tempDate) { @@ -503,795 +503,881 @@ public class NMRAbsenteesEmpListDataController { return listMap; } - - // ----------------------LFZ----------------------------------------- - -@GetMapping({ "/getLFZAbsentEmpList/{zone}/{tempDate}" }) -public List> getLFZAbsentEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { - - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); - } - - System.out.println(date); - System.out.println(zoneValue); - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nMRAbsenteesEmpListDataRepository.getAbsentLFZUserId(zoneValue, date); + // ----------------------LFZ----------------------------------------- - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } + @GetMapping({ "/getLFZAbsentEmpList/{zone}/{tempDate}" }) + public List> getLFZAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { - System.out.println(PunchedUserId.size()); + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nMRAbsenteesEmpListDataRepository.getAbsentLFZUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nMRAbsenteesEmpListDataRepository.getAbsentLFZDesignation(PunchedUserId.get(i)).trim()); - } + System.out.println(date); + System.out.println(zoneValue); -// System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); -// System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRAbsenteesEmpListDataRepository.getAbsentLFZUserId(zoneValue, date); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { + ArrayList PunchedUserId = new ArrayList(); for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); - } - listMap.add(map); + PunchedUserId.add(tempPunchedUserId.get(i).trim()); } - System.out.println("Printed"); - return listMap; - } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; - -} - - - // ----------------------PRINTING PRESS----------------------------------------- - -@GetMapping({ "/getPPAbsentEmpList/{zone}/{tempDate}" }) -public List> getPPAbsentEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { - - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); - } - - System.out.println(date); - System.out.println(zoneValue); - - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nMRAbsenteesEmpListDataRepository.getAbsentPPUserId(zoneValue, date); - - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } - - System.out.println(PunchedUserId.size()); + System.out.println(PunchedUserId.size()); - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nMRAbsenteesEmpListDataRepository.getAbsentPPUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nMRAbsenteesEmpListDataRepository.getAbsentPPDesignation(PunchedUserId.get(i)).trim()); - } + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRAbsenteesEmpListDataRepository.getAbsentLFZUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRAbsenteesEmpListDataRepository.getAbsentLFZDesignation(PunchedUserId.get(i)).trim()); + } // System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); + System.out.println(PunchedUserName.size()); // System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); + System.out.println(PunchedUserDesignation.size()); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { - for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); } - listMap.add(map); - } + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); System.out.println("Printed"); return listMap; - } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; - -} - // ----------------------NORTH CHENNAI DEPOT----------------------------------------- - -@GetMapping({ "/getNCDAbsentEmpList/{zone}/{tempDate}" }) -public List> getNCDPunchedEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { - - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); } - System.out.println(date); - System.out.println(zoneValue); - - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nMRAbsenteesEmpListDataRepository.getAbsentNCDUserId(zoneValue, date); + // ----------------------PRINTING PRESS----------------------------------------- - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } + @GetMapping({ "/getPPAbsentEmpList/{zone}/{tempDate}" }) + public List> getPPAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { - System.out.println(PunchedUserId.size()); + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nMRAbsenteesEmpListDataRepository.getAbsentNCDUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nMRAbsenteesEmpListDataRepository.getAbsentNCDDesignation(PunchedUserId.get(i)).trim()); - } + System.out.println(date); + System.out.println(zoneValue); -// System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); -// System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRAbsenteesEmpListDataRepository.getAbsentPPUserId(zoneValue, date); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { + ArrayList PunchedUserId = new ArrayList(); for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); - } - listMap.add(map); + PunchedUserId.add(tempPunchedUserId.get(i).trim()); } - System.out.println("Printed"); - return listMap; - } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; - -} - - // ----------------------TASK FORCE----------------------------------------- - -@GetMapping({ "/getTFAbsentEmpList/{zone}/{tempDate}" }) -public List> getTFAbsentEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { - - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); - } - - System.out.println(date); - System.out.println(zoneValue); - - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nMRAbsenteesEmpListDataRepository.getAbsentTFUserId(zoneValue, date); - - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } - - System.out.println(PunchedUserId.size()); + System.out.println(PunchedUserId.size()); - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nMRAbsenteesEmpListDataRepository.getAbsentTFUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nMRAbsenteesEmpListDataRepository.getAbsentTFDesignation(PunchedUserId.get(i)).trim()); - } + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRAbsenteesEmpListDataRepository.getAbsentPPUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRAbsenteesEmpListDataRepository.getAbsentPPDesignation(PunchedUserId.get(i)).trim()); + } // System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); + System.out.println(PunchedUserName.size()); // System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); + System.out.println(PunchedUserDesignation.size()); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { - for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); } - listMap.add(map); - } + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); System.out.println("Printed"); return listMap; + } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; -} + // ----------------------NORTH CHENNAI + // DEPOT----------------------------------------- - // ----------------------TPF----------------------------------------- - -@GetMapping({ "/getTPFAbsentEmpList/{zone}/{tempDate}" }) -public List> getTPFAbsentEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { - - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); - } + @GetMapping({ "/getNCDAbsentEmpList/{zone}/{tempDate}" }) + public List> getNCDPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } - System.out.println(date); - System.out.println(zoneValue); + System.out.println(date); + System.out.println(zoneValue); - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nMRAbsenteesEmpListDataRepository.getAbsentTPFUserId(zoneValue, date); + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRAbsenteesEmpListDataRepository.getAbsentNCDUserId(zoneValue, date); - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } - System.out.println(PunchedUserId.size()); + System.out.println(PunchedUserId.size()); - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nMRAbsenteesEmpListDataRepository.getAbsentTPFUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nMRAbsenteesEmpListDataRepository.getAbsentTPFDesignation(PunchedUserId.get(i)).trim()); - } + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRAbsenteesEmpListDataRepository.getAbsentNCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRAbsenteesEmpListDataRepository.getAbsentNCDDesignation(PunchedUserId.get(i)).trim()); + } // System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); + System.out.println(PunchedUserName.size()); // System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); + System.out.println(PunchedUserDesignation.size()); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { - for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); } - listMap.add(map); - } + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); System.out.println("Printed"); return listMap; - } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; -} - - // ----------------------CENTRAL CHENNAI DEPOT----------------------------------------- - -@GetMapping({ "/getCCDAbsentEmpList/{zone}/{tempDate}" }) -public List> getCCDAbsentEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { - - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); } - System.out.println(date); - System.out.println(zoneValue); - - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nMRAbsenteesEmpListDataRepository.getAbsentCCDUserId(zoneValue, date); + // ----------------------TASK FORCE----------------------------------------- - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } + @GetMapping({ "/getTFAbsentEmpList/{zone}/{tempDate}" }) + public List> getTFAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { - System.out.println(PunchedUserId.size()); + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nMRAbsenteesEmpListDataRepository.getAbsentCCDUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nMRAbsenteesEmpListDataRepository.getAbsentCCDDesignation(PunchedUserId.get(i)).trim()); - } + System.out.println(date); + System.out.println(zoneValue); -// System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); -// System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRAbsenteesEmpListDataRepository.getAbsentTFUserId(zoneValue, date); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { + ArrayList PunchedUserId = new ArrayList(); for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); - } - listMap.add(map); + PunchedUserId.add(tempPunchedUserId.get(i).trim()); } - System.out.println("Printed"); - return listMap; - } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; + System.out.println(PunchedUserId.size()); -} + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRAbsenteesEmpListDataRepository.getAbsentTFUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRAbsenteesEmpListDataRepository.getAbsentTFDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------TPF----------------------------------------- + + @GetMapping({ "/getTPFAbsentEmpList/{zone}/{tempDate}" }) + public List> getTPFAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRAbsenteesEmpListDataRepository.getAbsentTPFUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRAbsenteesEmpListDataRepository.getAbsentTPFUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRAbsenteesEmpListDataRepository.getAbsentTPFDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------CENTRAL CHENNAI + // DEPOT----------------------------------------- + + @GetMapping({ "/getCCDAbsentEmpList/{zone}/{tempDate}" }) + public List> getCCDAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRAbsenteesEmpListDataRepository.getAbsentCCDUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRAbsenteesEmpListDataRepository.getAbsentCCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRAbsenteesEmpListDataRepository.getAbsentCCDDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } // ----------------------PDG----------------------------------------- - -@GetMapping({ "/getPDGAbsentEmpList/{zone}/{tempDate}" }) -public List> getPDGAbsentEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { - - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); + + @GetMapping({ "/getPDGAbsentEmpList/{zone}/{tempDate}" }) + public List> getPDGAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRAbsenteesEmpListDataRepository.getAbsentPDGUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRAbsenteesEmpListDataRepository.getAbsentPDGUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRAbsenteesEmpListDataRepository.getAbsentPDGDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } - System.out.println(date); - System.out.println(zoneValue); + // ----------------------SOUTH CHENNAI DEPOT + // SCD----------------------------------------- + + @GetMapping({ "/getSCDAbsentEmpList/{zone}/{tempDate}" }) + public List> getSCDAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nMRAbsenteesEmpListDataRepository.getAbsentPDGUserId(zoneValue, date); + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRAbsenteesEmpListDataRepository.getAbsentSCDUserId(zoneValue, date); - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } - System.out.println(PunchedUserId.size()); + System.out.println(PunchedUserId.size()); - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nMRAbsenteesEmpListDataRepository.getAbsentPDGUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nMRAbsenteesEmpListDataRepository.getAbsentPDGDesignation(PunchedUserId.get(i)).trim()); - } + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRAbsenteesEmpListDataRepository.getAbsentSCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRAbsenteesEmpListDataRepository.getAbsentSCDDesignation(PunchedUserId.get(i)).trim()); + } // System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); + System.out.println(PunchedUserName.size()); // System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); + System.out.println(PunchedUserDesignation.size()); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { - for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); } - listMap.add(map); - } + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); System.out.println("Printed"); return listMap; - } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; -} + } - // ----------------------SOUTH CHENNAI DEPOT SCD----------------------------------------- + // ----------------------INSPECTION + // VEHICLE----------------------------------------- -@GetMapping({ "/getSCDAbsentEmpList/{zone}/{tempDate}" }) -public List> getSCDAbsentEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { + @GetMapping({ "/getIVAbsentEmpList/{zone}/{tempDate}" }) + public List> getIVAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); - } + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } - System.out.println(date); - System.out.println(zoneValue); + System.out.println(date); + System.out.println(zoneValue); - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nMRAbsenteesEmpListDataRepository.getAbsentSCDUserId(zoneValue, date); + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRAbsenteesEmpListDataRepository.getAbsentIVUserId(zoneValue, date); - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } - System.out.println(PunchedUserId.size()); + System.out.println(PunchedUserId.size()); - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nMRAbsenteesEmpListDataRepository.getAbsentSCDUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nMRAbsenteesEmpListDataRepository.getAbsentSCDDesignation(PunchedUserId.get(i)).trim()); - } + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRAbsenteesEmpListDataRepository.getAbsentIVUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRAbsenteesEmpListDataRepository.getAbsentIVDesignation(PunchedUserId.get(i)).trim()); + } // System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); + System.out.println(PunchedUserName.size()); // System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); + System.out.println(PunchedUserDesignation.size()); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { - for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); } - listMap.add(map); - } + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); System.out.println("Printed"); return listMap; + } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; -} + // ----------------------KDG----------------------------------------- - // ----------------------INSPECTION VEHICLE----------------------------------------- - -@GetMapping({ "/getIVAbsentEmpList/{zone}/{tempDate}" }) -public List> getIVAbsentEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { - - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); - } + @GetMapping({ "/getKDGAbsentEmpList/{zone}/{tempDate}" }) + public List> getKDGAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } - System.out.println(date); - System.out.println(zoneValue); + System.out.println(date); + System.out.println(zoneValue); - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nMRAbsenteesEmpListDataRepository.getAbsentIVUserId(zoneValue, date); + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRAbsenteesEmpListDataRepository.getAbsentKDGUserId(zoneValue, date); - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } - System.out.println(PunchedUserId.size()); + System.out.println(PunchedUserId.size()); - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nMRAbsenteesEmpListDataRepository.getAbsentIVUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nMRAbsenteesEmpListDataRepository.getAbsentIVDesignation(PunchedUserId.get(i)).trim()); - } + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRAbsenteesEmpListDataRepository.getAbsentKDGUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRAbsenteesEmpListDataRepository.getAbsentKDGDesignation(PunchedUserId.get(i)).trim()); + } // System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); + System.out.println(PunchedUserName.size()); // System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); + System.out.println(PunchedUserDesignation.size()); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { - for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); } - listMap.add(map); - } + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); System.out.println("Printed"); return listMap; - } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; -} + } - // ----------------------KDG----------------------------------------- +// ----------------------Designation----------------------------------------- -@GetMapping({ "/getKDGAbsentEmpList/{zone}/{tempDate}" }) -public List> getKDGAbsentEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { + @GetMapping({ "/getDESIGAbsentEmpList/{designation}/{tempDate}" }) + public List> getDESIGAbsentEmpList(@PathVariable String designation, + @PathVariable final String tempDate) { - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); - } + String desigValue = designation; + if(designation.equals("NA")) + { + desigValue = ""; + } + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } - System.out.println(date); - System.out.println(zoneValue); + System.out.println(date); + System.out.println(desigValue); - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nMRAbsenteesEmpListDataRepository.getAbsentKDGUserId(zoneValue, date); + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRAbsenteesEmpListDataRepository.getAbsentDESIGUserId(desigValue, date); - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } - System.out.println(PunchedUserId.size()); + System.out.println(PunchedUserId.size()); - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nMRAbsenteesEmpListDataRepository.getAbsentKDGUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nMRAbsenteesEmpListDataRepository.getAbsentKDGDesignation(PunchedUserId.get(i)).trim()); - } + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRAbsenteesEmpListDataRepository.getAbsentDESIGUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRAbsenteesEmpListDataRepository.getAbsentDESIGDesignation(PunchedUserId.get(i)).trim()); + } -// System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); -// System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); +//System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +//System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { - for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); } - listMap.add(map); - } + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); System.out.println("Printed"); return listMap; - } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; -} + } } diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMRDesignationEnrolledPunchedRestController.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMRDesignationEnrolledPunchedRestController.java new file mode 100644 index 0000000..87198ce --- /dev/null +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMRDesignationEnrolledPunchedRestController.java @@ -0,0 +1,127 @@ +package com.gcc.biometric.api.GccBioMetricApi.controller.nmr; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import com.gcc.biometric.api.GccBioMetricApi.repo.nmr.NMRDesignationEnrolledPunchedRepository; + +@RestController +@RequestMapping("/gcc.com/NMR") +public class NMRDesignationEnrolledPunchedRestController { + + @Autowired + private NMRDesignationEnrolledPunchedRepository nMRDesignationEnrolledPunchedRepository; + + // inject employee dao + @Autowired + public NMRDesignationEnrolledPunchedRestController( + NMRDesignationEnrolledPunchedRepository theNMRDesignationEnrolledPunchedRepository) { + nMRDesignationEnrolledPunchedRepository = theNMRDesignationEnrolledPunchedRepository; + } + + ArrayList enrolledCounts; + ArrayList punchedCounts; + + ArrayList allDesignations; + ArrayList designationsAsPerDate; + + @GetMapping("/DesignationCountPresentAbsentPercentage/{tempDate}") + public ResponseEntity>> getHeadQuaterDepartmentOfficeDate(@PathVariable String tempDate) + { + System.out.println("Inside getHeadQuaterDepartmentOfficeDate() method!"); + + //Department Office + + System.out.println("for HQ Department Office Data"); + + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + + e.printStackTrace(); + } + + System.out.println(date); + + + ArrayList allDesignations; + ArrayList allDesignationsAsPerDate; + ArrayList desigEnrolled; + ArrayList desigPunched; + + allDesignations = nMRDesignationEnrolledPunchedRepository.getAllDesignations(); + allDesignationsAsPerDate = nMRDesignationEnrolledPunchedRepository.getDesignationsAsPerDate(date); + + desigPunched = nMRDesignationEnrolledPunchedRepository.getDesigPunched(date); + + + System.out.println("All Designations: "+allDesignations); + System.out.println("All Designations as per date: "+allDesignationsAsPerDate); + desigEnrolled = nMRDesignationEnrolledPunchedRepository.getDesigEnrolled(); + System.out.println("Enrolled: "+desigEnrolled); + System.out.println("Punched: "+desigPunched); + + + String divAbsent = null; + String divPercentage = null; + Integer j = 0; + + List> listMap = new ArrayList>(); + for (int i = 0; i myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Designation"); myListValue.add(allDesignations.get(i).trim()); + myListKey.add("Enrolled"); myListValue.add(desigEnrolled.get(i)); + + if (allDesignationsAsPerDate.contains(allDesignations.get(i))) + { + myListKey.add("Punched"); myListValue.add(desigPunched.get(j)); + Integer xDivAbsent = Integer.parseInt(desigEnrolled.get(i)) - Integer.parseInt(desigPunched.get(j)); + Integer xdivPercentage = ((Integer.parseInt((desigPunched.get(j))) *100)/ Integer.parseInt(desigEnrolled.get(i))); + divAbsent = xDivAbsent.toString(); + divPercentage = xdivPercentage.toString(); + j++; + } + + else + { + myListKey.add("Punched"); myListValue.add("0"); + divAbsent = desigEnrolled.get(i); + divPercentage = "0"; + } + + myListKey.add("Absent"); myListValue.add(divAbsent); + myListKey.add("Percentage"); myListValue.add(divPercentage); + + Map map = new LinkedHashMap<>(); + for(int x=0;x> getDESIGEnrolledEmpList(@PathVariable String designation) { + + String desigValue = designation; + if(designation.equals("NA")) + { + desigValue = ""; + } + + System.out.println(desigValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMREnrolledEmpListDataRepository.getEnrolledDesigUserId(desigValue); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMREnrolledEmpListDataRepository.getEnrolledKDGUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMREnrolledEmpListDataRepository.getEnrolledKDGDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } } diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMRPunchedEmpListDataController.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMRPunchedEmpListDataController.java index 86ab3d1..50a85c1 100644 --- a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMRPunchedEmpListDataController.java +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMRPunchedEmpListDataController.java @@ -15,7 +15,6 @@ import org.springframework.web.bind.annotation.RestController; import com.gcc.biometric.api.GccBioMetricApi.repo.nmr.NMRPunchedEmpListDataRepository; - @RestController @RequestMapping("/gcc.com/NMR") public class NMRPunchedEmpListDataController { @@ -503,794 +502,880 @@ public class NMRPunchedEmpListDataController { return listMap; } - - // ----------------------LFZ----------------------------------------- - -@GetMapping({ "/getLFZPunchedEmpList/{zone}/{tempDate}" }) -public List> getLFZPunchedEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { - - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); - } - System.out.println(date); - System.out.println(zoneValue); + // ----------------------LFZ----------------------------------------- - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nMRPunchedEmpListDataRepository.getPunchedLFZUserId(zoneValue, date); - - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } + @GetMapping({ "/getLFZPunchedEmpList/{zone}/{tempDate}" }) + public List> getLFZPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { - System.out.println(PunchedUserId.size()); + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nMRPunchedEmpListDataRepository.getPunchedLFZUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nMRPunchedEmpListDataRepository.getPunchedLFZDesignation(PunchedUserId.get(i)).trim()); - } + System.out.println(date); + System.out.println(zoneValue); -// System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); -// System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRPunchedEmpListDataRepository.getPunchedLFZUserId(zoneValue, date); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { + ArrayList PunchedUserId = new ArrayList(); for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); - } - listMap.add(map); + PunchedUserId.add(tempPunchedUserId.get(i).trim()); } - System.out.println("Printed"); - return listMap; - } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; - -} - - // ----------------------PRINTING PRESS----------------------------------------- - -@GetMapping({ "/getPPPunchedEmpList/{zone}/{tempDate}" }) -public List> getPPPunchedEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { - - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); - } - - System.out.println(date); - System.out.println(zoneValue); - - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nMRPunchedEmpListDataRepository.getPunchedPPUserId(zoneValue, date); - - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } - - System.out.println(PunchedUserId.size()); + System.out.println(PunchedUserId.size()); - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nMRPunchedEmpListDataRepository.getPunchedPPUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nMRPunchedEmpListDataRepository.getPunchedPPDesignation(PunchedUserId.get(i)).trim()); - } + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRPunchedEmpListDataRepository.getPunchedLFZUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRPunchedEmpListDataRepository.getPunchedLFZDesignation(PunchedUserId.get(i)).trim()); + } // System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); + System.out.println(PunchedUserName.size()); // System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); + System.out.println(PunchedUserDesignation.size()); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { - for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); } - listMap.add(map); - } + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); System.out.println("Printed"); return listMap; - } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; -} + } - // ----------------------NORTH CHENNAI DEPOT----------------------------------------- + // ----------------------PRINTING PRESS----------------------------------------- -@GetMapping({ "/getNCDPunchedEmpList/{zone}/{tempDate}" }) -public List> getNCDPunchedEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { + @GetMapping({ "/getPPPunchedEmpList/{zone}/{tempDate}" }) + public List> getPPPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); - } + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } - System.out.println(date); - System.out.println(zoneValue); + System.out.println(date); + System.out.println(zoneValue); - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nMRPunchedEmpListDataRepository.getPunchedNCDUserId(zoneValue, date); + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRPunchedEmpListDataRepository.getPunchedPPUserId(zoneValue, date); - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } - System.out.println(PunchedUserId.size()); + System.out.println(PunchedUserId.size()); - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nMRPunchedEmpListDataRepository.getPunchedNCDUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nMRPunchedEmpListDataRepository.getPunchedNCDDesignation(PunchedUserId.get(i)).trim()); - } + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRPunchedEmpListDataRepository.getPunchedPPUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRPunchedEmpListDataRepository.getPunchedPPDesignation(PunchedUserId.get(i)).trim()); + } // System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); + System.out.println(PunchedUserName.size()); // System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); + System.out.println(PunchedUserDesignation.size()); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { - for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); } - listMap.add(map); - } + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); System.out.println("Printed"); return listMap; - } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; - -} - // ----------------------TASK FORCE----------------------------------------- - -@GetMapping({ "/getTFPunchedEmpList/{zone}/{tempDate}" }) -public List> getTFPunchedEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { - - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); } - System.out.println(date); - System.out.println(zoneValue); + // ----------------------NORTH CHENNAI + // DEPOT----------------------------------------- - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nMRPunchedEmpListDataRepository.getPunchedTFUserId(zoneValue, date); - - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } + @GetMapping({ "/getNCDPunchedEmpList/{zone}/{tempDate}" }) + public List> getNCDPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { - System.out.println(PunchedUserId.size()); + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nMRPunchedEmpListDataRepository.getPunchedTFUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nMRPunchedEmpListDataRepository.getPunchedTFDesignation(PunchedUserId.get(i)).trim()); - } + System.out.println(date); + System.out.println(zoneValue); -// System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); -// System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRPunchedEmpListDataRepository.getPunchedNCDUserId(zoneValue, date); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { + ArrayList PunchedUserId = new ArrayList(); for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); - } - listMap.add(map); + PunchedUserId.add(tempPunchedUserId.get(i).trim()); } - System.out.println("Printed"); - return listMap; - } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; - -} - - // ----------------------TPF----------------------------------------- - -@GetMapping({ "/getTPFPunchedEmpList/{zone}/{tempDate}" }) -public List> getTPFPunchedEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { - - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); - } - - System.out.println(date); - System.out.println(zoneValue); - - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nMRPunchedEmpListDataRepository.getPunchedTPFUserId(zoneValue, date); - - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } - - System.out.println(PunchedUserId.size()); + System.out.println(PunchedUserId.size()); - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nMRPunchedEmpListDataRepository.getPunchedTPFUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nMRPunchedEmpListDataRepository.getPunchedTPFDesignation(PunchedUserId.get(i)).trim()); - } + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRPunchedEmpListDataRepository.getPunchedNCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRPunchedEmpListDataRepository.getPunchedNCDDesignation(PunchedUserId.get(i)).trim()); + } // System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); + System.out.println(PunchedUserName.size()); // System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); + System.out.println(PunchedUserDesignation.size()); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { - for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); } - listMap.add(map); - } + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); System.out.println("Printed"); return listMap; - } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; - -} - // ----------------------CENTRAL CHENNAI DEPOT----------------------------------------- - -@GetMapping({ "/getCCDPunchedEmpList/{zone}/{tempDate}" }) -public List> getCCDPunchedEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { - - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); } - System.out.println(date); - System.out.println(zoneValue); - - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nMRPunchedEmpListDataRepository.getPunchedCCDUserId(zoneValue, date); + // ----------------------TASK FORCE----------------------------------------- - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } + @GetMapping({ "/getTFPunchedEmpList/{zone}/{tempDate}" }) + public List> getTFPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { - System.out.println(PunchedUserId.size()); + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nMRPunchedEmpListDataRepository.getPunchedCCDUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nMRPunchedEmpListDataRepository.getPunchedCCDDesignation(PunchedUserId.get(i)).trim()); - } + System.out.println(date); + System.out.println(zoneValue); -// System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); -// System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRPunchedEmpListDataRepository.getPunchedTFUserId(zoneValue, date); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { + ArrayList PunchedUserId = new ArrayList(); for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); - } - listMap.add(map); + PunchedUserId.add(tempPunchedUserId.get(i).trim()); } - System.out.println("Printed"); - return listMap; - } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; + System.out.println(PunchedUserId.size()); -} + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRPunchedEmpListDataRepository.getPunchedTFUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRPunchedEmpListDataRepository.getPunchedTFDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------TPF----------------------------------------- + + @GetMapping({ "/getTPFPunchedEmpList/{zone}/{tempDate}" }) + public List> getTPFPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRPunchedEmpListDataRepository.getPunchedTPFUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRPunchedEmpListDataRepository.getPunchedTPFUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRPunchedEmpListDataRepository.getPunchedTPFDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------CENTRAL CHENNAI + // DEPOT----------------------------------------- + + @GetMapping({ "/getCCDPunchedEmpList/{zone}/{tempDate}" }) + public List> getCCDPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRPunchedEmpListDataRepository.getPunchedCCDUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRPunchedEmpListDataRepository.getPunchedCCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRPunchedEmpListDataRepository.getPunchedCCDDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } // ----------------------PDG----------------------------------------- - -@GetMapping({ "/getPDGPunchedEmpList/{zone}/{tempDate}" }) -public List> getPDGPunchedEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { - - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); + + @GetMapping({ "/getPDGPunchedEmpList/{zone}/{tempDate}" }) + public List> getPDGPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRPunchedEmpListDataRepository.getPunchedPDGUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRPunchedEmpListDataRepository.getPunchedPDGUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRPunchedEmpListDataRepository.getPunchedPDGDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } - System.out.println(date); - System.out.println(zoneValue); + // ----------------------SOUTH CHENNAI DEPOT + // SCD----------------------------------------- + + @GetMapping({ "/getSCDPunchedEmpList/{zone}/{tempDate}" }) + public List> getSCDPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nMRPunchedEmpListDataRepository.getPunchedPDGUserId(zoneValue, date); + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRPunchedEmpListDataRepository.getPunchedSCDUserId(zoneValue, date); - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } - System.out.println(PunchedUserId.size()); + System.out.println(PunchedUserId.size()); - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nMRPunchedEmpListDataRepository.getPunchedPDGUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nMRPunchedEmpListDataRepository.getPunchedPDGDesignation(PunchedUserId.get(i)).trim()); - } + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRPunchedEmpListDataRepository.getPunchedSCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRPunchedEmpListDataRepository.getPunchedSCDDesignation(PunchedUserId.get(i)).trim()); + } // System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); + System.out.println(PunchedUserName.size()); // System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); + System.out.println(PunchedUserDesignation.size()); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { - for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); } - listMap.add(map); - } + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); System.out.println("Printed"); return listMap; - } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; -} + } - // ----------------------SOUTH CHENNAI DEPOT SCD----------------------------------------- + // ----------------------INSPECTION + // VEHICLE----------------------------------------- -@GetMapping({ "/getSCDPunchedEmpList/{zone}/{tempDate}" }) -public List> getSCDPunchedEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { + @GetMapping({ "/getIVPunchedEmpList/{zone}/{tempDate}" }) + public List> getIVPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); - } + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } - System.out.println(date); - System.out.println(zoneValue); + System.out.println(date); + System.out.println(zoneValue); - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nMRPunchedEmpListDataRepository.getPunchedSCDUserId(zoneValue, date); + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRPunchedEmpListDataRepository.getPunchedIVUserId(zoneValue, date); - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } - System.out.println(PunchedUserId.size()); + System.out.println(PunchedUserId.size()); - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nMRPunchedEmpListDataRepository.getPunchedSCDUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nMRPunchedEmpListDataRepository.getPunchedSCDDesignation(PunchedUserId.get(i)).trim()); - } + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRPunchedEmpListDataRepository.getPunchedIVUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRPunchedEmpListDataRepository.getPunchedIVDesignation(PunchedUserId.get(i)).trim()); + } // System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); + System.out.println(PunchedUserName.size()); // System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); + System.out.println(PunchedUserDesignation.size()); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { - for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); } - listMap.add(map); - } + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); System.out.println("Printed"); return listMap; + } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; -} + // ----------------------KDG----------------------------------------- - // ----------------------INSPECTION VEHICLE----------------------------------------- - -@GetMapping({ "/getIVPunchedEmpList/{zone}/{tempDate}" }) -public List> getIVPunchedEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { - - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); - } + @GetMapping({ "/getKDGPunchedEmpList/{zone}/{tempDate}" }) + public List> getKDGPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } - System.out.println(date); - System.out.println(zoneValue); + System.out.println(date); + System.out.println(zoneValue); - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nMRPunchedEmpListDataRepository.getPunchedIVUserId(zoneValue, date); + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRPunchedEmpListDataRepository.getPunchedKDGUserId(zoneValue, date); - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } - System.out.println(PunchedUserId.size()); + System.out.println(PunchedUserId.size()); - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nMRPunchedEmpListDataRepository.getPunchedIVUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nMRPunchedEmpListDataRepository.getPunchedIVDesignation(PunchedUserId.get(i)).trim()); - } + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRPunchedEmpListDataRepository.getPunchedKDGUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRPunchedEmpListDataRepository.getPunchedKDGDesignation(PunchedUserId.get(i)).trim()); + } // System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); + System.out.println(PunchedUserName.size()); // System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); + System.out.println(PunchedUserDesignation.size()); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { - for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); } - listMap.add(map); - } + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); System.out.println("Printed"); return listMap; - } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; -} + } - // ----------------------KDG----------------------------------------- +// ----------------------Designation ----------------------------------------- -@GetMapping({ "/getKDGPunchedEmpList/{zone}/{tempDate}" }) -public List> getKDGPunchedEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { + @GetMapping({ "/getDESIGPunchedEmpList/{designation}/{tempDate}" }) + public List> getKDGPunchedEmpList(@PathVariable String designation, + @PathVariable final String tempDate) { - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); - } + String desigValue = designation; + if (designation.equals("NA")) { + desigValue = ""; + } + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } - System.out.println(date); - System.out.println(zoneValue); + System.out.println(date); + System.out.println(desigValue); - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nMRPunchedEmpListDataRepository.getPunchedKDGUserId(zoneValue, date); + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRPunchedEmpListDataRepository.getPunchedDESIGUserId(desigValue, date); - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } - System.out.println(PunchedUserId.size()); + System.out.println(PunchedUserId.size()); - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nMRPunchedEmpListDataRepository.getPunchedKDGUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nMRPunchedEmpListDataRepository.getPunchedKDGDesignation(PunchedUserId.get(i)).trim()); - } + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRPunchedEmpListDataRepository.getPunchedKDGUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRPunchedEmpListDataRepository.getPunchedKDGDesignation(PunchedUserId.get(i)).trim()); + } // System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); + System.out.println(PunchedUserName.size()); // System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); + System.out.println(PunchedUserDesignation.size()); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { - for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); } - listMap.add(map); - } + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); System.out.println("Printed"); return listMap; - } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; -} + } } diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMAbsenteesEmpListDataController.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMAbsenteesEmpListDataController.java index 12e1161..85554bf 100644 --- a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMAbsenteesEmpListDataController.java +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMAbsenteesEmpListDataController.java @@ -22,7 +22,8 @@ public class NULMAbsenteesEmpListDataController { private NULMAbsenteesEmpListDataRepository nULMAbsenteesEmpListDataRepository; @Autowired - public NULMAbsenteesEmpListDataController(NULMAbsenteesEmpListDataRepository theNULMAbsenteesEmpListDataRepository) { + public NULMAbsenteesEmpListDataController( + NULMAbsenteesEmpListDataRepository theNULMAbsenteesEmpListDataRepository) { nULMAbsenteesEmpListDataRepository = theNULMAbsenteesEmpListDataRepository; } @@ -58,9 +59,10 @@ public class NULMAbsenteesEmpListDataController { System.out.println(AbsentUserId.size()); for (int i = 0; i < AbsentUserId.size(); i++) { - + AbsentUserName.add(nULMAbsenteesEmpListDataRepository.getAbsentDivUserName(AbsentUserId.get(i)).trim()); - AbsentUserDesignation.add(nULMAbsenteesEmpListDataRepository.getAbsentDivDesignation(AbsentUserId.get(i)).trim()); + AbsentUserDesignation + .add(nULMAbsenteesEmpListDataRepository.getAbsentDivDesignation(AbsentUserId.get(i)).trim()); } // System.out.println(PunchedUserName); @@ -347,7 +349,7 @@ public class NULMAbsenteesEmpListDataController { // // ----------------------Department office Enrolled--------------------------- - @GetMapping({"/getDeptAbsentEmpList/{dept}/{tempDate}" }) + @GetMapping({ "/getDeptAbsentEmpList/{dept}/{tempDate}" }) public List> getDeptPunchedEmpList(@PathVariable String dept, @PathVariable final String tempDate) { @@ -426,7 +428,7 @@ public class NULMAbsenteesEmpListDataController { // // ----------------------RDC office Enrolled--------------------------- - @GetMapping({"/getRDCAbsentEmpList/{zone}/{tempDate}" }) + @GetMapping({ "/getRDCAbsentEmpList/{zone}/{tempDate}" }) public List> getRDCPunchedEmpList(@PathVariable Integer zone, @PathVariable final String tempDate) { @@ -502,795 +504,881 @@ public class NULMAbsenteesEmpListDataController { return listMap; } - - // ----------------------LFZ----------------------------------------- - -@GetMapping({ "/getLFZAbsentEmpList/{zone}/{tempDate}" }) -public List> getLFZAbsentEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { - - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); - } - System.out.println(date); - System.out.println(zoneValue); + // ----------------------LFZ----------------------------------------- - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nULMAbsenteesEmpListDataRepository.getAbsentLFZUserId(zoneValue, date); - - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } + @GetMapping({ "/getLFZAbsentEmpList/{zone}/{tempDate}" }) + public List> getLFZAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { - System.out.println(PunchedUserId.size()); + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nULMAbsenteesEmpListDataRepository.getAbsentLFZUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nULMAbsenteesEmpListDataRepository.getAbsentLFZDesignation(PunchedUserId.get(i)).trim()); - } + System.out.println(date); + System.out.println(zoneValue); -// System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); -// System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMAbsenteesEmpListDataRepository.getAbsentLFZUserId(zoneValue, date); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { + ArrayList PunchedUserId = new ArrayList(); for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); - } - listMap.add(map); + PunchedUserId.add(tempPunchedUserId.get(i).trim()); } - System.out.println("Printed"); - return listMap; - } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; - -} - - - // ----------------------PRINTING PRESS----------------------------------------- - -@GetMapping({ "/getPPAbsentEmpList/{zone}/{tempDate}" }) -public List> getPPAbsentEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { - - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); - } - - System.out.println(date); - System.out.println(zoneValue); - - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nULMAbsenteesEmpListDataRepository.getAbsentPPUserId(zoneValue, date); - - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } - - System.out.println(PunchedUserId.size()); + System.out.println(PunchedUserId.size()); - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nULMAbsenteesEmpListDataRepository.getAbsentPPUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nULMAbsenteesEmpListDataRepository.getAbsentPPDesignation(PunchedUserId.get(i)).trim()); - } + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMAbsenteesEmpListDataRepository.getAbsentLFZUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMAbsenteesEmpListDataRepository.getAbsentLFZDesignation(PunchedUserId.get(i)).trim()); + } // System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); + System.out.println(PunchedUserName.size()); // System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); + System.out.println(PunchedUserDesignation.size()); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { - for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); } - listMap.add(map); - } + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); System.out.println("Printed"); return listMap; - } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; - -} - // ----------------------NORTH CHENNAI DEPOT----------------------------------------- - -@GetMapping({ "/getNCDAbsentEmpList/{zone}/{tempDate}" }) -public List> getNCDPunchedEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { - - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); } - System.out.println(date); - System.out.println(zoneValue); - - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nULMAbsenteesEmpListDataRepository.getAbsentNCDUserId(zoneValue, date); + // ----------------------PRINTING PRESS----------------------------------------- - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } + @GetMapping({ "/getPPAbsentEmpList/{zone}/{tempDate}" }) + public List> getPPAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { - System.out.println(PunchedUserId.size()); + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nULMAbsenteesEmpListDataRepository.getAbsentNCDUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nULMAbsenteesEmpListDataRepository.getAbsentNCDDesignation(PunchedUserId.get(i)).trim()); - } + System.out.println(date); + System.out.println(zoneValue); -// System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); -// System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMAbsenteesEmpListDataRepository.getAbsentPPUserId(zoneValue, date); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { + ArrayList PunchedUserId = new ArrayList(); for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); - } - listMap.add(map); + PunchedUserId.add(tempPunchedUserId.get(i).trim()); } - System.out.println("Printed"); - return listMap; - } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; - -} - - // ----------------------TASK FORCE----------------------------------------- - -@GetMapping({ "/getTFAbsentEmpList/{zone}/{tempDate}" }) -public List> getTFAbsentEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { - - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); - } - - System.out.println(date); - System.out.println(zoneValue); - - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nULMAbsenteesEmpListDataRepository.getAbsentTFUserId(zoneValue, date); - - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } - - System.out.println(PunchedUserId.size()); + System.out.println(PunchedUserId.size()); - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nULMAbsenteesEmpListDataRepository.getAbsentTFUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nULMAbsenteesEmpListDataRepository.getAbsentTFDesignation(PunchedUserId.get(i)).trim()); - } + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMAbsenteesEmpListDataRepository.getAbsentPPUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMAbsenteesEmpListDataRepository.getAbsentPPDesignation(PunchedUserId.get(i)).trim()); + } // System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); + System.out.println(PunchedUserName.size()); // System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); + System.out.println(PunchedUserDesignation.size()); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { - for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); } - listMap.add(map); - } + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); System.out.println("Printed"); return listMap; + } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; -} + // ----------------------NORTH CHENNAI + // DEPOT----------------------------------------- - // ----------------------TPF----------------------------------------- - -@GetMapping({ "/getTPFAbsentEmpList/{zone}/{tempDate}" }) -public List> getTPFAbsentEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { - - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); - } + @GetMapping({ "/getNCDAbsentEmpList/{zone}/{tempDate}" }) + public List> getNCDPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { - System.out.println(date); - System.out.println(zoneValue); + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nULMAbsenteesEmpListDataRepository.getAbsentTPFUserId(zoneValue, date); + System.out.println(date); + System.out.println(zoneValue); - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMAbsenteesEmpListDataRepository.getAbsentNCDUserId(zoneValue, date); - System.out.println(PunchedUserId.size()); + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nULMAbsenteesEmpListDataRepository.getAbsentTPFUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nULMAbsenteesEmpListDataRepository.getAbsentTPFDesignation(PunchedUserId.get(i)).trim()); - } + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMAbsenteesEmpListDataRepository.getAbsentNCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMAbsenteesEmpListDataRepository.getAbsentNCDDesignation(PunchedUserId.get(i)).trim()); + } // System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); + System.out.println(PunchedUserName.size()); // System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); + System.out.println(PunchedUserDesignation.size()); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { - for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); } - listMap.add(map); - } + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); System.out.println("Printed"); return listMap; - } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; - -} - // ----------------------CENTRAL CHENNAI DEPOT----------------------------------------- - -@GetMapping({ "/getCCDAbsentEmpList/{zone}/{tempDate}" }) -public List> getCCDAbsentEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { - - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); } - System.out.println(date); - System.out.println(zoneValue); - - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nULMAbsenteesEmpListDataRepository.getAbsentCCDUserId(zoneValue, date); + // ----------------------TASK FORCE----------------------------------------- - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } + @GetMapping({ "/getTFAbsentEmpList/{zone}/{tempDate}" }) + public List> getTFAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { - System.out.println(PunchedUserId.size()); + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nULMAbsenteesEmpListDataRepository.getAbsentCCDUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nULMAbsenteesEmpListDataRepository.getAbsentCCDDesignation(PunchedUserId.get(i)).trim()); - } + System.out.println(date); + System.out.println(zoneValue); -// System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); -// System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMAbsenteesEmpListDataRepository.getAbsentTFUserId(zoneValue, date); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { + ArrayList PunchedUserId = new ArrayList(); for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); - } - listMap.add(map); + PunchedUserId.add(tempPunchedUserId.get(i).trim()); } - System.out.println("Printed"); - return listMap; - } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; + System.out.println(PunchedUserId.size()); -} + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMAbsenteesEmpListDataRepository.getAbsentTFUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMAbsenteesEmpListDataRepository.getAbsentTFDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------TPF----------------------------------------- + + @GetMapping({ "/getTPFAbsentEmpList/{zone}/{tempDate}" }) + public List> getTPFAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMAbsenteesEmpListDataRepository.getAbsentTPFUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMAbsenteesEmpListDataRepository.getAbsentTPFUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMAbsenteesEmpListDataRepository.getAbsentTPFDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------CENTRAL CHENNAI + // DEPOT----------------------------------------- + + @GetMapping({ "/getCCDAbsentEmpList/{zone}/{tempDate}" }) + public List> getCCDAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMAbsenteesEmpListDataRepository.getAbsentCCDUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMAbsenteesEmpListDataRepository.getAbsentCCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMAbsenteesEmpListDataRepository.getAbsentCCDDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } // ----------------------PDG----------------------------------------- - -@GetMapping({ "/getPDGAbsentEmpList/{zone}/{tempDate}" }) -public List> getPDGAbsentEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { - - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); + + @GetMapping({ "/getPDGAbsentEmpList/{zone}/{tempDate}" }) + public List> getPDGAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMAbsenteesEmpListDataRepository.getAbsentPDGUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMAbsenteesEmpListDataRepository.getAbsentPDGUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMAbsenteesEmpListDataRepository.getAbsentPDGDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } - System.out.println(date); - System.out.println(zoneValue); + // ----------------------SOUTH CHENNAI DEPOT + // SCD----------------------------------------- + + @GetMapping({ "/getSCDAbsentEmpList/{zone}/{tempDate}" }) + public List> getSCDAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nULMAbsenteesEmpListDataRepository.getAbsentPDGUserId(zoneValue, date); + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMAbsenteesEmpListDataRepository.getAbsentSCDUserId(zoneValue, date); - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } - System.out.println(PunchedUserId.size()); + System.out.println(PunchedUserId.size()); - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nULMAbsenteesEmpListDataRepository.getAbsentPDGUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nULMAbsenteesEmpListDataRepository.getAbsentPDGDesignation(PunchedUserId.get(i)).trim()); - } + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMAbsenteesEmpListDataRepository.getAbsentSCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMAbsenteesEmpListDataRepository.getAbsentSCDDesignation(PunchedUserId.get(i)).trim()); + } // System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); + System.out.println(PunchedUserName.size()); // System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); + System.out.println(PunchedUserDesignation.size()); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { - for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); } - listMap.add(map); - } + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); System.out.println("Printed"); return listMap; - } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; -} + } - // ----------------------SOUTH CHENNAI DEPOT SCD----------------------------------------- + // ----------------------INSPECTION + // VEHICLE----------------------------------------- -@GetMapping({ "/getSCDAbsentEmpList/{zone}/{tempDate}" }) -public List> getSCDAbsentEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { + @GetMapping({ "/getIVAbsentEmpList/{zone}/{tempDate}" }) + public List> getIVAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); - } + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } - System.out.println(date); - System.out.println(zoneValue); + System.out.println(date); + System.out.println(zoneValue); - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nULMAbsenteesEmpListDataRepository.getAbsentSCDUserId(zoneValue, date); + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMAbsenteesEmpListDataRepository.getAbsentIVUserId(zoneValue, date); - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } - System.out.println(PunchedUserId.size()); + System.out.println(PunchedUserId.size()); - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nULMAbsenteesEmpListDataRepository.getAbsentSCDUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nULMAbsenteesEmpListDataRepository.getAbsentSCDDesignation(PunchedUserId.get(i)).trim()); - } + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMAbsenteesEmpListDataRepository.getAbsentIVUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMAbsenteesEmpListDataRepository.getAbsentIVDesignation(PunchedUserId.get(i)).trim()); + } // System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); + System.out.println(PunchedUserName.size()); // System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); + System.out.println(PunchedUserDesignation.size()); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { - for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); } - listMap.add(map); - } + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); System.out.println("Printed"); return listMap; + } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; -} + // ----------------------KDG----------------------------------------- - // ----------------------INSPECTION VEHICLE----------------------------------------- - -@GetMapping({ "/getIVAbsentEmpList/{zone}/{tempDate}" }) -public List> getIVAbsentEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { - - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); - } + @GetMapping({ "/getKDGAbsentEmpList/{zone}/{tempDate}" }) + public List> getKDGAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } - System.out.println(date); - System.out.println(zoneValue); + System.out.println(date); + System.out.println(zoneValue); - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nULMAbsenteesEmpListDataRepository.getAbsentIVUserId(zoneValue, date); + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMAbsenteesEmpListDataRepository.getAbsentKDGUserId(zoneValue, date); - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } - System.out.println(PunchedUserId.size()); + System.out.println(PunchedUserId.size()); - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nULMAbsenteesEmpListDataRepository.getAbsentIVUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nULMAbsenteesEmpListDataRepository.getAbsentIVDesignation(PunchedUserId.get(i)).trim()); - } + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMAbsenteesEmpListDataRepository.getAbsentKDGUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMAbsenteesEmpListDataRepository.getAbsentKDGDesignation(PunchedUserId.get(i)).trim()); + } // System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); + System.out.println(PunchedUserName.size()); // System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); + System.out.println(PunchedUserDesignation.size()); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { - for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); } - listMap.add(map); - } + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); System.out.println("Printed"); return listMap; - } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; -} + } - // ----------------------KDG----------------------------------------- +// ----------------------Designation----------------------------------------- -@GetMapping({ "/getKDGAbsentEmpList/{zone}/{tempDate}" }) -public List> getKDGAbsentEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { + @GetMapping({ "/getDESIGAbsentEmpList/{designation}/{tempDate}" }) + public List> getKDGAbsentEmpList(@PathVariable String designation, + @PathVariable final String tempDate) { - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); - } + String desigValue = designation; + if(designation.equals("NA")) + { + desigValue = ""; + } + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } - System.out.println(date); - System.out.println(zoneValue); + System.out.println(date); + System.out.println(desigValue); - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nULMAbsenteesEmpListDataRepository.getAbsentKDGUserId(zoneValue, date); + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMAbsenteesEmpListDataRepository.getAbsentDESIGUserId(desigValue, date); - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } - System.out.println(PunchedUserId.size()); + System.out.println(PunchedUserId.size()); - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nULMAbsenteesEmpListDataRepository.getAbsentKDGUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nULMAbsenteesEmpListDataRepository.getAbsentKDGDesignation(PunchedUserId.get(i)).trim()); - } + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMAbsenteesEmpListDataRepository.getAbsentDESIGUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMAbsenteesEmpListDataRepository.getAbsentDESIGDesignation(PunchedUserId.get(i)).trim()); + } -// System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); -// System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); +//System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +//System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { - for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); } - listMap.add(map); - } + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); System.out.println("Printed"); return listMap; - } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; -} + } } diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMDesignationEnrolledPunchedRestController.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMDesignationEnrolledPunchedRestController.java new file mode 100644 index 0000000..8e765b3 --- /dev/null +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMDesignationEnrolledPunchedRestController.java @@ -0,0 +1,127 @@ +package com.gcc.biometric.api.GccBioMetricApi.controller.nulm; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import com.gcc.biometric.api.GccBioMetricApi.repo.nulm.NULMDesignationEnrolledPunchedRepository; + +@RestController +@RequestMapping("/gcc.com/NULM") +public class NULMDesignationEnrolledPunchedRestController { + + @Autowired + private NULMDesignationEnrolledPunchedRepository nULMDesignationEnrolledPunchedRepository; + + // inject employee dao + @Autowired + public NULMDesignationEnrolledPunchedRestController( + NULMDesignationEnrolledPunchedRepository theNULMDesignationEnrolledPunchedRepository) { + nULMDesignationEnrolledPunchedRepository = theNULMDesignationEnrolledPunchedRepository; + } + + ArrayList enrolledCounts; + ArrayList punchedCounts; + + ArrayList allDesignations; + ArrayList designationsAsPerDate; + + @GetMapping("/DesignationCountPresentAbsentPercentage/{tempDate}") + public ResponseEntity>> getHeadQuaterDepartmentOfficeDate(@PathVariable String tempDate) + { + System.out.println("Inside getHeadQuaterDepartmentOfficeDate() method!"); + + //Department Office + + System.out.println("for HQ Department Office Data"); + + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + + e.printStackTrace(); + } + + System.out.println(date); + + + ArrayList allDesignations; + ArrayList allDesignationsAsPerDate; + ArrayList desigEnrolled; + ArrayList desigPunched; + + allDesignations = nULMDesignationEnrolledPunchedRepository.getAllDesignations(); + allDesignationsAsPerDate = nULMDesignationEnrolledPunchedRepository.getDesignationsAsPerDate(date); + + desigPunched = nULMDesignationEnrolledPunchedRepository.getDesigPunched(date); + + + System.out.println("All Designations: "+allDesignations); + System.out.println("All Designations as per date: "+allDesignationsAsPerDate); + desigEnrolled = nULMDesignationEnrolledPunchedRepository.getDesigEnrolled(); + System.out.println("Enrolled: "+desigEnrolled); + System.out.println("Punched: "+desigPunched); + + + String divAbsent = null; + String divPercentage = null; + Integer j = 0; + + List> listMap = new ArrayList>(); + for (int i = 0; i myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Designation"); myListValue.add(allDesignations.get(i).trim()); + myListKey.add("Enrolled"); myListValue.add(desigEnrolled.get(i)); + + if (allDesignationsAsPerDate.contains(allDesignations.get(i))) + { + myListKey.add("Punched"); myListValue.add(desigPunched.get(j)); + Integer xDivAbsent = Integer.parseInt(desigEnrolled.get(i)) - Integer.parseInt(desigPunched.get(j)); + Integer xdivPercentage = ((Integer.parseInt((desigPunched.get(j))) *100)/ Integer.parseInt(desigEnrolled.get(i))); + divAbsent = xDivAbsent.toString(); + divPercentage = xdivPercentage.toString(); + j++; + } + + else + { + myListKey.add("Punched"); myListValue.add("0"); + divAbsent = desigEnrolled.get(i); + divPercentage = "0"; + } + + myListKey.add("Absent"); myListValue.add(divAbsent); + myListKey.add("Percentage"); myListValue.add(divPercentage); + + Map map = new LinkedHashMap<>(); + for(int x=0;x> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + +// ----------------------Designation----------------------------------------- + + @GetMapping({ "/getDESIGEnrolledEmpList/{designation}" }) + public List> getDESIGEnrolledEmpList(@PathVariable String designation) { + + String desigValue = designation; + if(designation.equals("NA")) + { + desigValue = ""; + } + + System.out.println(desigValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMEnrolledEmpListDataRepository.getEnrolledDesigUserId(desigValue); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMEnrolledEmpListDataRepository.getEnrolledKDGUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMEnrolledEmpListDataRepository.getEnrolledKDGDesignation(PunchedUserId.get(i)).trim()); + } + // System.out.println(PunchedUserName); System.out.println(PunchedUserName.size()); // System.out.println(PunchedUserDesignation); diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMHeadQuaterZonesEntriesRestController.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMHeadQuaterZonesEntriesRestController.java index 7751376..77ab752 100644 --- a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMHeadQuaterZonesEntriesRestController.java +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMHeadQuaterZonesEntriesRestController.java @@ -30,6 +30,8 @@ public class NULMHeadQuaterZonesEntriesRestController { ArrayList arrZoneEnroll; ArrayList arrZonePunched; + ArrayList arrZoneAsPerEnroll; + ArrayList arrZonePunchedAsPerDate; @GetMapping("/HQZonesEmpCountPresentAbsentPercentage/{tempDate}") public LinkedHashMap getZoneEnrollPunchAbsentPercentage(@PathVariable String tempDate) //@RequestParam(value = "date")@DateTimeFormat(pattern="yyyy-MM-dd") LocalDate date @@ -49,9 +51,9 @@ public class NULMHeadQuaterZonesEntriesRestController { LinkedHashMap map = new LinkedHashMap<>(); arrZoneEnroll = nULMHeadQuaterZonesEntriesRepository.getEnrolled(); - + arrZoneAsPerEnroll = nULMHeadQuaterZonesEntriesRepository.getZoneAsPerEnrolled(); arrZonePunched = nULMHeadQuaterZonesEntriesRepository.getPunched(date); - + arrZonePunchedAsPerDate = nULMHeadQuaterZonesEntriesRepository.getPunchedAsPerDate(date); System.out.println("Enrolled: "+arrZoneEnroll); System.out.println("Punched: "+arrZonePunched); @@ -60,11 +62,11 @@ public class NULMHeadQuaterZonesEntriesRestController { Integer zoneAbsent=0; Integer zonePercentage=0; + int j = 0; - - for(int i=0;i> getLFZPunchedEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { - - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); - } - - System.out.println(date); - System.out.println(zoneValue); - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nULMPunchedEmpListDataRepository.getPunchedLFZUserId(zoneValue, date); + // ----------------------LFZ----------------------------------------- - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } + @GetMapping({ "/getLFZPunchedEmpList/{zone}/{tempDate}" }) + public List> getLFZPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { - System.out.println(PunchedUserId.size()); + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nULMPunchedEmpListDataRepository.getPunchedLFZUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nULMPunchedEmpListDataRepository.getPunchedLFZDesignation(PunchedUserId.get(i)).trim()); - } + System.out.println(date); + System.out.println(zoneValue); -// System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); -// System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMPunchedEmpListDataRepository.getPunchedLFZUserId(zoneValue, date); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { + ArrayList PunchedUserId = new ArrayList(); for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); - } - listMap.add(map); + PunchedUserId.add(tempPunchedUserId.get(i).trim()); } - System.out.println("Printed"); - return listMap; - } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; - -} - - // ----------------------PRINTING PRESS----------------------------------------- - -@GetMapping({ "/getPPPunchedEmpList/{zone}/{tempDate}" }) -public List> getPPPunchedEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { - - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); - } - - System.out.println(date); - System.out.println(zoneValue); - - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nULMPunchedEmpListDataRepository.getPunchedPPUserId(zoneValue, date); - - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } - - System.out.println(PunchedUserId.size()); + System.out.println(PunchedUserId.size()); - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nULMPunchedEmpListDataRepository.getPunchedPPUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nULMPunchedEmpListDataRepository.getPunchedPPDesignation(PunchedUserId.get(i)).trim()); - } + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMPunchedEmpListDataRepository.getPunchedLFZUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMPunchedEmpListDataRepository.getPunchedLFZDesignation(PunchedUserId.get(i)).trim()); + } // System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); + System.out.println(PunchedUserName.size()); // System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); + System.out.println(PunchedUserDesignation.size()); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { - for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); } - listMap.add(map); - } + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); System.out.println("Printed"); return listMap; - } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; -} + } - // ----------------------NORTH CHENNAI DEPOT----------------------------------------- + // ----------------------PRINTING PRESS----------------------------------------- -@GetMapping({ "/getNCDPunchedEmpList/{zone}/{tempDate}" }) -public List> getNCDPunchedEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { + @GetMapping({ "/getPPPunchedEmpList/{zone}/{tempDate}" }) + public List> getPPPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); - } + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } - System.out.println(date); - System.out.println(zoneValue); + System.out.println(date); + System.out.println(zoneValue); - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nULMPunchedEmpListDataRepository.getPunchedNCDUserId(zoneValue, date); + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMPunchedEmpListDataRepository.getPunchedPPUserId(zoneValue, date); - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } - System.out.println(PunchedUserId.size()); + System.out.println(PunchedUserId.size()); - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nULMPunchedEmpListDataRepository.getPunchedNCDUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nULMPunchedEmpListDataRepository.getPunchedNCDDesignation(PunchedUserId.get(i)).trim()); - } + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMPunchedEmpListDataRepository.getPunchedPPUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMPunchedEmpListDataRepository.getPunchedPPDesignation(PunchedUserId.get(i)).trim()); + } // System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); + System.out.println(PunchedUserName.size()); // System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); + System.out.println(PunchedUserDesignation.size()); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { - for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); } - listMap.add(map); - } + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); System.out.println("Printed"); return listMap; - } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; -} - - // ----------------------TASK FORCE----------------------------------------- - -@GetMapping({ "/getTFPunchedEmpList/{zone}/{tempDate}" }) -public List> getTFPunchedEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { - - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); } - System.out.println(date); - System.out.println(zoneValue); - - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nULMPunchedEmpListDataRepository.getPunchedTFUserId(zoneValue, date); + // ----------------------NORTH CHENNAI + // DEPOT----------------------------------------- - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } + @GetMapping({ "/getNCDPunchedEmpList/{zone}/{tempDate}" }) + public List> getNCDPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { - System.out.println(PunchedUserId.size()); + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nULMPunchedEmpListDataRepository.getPunchedTFUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nULMPunchedEmpListDataRepository.getPunchedTFDesignation(PunchedUserId.get(i)).trim()); - } + System.out.println(date); + System.out.println(zoneValue); -// System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); -// System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMPunchedEmpListDataRepository.getPunchedNCDUserId(zoneValue, date); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { + ArrayList PunchedUserId = new ArrayList(); for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); - } - listMap.add(map); + PunchedUserId.add(tempPunchedUserId.get(i).trim()); } - System.out.println("Printed"); - return listMap; - } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; - -} - - // ----------------------TPF----------------------------------------- - -@GetMapping({ "/getTPFPunchedEmpList/{zone}/{tempDate}" }) -public List> getTPFPunchedEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { - - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); - } - - System.out.println(date); - System.out.println(zoneValue); - - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nULMPunchedEmpListDataRepository.getPunchedTPFUserId(zoneValue, date); - - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } - - System.out.println(PunchedUserId.size()); + System.out.println(PunchedUserId.size()); - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nULMPunchedEmpListDataRepository.getPunchedTPFUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nULMPunchedEmpListDataRepository.getPunchedTPFDesignation(PunchedUserId.get(i)).trim()); - } + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMPunchedEmpListDataRepository.getPunchedNCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMPunchedEmpListDataRepository.getPunchedNCDDesignation(PunchedUserId.get(i)).trim()); + } // System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); + System.out.println(PunchedUserName.size()); // System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); + System.out.println(PunchedUserDesignation.size()); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { - for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); } - listMap.add(map); - } + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); System.out.println("Printed"); return listMap; - } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; - -} - // ----------------------CENTRAL CHENNAI DEPOT----------------------------------------- - -@GetMapping({ "/getCCDPunchedEmpList/{zone}/{tempDate}" }) -public List> getCCDPunchedEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { - - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); } - System.out.println(date); - System.out.println(zoneValue); - - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nULMPunchedEmpListDataRepository.getPunchedCCDUserId(zoneValue, date); + // ----------------------TASK FORCE----------------------------------------- - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } + @GetMapping({ "/getTFPunchedEmpList/{zone}/{tempDate}" }) + public List> getTFPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { - System.out.println(PunchedUserId.size()); + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nULMPunchedEmpListDataRepository.getPunchedCCDUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nULMPunchedEmpListDataRepository.getPunchedCCDDesignation(PunchedUserId.get(i)).trim()); - } + System.out.println(date); + System.out.println(zoneValue); -// System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); -// System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMPunchedEmpListDataRepository.getPunchedTFUserId(zoneValue, date); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { + ArrayList PunchedUserId = new ArrayList(); for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); - } - listMap.add(map); + PunchedUserId.add(tempPunchedUserId.get(i).trim()); } - System.out.println("Printed"); - return listMap; - } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; - -} + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMPunchedEmpListDataRepository.getPunchedTFUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMPunchedEmpListDataRepository.getPunchedTFDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------TPF----------------------------------------- + + @GetMapping({ "/getTPFPunchedEmpList/{zone}/{tempDate}" }) + public List> getTPFPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMPunchedEmpListDataRepository.getPunchedTPFUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMPunchedEmpListDataRepository.getPunchedTPFUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMPunchedEmpListDataRepository.getPunchedTPFDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------CENTRAL CHENNAI + // DEPOT----------------------------------------- + + @GetMapping({ "/getCCDPunchedEmpList/{zone}/{tempDate}" }) + public List> getCCDPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMPunchedEmpListDataRepository.getPunchedCCDUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMPunchedEmpListDataRepository.getPunchedCCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMPunchedEmpListDataRepository.getPunchedCCDDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } // ----------------------PDG----------------------------------------- - -@GetMapping({ "/getPDGPunchedEmpList/{zone}/{tempDate}" }) -public List> getPDGPunchedEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { - - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); + + @GetMapping({ "/getPDGPunchedEmpList/{zone}/{tempDate}" }) + public List> getPDGPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMPunchedEmpListDataRepository.getPunchedPDGUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMPunchedEmpListDataRepository.getPunchedPDGUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMPunchedEmpListDataRepository.getPunchedPDGDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } - System.out.println(date); - System.out.println(zoneValue); + // ----------------------SOUTH CHENNAI DEPOT + // SCD----------------------------------------- + + @GetMapping({ "/getSCDPunchedEmpList/{zone}/{tempDate}" }) + public List> getSCDPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nULMPunchedEmpListDataRepository.getPunchedPDGUserId(zoneValue, date); + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMPunchedEmpListDataRepository.getPunchedSCDUserId(zoneValue, date); - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } - System.out.println(PunchedUserId.size()); + System.out.println(PunchedUserId.size()); - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nULMPunchedEmpListDataRepository.getPunchedPDGUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nULMPunchedEmpListDataRepository.getPunchedPDGDesignation(PunchedUserId.get(i)).trim()); - } + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMPunchedEmpListDataRepository.getPunchedSCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMPunchedEmpListDataRepository.getPunchedSCDDesignation(PunchedUserId.get(i)).trim()); + } // System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); + System.out.println(PunchedUserName.size()); // System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); + System.out.println(PunchedUserDesignation.size()); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { - for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); } - listMap.add(map); - } + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); System.out.println("Printed"); return listMap; - } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; -} + } - // ----------------------SOUTH CHENNAI DEPOT SCD----------------------------------------- + // ----------------------INSPECTION + // VEHICLE----------------------------------------- -@GetMapping({ "/getSCDPunchedEmpList/{zone}/{tempDate}" }) -public List> getSCDPunchedEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { + @GetMapping({ "/getIVPunchedEmpList/{zone}/{tempDate}" }) + public List> getIVPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); - } + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } - System.out.println(date); - System.out.println(zoneValue); + System.out.println(date); + System.out.println(zoneValue); - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nULMPunchedEmpListDataRepository.getPunchedSCDUserId(zoneValue, date); + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMPunchedEmpListDataRepository.getPunchedIVUserId(zoneValue, date); - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } - System.out.println(PunchedUserId.size()); + System.out.println(PunchedUserId.size()); - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nULMPunchedEmpListDataRepository.getPunchedSCDUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nULMPunchedEmpListDataRepository.getPunchedSCDDesignation(PunchedUserId.get(i)).trim()); - } + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMPunchedEmpListDataRepository.getPunchedIVUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMPunchedEmpListDataRepository.getPunchedIVDesignation(PunchedUserId.get(i)).trim()); + } // System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); + System.out.println(PunchedUserName.size()); // System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); + System.out.println(PunchedUserDesignation.size()); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { - for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); } - listMap.add(map); - } + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); System.out.println("Printed"); return listMap; + } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; -} + // ----------------------KDG----------------------------------------- - // ----------------------INSPECTION VEHICLE----------------------------------------- - -@GetMapping({ "/getIVPunchedEmpList/{zone}/{tempDate}" }) -public List> getIVPunchedEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { - - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); - } + @GetMapping({ "/getKDGPunchedEmpList/{zone}/{tempDate}" }) + public List> getKDGPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } - System.out.println(date); - System.out.println(zoneValue); + System.out.println(date); + System.out.println(zoneValue); - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nULMPunchedEmpListDataRepository.getPunchedIVUserId(zoneValue, date); + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMPunchedEmpListDataRepository.getPunchedKDGUserId(zoneValue, date); - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } - System.out.println(PunchedUserId.size()); + System.out.println(PunchedUserId.size()); - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nULMPunchedEmpListDataRepository.getPunchedIVUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nULMPunchedEmpListDataRepository.getPunchedIVDesignation(PunchedUserId.get(i)).trim()); - } + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMPunchedEmpListDataRepository.getPunchedKDGUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMPunchedEmpListDataRepository.getPunchedKDGDesignation(PunchedUserId.get(i)).trim()); + } // System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); + System.out.println(PunchedUserName.size()); // System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); + System.out.println(PunchedUserDesignation.size()); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { - for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); } - listMap.add(map); - } + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); System.out.println("Printed"); return listMap; - } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; -} + } - // ----------------------KDG----------------------------------------- +// ----------------------Designation ----------------------------------------- -@GetMapping({ "/getKDGPunchedEmpList/{zone}/{tempDate}" }) -public List> getKDGPunchedEmpList(@PathVariable Integer zone, - @PathVariable final String tempDate) { + @GetMapping({ "/getDESIGPunchedEmpList/{designation}/{tempDate}" }) + public List> getKDGPunchedEmpList(@PathVariable String designation, + @PathVariable final String tempDate) { - Integer zoneValue = zone; - Date date = null; - try { - date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); - } catch (ParseException e) { - e.printStackTrace(); - } + String desigValue = designation; + if (designation.equals("NA")) { + desigValue = ""; + } + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } - System.out.println(date); - System.out.println(zoneValue); + System.out.println(date); + System.out.println(desigValue); - ArrayList tempPunchedUserId = new ArrayList<>(); - ArrayList PunchedUserName = new ArrayList<>(); - ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = nULMPunchedEmpListDataRepository.getPunchedKDGUserId(zoneValue, date); + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMPunchedEmpListDataRepository.getPunchedDESIGUserId(desigValue, date); - ArrayList PunchedUserId = new ArrayList(); - for (int i = 0; i < tempPunchedUserId.size(); i++) { - PunchedUserId.add(tempPunchedUserId.get(i).trim()); - } + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } - System.out.println(PunchedUserId.size()); + System.out.println(PunchedUserId.size()); - for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(nULMPunchedEmpListDataRepository.getPunchedKDGUserName(PunchedUserId.get(i)).trim()); - PunchedUserDesignation - .add(nULMPunchedEmpListDataRepository.getPunchedKDGDesignation(PunchedUserId.get(i)).trim()); - } + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMPunchedEmpListDataRepository.getPunchedKDGUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMPunchedEmpListDataRepository.getPunchedKDGDesignation(PunchedUserId.get(i)).trim()); + } // System.out.println(PunchedUserName); - System.out.println(PunchedUserName.size()); + System.out.println(PunchedUserName.size()); // System.out.println(PunchedUserDesignation); - System.out.println(PunchedUserDesignation.size()); + System.out.println(PunchedUserDesignation.size()); - List> listMap = new ArrayList>(); - if (!tempPunchedUserId.isEmpty()) { - for (int i = 0; i < tempPunchedUserId.size(); i++) { - ArrayList myListKey = new ArrayList(); - ArrayList myListValue = new ArrayList(); - myListKey.add("UserId"); - myListValue.add(PunchedUserId.get(i)); - myListKey.add("UserName"); - myListValue.add(PunchedUserName.get(i).trim()); - myListKey.add("Designation"); - myListValue.add(PunchedUserDesignation.get(i).trim()); - Map map = new LinkedHashMap(); - for (int x = 0; x < myListKey.size(); x++) { - map.put(myListKey.get(x), myListValue.get(x)); + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); } - listMap.add(map); - } + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); System.out.println("Printed"); return listMap; - } - ArrayList myListKey2 = new ArrayList(); - ArrayList myListValue2 = new ArrayList(); - myListKey2.add("UserId"); - myListValue2.add("0"); - myListKey2.add("UserName"); - myListValue2.add("0"); - myListKey2.add("Designation"); - myListValue2.add("0"); - Map map2 = new LinkedHashMap(); - for (int x2 = 0; x2 < myListKey2.size(); x2++) { - map2.put(myListKey2.get(x2), myListValue2.get(x2)); - } - listMap.add(map2); - System.out.println("Printed"); - return listMap; -} + } } diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMRegionalDeputyCommissionerController.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMRegionalDeputyCommissionerController.java index f9da126..0606a11 100644 --- a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMRegionalDeputyCommissionerController.java +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMRegionalDeputyCommissionerController.java @@ -34,7 +34,7 @@ public class NULMRegionalDeputyCommissionerController { ArrayList arrRDCEnroll; ArrayList arrRDCPunched; ArrayList arrRDCZoneNames; - ArrayList arrRDCZoneNamesAsPerPunched; + ArrayList arrRDCZoneNamesAsPerDate; @GetMapping("/RegionalDeputyCommissionerOfficeData/{tempDate}") public LinkedHashMap getZoneEnrollPunchAbsentPercentage(@PathVariable String tempDate) //@RequestParam(value = "date")@DateTimeFormat(pattern="yyyy-MM-dd") LocalDate date @@ -64,8 +64,8 @@ public class NULMRegionalDeputyCommissionerController { arrRDCZoneNames = nULMRegionalDeputyCommissionerRepository.getRDCZoneNames(); System.out.println("Enrolled: "+arrRDCZoneNames); - arrRDCZoneNamesAsPerPunched = nULMRegionalDeputyCommissionerRepository.getRDCOfficesAsPerPunched(date); - System.out.println("ZoneNamesAsPerPunched: "+arrRDCZoneNamesAsPerPunched); + arrRDCZoneNamesAsPerDate = nULMRegionalDeputyCommissionerRepository.getRDCOfficesAsPerPunched(date); + System.out.println("ZoneNamesAsPerPunched: "+arrRDCZoneNamesAsPerDate); Integer zoneAbsent=0; Integer zonePercentage=0; @@ -97,7 +97,7 @@ public class NULMRegionalDeputyCommissionerController { map.put(arrRDCZoneNames.get(i), arrRDCZoneNames.get(i)); map.put(arrRDCZoneNames.get(i)+"_Enrolled", arrRDCEnroll.get(i).toString()); - if(arrRDCZoneNamesAsPerPunched.contains(arrRDCZoneNames.get(i))) + if(arrRDCZoneNamesAsPerDate.contains(arrRDCZoneNames.get(i))) { map.put(arrRDCZoneNames.get(i)+"_Punched", arrRDCPunched.get(j).toString()); diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMAbsenteesEmpListDataController.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMAbsenteesEmpListDataController.java index 3bdd970..00b4a61 100644 --- a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMAbsenteesEmpListDataController.java +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMAbsenteesEmpListDataController.java @@ -1214,13 +1214,101 @@ public class PERMAbsenteesEmpListDataController { } - // ----------------------KDG----------------------------------------- + + - @GetMapping({ "/getKDGAbsentEmpList/{zone}/{tempDate}" }) - public List> getKDGAbsentEmpList(@PathVariable Integer zone, + // ----------------------KDG----------------------------------------- + + @GetMapping({ "/getKDGAbsentEmpList/{zone}/{tempDate}" }) + public List> getKDGAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = absenteesEmpListDataRepository.getAbsentKDGUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(absenteesEmpListDataRepository.getAbsentKDGUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(absenteesEmpListDataRepository.getAbsentKDGDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + + // ----------------------Designation----------------------------------------- + + @GetMapping({ "/getDESIGAbsentEmpList/{designation}/{tempDate}" }) + public List> getDESIGAbsentEmpList(@PathVariable String designation, @PathVariable final String tempDate) { - Integer zoneValue = zone; + String desigValue = designation; + if(designation.equals("NA")) + { + desigValue = ""; + } + Date date = null; try { date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); @@ -1229,12 +1317,12 @@ public class PERMAbsenteesEmpListDataController { } System.out.println(date); - System.out.println(zoneValue); + System.out.println(desigValue); ArrayList tempPunchedUserId = new ArrayList<>(); ArrayList PunchedUserName = new ArrayList<>(); ArrayList PunchedUserDesignation = new ArrayList<>(); - tempPunchedUserId = absenteesEmpListDataRepository.getAbsentKDGUserId(zoneValue, date); + tempPunchedUserId = absenteesEmpListDataRepository.getAbsentDESIGUserId(desigValue, date); ArrayList PunchedUserId = new ArrayList(); for (int i = 0; i < tempPunchedUserId.size(); i++) { @@ -1244,9 +1332,9 @@ public class PERMAbsenteesEmpListDataController { System.out.println(PunchedUserId.size()); for (int i = 0; i < PunchedUserId.size(); i++) { - PunchedUserName.add(absenteesEmpListDataRepository.getAbsentKDGUserName(PunchedUserId.get(i)).trim()); + PunchedUserName.add(absenteesEmpListDataRepository.getAbsentDESIGUserName(PunchedUserId.get(i)).trim()); PunchedUserDesignation - .add(absenteesEmpListDataRepository.getAbsentKDGDesignation(PunchedUserId.get(i)).trim()); + .add(absenteesEmpListDataRepository.getAbsentDESIGDesignation(PunchedUserId.get(i)).trim()); } // System.out.println(PunchedUserName); @@ -1292,5 +1380,4 @@ public class PERMAbsenteesEmpListDataController { return listMap; } - } diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMDesignationEnrolledPunchedRestController.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMDesignationEnrolledPunchedRestController.java new file mode 100644 index 0000000..208aeae --- /dev/null +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMDesignationEnrolledPunchedRestController.java @@ -0,0 +1,126 @@ +package com.gcc.biometric.api.GccBioMetricApi.controller.perm; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.gcc.biometric.api.GccBioMetricApi.repo.DesignationEnrolledPunchedRepository; + +@RestController +@RequestMapping("/gcc.com/PERM") +public class PERMDesignationEnrolledPunchedRestController { + + @Autowired + private DesignationEnrolledPunchedRepository designationEnrolledPunchedRepository; + + // inject employee dao + @Autowired + public PERMDesignationEnrolledPunchedRestController( + DesignationEnrolledPunchedRepository theDesignationEnrolledPunchedRepository) { + designationEnrolledPunchedRepository = theDesignationEnrolledPunchedRepository; + } + + ArrayList enrolledCounts; + ArrayList punchedCounts; + + ArrayList allDesignations; + ArrayList designationsAsPerDate; + + @GetMapping("/DesignationCountPresentAbsentPercentage/{tempDate}") + public ResponseEntity>> getHeadQuaterDepartmentOfficeDate(@PathVariable String tempDate) + { + System.out.println("Inside getHeadQuaterDepartmentOfficeDate() method!"); + + //Department Office + + System.out.println("for HQ Department Office Data"); + + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + + e.printStackTrace(); + } + + System.out.println(date); + + + ArrayList allDesignations; + ArrayList allDesignationsAsPerDate; + ArrayList desigEnrolled; + ArrayList desigPunched; + + allDesignations = designationEnrolledPunchedRepository.getAllDesignations(); + allDesignationsAsPerDate = designationEnrolledPunchedRepository.getDesignationsAsPerDate(date); + + desigPunched = designationEnrolledPunchedRepository.getDesigPunched(date); + + + System.out.println("All Designations: "+allDesignations); + System.out.println("All Designations as per date: "+allDesignationsAsPerDate); + desigEnrolled = designationEnrolledPunchedRepository.getDesigEnrolled(); + System.out.println("Enrolled: "+desigEnrolled); + System.out.println("Punched: "+desigPunched); + + + String divAbsent = null; + String divPercentage = null; + Integer j = 0; + + List> listMap = new ArrayList>(); + for (int i = 0; i myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Designation"); myListValue.add(allDesignations.get(i).trim()); + myListKey.add("Enrolled"); myListValue.add(desigEnrolled.get(i)); + + if (allDesignationsAsPerDate.contains(allDesignations.get(i))) + { + myListKey.add("Punched"); myListValue.add(desigPunched.get(j)); + Integer xDivAbsent = Integer.parseInt(desigEnrolled.get(i)) - Integer.parseInt(desigPunched.get(j)); + Integer xdivPercentage = ((Integer.parseInt((desigPunched.get(j))) *100)/ Integer.parseInt(desigEnrolled.get(i))); + divAbsent = xDivAbsent.toString(); + divPercentage = xdivPercentage.toString(); + j++; + } + + else + { + myListKey.add("Punched"); myListValue.add("0"); + divAbsent = desigEnrolled.get(i); + divPercentage = "0"; + } + + myListKey.add("Absent"); myListValue.add(divAbsent); + myListKey.add("Percentage"); myListValue.add(divPercentage); + + Map map = new LinkedHashMap<>(); + for(int x=0;x> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + +// ----------------------Designation----------------------------------------- + + @GetMapping({ "/getDESIGEnrolledEmpList/{designation}" }) + public List> getDESIGEnrolledEmpList(@PathVariable String designation) { + + String desigValue = designation; + if(designation.equals("NA")) + { + desigValue = ""; + } + + System.out.println(desigValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = enrolledEmpListDataRepository.getEnrolledDesigUserId(desigValue); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(enrolledEmpListDataRepository.getEnrolledKDGUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(enrolledEmpListDataRepository.getEnrolledKDGDesignation(PunchedUserId.get(i)).trim()); + } + // System.out.println(PunchedUserName); System.out.println(PunchedUserName.size()); // System.out.println(PunchedUserDesignation); diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMHeadQuaterZonesEntriesRestController.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMHeadQuaterZonesEntriesRestController.java index e772fff..d0932c8 100644 --- a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMHeadQuaterZonesEntriesRestController.java +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMHeadQuaterZonesEntriesRestController.java @@ -29,6 +29,8 @@ public class PERMHeadQuaterZonesEntriesRestController { ArrayList arrZoneEnroll; ArrayList arrZonePunched; + ArrayList arrZoneAsPerEnroll; + ArrayList arrZonePunchedAsPerDate; @GetMapping("/HQZonesEmpCountPresentAbsentPercentage/{tempDate}") public LinkedHashMap getZoneEnrollPunchAbsentPercentage(@PathVariable String tempDate) //@RequestParam(value = "date")@DateTimeFormat(pattern="yyyy-MM-dd") LocalDate date @@ -48,9 +50,9 @@ public class PERMHeadQuaterZonesEntriesRestController { LinkedHashMap map = new LinkedHashMap<>(); arrZoneEnroll = headQuaterZonesEntriesRepository.getEnrolled(); - + arrZoneAsPerEnroll = headQuaterZonesEntriesRepository.getZoneAsPerEnrolled(); arrZonePunched = headQuaterZonesEntriesRepository.getPunched(date); - + arrZonePunchedAsPerDate = headQuaterZonesEntriesRepository.getPunchedAsPerDate(date); System.out.println("Enrolled: "+arrZoneEnroll); System.out.println("Punched: "+arrZonePunched); @@ -59,11 +61,11 @@ public class PERMHeadQuaterZonesEntriesRestController { Integer zoneAbsent=0; Integer zonePercentage=0; + int j = 0; - - for(int i=0;i getTheEnrolledAndPunchedAbsPer(@RequestParam(value = "date")@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)String date) { -// -// arrEnroll = headQuaterEntriesRepository.getEnrolled(); -// arrPunched = headQuaterEntriesRepository.getPunched(date); -// LinkedHashMap map = new LinkedHashMap<>(); -// -// -// Integer Absent_1 = arrEnroll.get(0) - arrPunched.get(0); -// Integer Absent_2 = arrEnroll.get(1) - arrPunched.get(1); -// Integer Absent_3 = arrEnroll.get(2) - arrPunched.get(2); -// Integer Absent_4 = arrEnroll.get(3) - arrPunched.get(3); -// Integer Absent_5 = arrEnroll.get(4) - arrPunched.get(4); -// Integer Absent_6 = arrEnroll.get(5) - arrPunched.get(5); -// Integer Absent_7 = arrEnroll.get(6) - arrPunched.get(6); -// Integer Absent_8 = arrEnroll.get(7) - arrPunched.get(7); -// Integer Absent_9 = arrEnroll.get(8) - arrPunched.get(8); -// Integer Absent_10 = arrEnroll.get(9) - arrPunched.get(9); -// Integer Absent_11 = arrEnroll.get(10) - arrPunched.get(10); -// Integer Absent_12 = arrEnroll.get(11) - arrPunched.get(11); -// Integer Absent_13 = arrEnroll.get(12) - arrPunched.get(12); -// Integer Absent_14 = arrEnroll.get(13) - arrPunched.get(13); -// Integer Absent_15 = arrEnroll.get(14) - arrPunched.get(14); -// Integer Absent_16 = arrEnroll.get(15) - arrPunched.get(15); -// -// Integer Percentage_1 = ((arrPunched.get(0) *100)/ arrEnroll.get(0)); -// Integer Percentage_2 = ((arrPunched.get(1) *100)/ arrEnroll.get(1)); -// Integer Percentage_3 = ((arrPunched.get(2) *100)/ arrEnroll.get(2)); -// Integer Percentage_4 = ((arrPunched.get(3) *100)/ arrEnroll.get(3)); -// Integer Percentage_5 = ((arrPunched.get(4) *100)/ arrEnroll.get(4)); -// Integer Percentage_6 = ((arrPunched.get(5) *100)/ arrEnroll.get(5)); -// Integer Percentage_7 = ((arrPunched.get(6) *100)/ arrEnroll.get(6)); -// Integer Percentage_8 = ((arrPunched.get(7) *100)/ arrEnroll.get(7)); -// Integer Percentage_9 = ((arrPunched.get(8) *100)/ arrEnroll.get(8)); -// Integer Percentage_10 = ((arrPunched.get(9) *100)/ arrEnroll.get(9)); -// Integer Percentage_11 = ((arrPunched.get(10) *100)/ arrEnroll.get(10)); -// Integer Percentage_12 = ((arrPunched.get(11) *100)/ arrEnroll.get(11)); -// Integer Percentage_13 = ((arrPunched.get(12) *100)/ arrEnroll.get(12)); -// Integer Percentage_14 = ((arrPunched.get(13) *100)/ arrEnroll.get(13)); -// Integer Percentage_15 = ((arrPunched.get(14) *100)/ arrEnroll.get(14)); -// Integer Percentage_16 = ((arrPunched.get(15) *100)/ arrEnroll.get(15)); -// -// -// -// map.put("Zone_1", 1); -// map.put("Zone_1_enrolled", arrEnroll.get(0)); -// map.put("Zone_1_punched", arrPunched.get(0)); -// map.put("Absent_1", Absent_1); -// map.put("Percentage_1", Percentage_1); -// map.put("Zone_2", 2); -// map.put("Zone_2_enrolled", arrEnroll.get(1)); -// map.put("Zone_2_punched", arrPunched.get(1)); -// map.put("Absent_2", Absent_2); -// map.put("Percentage_2", Percentage_2); -// map.put("Zone_3", 3); -// map.put("Zone_3_enrolled", arrEnroll.get(2)); -// map.put("Zone_3_punched", arrPunched.get(2)); -// map.put("Absent_3", Absent_3); -// map.put("Percentage_3", Percentage_3); -// map.put("Zone_4", 4); -// map.put("Zone_4_enrolled", arrEnroll.get(3)); -// map.put("Zone_4_punched", arrPunched.get(0)); -// map.put("Absent_4", Absent_4); -// map.put("Percentage_4", Percentage_4); -// map.put("Zone_5", 5); -// map.put("Zone_5_enrolled", arrEnroll.get(4)); -// map.put("Zone_5_punched", arrPunched.get(4)); -// map.put("Absent_5", Absent_5); -// map.put("Percentage_5", Percentage_5); -// map.put("Zone_6", 6); -// map.put("Zone_6_enrolled", arrEnroll.get(5)); -// map.put("Zone_6_punched", arrPunched.get(5)); -// map.put("Absent_6", Absent_6); -// map.put("Percentage_6", Percentage_6); -// map.put("Zone_7", 7); -// map.put("Zone_7_enrolled", arrEnroll.get(6)); -// map.put("Zone_7_punched", arrPunched.get(6)); -// map.put("Absent_7", Absent_7); -// map.put("Percentage_7", Percentage_7); -// map.put("Zone_8", 8); -// map.put("Zone_8_enrolled", arrEnroll.get(7)); -// map.put("Zone_8_punched", arrPunched.get(7)); -// map.put("Absent_8", Absent_8); -// map.put("Percentage_8", Percentage_8); -// map.put("Zone_9", 9); -// map.put("Zone_9_enrolled", arrEnroll.get(8)); -// map.put("Zone_9_punched", arrPunched.get(8)); -// map.put("Absent_9", Absent_9); -// map.put("Percentage_9", Percentage_9); -// map.put("Zone_10", 10); -// map.put("Zone_10_enrolled", arrEnroll.get(9)); -// map.put("Zone_10_punched", arrPunched.get(9)); -// map.put("Absent_10", Absent_10); -// map.put("Percentage_10", Percentage_10); -// map.put("Zone_11", 11); -// map.put("Zone_11_enrolled", arrEnroll.get(10)); -// map.put("Zone_11_punched", arrPunched.get(10)); -// map.put("Absent_11", Absent_11); -// map.put("Percentage_11", Percentage_11); -// map.put("Zone_12", 12); -// map.put("Zone_12_enrolled", arrEnroll.get(11)); -// map.put("Zone_12_punched", arrPunched.get(11)); -// map.put("Absent_12", Absent_12); -// map.put("Percentage_12", Percentage_12); -// map.put("Zone_13", 13); -// map.put("Zone_13_enrolled", arrEnroll.get(12)); -// map.put("Zone_13_punched", arrPunched.get(12)); -// map.put("Absent_13", Absent_13); -// map.put("Percentage_13", Percentage_13); -// map.put("Zone_14", 14); -// map.put("Zone_14_enrolled", arrEnroll.get(13)); -// map.put("Zone_14_punched", arrPunched.get(13)); -// map.put("Absent_14", Absent_14); -// map.put("Percentage_14", Percentage_14); -// map.put("Zone_15", 15); -// map.put("Zone_15_enrolled", arrEnroll.get(14)); -// map.put("Zone_15_punched", arrPunched.get(14)); -// map.put("Absent_15", Absent_15); -// map.put("Percentage_15", Percentage_15); -// map.put("Zone_16", 16); -// map.put("Zone_16_enrolled", arrEnroll.get(15)); -// map.put("Zone_16_punched", arrPunched.get(15)); -// map.put("Absent_16", Absent_16); -// map.put("Percentage_16", Percentage_16); -// System.out.println("Till 15"); - - -// return map; -// } - - } diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMPunchedEmpListDataController.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMPunchedEmpListDataController.java index 8fb4984..5c368ec 100644 --- a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMPunchedEmpListDataController.java +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMPunchedEmpListDataController.java @@ -1292,4 +1292,90 @@ public class PERMPunchedEmpListDataController { } + + + + // ----------------------Designation ----------------------------------------- + + @GetMapping({ "/getDESIGPunchedEmpList/{designation}/{tempDate}" }) + public List> getKDGPunchedEmpList(@PathVariable String designation, + @PathVariable final String tempDate) { + + String desigValue = designation; + if(designation.equals("NA")) + { + desigValue = ""; + } + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(desigValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = punchedEmpListDataRepository.getPunchedDESIGUserId(desigValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(punchedEmpListDataRepository.getPunchedKDGUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(punchedEmpListDataRepository.getPunchedKDGDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + } diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMZoneDivisionOfficeController.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMZoneDivisionOfficeController.java index 4af3a54..4833ec8 100644 --- a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMZoneDivisionOfficeController.java +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMZoneDivisionOfficeController.java @@ -72,7 +72,7 @@ public class PERMZoneDivisionOfficeController { System.out.println("Inside division 1: Special case"); divPunched = zoneDivMasterRepository.getDivisionOfficePunchedPerDiv_1(zoneValue, date); - zoneDivisionsOnDate = zoneDivMasterRepository.getDivisionOfficeZoneDivAsPerDate(zoneValue, date); + zoneDivisionsOnDate = zoneDivMasterRepository.getDivisionOfficeZoneDivAsPerDate_1_2(zoneValue, date); Collections.sort(zoneDivisionsOnDate); zoneDivisions = zoneDivMasterRepository.getDivisionOfficeZoneDivisions(zoneValue); @@ -83,6 +83,11 @@ public class PERMZoneDivisionOfficeController { System.out.println("Punched: "+divPunched); divEnrolled = zoneDivMasterRepository.getDivisionOfficeEnrolledPerDiv_1(zoneValue); System.out.println("Enrolled: "+divEnrolled); + + System.out.println("Divisions: "+zoneDivisions.size()); + System.out.println("Divisions as per Date: "+zoneDivisionsOnDate.size()); + System.out.println("Punched: "+divPunched.size()); + System.out.println("Enrolled: "+divEnrolled.size()); } else if(zoneValue==8) @@ -112,28 +117,43 @@ public class PERMZoneDivisionOfficeController { else { divPunched = zoneDivMasterRepository.getDivisionOfficePunchedPerDiv(zoneValue, date); - zoneDivisionsOnDate = zoneDivMasterRepository.getDivisionOfficeZoneDivAsPerDate(zoneValue, date); + + if(zoneValue==2) + { + zoneDivisionsOnDate = zoneDivMasterRepository.getDivisionOfficeZoneDivAsPerDate_1_2(zoneValue, date); + } + + else + { + zoneDivisionsOnDate = zoneDivMasterRepository.getDivisionOfficeZoneDivAsPerDate(zoneValue, date); + } Collections.sort(zoneDivisionsOnDate); zoneDivisions = zoneDivMasterRepository.getDivisionOfficeZoneDivisions(zoneValue); System.out.println("Divisions: "+zoneDivisions); + System.out.println("Divisions size: "+zoneDivisions.size()); System.out.println("Divisions as per Date: "+zoneDivisionsOnDate); + System.out.println("Divisions as per Date size: "+zoneDivisionsOnDate.size()); System.out.println("Punched: "+divPunched); + System.out.println("Punched size: "+divPunched.size()); divEnrolled = zoneDivMasterRepository.getDivisionOfficeEnrolledPerDiv(zoneValue); System.out.println("Enrolled: "+divEnrolled); + System.out.println("Enrolled size: "+divEnrolled.size()); } String divAbsent = null; String divPercentage = null; Integer j = 0; List> listMap = new ArrayList>(); + for (int i = 0; i myListKey = new ArrayList<>(); ArrayList myListValue = new ArrayList<>(); myListKey.add("Division"); myListValue.add(zoneDivisions.get(i)); + System.out.println(zoneDivisions.get(i)); myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i)); if (zoneDivisionsOnDate.contains(zoneDivisions.get(i))) @@ -143,6 +163,7 @@ public class PERMZoneDivisionOfficeController { Integer xdivPercentage = ((Integer.parseInt((divPunched.get(j))) *100)/ Integer.parseInt(divEnrolled.get(i))); divAbsent = xDivAbsent.toString(); divPercentage = xdivPercentage.toString(); + System.out.println(divPunched.get(j)); j++; } @@ -232,7 +253,7 @@ public class PERMZoneDivisionOfficeController { { myListKey.add("Enrolled"); myListValue.add(unitEnrolled.get(k)); String enrolled = unitEnrolled.get(k); - k++; + if (unitAsPunched.contains(allUnitsAsPerZone.get(i))) @@ -250,12 +271,14 @@ public class PERMZoneDivisionOfficeController { else { myListKey.add("Punched"); myListValue.add("0"); - divAbsent = unitEnrolled.get(i); + divAbsent = unitEnrolled.get(k); divPercentage = "0"; myListKey.add("Absent"); myListValue.add(divAbsent); myListKey.add("Percentage"); myListValue.add(divPercentage); + } + k++; } else diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/AbsenteesEmpListDataRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/AbsenteesEmpListDataRepository.java index d6a2597..bd1ac51 100644 --- a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/AbsenteesEmpListDataRepository.java +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/AbsenteesEmpListDataRepository.java @@ -325,4 +325,27 @@ public interface AbsenteesEmpListDataRepository extends JpaRepository getAbsentDESIGUserId(String desig, Date date); + + @Query(value="select d.empName from Employee d where d.payCode=:userId") + public String getAbsentDESIGUserName(String userId); + + @Query(value="select d.designation from Employee d where d.payCode=:userId") + public String getAbsentDESIGDesignation(String userId); + } diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/DesignationEnrolledPunchedRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/DesignationEnrolledPunchedRepository.java new file mode 100644 index 0000000..c9822d0 --- /dev/null +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/DesignationEnrolledPunchedRepository.java @@ -0,0 +1,352 @@ +package com.gcc.biometric.api.GccBioMetricApi.repo; + + +import java.util.ArrayList; +import java.util.Date; + +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; + +import com.gcc.biometric.api.GccBioMetricApi.entity.HeadQuaterEntries; + +public interface DesignationEnrolledPunchedRepository extends JpaRepository { + + @Query("select upper(c.designation) \r\n" + + "from RealTimeUserInfo a, Employee c,\r\n" + + "DeviceStatus b, \r\n" + + "ZoneDivMaster d \r\n" + + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" + + "and c.payCode=a.userId\r\n" + + "and a.userId not like '%1100%' and a.userId not like '%1200%'\r\n" + + "and d.devname=b.deviceName\r\n" + + "group by c.designation\r\n" + + "order by c.designation asc") + ArrayList getAllDesignations(); + + @Query("select count(a.userId) as Enrolled \r\n" + + "from RealTimeUserInfo a, Employee c,\r\n" + + "DeviceStatus b, \r\n" + + "ZoneDivMaster d \r\n" + + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" + + "and c.payCode=a.userId\r\n" + + "and a.userId not like '%1100%' and a.userId not like '%1200%'\r\n" + + "and d.devname=b.deviceName\r\n" + + "group by c.designation\r\n" + + "order by c.designation asc") + ArrayList getDesigEnrolled(); + + @Query("select COUNT(distinct a.payCode) as punched\r\n" + + "from MachineRawPunchh a , DeviceStatus b, ZoneDivMaster c,Employee d \r\n" + + "where \r\n" + + "c.devname=b.deviceName\r\n" + + "and a.deviceId=b.deviceId \r\n" + + "and d.payCode=a.payCode\r\n" + + "and a.payCode not like '%1100%' and a.payCode not like '%1200%'\r\n" + + "and cast(a.officePunch as date) =:date\r\n" + + "group by d.designation\r\n" + + "order by d.designation") + ArrayList getDesigPunched(Date date); + + @Query("select upper(d.designation)\r\n" + + "from MachineRawPunchh a , DeviceStatus b, ZoneDivMaster c,Employee d \r\n" + + "where \r\n" + + "c.devname=b.deviceName\r\n" + + "and a.deviceId=b.deviceId \r\n" + + "and d.payCode=a.payCode\r\n" + + "and a.payCode not like '%1100%' and a.payCode not like '%1200%'\r\n" + + "and cast(a.officePunch as date) =:date\r\n" + + "group by d.designation\r\n" + + "order by d.designation") + ArrayList getDesignationsAsPerDate(Date date); + + + + + + + + + +// ======================================================================================== + +// @Query("select count(a.userId)\r\n" +// + "from RealTimeUserInfo a, Employee c,\r\n" +// + " DeviceStatus b, ZoneDivMaster d \r\n" +// + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" +// + "AND a.deviceId=b.deviceId\r\n" +// + "and d.zone=1\r\n" +// + "and c.payCode=a.userId\r\n" +// + "and d.devname=b.deviceName") +// String getEnroll_ZONE_1(); +// +// @Query("select count(distinct a.payCode)\r\n" +// + "from MachineRawPunch a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n" +// + "AND c.zone=1\r\n" +// + "and a.deviceId=b.deviceId \r\n" +// + "and cast(a.officePunch as date) ='2022-10-21'") +// String getPunched_1(); +// +// +// +// @Query("select count(a.userId)\r\n" +// + "from RealTimeUserInfo a, Employee c,\r\n" +// + " DeviceStatus b, ZoneDivMaster d \r\n" +// + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" +// + "AND a.deviceId=b.deviceId\r\n" +// + "and d.zone=2\r\n" +// + "and c.payCode=a.userId\r\n" +// + "and d.devname=b.deviceName") +// String getEnroll_ZONE_2(); +// +// @Query("select count(distinct a.payCode)\r\n" +// + "from MachineRawPunch a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n" +// + "AND c.zone=2\r\n" +// + "and a.deviceId=b.deviceId \r\n" +// + "and cast(a.officePunch as date) ='2022-10-21'") +// String getPunched_2(); +// +// @Query("select count(a.userId)\r\n" +// + "from RealTimeUserInfo a, Employee c,\r\n" +// + " DeviceStatus b, ZoneDivMaster d \r\n" +// + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" +// + "AND a.deviceId=b.deviceId\r\n" +// + "and d.zone=3\r\n" +// + "and c.payCode=a.userId\r\n" +// + "and d.devname=b.deviceName") +// String getEnroll_ZONE_3(); +// +// @Query("select count(distinct a.payCode)\r\n" +// + "from MachineRawPunch a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n" +// + "AND c.zone=3\r\n" +// + "and a.deviceId=b.deviceId \r\n" +// + "and cast(a.officePunch as date) ='2022-10-21'") +// String getPunched_3(); +// +// @Query("select count(a.userId)\r\n" +// + "from RealTimeUserInfo a, Employee c,\r\n" +// + " DeviceStatus b, ZoneDivMaster d \r\n" +// + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" +// + "AND a.deviceId=b.deviceId\r\n" +// + "and d.zone=4\r\n" +// + "and c.payCode=a.userId\r\n" +// + "and d.devname=b.deviceName") +// String getEnroll_ZONE_4(); +// +// @Query("select count(distinct a.payCode)\r\n" +// + "from MachineRawPunch a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n" +// + "AND c.zone=4\r\n" +// + "and a.deviceId=b.deviceId \r\n" +// + "and cast(a.officePunch as date) ='2022-10-21'") +// String getPunched_4(); +// +// @Query("select count(a.userId)\r\n" +// + "from RealTimeUserInfo a, Employee c,\r\n" +// + " DeviceStatus b, ZoneDivMaster d \r\n" +// + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" +// + "AND a.deviceId=b.deviceId\r\n" +// + "and d.zone=5\r\n" +// + "and c.payCode=a.userId\r\n" +// + "and d.devname=b.deviceName") +// String getEnroll_ZONE_5(); +// +// @Query("select count(distinct a.payCode)\r\n" +// + "from MachineRawPunch a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n" +// + "AND c.zone=5\r\n" +// + "and a.deviceId=b.deviceId \r\n" +// + "and cast(a.officePunch as date) ='2022-10-21'") +// String getPunched_5(); +// +// @Query("select count(a.userId)\r\n" +// + "from RealTimeUserInfo a, Employee c,\r\n" +// + " DeviceStatus b, ZoneDivMaster d \r\n" +// + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" +// + "AND a.deviceId=b.deviceId\r\n" +// + "and d.zone=6\r\n" +// + "and c.payCode=a.userId\r\n" +// + "and d.devname=b.deviceName") +// String getEnroll_ZONE_6(); +// +// @Query("select count(distinct a.payCode)\r\n" +// + "from MachineRawPunch a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n" +// + "AND c.zone=6\r\n" +// + "and a.deviceId=b.deviceId \r\n" +// + "and cast(a.officePunch as date) ='2022-10-21'") +// String getPunched_6(); +// +// @Query("select count(a.userId)\r\n" +// + "from RealTimeUserInfo a, Employee c,\r\n" +// + " DeviceStatus b, ZoneDivMaster d \r\n" +// + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" +// + "AND a.deviceId=b.deviceId\r\n" +// + "and d.zone=7\r\n" +// + "and c.payCode=a.userId\r\n" +// + "and d.devname=b.deviceName") +// String getEnroll_ZONE_7(); +// +// @Query("select count(distinct a.payCode)\r\n" +// + "from MachineRawPunch a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n" +// + "AND c.zone=7\r\n" +// + "and a.deviceId=b.deviceId \r\n" +// + "and cast(a.officePunch as date) ='2022-10-21'") +// String getPunched_7(); +// +// @Query("select count(a.userId)\r\n" +// + "from RealTimeUserInfo a, Employee c,\r\n" +// + " DeviceStatus b, ZoneDivMaster d \r\n" +// + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" +// + "AND a.deviceId=b.deviceId\r\n" +// + "and d.zone=8\r\n" +// + "and c.payCode=a.userId\r\n" +// + "and d.devname=b.deviceName") +// String getEnroll_ZONE_8(); +// +// @Query("select count(distinct a.payCode)\r\n" +// + "from MachineRawPunch a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n" +// + "AND c.zone=8\r\n" +// + "and a.deviceId=b.deviceId \r\n" +// + "and cast(a.officePunch as date) ='2022-10-21'") +// String getPunched_8(); +// +// @Query("select count(a.userId)\r\n" +// + "from RealTimeUserInfo a, Employee c,\r\n" +// + " DeviceStatus b, ZoneDivMaster d \r\n" +// + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" +// + "AND a.deviceId=b.deviceId\r\n" +// + "and d.zone=9\r\n" +// + "and c.payCode=a.userId\r\n" +// + "and d.devname=b.deviceName") +// String getEnroll_ZONE_9(); +// +// @Query("select count(distinct a.payCode)\r\n" +// + "from MachineRawPunch a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n" +// + "AND c.zone=9\r\n" +// + "and a.deviceId=b.deviceId \r\n" +// + "and cast(a.officePunch as date) ='2022-10-21'") +// String getPunched_9(); +// +// @Query("select count(a.userId)\r\n" +// + "from RealTimeUserInfo a, Employee c,\r\n" +// + " DeviceStatus b, ZoneDivMaster d \r\n" +// + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" +// + "AND a.deviceId=b.deviceId\r\n" +// + "and d.zone=10\r\n" +// + "and c.payCode=a.userId\r\n" +// + "and d.devname=b.deviceName") +// String getEnroll_ZONE_10(); +// +// @Query("select count(distinct a.payCode)\r\n" +// + "from MachineRawPunch a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n" +// + "AND c.zone=10\r\n" +// + "and a.deviceId=b.deviceId \r\n" +// + "and cast(a.officePunch as date) ='2022-10-21'") +// String getPunched_10(); +// +// @Query("select count(a.userId)\r\n" +// + "from RealTimeUserInfo a, Employee c,\r\n" +// + " DeviceStatus b, ZoneDivMaster d \r\n" +// + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" +// + "AND a.deviceId=b.deviceId\r\n" +// + "and d.zone=11\r\n" +// + "and c.payCode=a.userId\r\n" +// + "and d.devname=b.deviceName") +// String getEnroll_ZONE_11(); +// +// @Query("select count(distinct a.payCode)\r\n" +// + "from MachineRawPunch a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n" +// + "AND c.zone=11\r\n" +// + "and a.deviceId=b.deviceId \r\n" +// + "and cast(a.officePunch as date) ='2022-10-21'") +// String getPunched_11(); +// +// @Query("select count(a.userId)\r\n" +// + "from RealTimeUserInfo a, Employee c,\r\n" +// + " DeviceStatus b, ZoneDivMaster d \r\n" +// + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" +// + "AND a.deviceId=b.deviceId\r\n" +// + "and d.zone=12\r\n" +// + "and c.payCode=a.userId\r\n" +// + "and d.devname=b.deviceName") +// String getEnroll_ZONE_12(); +// +// @Query("select count(distinct a.payCode)\r\n" +// + "from MachineRawPunch a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n" +// + "AND c.zone=12\r\n" +// + "and a.deviceId=b.deviceId \r\n" +// + "and cast(a.officePunch as date) ='2022-10-21'") +// String getPunched_12(); +// +// @Query("select count(a.userId)\r\n" +// + "from RealTimeUserInfo a, Employee c,\r\n" +// + " DeviceStatus b, ZoneDivMaster d \r\n" +// + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" +// + "AND a.deviceId=b.deviceId\r\n" +// + "and d.zone=13\r\n" +// + "and c.payCode=a.userId\r\n" +// + "and d.devname=b.deviceName") +// String getEnroll_ZONE_13(); +// +// @Query("select count(distinct a.payCode)\r\n" +// + "from MachineRawPunch a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n" +// + "AND c.zone=13\r\n" +// + "and a.deviceId=b.deviceId \r\n" +// + "and cast(a.officePunch as date) ='2022-10-21'") +// String getPunched_13(); +// +// @Query("select count(a.userId)\r\n" +// + "from RealTimeUserInfo a, Employee c,\r\n" +// + " DeviceStatus b, ZoneDivMaster d \r\n" +// + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" +// + "AND a.deviceId=b.deviceId\r\n" +// + "and d.zone=14\r\n" +// + "and c.payCode=a.userId\r\n" +// + "and d.devname=b.deviceName") +// String getEnroll_ZONE_14(); +// +// @Query("select count(distinct a.payCode)\r\n" +// + "from MachineRawPunch a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n" +// + "AND c.zone=14\r\n" +// + "and a.deviceId=b.deviceId \r\n" +// + "and cast(a.officePunch as date) ='2022-10-21'") +// String getPunched_14(); +// +// @Query("select count(a.userId)\r\n" +// + "from RealTimeUserInfo a, Employee c,\r\n" +// + " DeviceStatus b, ZoneDivMaster d \r\n" +// + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" +// + "AND a.deviceId=b.deviceId\r\n" +// + "and d.zone=15\r\n" +// + "and c.payCode=a.userId\r\n" +// + "and d.devname=b.deviceName") +// String getEnroll_ZONE_15(); +// +// @Query("select count(distinct a.payCode)\r\n" +// + "from MachineRawPunch a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n" +// + "AND c.zone=15\r\n" +// + "and a.deviceId=b.deviceId \r\n" +// + "and cast(a.officePunch as date) ='2022-10-21'") +// String getPunched_15(); +// +// @Query("select count(a.userId)\r\n" +// + "from RealTimeUserInfo a, Employee c,\r\n" +// + " DeviceStatus b, ZoneDivMaster d \r\n" +// + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" +// + "AND a.deviceId=b.deviceId\r\n" +// + "and d.zone=16\r\n" +// + "and c.payCode=a.userId\r\n" +// + "and d.devname=b.deviceName") +// String getEnroll_ZONE_16(); +// +// @Query("select count(distinct a.payCode)\r\n" +// + "from MachineRawPunch a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n" +// + "AND c.zone=16\r\n" +// + "and a.deviceId=b.deviceId \r\n" +// + "and cast(a.officePunch as date) ='2022-10-21'") +// String getPunched_16(); +// + + + + + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/EnrolledEmpListDataRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/EnrolledEmpListDataRepository.java index e3bde66..0a03868 100644 --- a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/EnrolledEmpListDataRepository.java +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/EnrolledEmpListDataRepository.java @@ -474,5 +474,25 @@ public interface EnrolledEmpListDataRepository extends JpaRepository1 and a.userId <> 2 and a.userId <> 3\r\n" + + " and c.payCode=a.userId\r\n" + + "and c.designation=:designation\r\n" + + "and a.userId not like '%1100%' and a.userId not like '%1200%'\r\n" + + "and d.devname=b.deviceName\r\n" + + "order by a.userId") + public ArrayList getEnrolledDesigUserId(String designation); + + @Query(value="select d.empName from Employee d where d.payCode=:userId") + public String getEnrolledDesigUserName(String userId); + + @Query(value="select d.designation from Employee d where d.payCode=:userId") + public String getEnrolledDesigDesignation(String userId); } diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/HeadQuaterZonesEntriesRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/HeadQuaterZonesEntriesRepository.java index f79b298..3cbb1f5 100644 --- a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/HeadQuaterZonesEntriesRepository.java +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/HeadQuaterZonesEntriesRepository.java @@ -24,15 +24,36 @@ public interface HeadQuaterZonesEntriesRepository extends JpaRepository getEnrolled(); + @Query("select d.zone\r\n" + + "from RealTimeUserInfo a, Employee c,\r\n" + + " DeviceStatus b, ZoneDivMaster d \r\n" + + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" + + "and a.userId not like '%1100%' and a.userId not like '%1200%'\r\n" + + "and d.division not like '%ZONAL%' and d.division not like '%HQ%' and d.division not like '%RDC%'" + + "AND a.deviceId=b.deviceId\r\n" + + "and c.payCode=a.userId\r\n" + + "and d.devname=b.deviceName\r\n" + + "group by d.zone") + ArrayList getZoneAsPerEnrolled(); + @Query("select count(distinct a.payCode)\r\n" + "from MachineRawPunchh a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n" + "and a.deviceId=b.deviceId \r\n" + "and a.payCode not like '%1100%' and a.payCode not like '%1200%'\r\n" + "and c.division not like '%ZONAL%' and c.division not like '%HQ%' and c.division not like '%RDC%'" - + "and cast(a.officePunch as date) =?1\r\n" + + "and cast(a.officePunch as date) =:date\r\n" + "group by c.zone") ArrayList getPunched(Date date); + @Query("select c.zone\r\n" + + "from MachineRawPunchh a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n" + + "and a.deviceId=b.deviceId \r\n" + + "and a.payCode not like '%1100%' and a.payCode not like '%1200%'\r\n" + + "and c.division not like '%ZONAL%' and c.division not like '%HQ%' and c.division not like '%RDC%'" + + "and cast(a.officePunch as date) =:date\r\n" + + "group by c.zone") + ArrayList getPunchedAsPerDate(Date date); + diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/PunchedEmpListDataRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/PunchedEmpListDataRepository.java index dfb345f..b23879d 100644 --- a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/PunchedEmpListDataRepository.java +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/PunchedEmpListDataRepository.java @@ -362,5 +362,28 @@ public interface PunchedEmpListDataRepository extends JpaRepository getPunchedDESIGUserId(String designation, Date date); + + @Query(value="select d.empName from Employee d where d.payCode=:userId") + public String getPunchedDESIGUserName(String userId); + + @Query(value="select d.designation from Employee d where d.payCode=:userId") + public String getPunchedDESIGDesignation(String userId); } diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/ZoneDivisionOfficeRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/ZoneDivisionOfficeRepository.java index 9ae1b8c..a40e436 100644 --- a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/ZoneDivisionOfficeRepository.java +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/ZoneDivisionOfficeRepository.java @@ -67,14 +67,30 @@ public interface ZoneDivisionOfficeRepository extends JpaRepository getDivisionOfficePunchedPerDiv(Integer zoneValue, Date date); - @Query(value="select c.division\r\n" - + "from MachineRawPunchh a , DeviceStatus b, ZoneDivMaster c where \r\n" - + "c.devname=b.deviceName\r\n" - + "and a.deviceId=b.deviceId \r\n" - + "and c.zone= :zoneValue \r\n" - + "and c.devname like '%DIV%'\r\n" - + "and cast(a.officePunch as date) = :date group by c.division\r\n" - +"order by c.division asc") + @Query(value="select c.division\r\n" + + "from MachineRawPunchh a , DeviceStatus b, ZoneDivMaster c \r\n" + + "where \r\n" + + "c.devname=b.deviceName\r\n" + + "and a.deviceId=b.deviceId \r\n" + + "AND c.zone=:zoneValue\r\n" + + "and a.payCode not like '%1100%' and a.payCode not like '%1200%'\r\n" + + "and c.devname like '%DIV%'\r\n" + + "and cast(a.officePunch as date) =:date\r\n" + + "group by c.division\r\n" + + "order by c.division + 0 asc") + public ArrayList getDivisionOfficeZoneDivAsPerDate_1_2(Integer zoneValue, Date date); + + @Query(value="select c.division\r\n" + + "from MachineRawPunchh a , DeviceStatus b, ZoneDivMaster c \r\n" + + "where \r\n" + + "c.devname=b.deviceName\r\n" + + "and a.deviceId=b.deviceId \r\n" + + "AND c.zone=:zoneValue\r\n" + + "and a.payCode not like '%1100%' and a.payCode not like '%1200%'\r\n" + + "and c.devname like '%DIV%'\r\n" + + "and cast(a.officePunch as date) =:date\r\n" + + "group by c.division\r\n" + + "order by c.division asc") public ArrayList getDivisionOfficeZoneDivAsPerDate(Integer zoneValue, Date date); diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRAbsenteesEmpListDataRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRAbsenteesEmpListDataRepository.java index 7e00c55..c7994ab 100644 --- a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRAbsenteesEmpListDataRepository.java +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRAbsenteesEmpListDataRepository.java @@ -325,5 +325,26 @@ public interface NMRAbsenteesEmpListDataRepository extends JpaRepository getAbsentDESIGUserId(String desig, Date date); + + @Query(value="select d.empName from Employee d where d.payCode=:userId") + public String getAbsentDESIGUserName(String userId); + + @Query(value="select d.designation from Employee d where d.payCode=:userId") + public String getAbsentDESIGDesignation(String userId); + } diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRDesignationEnrolledPunchedRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRDesignationEnrolledPunchedRepository.java new file mode 100644 index 0000000..8ac3db7 --- /dev/null +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRDesignationEnrolledPunchedRepository.java @@ -0,0 +1,64 @@ +package com.gcc.biometric.api.GccBioMetricApi.repo.nmr; + + +import java.util.ArrayList; +import java.util.Date; + +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; + +import com.gcc.biometric.api.GccBioMetricApi.entity.HeadQuaterEntries; + +public interface NMRDesignationEnrolledPunchedRepository extends JpaRepository { + + @Query("select upper(c.designation) \r\n" + + "from RealTimeUserInfo a, Employee c,\r\n" + + "DeviceStatus b, \r\n" + + "ZoneDivMaster d \r\n" + + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" + + "and c.payCode=a.userId\r\n" + + "and a.userId like '%1200%'\r\n" + + "and d.devname=b.deviceName\r\n" + + "group by c.designation\r\n" + + "order by c.designation asc") + ArrayList getAllDesignations(); + + @Query("select count(a.userId) as Enrolled \r\n" + + "from RealTimeUserInfo a, Employee c,\r\n" + + "DeviceStatus b, \r\n" + + "ZoneDivMaster d \r\n" + + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" + + "and c.payCode=a.userId\r\n" + + "and a.userId like '%1200%'\r\n" + + "and d.devname=b.deviceName\r\n" + + "group by c.designation\r\n" + + "order by c.designation asc") + ArrayList getDesigEnrolled(); + + @Query("select COUNT(distinct a.payCode) as punched\r\n" + + "from MachineRawPunchh a , DeviceStatus b, ZoneDivMaster c,Employee d \r\n" + + "where \r\n" + + "c.devname=b.deviceName\r\n" + + "and a.deviceId=b.deviceId \r\n" + + "and d.payCode=a.payCode\r\n" + + "and a.payCode like '%1200%'" + + "and cast(a.officePunch as date) =:date\r\n" + + "group by d.designation\r\n" + + "order by d.designation") + ArrayList getDesigPunched(Date date); + + @Query("select upper(d.designation)\r\n" + + "from MachineRawPunchh a , DeviceStatus b, ZoneDivMaster c,Employee d \r\n" + + "where \r\n" + + "c.devname=b.deviceName\r\n" + + "and a.deviceId=b.deviceId \r\n" + + "and d.payCode=a.payCode\r\n" + + "and a.payCode like '%1200%'\r\n" + + "and cast(a.officePunch as date) =:date\r\n" + + "group by d.designation\r\n" + + "order by d.designation") + ArrayList getDesignationsAsPerDate(Date date); + + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMREnrolledEmpListDataRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMREnrolledEmpListDataRepository.java index 8f684de..533364b 100644 --- a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMREnrolledEmpListDataRepository.java +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMREnrolledEmpListDataRepository.java @@ -471,5 +471,26 @@ public interface NMREnrolledEmpListDataRepository extends JpaRepository1 and a.userId <> 2 and a.userId <> 3\r\n" + + " and c.payCode=a.userId\r\n" + + "and c.designation=:designation\r\n" + + "and a.userId like '%1200%'\r\n" + + "and d.devname=b.deviceName\r\n" + + "order by a.userId") + public ArrayList getEnrolledDesigUserId(String designation); + + @Query(value="select d.empName from Employee d where d.payCode=:userId") + public String getEnrolledDesigUserName(String userId); + + @Query(value="select d.designation from Employee d where d.payCode=:userId") + public String getEnrolledDesigDesignation(String userId); } diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRPunchedEmpListDataRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRPunchedEmpListDataRepository.java index 5cae4ce..7a98cb3 100644 --- a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRPunchedEmpListDataRepository.java +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRPunchedEmpListDataRepository.java @@ -359,5 +359,27 @@ public interface NMRPunchedEmpListDataRepository extends JpaRepository getPunchedDESIGUserId(String designation, Date date); + + @Query(value="select d.empName from Employee d where d.payCode=:userId") + public String getPunchedDESIGUserName(String userId); + + @Query(value="select d.designation from Employee d where d.payCode=:userId") + public String getPunchedDESIGDesignation(String userId); } diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRRegionalDeputyCommissionerRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRRegionalDeputyCommissionerRepository.java index e3441f8..09864ad 100644 --- a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRRegionalDeputyCommissionerRepository.java +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRRegionalDeputyCommissionerRepository.java @@ -64,7 +64,7 @@ public interface NMRRegionalDeputyCommissionerRepository extends JpaRepository getRDCZoneNames(); diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMAbsenteesEmpListDataRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMAbsenteesEmpListDataRepository.java index 9b6a126..eab8aeb 100644 --- a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMAbsenteesEmpListDataRepository.java +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMAbsenteesEmpListDataRepository.java @@ -324,5 +324,27 @@ public interface NULMAbsenteesEmpListDataRepository extends JpaRepository getAbsentDESIGUserId(String desig, Date date); + + @Query(value="select d.empName from Employee d where d.payCode=:userId") + public String getAbsentDESIGUserName(String userId); + + @Query(value="select d.designation from Employee d where d.payCode=:userId") + public String getAbsentDESIGDesignation(String userId); } diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMDesignationEnrolledPunchedRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMDesignationEnrolledPunchedRepository.java new file mode 100644 index 0000000..a01a526 --- /dev/null +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMDesignationEnrolledPunchedRepository.java @@ -0,0 +1,65 @@ +package com.gcc.biometric.api.GccBioMetricApi.repo.nulm; + + +import java.util.ArrayList; +import java.util.Date; + +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; + +import com.gcc.biometric.api.GccBioMetricApi.entity.HeadQuaterEntries; + +public interface NULMDesignationEnrolledPunchedRepository extends JpaRepository { + + @Query("select upper(c.designation) \r\n" + + "from RealTimeUserInfo a, Employee c,\r\n" + + "DeviceStatus b, \r\n" + + "ZoneDivMaster d \r\n" + + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" + + "and c.payCode=a.userId\r\n" + + "and a.userId like '%1100%'\r\n" + + "and d.devname=b.deviceName\r\n" + + "group by c.designation\r\n" + + "order by c.designation asc") + ArrayList getAllDesignations(); + + @Query("select count(a.userId) as Enrolled \r\n" + + "from RealTimeUserInfo a, Employee c,\r\n" + + "DeviceStatus b, \r\n" + + "ZoneDivMaster d \r\n" + + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" + + "and c.payCode=a.userId\r\n" + + "and a.userId like '%1100%'\r\n" + + "and d.devname=b.deviceName\r\n" + + "group by c.designation\r\n" + + "order by c.designation asc") + ArrayList getDesigEnrolled(); + + @Query("select COUNT(distinct a.payCode) as punched\r\n" + + "from MachineRawPunchh a , DeviceStatus b, ZoneDivMaster c,Employee d \r\n" + + "where \r\n" + + "c.devname=b.deviceName\r\n" + + "and a.deviceId=b.deviceId \r\n" + + "and d.payCode=a.payCode\r\n" + + "and a.payCode like '%1100%'\r\n" + + "and cast(a.officePunch as date) =:date\r\n" + + "group by d.designation\r\n" + + "order by d.designation") + ArrayList getDesigPunched(Date date); + + @Query("select upper(d.designation)\r\n" + + "from MachineRawPunchh a , DeviceStatus b, ZoneDivMaster c,Employee d \r\n" + + "where \r\n" + + "c.devname=b.deviceName\r\n" + + "and a.deviceId=b.deviceId \r\n" + + "and d.payCode=a.payCode\r\n" + + "and a.payCode like '%1100%'\r\n" + + "and cast(a.officePunch as date) =:date\r\n" + + "group by d.designation\r\n" + + "order by d.designation") + ArrayList getDesignationsAsPerDate(Date date); + + + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMEnrolledEmpListDataRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMEnrolledEmpListDataRepository.java index 70178ff..6537d63 100644 --- a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMEnrolledEmpListDataRepository.java +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMEnrolledEmpListDataRepository.java @@ -473,5 +473,26 @@ public interface NULMEnrolledEmpListDataRepository extends JpaRepository1 and a.userId <> 2 and a.userId <> 3\r\n" + + " and c.payCode=a.userId\r\n" + + "and c.designation=:designation\r\n" + + "and a.userId like '%1100%'\r\n" + + "and d.devname=b.deviceName\r\n" + + "order by a.userId") + public ArrayList getEnrolledDesigUserId(String designation); + + @Query(value="select d.empName from Employee d where d.payCode=:userId") + public String getEnrolledDesigUserName(String userId); + + @Query(value="select d.designation from Employee d where d.payCode=:userId") + public String getEnrolledDesigDesignation(String userId); + + } diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMHeadQuaterZonesEntriesRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMHeadQuaterZonesEntriesRepository.java index b5dd744..532c2df 100644 --- a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMHeadQuaterZonesEntriesRepository.java +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMHeadQuaterZonesEntriesRepository.java @@ -24,6 +24,19 @@ public interface NULMHeadQuaterZonesEntriesRepository extends JpaRepository getEnrolled(); + @Query("select d.zone\r\n" + + "from RealTimeUserInfo a, Employee c,\r\n" + + " DeviceStatus b, ZoneDivMaster d \r\n" + + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" + + "and a.userId not like '%1100%' and a.userId not like '%1200%'\r\n" + + "and d.division not like '%ZONAL%' and d.division not like '%HQ%' and d.division not like '%RDC%'" + + "AND a.deviceId=b.deviceId\r\n" + + "and c.payCode=a.userId\r\n" + + "and d.devname=b.deviceName\r\n" + + "group by d.zone") + ArrayList getZoneAsPerEnrolled(); + + @Query("select count(distinct a.payCode)\r\n" + "from MachineRawPunchh a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n" + "and a.deviceId=b.deviceId \r\n" @@ -33,292 +46,14 @@ public interface NULMHeadQuaterZonesEntriesRepository extends JpaRepository getPunched(Date date); - - - - - - - - - - -// ======================================================================================== - -// @Query("select count(a.userId)\r\n" -// + "from RealTimeUserInfo a, Employee c,\r\n" -// + " DeviceStatus b, ZoneDivMaster d \r\n" -// + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" -// + "AND a.deviceId=b.deviceId\r\n" -// + "and d.zone=1\r\n" -// + "and c.payCode=a.userId\r\n" -// + "and d.devname=b.deviceName") -// String getEnroll_ZONE_1(); -// -// @Query("select count(distinct a.payCode)\r\n" -// + "from MachineRawPunch a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n" -// + "AND c.zone=1\r\n" -// + "and a.deviceId=b.deviceId \r\n" -// + "and cast(a.officePunch as date) ='2022-10-21'") -// String getPunched_1(); -// -// -// -// @Query("select count(a.userId)\r\n" -// + "from RealTimeUserInfo a, Employee c,\r\n" -// + " DeviceStatus b, ZoneDivMaster d \r\n" -// + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" -// + "AND a.deviceId=b.deviceId\r\n" -// + "and d.zone=2\r\n" -// + "and c.payCode=a.userId\r\n" -// + "and d.devname=b.deviceName") -// String getEnroll_ZONE_2(); -// -// @Query("select count(distinct a.payCode)\r\n" -// + "from MachineRawPunch a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n" -// + "AND c.zone=2\r\n" -// + "and a.deviceId=b.deviceId \r\n" -// + "and cast(a.officePunch as date) ='2022-10-21'") -// String getPunched_2(); -// -// @Query("select count(a.userId)\r\n" -// + "from RealTimeUserInfo a, Employee c,\r\n" -// + " DeviceStatus b, ZoneDivMaster d \r\n" -// + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" -// + "AND a.deviceId=b.deviceId\r\n" -// + "and d.zone=3\r\n" -// + "and c.payCode=a.userId\r\n" -// + "and d.devname=b.deviceName") -// String getEnroll_ZONE_3(); -// -// @Query("select count(distinct a.payCode)\r\n" -// + "from MachineRawPunch a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n" -// + "AND c.zone=3\r\n" -// + "and a.deviceId=b.deviceId \r\n" -// + "and cast(a.officePunch as date) ='2022-10-21'") -// String getPunched_3(); -// -// @Query("select count(a.userId)\r\n" -// + "from RealTimeUserInfo a, Employee c,\r\n" -// + " DeviceStatus b, ZoneDivMaster d \r\n" -// + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" -// + "AND a.deviceId=b.deviceId\r\n" -// + "and d.zone=4\r\n" -// + "and c.payCode=a.userId\r\n" -// + "and d.devname=b.deviceName") -// String getEnroll_ZONE_4(); -// -// @Query("select count(distinct a.payCode)\r\n" -// + "from MachineRawPunch a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n" -// + "AND c.zone=4\r\n" -// + "and a.deviceId=b.deviceId \r\n" -// + "and cast(a.officePunch as date) ='2022-10-21'") -// String getPunched_4(); -// -// @Query("select count(a.userId)\r\n" -// + "from RealTimeUserInfo a, Employee c,\r\n" -// + " DeviceStatus b, ZoneDivMaster d \r\n" -// + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" -// + "AND a.deviceId=b.deviceId\r\n" -// + "and d.zone=5\r\n" -// + "and c.payCode=a.userId\r\n" -// + "and d.devname=b.deviceName") -// String getEnroll_ZONE_5(); -// -// @Query("select count(distinct a.payCode)\r\n" -// + "from MachineRawPunch a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n" -// + "AND c.zone=5\r\n" -// + "and a.deviceId=b.deviceId \r\n" -// + "and cast(a.officePunch as date) ='2022-10-21'") -// String getPunched_5(); -// -// @Query("select count(a.userId)\r\n" -// + "from RealTimeUserInfo a, Employee c,\r\n" -// + " DeviceStatus b, ZoneDivMaster d \r\n" -// + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" -// + "AND a.deviceId=b.deviceId\r\n" -// + "and d.zone=6\r\n" -// + "and c.payCode=a.userId\r\n" -// + "and d.devname=b.deviceName") -// String getEnroll_ZONE_6(); -// -// @Query("select count(distinct a.payCode)\r\n" -// + "from MachineRawPunch a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n" -// + "AND c.zone=6\r\n" -// + "and a.deviceId=b.deviceId \r\n" -// + "and cast(a.officePunch as date) ='2022-10-21'") -// String getPunched_6(); -// -// @Query("select count(a.userId)\r\n" -// + "from RealTimeUserInfo a, Employee c,\r\n" -// + " DeviceStatus b, ZoneDivMaster d \r\n" -// + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" -// + "AND a.deviceId=b.deviceId\r\n" -// + "and d.zone=7\r\n" -// + "and c.payCode=a.userId\r\n" -// + "and d.devname=b.deviceName") -// String getEnroll_ZONE_7(); -// -// @Query("select count(distinct a.payCode)\r\n" -// + "from MachineRawPunch a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n" -// + "AND c.zone=7\r\n" -// + "and a.deviceId=b.deviceId \r\n" -// + "and cast(a.officePunch as date) ='2022-10-21'") -// String getPunched_7(); -// -// @Query("select count(a.userId)\r\n" -// + "from RealTimeUserInfo a, Employee c,\r\n" -// + " DeviceStatus b, ZoneDivMaster d \r\n" -// + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" -// + "AND a.deviceId=b.deviceId\r\n" -// + "and d.zone=8\r\n" -// + "and c.payCode=a.userId\r\n" -// + "and d.devname=b.deviceName") -// String getEnroll_ZONE_8(); -// -// @Query("select count(distinct a.payCode)\r\n" -// + "from MachineRawPunch a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n" -// + "AND c.zone=8\r\n" -// + "and a.deviceId=b.deviceId \r\n" -// + "and cast(a.officePunch as date) ='2022-10-21'") -// String getPunched_8(); -// -// @Query("select count(a.userId)\r\n" -// + "from RealTimeUserInfo a, Employee c,\r\n" -// + " DeviceStatus b, ZoneDivMaster d \r\n" -// + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" -// + "AND a.deviceId=b.deviceId\r\n" -// + "and d.zone=9\r\n" -// + "and c.payCode=a.userId\r\n" -// + "and d.devname=b.deviceName") -// String getEnroll_ZONE_9(); -// -// @Query("select count(distinct a.payCode)\r\n" -// + "from MachineRawPunch a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n" -// + "AND c.zone=9\r\n" -// + "and a.deviceId=b.deviceId \r\n" -// + "and cast(a.officePunch as date) ='2022-10-21'") -// String getPunched_9(); -// -// @Query("select count(a.userId)\r\n" -// + "from RealTimeUserInfo a, Employee c,\r\n" -// + " DeviceStatus b, ZoneDivMaster d \r\n" -// + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" -// + "AND a.deviceId=b.deviceId\r\n" -// + "and d.zone=10\r\n" -// + "and c.payCode=a.userId\r\n" -// + "and d.devname=b.deviceName") -// String getEnroll_ZONE_10(); -// -// @Query("select count(distinct a.payCode)\r\n" -// + "from MachineRawPunch a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n" -// + "AND c.zone=10\r\n" -// + "and a.deviceId=b.deviceId \r\n" -// + "and cast(a.officePunch as date) ='2022-10-21'") -// String getPunched_10(); -// -// @Query("select count(a.userId)\r\n" -// + "from RealTimeUserInfo a, Employee c,\r\n" -// + " DeviceStatus b, ZoneDivMaster d \r\n" -// + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" -// + "AND a.deviceId=b.deviceId\r\n" -// + "and d.zone=11\r\n" -// + "and c.payCode=a.userId\r\n" -// + "and d.devname=b.deviceName") -// String getEnroll_ZONE_11(); -// -// @Query("select count(distinct a.payCode)\r\n" -// + "from MachineRawPunch a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n" -// + "AND c.zone=11\r\n" -// + "and a.deviceId=b.deviceId \r\n" -// + "and cast(a.officePunch as date) ='2022-10-21'") -// String getPunched_11(); -// -// @Query("select count(a.userId)\r\n" -// + "from RealTimeUserInfo a, Employee c,\r\n" -// + " DeviceStatus b, ZoneDivMaster d \r\n" -// + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" -// + "AND a.deviceId=b.deviceId\r\n" -// + "and d.zone=12\r\n" -// + "and c.payCode=a.userId\r\n" -// + "and d.devname=b.deviceName") -// String getEnroll_ZONE_12(); -// -// @Query("select count(distinct a.payCode)\r\n" -// + "from MachineRawPunch a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n" -// + "AND c.zone=12\r\n" -// + "and a.deviceId=b.deviceId \r\n" -// + "and cast(a.officePunch as date) ='2022-10-21'") -// String getPunched_12(); -// -// @Query("select count(a.userId)\r\n" -// + "from RealTimeUserInfo a, Employee c,\r\n" -// + " DeviceStatus b, ZoneDivMaster d \r\n" -// + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" -// + "AND a.deviceId=b.deviceId\r\n" -// + "and d.zone=13\r\n" -// + "and c.payCode=a.userId\r\n" -// + "and d.devname=b.deviceName") -// String getEnroll_ZONE_13(); -// -// @Query("select count(distinct a.payCode)\r\n" -// + "from MachineRawPunch a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n" -// + "AND c.zone=13\r\n" -// + "and a.deviceId=b.deviceId \r\n" -// + "and cast(a.officePunch as date) ='2022-10-21'") -// String getPunched_13(); -// -// @Query("select count(a.userId)\r\n" -// + "from RealTimeUserInfo a, Employee c,\r\n" -// + " DeviceStatus b, ZoneDivMaster d \r\n" -// + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" -// + "AND a.deviceId=b.deviceId\r\n" -// + "and d.zone=14\r\n" -// + "and c.payCode=a.userId\r\n" -// + "and d.devname=b.deviceName") -// String getEnroll_ZONE_14(); -// -// @Query("select count(distinct a.payCode)\r\n" -// + "from MachineRawPunch a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n" -// + "AND c.zone=14\r\n" -// + "and a.deviceId=b.deviceId \r\n" -// + "and cast(a.officePunch as date) ='2022-10-21'") -// String getPunched_14(); -// -// @Query("select count(a.userId)\r\n" -// + "from RealTimeUserInfo a, Employee c,\r\n" -// + " DeviceStatus b, ZoneDivMaster d \r\n" -// + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" -// + "AND a.deviceId=b.deviceId\r\n" -// + "and d.zone=15\r\n" -// + "and c.payCode=a.userId\r\n" -// + "and d.devname=b.deviceName") -// String getEnroll_ZONE_15(); -// -// @Query("select count(distinct a.payCode)\r\n" -// + "from MachineRawPunch a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n" -// + "AND c.zone=15\r\n" -// + "and a.deviceId=b.deviceId \r\n" -// + "and cast(a.officePunch as date) ='2022-10-21'") -// String getPunched_15(); -// -// @Query("select count(a.userId)\r\n" -// + "from RealTimeUserInfo a, Employee c,\r\n" -// + " DeviceStatus b, ZoneDivMaster d \r\n" -// + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" -// + "AND a.deviceId=b.deviceId\r\n" -// + "and d.zone=16\r\n" -// + "and c.payCode=a.userId\r\n" -// + "and d.devname=b.deviceName") -// String getEnroll_ZONE_16(); -// -// @Query("select count(distinct a.payCode)\r\n" -// + "from MachineRawPunch a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n" -// + "AND c.zone=16\r\n" -// + "and a.deviceId=b.deviceId \r\n" -// + "and cast(a.officePunch as date) ='2022-10-21'") -// String getPunched_16(); -// + @Query("select c.zone\r\n" + + "from MachineRawPunchh a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n" + + "and a.deviceId=b.deviceId \r\n" + + "and a.payCode not like '%1100%' and a.payCode not like '%1200%'\r\n" + + "and c.division not like '%ZONAL%' and c.division not like '%HQ%' and c.division not like '%RDC%'" + + "and cast(a.officePunch as date) =?1\r\n" + + "group by c.zone") + ArrayList getPunchedAsPerDate(Date date); diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMPunchedEmpListDataRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMPunchedEmpListDataRepository.java index aec07da..4e4e336 100644 --- a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMPunchedEmpListDataRepository.java +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMPunchedEmpListDataRepository.java @@ -359,5 +359,27 @@ public interface NULMPunchedEmpListDataRepository extends JpaRepository getPunchedDESIGUserId(String designation, Date date); + + @Query(value="select d.empName from Employee d where d.payCode=:userId") + public String getPunchedDESIGUserName(String userId); + + @Query(value="select d.designation from Employee d where d.payCode=:userId") + public String getPunchedDESIGDesignation(String userId); } diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMRegionalDeputyCommissionerRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMRegionalDeputyCommissionerRepository.java index 8b4e765..ef5c9d2 100644 --- a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMRegionalDeputyCommissionerRepository.java +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMRegionalDeputyCommissionerRepository.java @@ -47,14 +47,17 @@ public interface NULMRegionalDeputyCommissionerRepository extends JpaRepository< + "order by c.division") ArrayList getRDCOfficesAsPerPunched(Date date); - @Query("select c.division\r\n" - + "from MachineRawPunchh a , DeviceStatus b, ZoneDivMaster c where \r\n" - + "c.devname=b.deviceName\r\n" - + "and a.deviceId=b.deviceId \r\n" - + "and c.division like '%RDC%'\r\n" - + "and a.payCode like '%1100%'\r\n" - + "group by c.division\r\n" - + "order by c.division") + @Query("select d.division\r\n" + + "from RealTimeUserInfo a, Employee c,\r\n" + + "DeviceStatus b, \r\n" + + "ZoneDivMaster d \r\n" + + "where a.deviceId=b.deviceId and a.userId <>1 and a.userId <> 2 and a.userId <> 3\r\n" + + "and c.payCode=a.userId\r\n" + + "and d.division like '%RDC%'\r\n" + + "and a.userId like '%1100%'\r\n" + + "and d.devname=b.deviceName\r\n" + + "group by d.division\r\n" + + "order by d.division") ArrayList getRDCZoneNames(); diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index b826454..7d443e1 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -4,7 +4,7 @@ spring.datasource.url=jdbc:sqlserver://10.6.1.165:1433;databaseName=iASweb;encry spring.datasource.username=sa -spring.datasource.password=sss +spring.datasource.password=gcc@123 spring.datasource.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver