Browse Source

Last Commit

master
sachinsavita 4 years ago
parent
commit
48eb21adcc
  1. 5
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/GccAttendanceApplication.java
  2. 1416
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMRAbsenteesEmpListDataController.java
  3. 127
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMRDesignationEnrolledPunchedRestController.java
  4. 77
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMREnrolledEmpListDataController.java
  5. 1399
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMRPunchedEmpListDataController.java
  6. 1418
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMAbsenteesEmpListDataController.java
  7. 127
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMDesignationEnrolledPunchedRestController.java
  8. 75
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMEnrolledEmpListDataController.java
  9. 31
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMHeadQuaterZonesEntriesRestController.java
  10. 1400
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMPunchedEmpListDataController.java
  11. 8
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMRegionalDeputyCommissionerController.java
  12. 105
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMAbsenteesEmpListDataController.java
  13. 126
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMDesignationEnrolledPunchedRestController.java
  14. 75
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMEnrolledEmpListDataController.java
  15. 228
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMHeadQuaterZonesEntriesRestController.java
  16. 86
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMPunchedEmpListDataController.java
  17. 31
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMZoneDivisionOfficeController.java
  18. 23
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/AbsenteesEmpListDataRepository.java
  19. 352
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/DesignationEnrolledPunchedRepository.java
  20. 20
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/EnrolledEmpListDataRepository.java
  21. 23
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/HeadQuaterZonesEntriesRepository.java
  22. 23
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/PunchedEmpListDataRepository.java
  23. 32
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/ZoneDivisionOfficeRepository.java
  24. 21
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRAbsenteesEmpListDataRepository.java
  25. 64
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRDesignationEnrolledPunchedRepository.java
  26. 21
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMREnrolledEmpListDataRepository.java
  27. 22
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRPunchedEmpListDataRepository.java
  28. 2
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRRegionalDeputyCommissionerRepository.java
  29. 22
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMAbsenteesEmpListDataRepository.java
  30. 65
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMDesignationEnrolledPunchedRepository.java
  31. 21
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMEnrolledEmpListDataRepository.java
  32. 307
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMHeadQuaterZonesEntriesRepository.java
  33. 22
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMPunchedEmpListDataRepository.java
  34. 19
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMRegionalDeputyCommissionerRepository.java
  35. 2
      src/main/resources/application.properties

5
src/main/java/com/gcc/biometric/api/GccBioMetricApi/GccAttendanceApplication.java

@ -1,15 +1,20 @@
package com.gcc.biometric.api.GccBioMetricApi; package com.gcc.biometric.api.GccBioMetricApi;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication @SpringBootApplication
public class GccAttendanceApplication{ public class GccAttendanceApplication{
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(GccAttendanceApplication.class, args); SpringApplication.run(GccAttendanceApplication.class, args);

1416
src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMRAbsenteesEmpListDataController.java
File diff suppressed because it is too large
View File

127
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<Integer> enrolledCounts;
ArrayList<Integer> punchedCounts;
ArrayList<String> allDesignations;
ArrayList<String> designationsAsPerDate;
@GetMapping("/DesignationCountPresentAbsentPercentage/{tempDate}")
public ResponseEntity<List<Map<String, String>>> 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<String> allDesignations;
ArrayList<String> allDesignationsAsPerDate;
ArrayList<String> desigEnrolled;
ArrayList<String> 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<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
for (int i = 0; i <allDesignations.size(); i++) {
ArrayList<String> myListKey = new ArrayList<>();
ArrayList<String> 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<String, String> map = new LinkedHashMap<>();
for(int x=0;x<myListKey.size();x++)
{
map.put(myListKey.get(x), myListValue.get(x));
}
listMap.add(map);
divAbsent=null;
divPercentage=null;
}
return ResponseEntity.ok(listMap);
}
}

77
src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMREnrolledEmpListDataController.java

@ -1049,4 +1049,81 @@ String zoneValue = dept;
return listMap; return listMap;
} }
// ----------------------Designation-----------------------------------------
@GetMapping({ "/getDESIGEnrolledEmpList/{designation}" })
public List<Map<String, String>> getDESIGEnrolledEmpList(@PathVariable String designation) {
String desigValue = designation;
if(designation.equals("NA"))
{
desigValue = "";
}
System.out.println(desigValue);
ArrayList<String> tempPunchedUserId = new ArrayList<>();
ArrayList<String> PunchedUserName = new ArrayList<>();
ArrayList<String> PunchedUserDesignation = new ArrayList<>();
tempPunchedUserId = nMREnrolledEmpListDataRepository.getEnrolledDesigUserId(desigValue);
ArrayList<String> PunchedUserId = new ArrayList<String>();
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<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
if (!tempPunchedUserId.isEmpty()) {
for (int i = 0; i < tempPunchedUserId.size(); i++) {
ArrayList<String> myListKey = new ArrayList<String>();
ArrayList<String> myListValue = new ArrayList<String>();
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<String, String> map = new LinkedHashMap<String, String>();
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<String> myListKey2 = new ArrayList<String>();
ArrayList<String> myListValue2 = new ArrayList<String>();
myListKey2.add("UserId");
myListValue2.add("0");
myListKey2.add("UserName");
myListValue2.add("0");
myListKey2.add("Designation");
myListValue2.add("0");
Map<String, String> map2 = new LinkedHashMap<String, String>();
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;
}
} }

1399
src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMRPunchedEmpListDataController.java
File diff suppressed because it is too large
View File

1418
src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMAbsenteesEmpListDataController.java
File diff suppressed because it is too large
View File

127
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<Integer> enrolledCounts;
ArrayList<Integer> punchedCounts;
ArrayList<String> allDesignations;
ArrayList<String> designationsAsPerDate;
@GetMapping("/DesignationCountPresentAbsentPercentage/{tempDate}")
public ResponseEntity<List<Map<String, String>>> 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<String> allDesignations;
ArrayList<String> allDesignationsAsPerDate;
ArrayList<String> desigEnrolled;
ArrayList<String> 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<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
for (int i = 0; i <allDesignations.size(); i++) {
ArrayList<String> myListKey = new ArrayList<>();
ArrayList<String> 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<String, String> map = new LinkedHashMap<>();
for(int x=0;x<myListKey.size();x++)
{
map.put(myListKey.get(x), myListValue.get(x));
}
listMap.add(map);
divAbsent=null;
divPercentage=null;
}
return ResponseEntity.ok(listMap);
}
}

75
src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMEnrolledEmpListDataController.java

@ -1006,6 +1006,81 @@ String zoneValue = dept;
.add(nULMEnrolledEmpListDataRepository.getEnrolledKDGDesignation(PunchedUserId.get(i)).trim()); .add(nULMEnrolledEmpListDataRepository.getEnrolledKDGDesignation(PunchedUserId.get(i)).trim());
} }
// System.out.println(PunchedUserName);
System.out.println(PunchedUserName.size());
// System.out.println(PunchedUserDesignation);
System.out.println(PunchedUserDesignation.size());
List<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
if (!tempPunchedUserId.isEmpty()) {
for (int i = 0; i < tempPunchedUserId.size(); i++) {
ArrayList<String> myListKey = new ArrayList<String>();
ArrayList<String> myListValue = new ArrayList<String>();
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<String, String> map = new LinkedHashMap<String, String>();
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<String> myListKey2 = new ArrayList<String>();
ArrayList<String> myListValue2 = new ArrayList<String>();
myListKey2.add("UserId");
myListValue2.add("0");
myListKey2.add("UserName");
myListValue2.add("0");
myListKey2.add("Designation");
myListValue2.add("0");
Map<String, String> map2 = new LinkedHashMap<String, String>();
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<Map<String, String>> getDESIGEnrolledEmpList(@PathVariable String designation) {
String desigValue = designation;
if(designation.equals("NA"))
{
desigValue = "";
}
System.out.println(desigValue);
ArrayList<String> tempPunchedUserId = new ArrayList<>();
ArrayList<String> PunchedUserName = new ArrayList<>();
ArrayList<String> PunchedUserDesignation = new ArrayList<>();
tempPunchedUserId = nULMEnrolledEmpListDataRepository.getEnrolledDesigUserId(desigValue);
ArrayList<String> PunchedUserId = new ArrayList<String>();
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);
System.out.println(PunchedUserName.size()); System.out.println(PunchedUserName.size());
// System.out.println(PunchedUserDesignation); // System.out.println(PunchedUserDesignation);

31
src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMHeadQuaterZonesEntriesRestController.java

@ -30,6 +30,8 @@ public class NULMHeadQuaterZonesEntriesRestController {
ArrayList<Integer> arrZoneEnroll; ArrayList<Integer> arrZoneEnroll;
ArrayList<Integer> arrZonePunched; ArrayList<Integer> arrZonePunched;
ArrayList<Integer> arrZoneAsPerEnroll;
ArrayList<Integer> arrZonePunchedAsPerDate;
@GetMapping("/HQZonesEmpCountPresentAbsentPercentage/{tempDate}") @GetMapping("/HQZonesEmpCountPresentAbsentPercentage/{tempDate}")
public LinkedHashMap<String, Integer> getZoneEnrollPunchAbsentPercentage(@PathVariable String tempDate) //@RequestParam(value = "date")@DateTimeFormat(pattern="yyyy-MM-dd") LocalDate date public LinkedHashMap<String, Integer> getZoneEnrollPunchAbsentPercentage(@PathVariable String tempDate) //@RequestParam(value = "date")@DateTimeFormat(pattern="yyyy-MM-dd") LocalDate date
@ -49,9 +51,9 @@ public class NULMHeadQuaterZonesEntriesRestController {
LinkedHashMap<String, Integer> map = new LinkedHashMap<>(); LinkedHashMap<String, Integer> map = new LinkedHashMap<>();
arrZoneEnroll = nULMHeadQuaterZonesEntriesRepository.getEnrolled(); arrZoneEnroll = nULMHeadQuaterZonesEntriesRepository.getEnrolled();
arrZoneAsPerEnroll = nULMHeadQuaterZonesEntriesRepository.getZoneAsPerEnrolled();
arrZonePunched = nULMHeadQuaterZonesEntriesRepository.getPunched(date); arrZonePunched = nULMHeadQuaterZonesEntriesRepository.getPunched(date);
arrZonePunchedAsPerDate = nULMHeadQuaterZonesEntriesRepository.getPunchedAsPerDate(date);
System.out.println("Enrolled: "+arrZoneEnroll); System.out.println("Enrolled: "+arrZoneEnroll);
System.out.println("Punched: "+arrZonePunched); System.out.println("Punched: "+arrZonePunched);
@ -60,11 +62,11 @@ public class NULMHeadQuaterZonesEntriesRestController {
Integer zoneAbsent=0; Integer zoneAbsent=0;
Integer zonePercentage=0; Integer zonePercentage=0;
int j = 0;
for(int i=0;i<arrZoneEnroll.size();i++)
for(int i=0;i<arrZoneAsPerEnroll.size();i++)
{ {
System.out.println("Printing for zone_"+i);
System.out.println("Printing for zone_"+arrZoneAsPerEnroll.get(i));
if(arrZonePunched.isEmpty()) if(arrZonePunched.isEmpty())
{ {
@ -86,10 +88,23 @@ public class NULMHeadQuaterZonesEntriesRestController {
{ {
map.put("Zone_"+(i+1)+"", i+1); map.put("Zone_"+(i+1)+"", i+1);
map.put("Zone_"+(i+1)+"_enrolled", arrZoneEnroll.get(i)); map.put("Zone_"+(i+1)+"_enrolled", arrZoneEnroll.get(i));
map.put("Zone_"+(i+1)+"_punched", arrZonePunched.get(i));
zoneAbsent = arrZoneEnroll.get(i) - arrZonePunched.get(i);
zonePercentage = ((arrZonePunched.get(i) *100)/ arrZoneEnroll.get(i));
if(arrZonePunchedAsPerDate.contains(arrZoneAsPerEnroll.get(i)))
{
map.put("Zone_"+(i+1)+"_punched", arrZonePunched.get(j));
zoneAbsent = arrZoneEnroll.get(i) - arrZonePunched.get(j);
zonePercentage = ((arrZonePunched.get(j) *100)/ arrZoneEnroll.get(i));
j++;
}
else
{
map.put("Zone_"+(i+1)+"_punched", 0);
zoneAbsent = arrZoneEnroll.get(i) - 0;
zonePercentage = ((0 *100)/ arrZoneEnroll.get(i));
}
map.put("Absent_"+(i+1)+"", zoneAbsent); map.put("Absent_"+(i+1)+"", zoneAbsent);
map.put("Percentage_"+(i+1)+"", zonePercentage); map.put("Percentage_"+(i+1)+"", zonePercentage);

1400
src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMPunchedEmpListDataController.java
File diff suppressed because it is too large
View File

8
src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMRegionalDeputyCommissionerController.java

@ -34,7 +34,7 @@ public class NULMRegionalDeputyCommissionerController {
ArrayList<Integer> arrRDCEnroll; ArrayList<Integer> arrRDCEnroll;
ArrayList<Integer> arrRDCPunched; ArrayList<Integer> arrRDCPunched;
ArrayList<String> arrRDCZoneNames; ArrayList<String> arrRDCZoneNames;
ArrayList<String> arrRDCZoneNamesAsPerPunched;
ArrayList<String> arrRDCZoneNamesAsPerDate;
@GetMapping("/RegionalDeputyCommissionerOfficeData/{tempDate}") @GetMapping("/RegionalDeputyCommissionerOfficeData/{tempDate}")
public LinkedHashMap<String, String> getZoneEnrollPunchAbsentPercentage(@PathVariable String tempDate) //@RequestParam(value = "date")@DateTimeFormat(pattern="yyyy-MM-dd") LocalDate date public LinkedHashMap<String, String> getZoneEnrollPunchAbsentPercentage(@PathVariable String tempDate) //@RequestParam(value = "date")@DateTimeFormat(pattern="yyyy-MM-dd") LocalDate date
@ -64,8 +64,8 @@ public class NULMRegionalDeputyCommissionerController {
arrRDCZoneNames = nULMRegionalDeputyCommissionerRepository.getRDCZoneNames(); arrRDCZoneNames = nULMRegionalDeputyCommissionerRepository.getRDCZoneNames();
System.out.println("Enrolled: "+arrRDCZoneNames); 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 zoneAbsent=0;
Integer zonePercentage=0; Integer zonePercentage=0;
@ -97,7 +97,7 @@ public class NULMRegionalDeputyCommissionerController {
map.put(arrRDCZoneNames.get(i), arrRDCZoneNames.get(i)); map.put(arrRDCZoneNames.get(i), arrRDCZoneNames.get(i));
map.put(arrRDCZoneNames.get(i)+"_Enrolled", arrRDCEnroll.get(i).toString()); 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()); map.put(arrRDCZoneNames.get(i)+"_Punched", arrRDCPunched.get(j).toString());

105
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<Map<String, String>> getKDGAbsentEmpList(@PathVariable Integer zone,
// ----------------------KDG-----------------------------------------
@GetMapping({ "/getKDGAbsentEmpList/{zone}/{tempDate}" })
public List<Map<String, String>> 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<String> tempPunchedUserId = new ArrayList<>();
ArrayList<String> PunchedUserName = new ArrayList<>();
ArrayList<String> PunchedUserDesignation = new ArrayList<>();
tempPunchedUserId = absenteesEmpListDataRepository.getAbsentKDGUserId(zoneValue, date);
ArrayList<String> PunchedUserId = new ArrayList<String>();
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<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
if (!tempPunchedUserId.isEmpty()) {
for (int i = 0; i < tempPunchedUserId.size(); i++) {
ArrayList<String> myListKey = new ArrayList<String>();
ArrayList<String> myListValue = new ArrayList<String>();
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<String, String> map = new LinkedHashMap<String, String>();
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<String> myListKey2 = new ArrayList<String>();
ArrayList<String> myListValue2 = new ArrayList<String>();
myListKey2.add("UserId");
myListValue2.add("0");
myListKey2.add("UserName");
myListValue2.add("0");
myListKey2.add("Designation");
myListValue2.add("0");
Map<String, String> map2 = new LinkedHashMap<String, String>();
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<Map<String, String>> getDESIGAbsentEmpList(@PathVariable String designation,
@PathVariable final String tempDate) { @PathVariable final String tempDate) {
Integer zoneValue = zone;
String desigValue = designation;
if(designation.equals("NA"))
{
desigValue = "";
}
Date date = null; Date date = null;
try { try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
@ -1229,12 +1317,12 @@ public class PERMAbsenteesEmpListDataController {
} }
System.out.println(date); System.out.println(date);
System.out.println(zoneValue);
System.out.println(desigValue);
ArrayList<String> tempPunchedUserId = new ArrayList<>(); ArrayList<String> tempPunchedUserId = new ArrayList<>();
ArrayList<String> PunchedUserName = new ArrayList<>(); ArrayList<String> PunchedUserName = new ArrayList<>();
ArrayList<String> PunchedUserDesignation = new ArrayList<>(); ArrayList<String> PunchedUserDesignation = new ArrayList<>();
tempPunchedUserId = absenteesEmpListDataRepository.getAbsentKDGUserId(zoneValue, date);
tempPunchedUserId = absenteesEmpListDataRepository.getAbsentDESIGUserId(desigValue, date);
ArrayList<String> PunchedUserId = new ArrayList<String>(); ArrayList<String> PunchedUserId = new ArrayList<String>();
for (int i = 0; i < tempPunchedUserId.size(); i++) { for (int i = 0; i < tempPunchedUserId.size(); i++) {
@ -1244,9 +1332,9 @@ public class PERMAbsenteesEmpListDataController {
System.out.println(PunchedUserId.size()); System.out.println(PunchedUserId.size());
for (int i = 0; i < PunchedUserId.size(); i++) { 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 PunchedUserDesignation
.add(absenteesEmpListDataRepository.getAbsentKDGDesignation(PunchedUserId.get(i)).trim());
.add(absenteesEmpListDataRepository.getAbsentDESIGDesignation(PunchedUserId.get(i)).trim());
} }
// System.out.println(PunchedUserName); // System.out.println(PunchedUserName);
@ -1292,5 +1380,4 @@ public class PERMAbsenteesEmpListDataController {
return listMap; return listMap;
} }
} }

126
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<Integer> enrolledCounts;
ArrayList<Integer> punchedCounts;
ArrayList<String> allDesignations;
ArrayList<String> designationsAsPerDate;
@GetMapping("/DesignationCountPresentAbsentPercentage/{tempDate}")
public ResponseEntity<List<Map<String, String>>> 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<String> allDesignations;
ArrayList<String> allDesignationsAsPerDate;
ArrayList<String> desigEnrolled;
ArrayList<String> 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<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
for (int i = 0; i <allDesignations.size(); i++) {
ArrayList<String> myListKey = new ArrayList<>();
ArrayList<String> 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<String, String> map = new LinkedHashMap<>();
for(int x=0;x<myListKey.size();x++)
{
map.put(myListKey.get(x), myListValue.get(x));
}
listMap.add(map);
divAbsent=null;
divPercentage=null;
}
return ResponseEntity.ok(listMap);
}
}

75
src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMEnrolledEmpListDataController.java

@ -1005,6 +1005,81 @@ String zoneValue = dept;
.add(enrolledEmpListDataRepository.getEnrolledKDGDesignation(PunchedUserId.get(i)).trim()); .add(enrolledEmpListDataRepository.getEnrolledKDGDesignation(PunchedUserId.get(i)).trim());
} }
// System.out.println(PunchedUserName);
System.out.println(PunchedUserName.size());
// System.out.println(PunchedUserDesignation);
System.out.println(PunchedUserDesignation.size());
List<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
if (!tempPunchedUserId.isEmpty()) {
for (int i = 0; i < tempPunchedUserId.size(); i++) {
ArrayList<String> myListKey = new ArrayList<String>();
ArrayList<String> myListValue = new ArrayList<String>();
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<String, String> map = new LinkedHashMap<String, String>();
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<String> myListKey2 = new ArrayList<String>();
ArrayList<String> myListValue2 = new ArrayList<String>();
myListKey2.add("UserId");
myListValue2.add("0");
myListKey2.add("UserName");
myListValue2.add("0");
myListKey2.add("Designation");
myListValue2.add("0");
Map<String, String> map2 = new LinkedHashMap<String, String>();
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<Map<String, String>> getDESIGEnrolledEmpList(@PathVariable String designation) {
String desigValue = designation;
if(designation.equals("NA"))
{
desigValue = "";
}
System.out.println(desigValue);
ArrayList<String> tempPunchedUserId = new ArrayList<>();
ArrayList<String> PunchedUserName = new ArrayList<>();
ArrayList<String> PunchedUserDesignation = new ArrayList<>();
tempPunchedUserId = enrolledEmpListDataRepository.getEnrolledDesigUserId(desigValue);
ArrayList<String> PunchedUserId = new ArrayList<String>();
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);
System.out.println(PunchedUserName.size()); System.out.println(PunchedUserName.size());
// System.out.println(PunchedUserDesignation); // System.out.println(PunchedUserDesignation);

228
src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMHeadQuaterZonesEntriesRestController.java

@ -29,6 +29,8 @@ public class PERMHeadQuaterZonesEntriesRestController {
ArrayList<Integer> arrZoneEnroll; ArrayList<Integer> arrZoneEnroll;
ArrayList<Integer> arrZonePunched; ArrayList<Integer> arrZonePunched;
ArrayList<Integer> arrZoneAsPerEnroll;
ArrayList<Integer> arrZonePunchedAsPerDate;
@GetMapping("/HQZonesEmpCountPresentAbsentPercentage/{tempDate}") @GetMapping("/HQZonesEmpCountPresentAbsentPercentage/{tempDate}")
public LinkedHashMap<String, Integer> getZoneEnrollPunchAbsentPercentage(@PathVariable String tempDate) //@RequestParam(value = "date")@DateTimeFormat(pattern="yyyy-MM-dd") LocalDate date public LinkedHashMap<String, Integer> getZoneEnrollPunchAbsentPercentage(@PathVariable String tempDate) //@RequestParam(value = "date")@DateTimeFormat(pattern="yyyy-MM-dd") LocalDate date
@ -48,9 +50,9 @@ public class PERMHeadQuaterZonesEntriesRestController {
LinkedHashMap<String, Integer> map = new LinkedHashMap<>(); LinkedHashMap<String, Integer> map = new LinkedHashMap<>();
arrZoneEnroll = headQuaterZonesEntriesRepository.getEnrolled(); arrZoneEnroll = headQuaterZonesEntriesRepository.getEnrolled();
arrZoneAsPerEnroll = headQuaterZonesEntriesRepository.getZoneAsPerEnrolled();
arrZonePunched = headQuaterZonesEntriesRepository.getPunched(date); arrZonePunched = headQuaterZonesEntriesRepository.getPunched(date);
arrZonePunchedAsPerDate = headQuaterZonesEntriesRepository.getPunchedAsPerDate(date);
System.out.println("Enrolled: "+arrZoneEnroll); System.out.println("Enrolled: "+arrZoneEnroll);
System.out.println("Punched: "+arrZonePunched); System.out.println("Punched: "+arrZonePunched);
@ -59,11 +61,11 @@ public class PERMHeadQuaterZonesEntriesRestController {
Integer zoneAbsent=0; Integer zoneAbsent=0;
Integer zonePercentage=0; Integer zonePercentage=0;
int j = 0;
for(int i=0;i<arrZoneEnroll.size();i++)
for(int i=0;i<arrZoneAsPerEnroll.size();i++)
{ {
System.out.println("Printing for zone_"+i);
System.out.println("Printing for zone_"+arrZoneAsPerEnroll.get(i));
if(arrZonePunched.isEmpty()) if(arrZonePunched.isEmpty())
{ {
@ -85,10 +87,23 @@ public class PERMHeadQuaterZonesEntriesRestController {
{ {
map.put("Zone_"+(i+1)+"", i+1); map.put("Zone_"+(i+1)+"", i+1);
map.put("Zone_"+(i+1)+"_enrolled", arrZoneEnroll.get(i)); map.put("Zone_"+(i+1)+"_enrolled", arrZoneEnroll.get(i));
map.put("Zone_"+(i+1)+"_punched", arrZonePunched.get(i));
zoneAbsent = arrZoneEnroll.get(i) - arrZonePunched.get(i);
zonePercentage = ((arrZonePunched.get(i) *100)/ arrZoneEnroll.get(i));
if(arrZonePunchedAsPerDate.contains(arrZoneAsPerEnroll.get(i)))
{
map.put("Zone_"+(i+1)+"_punched", arrZonePunched.get(j));
zoneAbsent = arrZoneEnroll.get(i) - arrZonePunched.get(j);
zonePercentage = ((arrZonePunched.get(j) *100)/ arrZoneEnroll.get(i));
j++;
}
else
{
map.put("Zone_"+(i+1)+"_punched", 0);
zoneAbsent = arrZoneEnroll.get(i) - 0;
zonePercentage = ((0 *100)/ arrZoneEnroll.get(i));
}
map.put("Absent_"+(i+1)+"", zoneAbsent); map.put("Absent_"+(i+1)+"", zoneAbsent);
map.put("Percentage_"+(i+1)+"", zonePercentage); map.put("Percentage_"+(i+1)+"", zonePercentage);
@ -104,201 +119,4 @@ public class PERMHeadQuaterZonesEntriesRestController {
// @GetMapping("/enroll_2")
// public LinkedHashMap<String, Integer> getTheEnrolledAndPunchedAbsPer(@RequestParam(value = "date")@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)String date) {
//
// arrEnroll = headQuaterEntriesRepository.getEnrolled();
// arrPunched = headQuaterEntriesRepository.getPunched(date);
// LinkedHashMap<String, Integer> 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;
// }
} }

86
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<Map<String, String>> 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<String> tempPunchedUserId = new ArrayList<>();
ArrayList<String> PunchedUserName = new ArrayList<>();
ArrayList<String> PunchedUserDesignation = new ArrayList<>();
tempPunchedUserId = punchedEmpListDataRepository.getPunchedDESIGUserId(desigValue, date);
ArrayList<String> PunchedUserId = new ArrayList<String>();
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<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
if (!tempPunchedUserId.isEmpty()) {
for (int i = 0; i < tempPunchedUserId.size(); i++) {
ArrayList<String> myListKey = new ArrayList<String>();
ArrayList<String> myListValue = new ArrayList<String>();
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<String, String> map = new LinkedHashMap<String, String>();
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<String> myListKey2 = new ArrayList<String>();
ArrayList<String> myListValue2 = new ArrayList<String>();
myListKey2.add("UserId");
myListValue2.add("0");
myListKey2.add("UserName");
myListValue2.add("0");
myListKey2.add("Designation");
myListValue2.add("0");
Map<String, String> map2 = new LinkedHashMap<String, String>();
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;
}
} }

31
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"); System.out.println("Inside division 1: Special case");
divPunched = zoneDivMasterRepository.getDivisionOfficePunchedPerDiv_1(zoneValue, date); divPunched = zoneDivMasterRepository.getDivisionOfficePunchedPerDiv_1(zoneValue, date);
zoneDivisionsOnDate = zoneDivMasterRepository.getDivisionOfficeZoneDivAsPerDate(zoneValue, date);
zoneDivisionsOnDate = zoneDivMasterRepository.getDivisionOfficeZoneDivAsPerDate_1_2(zoneValue, date);
Collections.sort(zoneDivisionsOnDate); Collections.sort(zoneDivisionsOnDate);
zoneDivisions = zoneDivMasterRepository.getDivisionOfficeZoneDivisions(zoneValue); zoneDivisions = zoneDivMasterRepository.getDivisionOfficeZoneDivisions(zoneValue);
@ -83,6 +83,11 @@ public class PERMZoneDivisionOfficeController {
System.out.println("Punched: "+divPunched); System.out.println("Punched: "+divPunched);
divEnrolled = zoneDivMasterRepository.getDivisionOfficeEnrolledPerDiv_1(zoneValue); divEnrolled = zoneDivMasterRepository.getDivisionOfficeEnrolledPerDiv_1(zoneValue);
System.out.println("Enrolled: "+divEnrolled); 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) else if(zoneValue==8)
@ -112,28 +117,43 @@ public class PERMZoneDivisionOfficeController {
else else
{ {
divPunched = zoneDivMasterRepository.getDivisionOfficePunchedPerDiv(zoneValue, date); 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); Collections.sort(zoneDivisionsOnDate);
zoneDivisions = zoneDivMasterRepository.getDivisionOfficeZoneDivisions(zoneValue); zoneDivisions = zoneDivMasterRepository.getDivisionOfficeZoneDivisions(zoneValue);
System.out.println("Divisions: "+zoneDivisions); 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: "+zoneDivisionsOnDate);
System.out.println("Divisions as per Date size: "+zoneDivisionsOnDate.size());
System.out.println("Punched: "+divPunched); System.out.println("Punched: "+divPunched);
System.out.println("Punched size: "+divPunched.size());
divEnrolled = zoneDivMasterRepository.getDivisionOfficeEnrolledPerDiv(zoneValue); divEnrolled = zoneDivMasterRepository.getDivisionOfficeEnrolledPerDiv(zoneValue);
System.out.println("Enrolled: "+divEnrolled); System.out.println("Enrolled: "+divEnrolled);
System.out.println("Enrolled size: "+divEnrolled.size());
} }
String divAbsent = null; String divAbsent = null;
String divPercentage = null; String divPercentage = null;
Integer j = 0; Integer j = 0;
List<Map<String, String>> listMap = new ArrayList<Map<String, String>>(); List<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
for (int i = 0; i <zoneDivisions.size(); i++) { for (int i = 0; i <zoneDivisions.size(); i++) {
ArrayList<String> myListKey = new ArrayList<>(); ArrayList<String> myListKey = new ArrayList<>();
ArrayList<String> myListValue = new ArrayList<>(); ArrayList<String> myListValue = new ArrayList<>();
myListKey.add("Division"); myListValue.add(zoneDivisions.get(i)); myListKey.add("Division"); myListValue.add(zoneDivisions.get(i));
System.out.println(zoneDivisions.get(i));
myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i)); myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i));
if (zoneDivisionsOnDate.contains(zoneDivisions.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))); Integer xdivPercentage = ((Integer.parseInt((divPunched.get(j))) *100)/ Integer.parseInt(divEnrolled.get(i)));
divAbsent = xDivAbsent.toString(); divAbsent = xDivAbsent.toString();
divPercentage = xdivPercentage.toString(); divPercentage = xdivPercentage.toString();
System.out.println(divPunched.get(j));
j++; j++;
} }
@ -232,7 +253,7 @@ public class PERMZoneDivisionOfficeController {
{ {
myListKey.add("Enrolled"); myListValue.add(unitEnrolled.get(k)); myListKey.add("Enrolled"); myListValue.add(unitEnrolled.get(k));
String enrolled = unitEnrolled.get(k); String enrolled = unitEnrolled.get(k);
k++;
if (unitAsPunched.contains(allUnitsAsPerZone.get(i))) if (unitAsPunched.contains(allUnitsAsPerZone.get(i)))
@ -250,12 +271,14 @@ public class PERMZoneDivisionOfficeController {
else else
{ {
myListKey.add("Punched"); myListValue.add("0"); myListKey.add("Punched"); myListValue.add("0");
divAbsent = unitEnrolled.get(i);
divAbsent = unitEnrolled.get(k);
divPercentage = "0"; divPercentage = "0";
myListKey.add("Absent"); myListValue.add(divAbsent); myListKey.add("Absent"); myListValue.add(divAbsent);
myListKey.add("Percentage"); myListValue.add(divPercentage); myListKey.add("Percentage"); myListValue.add(divPercentage);
} }
k++;
} }
else else

23
src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/AbsenteesEmpListDataRepository.java

@ -325,4 +325,27 @@ public interface AbsenteesEmpListDataRepository extends JpaRepository<ZoneDivMas
@Query(value="select d.designation from Employee d where d.payCode=:userId") @Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentKDGDesignation(String userId); public String getAbsentKDGDesignation(String userId);
// ----------------------Designation-----------------------------------------
@Query(value="select a.userId \r\n"+
"from RealTimeUserInfo a,DeviceStatus b, \r\n" +
"ZoneDivMaster c , Employee d\r\n" +
"where a.deviceId=b.deviceId and c.devname=b.deviceName and d.payCode=a.userId\r\n" +
"and a.userId not in (select a.payCode from MachineRawPunchh a,DeviceStatus b,ZoneDivMaster c \r\n" +
"where cast(a.officePunch as date) =:date and \r\n" +
"c.devname=b.deviceName and a.deviceId=b.deviceId \r\n" +
"AND a.payCode not like '%1100%' and a.payCode not like '%1200%' and d.designation =:desig)\r\n" +
"and a.userId not like '%1100%' and a.userId not like '%1200%' and d.designation =:desig\r\n" +
"order by a.userId")
public ArrayList<String> 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);
} }

352
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<HeadQuaterEntries, Integer> {
@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<String> 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<String> 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<String> 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<String> 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();
//
}

20
src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/EnrolledEmpListDataRepository.java

@ -474,5 +474,25 @@ public interface EnrolledEmpListDataRepository extends JpaRepository<ZoneDivMast
public String getEnrolledKDGDesignation(String userId); public String getEnrolledKDGDesignation(String userId);
// ----------------------Designation Wise-----------------------------------------
@Query(value="select a.userId\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 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<String> 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);
} }

23
src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/HeadQuaterZonesEntriesRepository.java

@ -24,15 +24,36 @@ public interface HeadQuaterZonesEntriesRepository extends JpaRepository<HeadQuat
+ "group by d.zone") + "group by d.zone")
ArrayList<Integer> getEnrolled(); ArrayList<Integer> 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<Integer> getZoneAsPerEnrolled();
@Query("select count(distinct a.payCode)\r\n" @Query("select count(distinct a.payCode)\r\n"
+ "from MachineRawPunchh a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\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.deviceId=b.deviceId \r\n"
+ "and a.payCode not like '%1100%' and a.payCode not like '%1200%'\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 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") + "group by c.zone")
ArrayList<Integer> getPunched(Date date); ArrayList<Integer> 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<Integer> getPunchedAsPerDate(Date date);

23
src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/PunchedEmpListDataRepository.java

@ -362,5 +362,28 @@ public interface PunchedEmpListDataRepository extends JpaRepository<ZoneDivMaste
@Query(value="select d.designation from Employee d where d.payCode=:userId") @Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedKDGDesignation(String userId); public String getPunchedKDGDesignation(String userId);
// ----------------------Designation Wise-----------------------------------------
@Query(value="select distinct a.payCode\r\n" +
"from MachineRawPunchh a , DeviceStatus b, ZoneDivMaster c,\r\n" +
"Employee d\r\n" +
"where \r\n" +
"d.payCode=a.payCode and\r\n" +
"c.devname=b.deviceName\r\n" +
"and a.deviceId=b.deviceId \r\n" +
"and d.designation=:designation\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" +
"order by a.payCode asc")
public ArrayList<String> 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);
} }

32
src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/ZoneDivisionOfficeRepository.java

@ -67,14 +67,30 @@ public interface ZoneDivisionOfficeRepository extends JpaRepository<ZoneDivMaste
+"order by c.division asc") +"order by c.division asc")
public ArrayList<String> getDivisionOfficePunchedPerDiv(Integer zoneValue, Date date); public ArrayList<String> 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<String> 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<String> getDivisionOfficeZoneDivAsPerDate(Integer zoneValue, Date date); public ArrayList<String> getDivisionOfficeZoneDivAsPerDate(Integer zoneValue, Date date);

21
src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRAbsenteesEmpListDataRepository.java

@ -325,5 +325,26 @@ public interface NMRAbsenteesEmpListDataRepository extends JpaRepository<ZoneDiv
@Query(value="select d.designation from Employee d where d.payCode=:userId") @Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentKDGDesignation(String userId); public String getAbsentKDGDesignation(String userId);
// ----------------------Designation-----------------------------------------
@Query(value="select a.userId \r\n"+
"from RealTimeUserInfo a,DeviceStatus b, \r\n" +
"ZoneDivMaster c , Employee d\r\n" +
"where a.deviceId=b.deviceId and c.devname=b.deviceName and d.payCode=a.userId\r\n" +
"and a.userId not in (select a.payCode from MachineRawPunchh a,DeviceStatus b,ZoneDivMaster c \r\n" +
"where cast(a.officePunch as date) =:date and \r\n" +
"c.devname=b.deviceName and a.deviceId=b.deviceId \r\n" +
"AND a.payCode like '%1200%'and d.designation =:desig)\r\n" +
"and a.userId like '%1200%' and d.designation =:desig\r\n" +
"order by a.userId")
public ArrayList<String> 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);
} }

64
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<HeadQuaterEntries, Integer> {
@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<String> 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<String> 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<String> 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<String> getDesignationsAsPerDate(Date date);
}

21
src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMREnrolledEmpListDataRepository.java

@ -471,5 +471,26 @@ public interface NMREnrolledEmpListDataRepository extends JpaRepository<ZoneDivM
@Query(value="select d.designation from Employee d where d.payCode=:userId") @Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getEnrolledKDGDesignation(String userId); public String getEnrolledKDGDesignation(String userId);
// ----------------------Designation Wise-----------------------------------------
@Query(value="select a.userId\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 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<String> 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);
} }

22
src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRPunchedEmpListDataRepository.java

@ -359,5 +359,27 @@ public interface NMRPunchedEmpListDataRepository extends JpaRepository<ZoneDivMa
@Query(value="select d.designation from Employee d where d.payCode=:userId") @Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedKDGDesignation(String userId); public String getPunchedKDGDesignation(String userId);
// ----------------------Designation Wise-----------------------------------------
@Query(value="select distinct a.payCode\r\n" +
"from MachineRawPunchh a , DeviceStatus b, ZoneDivMaster c,\r\n" +
"Employee d\r\n" +
"where \r\n" +
"d.payCode=a.payCode and\r\n" +
"c.devname=b.deviceName\r\n" +
"and a.deviceId=b.deviceId \r\n" +
"and d.designation=:designation\r\n" +
"and a.payCode like '%1200%'\r\n" +
"and cast(a.officePunch as date) =:date\r\n" +
"order by a.payCode asc")
public ArrayList<String> 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);
} }

2
src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRRegionalDeputyCommissionerRepository.java

@ -64,7 +64,7 @@ public interface NMRRegionalDeputyCommissionerRepository extends JpaRepository<H
+ "c.devname=b.deviceName\r\n" + "c.devname=b.deviceName\r\n"
+ "and a.deviceId=b.deviceId \r\n" + "and a.deviceId=b.deviceId \r\n"
+ "and c.division like '%RDC%'\r\n" + "and c.division like '%RDC%'\r\n"
+ "and a.payCode like '%1100%'\r\n" //since in NMR no Zones no enrolled
+ "and a.payCode not like '%1100%' and a.payCode not like '%1200%'\r\n" //since in NMR no Zones no enrolled
+ "group by c.division\r\n" + "group by c.division\r\n"
+ "order by c.division") + "order by c.division")
ArrayList<String> getRDCZoneNames(); ArrayList<String> getRDCZoneNames();

22
src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMAbsenteesEmpListDataRepository.java

@ -324,5 +324,27 @@ public interface NULMAbsenteesEmpListDataRepository extends JpaRepository<ZoneDi
@Query(value="select d.designation from Employee d where d.payCode=:userId") @Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentKDGDesignation(String userId); public String getAbsentKDGDesignation(String userId);
// ----------------------Designation-----------------------------------------
@Query(value="select a.userId \r\n"+
"from RealTimeUserInfo a,DeviceStatus b, \r\n" +
"ZoneDivMaster c , Employee d\r\n" +
"where a.deviceId=b.deviceId and c.devname=b.deviceName and d.payCode=a.userId\r\n" +
"and a.userId not in (select a.payCode from MachineRawPunchh a,DeviceStatus b,ZoneDivMaster c \r\n" +
"where cast(a.officePunch as date) =:date and \r\n" +
"c.devname=b.deviceName and a.deviceId=b.deviceId \r\n" +
"AND a.payCode like '%1100%'and d.designation =:desig)\r\n" +
"and a.userId like '%1100%' and d.designation =:desig\r\n" +
"order by a.userId")
public ArrayList<String> 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);
} }

65
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<HeadQuaterEntries, Integer> {
@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<String> 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<String> 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<String> 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<String> getDesignationsAsPerDate(Date date);
}

21
src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMEnrolledEmpListDataRepository.java

@ -473,5 +473,26 @@ public interface NULMEnrolledEmpListDataRepository extends JpaRepository<ZoneDiv
public String getEnrolledKDGDesignation(String userId); public String getEnrolledKDGDesignation(String userId);
// ----------------------Designation Wise-----------------------------------------
@Query(value="select a.userId\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 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<String> 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);
} }

307
src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMHeadQuaterZonesEntriesRepository.java

@ -24,6 +24,19 @@ public interface NULMHeadQuaterZonesEntriesRepository extends JpaRepository<Head
+ "group by d.zone") + "group by d.zone")
ArrayList<Integer> getEnrolled(); ArrayList<Integer> 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<Integer> getZoneAsPerEnrolled();
@Query("select count(distinct a.payCode)\r\n" @Query("select count(distinct a.payCode)\r\n"
+ "from MachineRawPunchh a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\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.deviceId=b.deviceId \r\n"
@ -33,292 +46,14 @@ public interface NULMHeadQuaterZonesEntriesRepository extends JpaRepository<Head
+ "group by c.zone") + "group by c.zone")
ArrayList<Integer> getPunched(Date date); ArrayList<Integer> 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<Integer> getPunchedAsPerDate(Date date);

22
src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMPunchedEmpListDataRepository.java

@ -359,5 +359,27 @@ public interface NULMPunchedEmpListDataRepository extends JpaRepository<ZoneDivM
@Query(value="select d.designation from Employee d where d.payCode=:userId") @Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedKDGDesignation(String userId); public String getPunchedKDGDesignation(String userId);
// ----------------------Designation Wise-----------------------------------------
@Query(value="select distinct a.payCode\r\n" +
"from MachineRawPunchh a , DeviceStatus b, ZoneDivMaster c,\r\n" +
"Employee d\r\n" +
"where \r\n" +
"d.payCode=a.payCode and\r\n" +
"c.devname=b.deviceName\r\n" +
"and a.deviceId=b.deviceId \r\n" +
"and d.designation=:designation\r\n" +
"and a.payCode like '%1100%'\r\n" +
"and cast(a.officePunch as date) =:date\r\n" +
"order by a.payCode asc")
public ArrayList<String> 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);
} }

19
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") + "order by c.division")
ArrayList<String> getRDCOfficesAsPerPunched(Date date); ArrayList<String> 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<String> getRDCZoneNames(); ArrayList<String> getRDCZoneNames();

2
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.username=sa
spring.datasource.password=sss
spring.datasource.password=gcc@123
spring.datasource.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver spring.datasource.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver

Loading…
Cancel
Save