Browse Source

update

master
sachinsavita 4 years ago
commit
756956b6cb
  1. 33
      .gitignore
  2. BIN
      .mvn/wrapper/maven-wrapper.jar
  3. 2
      .mvn/wrapper/maven-wrapper.properties
  4. 316
      mvnw
  5. 188
      mvnw.cmd
  6. 85
      pom.xml
  7. 21
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/GccAttendanceApplication.java
  8. 24
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/TestApp.java
  9. 511
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/AbsenteesEmpListDataController.java
  10. 120
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/DeptHeadQuaterOfficeController.java
  11. 340
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/EnrolledEmpListDataController.java
  12. 315
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/HeadQuaterTotalEntriesRestController.java
  13. 311
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/HeadQuaterZonesEntriesRestController.java
  14. 504
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/PunchedEmpListDataController.java
  15. 121
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/RegionalDeputyCommissionerController.java
  16. 94
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/ZonalOfficeTotalDateController.java
  17. 523
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/ZoneDivisionOfficeController.java
  18. 1297
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMRAbsenteesEmpListDataController.java
  19. 148
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMRDeptHeadQuaterOfficeController.java
  20. 1052
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMREnrolledEmpListDataController.java
  21. 308
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMRHeadQuaterTotalEntriesRestController.java
  22. 135
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMRHeadQuaterZonesEntriesRestController.java
  23. 1073
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMROtherZoneOfficesController.java
  24. 1296
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMRPunchedEmpListDataController.java
  25. 139
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMRRegionalDeputyCommissionerController.java
  26. 84
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMRZonalOfficeTotalDateController.java
  27. 625
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMRZoneDivisionOfficeController.java
  28. 1296
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMAbsenteesEmpListDataController.java
  29. 146
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMDeptHeadQuaterOfficeController.java
  30. 1052
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMEnrolledEmpListDataController.java
  31. 306
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMHeadQuaterTotalEntriesRestController.java
  32. 305
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMHeadQuaterZonesEntriesRestController.java
  33. 1072
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMOtherZoneOfficesController.java
  34. 1295
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMPunchedEmpListDataController.java
  35. 137
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMRegionalDeputyCommissionerController.java
  36. 82
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMZonalOfficeTotalDateController.java
  37. 623
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMZoneDivisionOfficeController.java
  38. 1296
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMAbsenteesEmpListDataController.java
  39. 124
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMDeptHeadQuaterOfficeController.java
  40. 1051
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMEnrolledEmpListDataController.java
  41. 308
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMHeadQuaterTotalEntriesRestController.java
  42. 304
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMHeadQuaterZonesEntriesRestController.java
  43. 1070
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMOtherZoneOfficesController.java
  44. 1295
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMPunchedEmpListDataController.java
  45. 113
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMRegionalDeputyCommissionerController.java
  46. 85
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMZonalOfficeTotalDateController.java
  47. 548
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMZoneDivisionOfficeController.java
  48. 18
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/CustomerDAO.java
  49. 71
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/CustomerDAOImpl.java
  50. 59
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/CustomerDAOJpaImpl.java
  51. 12
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/DeviceStatusDAO.java
  52. 37
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/DeviceStatusDAOImpl.java
  53. 13
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/EmployeeDAO.java
  54. 59
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/EmployeeDAOImpl.java
  55. 10
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/MachineRawPunchDAO.java
  56. 36
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/MachineRawPunchDAOImpl.java
  57. 11
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/RealTimeUserInfoDAO.java
  58. 55
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/RealTimeUserInfoDAOImpl.java
  59. 91
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/entity/Customer.java
  60. 84
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/entity/DeviceStatus.java
  61. 214
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/entity/Employee.java
  62. 53
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/entity/HeadQuaterEntries.java
  63. 113
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/entity/MachineRawPunchh.java
  64. 108
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/entity/RealTimeUserInfo.java
  65. 44
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/entity/ZoneDivMaster.java
  66. 37
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/exception/CustomizedResponseEntityExceptionHandler.java
  67. 29
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/exception/ExceptionResponse.java
  68. 328
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/AbsenteesEmpListDataRepository.java
  69. 12
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/CustomerRepository.java
  70. 57
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/DeptHeadQuaterOfficeRepository.java
  71. 13
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/DeviceStatusRepository.java
  72. 49
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/EmployeeRepository.java
  73. 478
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/EnrolledEmpListDataRepository.java
  74. 327
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/HeadQuaterTotalEntriesRepository.java
  75. 328
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/HeadQuaterZonesEntriesRepository.java
  76. 12
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/MachineRawPunchRepository.java
  77. 350
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/OtherZoneOfficesRepository.java
  78. 366
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/PunchedEmpListDataRepository.java
  79. 13
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/RealTimeUserInfoRepository.java
  80. 341
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/RegionalDeputyCommissionerRepository.java
  81. 36
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/ZonalOfficeTotalDataRepository.java
  82. 346
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/ZoneDivisionOfficeRepository.java
  83. 329
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRAbsenteesEmpListDataRepository.java
  84. 70
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRDeptHeadQuaterOfficeRepository.java
  85. 475
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMREnrolledEmpListDataRepository.java
  86. 327
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRHeadQuaterTotalEntriesRepository.java
  87. 66
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRHeadQuaterZonesEntriesRepository.java
  88. 350
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMROtherZoneOfficesRepository.java
  89. 363
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRPunchedEmpListDataRepository.java
  90. 81
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRRegionalDeputyCommissionerRepository.java
  91. 36
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRZonalOfficeTotalDataRepository.java
  92. 372
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRZoneDivisionOfficeRepository.java
  93. 328
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMAbsenteesEmpListDataRepository.java
  94. 70
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMDeptHeadQuaterOfficeRepository.java
  95. 477
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMEnrolledEmpListDataRepository.java
  96. 327
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMHeadQuaterTotalEntriesRepository.java
  97. 328
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMHeadQuaterZonesEntriesRepository.java
  98. 350
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMOtherZoneOfficesRepository.java
  99. 363
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMPunchedEmpListDataRepository.java
  100. 352
      src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMRegionalDeputyCommissionerRepository.java

33
.gitignore

@ -0,0 +1,33 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/

BIN
.mvn/wrapper/maven-wrapper.jar

2
.mvn/wrapper/maven-wrapper.properties

@ -0,0 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.6/apache-maven-3.8.6-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar

316
mvnw

@ -0,0 +1,316 @@
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Maven Start Up Batch script
#
# Required ENV vars:
# ------------------
# JAVA_HOME - location of a JDK home dir
#
# Optional ENV vars
# -----------------
# M2_HOME - location of maven2's installed home dir
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
# e.g. to debug Maven itself, use
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
# ----------------------------------------------------------------------------
if [ -z "$MAVEN_SKIP_RC" ] ; then
if [ -f /usr/local/etc/mavenrc ] ; then
. /usr/local/etc/mavenrc
fi
if [ -f /etc/mavenrc ] ; then
. /etc/mavenrc
fi
if [ -f "$HOME/.mavenrc" ] ; then
. "$HOME/.mavenrc"
fi
fi
# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
mingw=false
case "`uname`" in
CYGWIN*) cygwin=true ;;
MINGW*) mingw=true;;
Darwin*) darwin=true
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
if [ -z "$JAVA_HOME" ]; then
if [ -x "/usr/libexec/java_home" ]; then
export JAVA_HOME="`/usr/libexec/java_home`"
else
export JAVA_HOME="/Library/Java/Home"
fi
fi
;;
esac
if [ -z "$JAVA_HOME" ] ; then
if [ -r /etc/gentoo-release ] ; then
JAVA_HOME=`java-config --jre-home`
fi
fi
if [ -z "$M2_HOME" ] ; then
## resolve links - $0 may be a link to maven's home
PRG="$0"
# need this for relative symlinks
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG="`dirname "$PRG"`/$link"
fi
done
saveddir=`pwd`
M2_HOME=`dirname "$PRG"`/..
# make it fully qualified
M2_HOME=`cd "$M2_HOME" && pwd`
cd "$saveddir"
# echo Using m2 at $M2_HOME
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --unix "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi
# For Mingw, ensure paths are in UNIX format before anything is touched
if $mingw ; then
[ -n "$M2_HOME" ] &&
M2_HOME="`(cd "$M2_HOME"; pwd)`"
[ -n "$JAVA_HOME" ] &&
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
fi
if [ -z "$JAVA_HOME" ]; then
javaExecutable="`which javac`"
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
# readlink(1) is not available as standard on Solaris 10.
readLink=`which readlink`
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
if $darwin ; then
javaHome="`dirname \"$javaExecutable\"`"
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
else
javaExecutable="`readlink -f \"$javaExecutable\"`"
fi
javaHome="`dirname \"$javaExecutable\"`"
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
JAVA_HOME="$javaHome"
export JAVA_HOME
fi
fi
fi
if [ -z "$JAVACMD" ] ; then
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
else
JAVACMD="`\\unset -f command; \\command -v java`"
fi
fi
if [ ! -x "$JAVACMD" ] ; then
echo "Error: JAVA_HOME is not defined correctly." >&2
echo " We cannot execute $JAVACMD" >&2
exit 1
fi
if [ -z "$JAVA_HOME" ] ; then
echo "Warning: JAVA_HOME environment variable is not set."
fi
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
# traverses directory structure from process work directory to filesystem root
# first directory with .mvn subdirectory is considered project base directory
find_maven_basedir() {
if [ -z "$1" ]
then
echo "Path not specified to find_maven_basedir"
return 1
fi
basedir="$1"
wdir="$1"
while [ "$wdir" != '/' ] ; do
if [ -d "$wdir"/.mvn ] ; then
basedir=$wdir
break
fi
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
if [ -d "${wdir}" ]; then
wdir=`cd "$wdir/.."; pwd`
fi
# end of workaround
done
echo "${basedir}"
}
# concatenates all lines of a file
concat_lines() {
if [ -f "$1" ]; then
echo "$(tr -s '\n' ' ' < "$1")"
fi
}
BASE_DIR=`find_maven_basedir "$(pwd)"`
if [ -z "$BASE_DIR" ]; then
exit 1;
fi
##########################################################################################
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
# This allows using the maven wrapper in projects that prohibit checking in binary data.
##########################################################################################
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found .mvn/wrapper/maven-wrapper.jar"
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
fi
if [ -n "$MVNW_REPOURL" ]; then
jarUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
else
jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
fi
while IFS="=" read key value; do
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
esac
done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
if [ "$MVNW_VERBOSE" = true ]; then
echo "Downloading from: $jarUrl"
fi
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
if $cygwin; then
wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
fi
if command -v wget > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found wget ... using wget"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
wget "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
else
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
fi
elif command -v curl > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found curl ... using curl"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
curl -o "$wrapperJarPath" "$jarUrl" -f
else
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Falling back to using Java to download"
fi
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
# For Cygwin, switch paths to Windows format before running javac
if $cygwin; then
javaClass=`cygpath --path --windows "$javaClass"`
fi
if [ -e "$javaClass" ]; then
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Compiling MavenWrapperDownloader.java ..."
fi
# Compiling the Java class
("$JAVA_HOME/bin/javac" "$javaClass")
fi
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
# Running the downloader
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Running MavenWrapperDownloader.java ..."
fi
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
fi
fi
fi
fi
##########################################################################################
# End of extension
##########################################################################################
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
if [ "$MVNW_VERBOSE" = true ]; then
echo $MAVEN_PROJECTBASEDIR
fi
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --path --windows "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
fi
# Provide a "standardized" way to retrieve the CLI args that will
# work with both Windows and non-Windows executions.
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
export MAVEN_CMD_LINE_ARGS
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
exec "$JAVACMD" \
$MAVEN_OPTS \
$MAVEN_DEBUG_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
"-Dmaven.home=${M2_HOME}" \
"-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

188
mvnw.cmd

@ -0,0 +1,188 @@
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM https://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Maven Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
@REM ----------------------------------------------------------------------------
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM set title of command window
title %0
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %*
if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %*
:skipRcPre
@setlocal
set ERROR_CODE=0
@REM To isolate internal variables from possible post scripts, we use another setlocal
@setlocal
@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome
echo.
echo Error: JAVA_HOME not found in your environment. >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto init
echo.
echo Error: JAVA_HOME is set to an invalid directory. >&2
echo JAVA_HOME = "%JAVA_HOME%" >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
@REM ==== END VALIDATION ====
:init
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
@REM Fallback to current working directory if not found.
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
set EXEC_DIR=%CD%
set WDIR=%EXEC_DIR%
:findBaseDir
IF EXIST "%WDIR%"\.mvn goto baseDirFound
cd ..
IF "%WDIR%"=="%CD%" goto baseDirNotFound
set WDIR=%CD%
goto findBaseDir
:baseDirFound
set MAVEN_PROJECTBASEDIR=%WDIR%
cd "%EXEC_DIR%"
goto endDetectBaseDir
:baseDirNotFound
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
cd "%EXEC_DIR%"
:endDetectBaseDir
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
@setlocal EnableExtensions EnableDelayedExpansion
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
:endReadAdditionalConfig
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
)
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
if exist %WRAPPER_JAR% (
if "%MVNW_VERBOSE%" == "true" (
echo Found %WRAPPER_JAR%
)
) else (
if not "%MVNW_REPOURL%" == "" (
SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
)
if "%MVNW_VERBOSE%" == "true" (
echo Couldn't find %WRAPPER_JAR%, downloading it ...
echo Downloading from: %DOWNLOAD_URL%
)
powershell -Command "&{"^
"$webclient = new-object System.Net.WebClient;"^
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
"}"^
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
"}"
if "%MVNW_VERBOSE%" == "true" (
echo Finished downloading %WRAPPER_JAR%
)
)
@REM End of extension
@REM Provide a "standardized" way to retrieve the CLI args that will
@REM work with both Windows and non-Windows executions.
set MAVEN_CMD_LINE_ARGS=%*
%MAVEN_JAVA_EXE% ^
%JVM_CONFIG_MAVEN_PROPS% ^
%MAVEN_OPTS% ^
%MAVEN_DEBUG_OPTS% ^
-classpath %WRAPPER_JAR% ^
"-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^
%WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end
:error
set ERROR_CODE=1
:end
@endlocal & set ERROR_CODE=%ERROR_CODE%
if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat"
if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd"
:skipRcPost
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%"=="on" pause
if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE%
cmd /C exit /B %ERROR_CODE%

85
pom.xml

@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.5</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>com.gcc.biometric.api</groupId>
<artifactId>GccBioMetricApi</artifactId>
<version>2.0.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>GccBioMetricApi</name>
<description>Spring Boot Api</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>8.4.1.jre8</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!--######################################### -->
<!--<dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId>
</dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-entitymanager</artifactId>
</dependency> -->
<!--######################################### -->
<!-- https://mvnrepository.com/artifact/org.json/json -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20171018</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency> <!--$NO-MVN-MAN-VER$ -->
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
<defaultGoal>package</defaultGoal>
</build>
</project>

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

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

24
src/main/java/com/gcc/biometric/api/GccBioMetricApi/TestApp.java

@ -0,0 +1,24 @@
package com.gcc.biometric.api.GccBioMetricApi;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Vector;
import java.security.*;
public class TestApp {
public static void main(String[] args) {
for (Provider provider: Security.getProviders()) {
System.out.println(provider.getName());
for (String key: provider.stringPropertyNames())
System.out.println("\t" + key + "\t" + provider.getProperty(key));
}
}
}

511
src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/AbsenteesEmpListDataController.java

@ -0,0 +1,511 @@
package com.gcc.biometric.api.GccBioMetricApi.controller;
import org.springframework.web.bind.annotation.GetMapping;
import java.util.LinkedHashMap;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Map;
import java.util.List;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.beans.factory.annotation.Autowired;
import com.gcc.biometric.api.GccBioMetricApi.repo.AbsenteesEmpListDataRepository;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/gcc.com")
public class AbsenteesEmpListDataController {
@Autowired
private AbsenteesEmpListDataRepository absenteesEmpListDataRepository;
@Autowired
public AbsenteesEmpListDataController(AbsenteesEmpListDataRepository theAbsenteesEmpListDataRepository) {
absenteesEmpListDataRepository = theAbsenteesEmpListDataRepository;
}
// -----Division office Enrolled-----------------------------------------
@GetMapping({ "/getDivAbsentEmpList/{div}/{tempDate}" })
public List<Object> getDivPunchedEmpList(@PathVariable String div,
@PathVariable final String tempDate) {
String divValue = div;
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(date);
System.out.println(divValue);
ArrayList<String> tempAbsentUserId = new ArrayList<>();
ArrayList<String> AbsentUserName = new ArrayList<>();
ArrayList<String> AbsentUserDesignation = new ArrayList<>();
tempAbsentUserId = absenteesEmpListDataRepository.getAbsentDivUserId(divValue, date);
ArrayList<String> AbsentUserId = new ArrayList<String>();
for (int i = 0; i < tempAbsentUserId.size(); i++) {
AbsentUserId.add(tempAbsentUserId.get(i).trim());
}
System.out.println(AbsentUserId.size());
for (int i = 0; i < AbsentUserId.size(); i++) {
AbsentUserName.add(absenteesEmpListDataRepository.getAbsentDivUserName(AbsentUserId.get(i)).trim());
AbsentUserDesignation.add(absenteesEmpListDataRepository.getAbsentDivDesignation(AbsentUserId.get(i)).trim());
}
// System.out.println(PunchedUserName);
System.out.println(AbsentUserName.size());
// System.out.println(PunchedUserDesignation);
System.out.println(AbsentUserDesignation.size());
List<Object> listMap = new ArrayList<>();
if (!AbsentUserId.isEmpty()) {
for (int i = 0; i < AbsentUserId.size(); i++) {
ArrayList<String> myListKey = new ArrayList<String>();
ArrayList<String> myListValue = new ArrayList<String>();
myListKey.add("UserId");
myListValue.add(AbsentUserId.get(i));
myListKey.add("UserName");
myListValue.add(AbsentUserName.get(i).trim());
myListKey.add("Designation");
myListValue.add(AbsentUserDesignation.get(i).trim());
final 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");
listMap.add("Message: Success");
listMap.add("ResultSet: True");
return listMap;
}
else {
final ArrayList<String> myListKey2 = new ArrayList<String>();
final ArrayList<String> myListValue2 = new ArrayList<String>();
myListKey2.add("UserId");
myListValue2.add("0");
myListKey2.add("UserName");
myListValue2.add("0");
myListKey2.add("Designation");
myListValue2.add("0");
final 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;
}
}
// ----------------Unit office Enrolled---------------
@GetMapping({ "/getUnitAbsentEmpList/{unit}/{tempDate}" })
public List<Object> getUnitPunchedEmpList(@PathVariable String unit, @PathVariable String tempDate) {
String unitValue = unit;
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(date);
System.out.println(unitValue);
ArrayList<String> tempPunchedUserId = new ArrayList<>();
ArrayList<String> PunchedUserName = new ArrayList<>();
ArrayList<String> PunchedUserDesignation = new ArrayList<>();
tempPunchedUserId = absenteesEmpListDataRepository.getAbsentUnitUserId(unitValue, 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.getAbsentUnitUserName(PunchedUserId.get(i)).trim());
PunchedUserDesignation
.add(absenteesEmpListDataRepository.getAbsentUnitDesignation(PunchedUserId.get(i)).trim());
}
// System.out.println(PunchedUserName);
System.out.println(PunchedUserName.size());
// System.out.println(PunchedUserDesignation);
System.out.println(PunchedUserDesignation.size());
List<Object> listMap = new ArrayList<>();
if (!tempPunchedUserId.isEmpty()) {
for (int i = 0; i < tempPunchedUserId.size(); i++) {
final ArrayList<String> myListKey = new ArrayList<String>();
final 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());
final 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;
}
final ArrayList<String> myListKey2 = new ArrayList<String>();
final ArrayList<String> myListValue2 = new ArrayList<String>();
myListKey2.add("UserId");
myListValue2.add("0");
myListKey2.add("UserName");
myListValue2.add("0");
myListKey2.add("Designation");
myListValue2.add("0");
final 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;
}
// // ----------------------Lorry office Enrolled------------------------
@GetMapping({ "/getLorryAbsentEmpList/{zone}/{tempDate}" })
public List<Map<String, String>> getLorryPunchedEmpList(@PathVariable Integer zone,
@PathVariable final String tempDate) {
Integer zoneValue = zone;
if (zoneValue == 1 || zoneValue == 2 || zoneValue == 3) {
zoneValue = 1;
}
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.getAbsentLorryUserId(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.getAbsentLorryUserName(PunchedUserId.get(i)).trim());
PunchedUserDesignation
.add(absenteesEmpListDataRepository.getAbsentLorryDesignation(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++) {
final ArrayList<String> myListKey = new ArrayList<String>();
final 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());
final 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;
}
final ArrayList<String> myListKey2 = new ArrayList<String>();
final ArrayList<String> myListValue2 = new ArrayList<String>();
myListKey2.add("UserId");
myListValue2.add("0");
myListKey2.add("UserName");
myListValue2.add("0");
myListKey2.add("Designation");
myListValue2.add("0");
final 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;
}
// // ----------------------zonal office Enrolled-----------------------
@GetMapping({ "/getZonalAbsentEmpList/{zone}/{tempDate}" })
public List<Map<String, String>> getZonalPunchedEmpList(@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.getAbsentZonalUserId(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.getAbsentZonalUserName(PunchedUserId.get(i)).trim());
PunchedUserDesignation
.add(absenteesEmpListDataRepository.getAbsentZonalDesignation(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++) {
final ArrayList<String> myListKey = new ArrayList<String>();
final 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());
final 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;
}
final ArrayList<String> myListKey2 = new ArrayList<String>();
final ArrayList<String> myListValue2 = new ArrayList<String>();
myListKey2.add("UserId");
myListValue2.add("0");
myListKey2.add("UserName");
myListValue2.add("0");
myListKey2.add("Designation");
myListValue2.add("0");
final 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;
}
// // ----------------------Department office Enrolled---------------------------
@GetMapping({ "/getDeptAbsentEmpList/{dept}/{tempDate}" })
public List<Map<String, String>> getDeptPunchedEmpList(@PathVariable String dept,
@PathVariable final String tempDate) {
String zoneValue = dept;
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.getAbsentDeptUserId(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.getAbsentDeptUserName(PunchedUserId.get(i)).trim());
PunchedUserDesignation
.add(absenteesEmpListDataRepository.getAbsentDeptDesignation(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;
}
// // ----------------------RDC office Enrolled---------------------------
@GetMapping({ "/getRDCAbsentEmpList/{zone}/{tempDate}" })
public List<Map<String, String>> getRDCPunchedEmpList(@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.getAbsentRDCUserId(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.getAbsentRDCUserName(PunchedUserId.get(i)).trim());
PunchedUserDesignation
.add(absenteesEmpListDataRepository.getAbsentRDCDesignation(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;
}
}

120
src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/DeptHeadQuaterOfficeController.java

@ -0,0 +1,120 @@
package com.gcc.biometric.api.GccBioMetricApi.controller;
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.DeptHeadQuaterOfficeRepository;
@RestController
@RequestMapping("/gcc.com")
public class DeptHeadQuaterOfficeController {
@Autowired
private DeptHeadQuaterOfficeRepository deptHeadQuaterOfficeRepository;
@Autowired
public DeptHeadQuaterOfficeController(DeptHeadQuaterOfficeRepository theDeptHeadQuaterOfficeRepository) {
deptHeadQuaterOfficeRepository = theDeptHeadQuaterOfficeRepository;
}
@GetMapping("/HeadQuaterDepartmentOfficeData/{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> allHQDepartments;
ArrayList<String> allHQDepartmentsAsperDate;
ArrayList<String> hqDepartmentsEnrolled;
ArrayList<String> hqDepartmentsPunched;
allHQDepartments = deptHeadQuaterOfficeRepository.getAllHQDepartmentOffices();
allHQDepartmentsAsperDate = deptHeadQuaterOfficeRepository.getHQDepartmentOfficesAsPerDate(date);
hqDepartmentsPunched = deptHeadQuaterOfficeRepository.getHQDepartmentOfficePunched(date);
System.out.println("All Departments: "+allHQDepartments);
System.out.println("All Departments as per date: "+allHQDepartmentsAsperDate);
hqDepartmentsEnrolled = deptHeadQuaterOfficeRepository.getHQDepartmentOfficeEnrolled();
System.out.println("Enrolled: "+hqDepartmentsEnrolled);
System.out.println("Punched: "+hqDepartmentsPunched);
String divAbsent = null;
String divPercentage = null;
Integer j = 0;
List<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
for (int i = 0; i <allHQDepartments.size(); i++) {
ArrayList<String> myListKey = new ArrayList<>();
ArrayList<String> myListValue = new ArrayList<>();
myListKey.add("Department"); myListValue.add(allHQDepartments.get(i));
myListKey.add("Enrolled"); myListValue.add(hqDepartmentsEnrolled.get(i));
if (allHQDepartmentsAsperDate.contains(allHQDepartments.get(i)))
{
myListKey.add("Punched"); myListValue.add(hqDepartmentsPunched.get(j));
Integer xDivAbsent = Integer.parseInt(hqDepartmentsEnrolled.get(i)) - Integer.parseInt(hqDepartmentsPunched.get(j));
Integer xdivPercentage = ((Integer.parseInt((hqDepartmentsPunched.get(j))) *100)/ Integer.parseInt(hqDepartmentsEnrolled.get(i)));
divAbsent = xDivAbsent.toString();
divPercentage = xdivPercentage.toString();
j++;
}
else
{
myListKey.add("Punched"); myListValue.add("0");
divAbsent = hqDepartmentsEnrolled.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);
}
}

340
src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/EnrolledEmpListDataController.java

@ -0,0 +1,340 @@
package com.gcc.biometric.api.GccBioMetricApi.controller;
import org.springframework.web.bind.annotation.GetMapping;
import java.util.LinkedHashMap;
import java.util.ArrayList;
import java.util.Map;
import java.util.List;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.beans.factory.annotation.Autowired;
import com.gcc.biometric.api.GccBioMetricApi.repo.EnrolledEmpListDataRepository;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/gcc.com")
public class EnrolledEmpListDataController
{
@Autowired
private EnrolledEmpListDataRepository enrolledEmpListDataRepository;
@Autowired
public EnrolledEmpListDataController(EnrolledEmpListDataRepository theEnrolledEmpListDataRepository) {
enrolledEmpListDataRepository = theEnrolledEmpListDataRepository;
}
ArrayList<String> EnrolledUserId;
ArrayList<String> EnrolledUserName;
ArrayList<String> EnrolledUserDesignation;
// ----------------------Division office Enrolled-----------------------------------------
@GetMapping({ "/getDivEnrolledEmpList/{div}" })
public List<Map<String, String>> getDivEnrolledEmpList(@PathVariable String div) {
String divValue = div;
System.out.println(divValue);
EnrolledUserId = enrolledEmpListDataRepository.getEnrolledDivUserId(divValue);
EnrolledUserName = enrolledEmpListDataRepository.getEnrolledDivUserName(divValue);
EnrolledUserDesignation = enrolledEmpListDataRepository.getEnrolledDivDesignation(divValue);
System.out.println(EnrolledUserId.size());
List<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
if (!EnrolledUserId.isEmpty()) {
for (int i = 0; i < EnrolledUserId.size(); ++i) {
final ArrayList<String> myListKey = new ArrayList<String>();
final ArrayList<String> myListValue = new ArrayList<String>();
myListKey.add("UserId");
myListValue.add(EnrolledUserId.get(i));
myListKey.add("UserName");
myListValue.add(EnrolledUserName.get(i));
myListKey.add("Designation");
myListValue.add(EnrolledUserDesignation.get(i).trim());
final 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;
}
final ArrayList<String> myListKey2 = new ArrayList<String>();
final ArrayList<String> myListValue2 = new ArrayList<String>();
myListKey2.add("UserId");
myListValue2.add("0");
myListKey2.add("UserName");
myListValue2.add("0");
myListKey2.add("Designation");
myListValue2.add("0");
final 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;
}
// ----------------------Unit office Enrolled-----------------------------------------
@GetMapping({ "/getUnitEnrolledEmpList/{unit}" })
public List<Map<String, String>> getUnitEnrolledEmpList(@PathVariable String unit) {
String unitValue = unit;
System.out.println(unitValue);
EnrolledUserId = enrolledEmpListDataRepository.getEnrolledUnitUserId(unitValue);
EnrolledUserName = enrolledEmpListDataRepository.getEnrolledUnitUserName(unitValue);
EnrolledUserDesignation = enrolledEmpListDataRepository.getEnrolledUnitDesignation(unitValue);
System.out.println(EnrolledUserId.size());
List<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
if (!EnrolledUserId.isEmpty()) {
for (int i = 0; i < EnrolledUserId.size(); ++i) {
final ArrayList<String> myListKey = new ArrayList<String>();
final ArrayList<String> myListValue = new ArrayList<String>();
myListKey.add("UserId");
myListValue.add(EnrolledUserId.get(i));
myListKey.add("UserName");
myListValue.add(EnrolledUserName.get(i));
myListKey.add("Designation");
myListValue.add(EnrolledUserDesignation.get(i).trim());
final 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;
}
final ArrayList<String> myListKey2 = new ArrayList<String>();
final ArrayList<String> myListValue2 = new ArrayList<String>();
myListKey2.add("UserId");
myListValue2.add("0");
myListKey2.add("UserName");
myListValue2.add("0");
myListKey2.add("Designation");
myListValue2.add("0");
final 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;
}
// // ----------------------Lorry office Enrolled-----------------------------------------
@GetMapping({ "/getLorryEnrolledEmpList/{zone}" })
public List<Map<String, String>> getLorryEnrolledEmpList(@PathVariable Integer zone) {
Integer zoneValue = zone;
if(zoneValue==1 || zoneValue==2 || zoneValue==3)
{
zoneValue = 1;
}
System.out.println(zoneValue);
EnrolledUserId = enrolledEmpListDataRepository.getEnrolledLorryUserId(zoneValue);
EnrolledUserName = enrolledEmpListDataRepository.getEnrolledLorryUserName(zoneValue);
EnrolledUserDesignation = enrolledEmpListDataRepository.getEnrolledLorryDesignation(zoneValue);
System.out.println(EnrolledUserId.size());
List<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
if (!EnrolledUserId.isEmpty()) {
for (int i = 0; i < EnrolledUserId.size(); ++i) {
final ArrayList<String> myListKey = new ArrayList<String>();
final ArrayList<String> myListValue = new ArrayList<String>();
myListKey.add("UserId");
myListValue.add(EnrolledUserId.get(i));
myListKey.add("UserName");
myListValue.add(EnrolledUserName.get(i));
myListKey.add("Designation");
myListValue.add(EnrolledUserDesignation.get(i).trim());
final 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;
}
final ArrayList<String> myListKey2 = new ArrayList<String>();
final ArrayList<String> myListValue2 = new ArrayList<String>();
myListKey2.add("UserId");
myListValue2.add("0");
myListKey2.add("UserName");
myListValue2.add("0");
myListKey2.add("Designation");
myListValue2.add("0");
final 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;
}
// // ----------------------zonal office Enrolled-----------------------------------------
@GetMapping({ "/getZonalEnrolledEmpList/{zone}" })
public List<Map<String, String>> getZonalEnrolledEmpList(@PathVariable Integer zone) {
Integer zoneValue = zone;
System.out.println(zoneValue);
EnrolledUserId = enrolledEmpListDataRepository.getEnrolledZonalUserId(zoneValue);
EnrolledUserName = enrolledEmpListDataRepository.getEnrolledZonalUserName(zoneValue);
EnrolledUserDesignation = enrolledEmpListDataRepository.getEnrolledZonalDesignation(zoneValue);
System.out.println(EnrolledUserId.size());
List<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
if (!EnrolledUserId.isEmpty()) {
for (int i = 0; i < EnrolledUserId.size(); ++i) {
final ArrayList<String> myListKey = new ArrayList<String>();
final ArrayList<String> myListValue = new ArrayList<String>();
myListKey.add("UserId");
myListValue.add(EnrolledUserId.get(i));
myListKey.add("UserName");
myListValue.add(EnrolledUserName.get(i));
myListKey.add("Designation");
myListValue.add(EnrolledUserDesignation.get(i).trim());
final 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;
}
final ArrayList<String> myListKey2 = new ArrayList<String>();
final ArrayList<String> myListValue2 = new ArrayList<String>();
myListKey2.add("UserId");
myListValue2.add("0");
myListKey2.add("UserName");
myListValue2.add("0");
myListKey2.add("Designation");
myListValue2.add("0");
final 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;
}
// // ----------------------Department office Enrolled-----------------------------------------
@GetMapping({ "/getDeptEnrolledEmpList/{dept}" })
public List<Map<String, String>> getDeptEnrolledEmpList(@PathVariable String dept) {
String zoneValue = dept;
System.out.println(zoneValue);
EnrolledUserId = enrolledEmpListDataRepository.getEnrolledDeptUserId(zoneValue);
EnrolledUserName = enrolledEmpListDataRepository.getEnrolledDeptUserName(zoneValue);
EnrolledUserDesignation = enrolledEmpListDataRepository.getEnrolledDeptDesignation(zoneValue);
System.out.println(EnrolledUserId.size());
List<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
if (!EnrolledUserId.isEmpty()) {
for (int i = 0; i < EnrolledUserId.size(); ++i) {
ArrayList<String> myListKey = new ArrayList<String>();
ArrayList<String> myListValue = new ArrayList<String>();
myListKey.add("UserId");
myListValue.add(EnrolledUserId.get(i));
myListKey.add("UserName");
myListValue.add(EnrolledUserName.get(i));
myListKey.add("Designation");
myListValue.add(EnrolledUserDesignation.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;
}
// // ----------------------RDC office Enrolled-----------------------------------------
@GetMapping({ "/getRDCEnrolledEmpList/{zone}" })
public List<Map<String, String>> getRDCEnrolledEmpList(@PathVariable Integer zone) {
Integer zoneValue = zone;
System.out.println(zoneValue);
EnrolledUserId = enrolledEmpListDataRepository.getEnrolledRDCUserId(zoneValue);
EnrolledUserName = enrolledEmpListDataRepository.getEnrolledRDCUserName(zoneValue);
EnrolledUserDesignation = enrolledEmpListDataRepository.getEnrolledRDCDesignation(zoneValue);
System.out.println(EnrolledUserId.size());
List<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
if (!EnrolledUserId.isEmpty()) {
for (int i = 0; i < EnrolledUserId.size(); ++i) {
ArrayList<String> myListKey = new ArrayList<String>();
ArrayList<String> myListValue = new ArrayList<String>();
myListKey.add("UserId");
myListValue.add(EnrolledUserId.get(i));
myListKey.add("UserName");
myListValue.add(EnrolledUserName.get(i));
myListKey.add("Designation");
myListValue.add(EnrolledUserDesignation.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;
}
}

315
src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/HeadQuaterTotalEntriesRestController.java

@ -0,0 +1,315 @@
package com.gcc.biometric.api.GccBioMetricApi.controller;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.LinkedHashMap;
import org.springframework.beans.factory.annotation.Autowired;
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.HeadQuaterTotalEntriesRepository;
import com.gcc.biometric.api.GccBioMetricApi.repo.ZoneDivisionOfficeRepository;
@RestController
@RequestMapping("/gcc.com")
public class HeadQuaterTotalEntriesRestController {
@Autowired
private HeadQuaterTotalEntriesRepository headQuaterTotalEntriesRepository;
// inject employee dao
@Autowired
public HeadQuaterTotalEntriesRestController(HeadQuaterTotalEntriesRepository theHeadQuaterTotalEntriesRepository) {
headQuaterTotalEntriesRepository = theHeadQuaterTotalEntriesRepository;
}
ArrayList<Integer> arrZoneEnroll;
ArrayList<Integer> arrZonePunched;
@GetMapping("/HQTotalEmpCountPresentAbsentPercentage/{tempDate}")
public LinkedHashMap<String, Object> getZoneEnrollPunchAbsentPercentage(@PathVariable String tempDate) //@RequestParam(value = "date")@DateTimeFormat(pattern="yyyy-MM-dd") LocalDate date
{
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(date);
LinkedHashMap<String, Integer> map = new LinkedHashMap<>();
LinkedHashMap<String, Object> resultMap = new LinkedHashMap<>();
arrZoneEnroll = headQuaterTotalEntriesRepository.getEnrolled();
arrZonePunched = headQuaterTotalEntriesRepository.getPunched(date);
System.out.println("Enrolled: "+arrZoneEnroll);
System.out.println("Punched: "+arrZonePunched);
System.out.println(arrZonePunched.isEmpty());
Integer zoneAbsent=0;
Integer zonePercentage=0;
for(int i=0;i<arrZoneEnroll.size();i++)
{
System.out.println("Printing for zone_"+i);
if(arrZonePunched.isEmpty())
{
map.put("Zone_"+(i+1)+"", i+1);
map.put("Zone_"+(i+1)+"_enrolled", arrZoneEnroll.get(i));
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("Percentage_"+(i+1)+"", zonePercentage);
zoneAbsent=0;
zonePercentage=0;
}
else
{
map.put("Zone_"+(i+1)+"", i+1);
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));
map.put("Absent_"+(i+1)+"", zoneAbsent);
map.put("Percentage_"+(i+1)+"", zonePercentage);
zoneAbsent=0;
zonePercentage=0;
}
}
resultMap.put("Data", map);
resultMap.put("Message", "Success");
resultMap.put("ResultStatus", "True");
return resultMap;
}
// @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;
// }
}

311
src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/HeadQuaterZonesEntriesRestController.java

@ -0,0 +1,311 @@
package com.gcc.biometric.api.GccBioMetricApi.controller;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.LinkedHashMap;
import org.springframework.beans.factory.annotation.Autowired;
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.HeadQuaterZonesEntriesRepository;
@RestController
@RequestMapping("/gcc.com")
public class HeadQuaterZonesEntriesRestController {
@Autowired
private HeadQuaterZonesEntriesRepository headQuaterZonesEntriesRepository;
// inject employee dao
@Autowired
public HeadQuaterZonesEntriesRestController(HeadQuaterZonesEntriesRepository theHeadQuaterEntriesRepository) {
headQuaterZonesEntriesRepository = theHeadQuaterEntriesRepository;
}
ArrayList<Integer> arrZoneEnroll;
ArrayList<Integer> arrZonePunched;
@GetMapping("/HQZonesEmpCountPresentAbsentPercentage/{tempDate}")
public LinkedHashMap<String, Object> getZoneEnrollPunchAbsentPercentage(@PathVariable String tempDate) //@RequestParam(value = "date")@DateTimeFormat(pattern="yyyy-MM-dd") LocalDate date
{
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(date);
LinkedHashMap<String, Object> resultMap = new LinkedHashMap<>();
LinkedHashMap<String, Integer> map = new LinkedHashMap<>();
arrZoneEnroll = headQuaterZonesEntriesRepository.getEnrolled();
arrZonePunched = headQuaterZonesEntriesRepository.getPunched(date);
System.out.println("Enrolled: "+arrZoneEnroll);
System.out.println("Punched: "+arrZonePunched);
System.out.println(arrZonePunched.isEmpty());
Integer zoneAbsent=0;
Integer zonePercentage=0;
for(int i=0;i<arrZoneEnroll.size();i++)
{
System.out.println("Printing for zone_"+i);
if(arrZonePunched.isEmpty())
{
map.put("Zone_"+(i+1)+"", i+1);
map.put("Zone_"+(i+1)+"_enrolled", arrZoneEnroll.get(i));
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("Percentage_"+(i+1)+"", zonePercentage);
zoneAbsent=0;
zonePercentage=0;
}
else
{
map.put("Zone_"+(i+1)+"", i+1);
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));
map.put("Absent_"+(i+1)+"", zoneAbsent);
map.put("Percentage_"+(i+1)+"", zonePercentage);
zoneAbsent=0;
zonePercentage=0;
}
}
resultMap.put("Data", map);
resultMap.put("Message", "Success");
resultMap.put("ResultStatus", "True");
return resultMap;
}
// @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;
// }
}

504
src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/PunchedEmpListDataController.java

@ -0,0 +1,504 @@
package com.gcc.biometric.api.GccBioMetricApi.controller;
import org.springframework.web.bind.annotation.GetMapping;
import java.util.LinkedHashMap;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Map;
import java.util.List;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.beans.factory.annotation.Autowired;
import com.gcc.biometric.api.GccBioMetricApi.repo.PunchedEmpListDataRepository;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/gcc.com")
public class PunchedEmpListDataController {
@Autowired
private PunchedEmpListDataRepository punchedEmpListDataRepository;
@Autowired
public PunchedEmpListDataController(PunchedEmpListDataRepository theEnrolledEmpListDataRepository) {
punchedEmpListDataRepository = theEnrolledEmpListDataRepository;
}
// -----Division office Enrolled-----------------------------------------
@GetMapping({ "/getDivPunchedEmpList/{div}/{tempDate}" })
public List<Map<String, String>> getDivPunchedEmpList(@PathVariable String div,
@PathVariable final String tempDate) {
String divValue = div;
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(date);
System.out.println(divValue);
ArrayList<String> tempPunchedUserId = new ArrayList<>();
ArrayList<String> PunchedUserName = new ArrayList<>();
ArrayList<String> PunchedUserDesignation = new ArrayList<>();
tempPunchedUserId = punchedEmpListDataRepository.getPunchedDivUserId(divValue, 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.getPunchedDivUserName(PunchedUserId.get(i)).trim());
PunchedUserDesignation
.add(punchedEmpListDataRepository.getPunchedDivDesignation(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 (!PunchedUserId.isEmpty()) {
for (int i = 0; i < PunchedUserId.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());
final 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;
}
final ArrayList<String> myListKey2 = new ArrayList<String>();
final ArrayList<String> myListValue2 = new ArrayList<String>();
myListKey2.add("UserId");
myListValue2.add("0");
myListKey2.add("UserName");
myListValue2.add("0");
myListKey2.add("Designation");
myListValue2.add("0");
final 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;
}
// ----------------Unit office Enrolled---------------
@GetMapping({ "/getUnitPunchedEmpList/{unit}/{tempDate}" })
public List<Map<String, String>> getUnitPunchedEmpList(@PathVariable String unit, @PathVariable String tempDate) {
String unitValue = unit;
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(date);
System.out.println(unitValue);
ArrayList<String> tempPunchedUserId = new ArrayList<>();
ArrayList<String> PunchedUserName = new ArrayList<>();
ArrayList<String> PunchedUserDesignation = new ArrayList<>();
tempPunchedUserId = punchedEmpListDataRepository.getPunchedUnitUserId(unitValue, 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.getPunchedUnitUserName(PunchedUserId.get(i)).trim());
PunchedUserDesignation
.add(punchedEmpListDataRepository.getPunchedUnitDesignation(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++) {
final ArrayList<String> myListKey = new ArrayList<String>();
final 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());
final 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;
}
final ArrayList<String> myListKey2 = new ArrayList<String>();
final ArrayList<String> myListValue2 = new ArrayList<String>();
myListKey2.add("UserId");
myListValue2.add("0");
myListKey2.add("UserName");
myListValue2.add("0");
myListKey2.add("Designation");
myListValue2.add("0");
final 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;
}
// // ----------------------Lorry office Enrolled------------------------
@GetMapping({ "/getLorryPunchedEmpList/{zone}/{tempDate}" })
public List<Map<String, String>> getLorryPunchedEmpList(@PathVariable Integer zone,
@PathVariable final String tempDate) {
Integer zoneValue = zone;
if (zoneValue == 1 || zoneValue == 2 || zoneValue == 3) {
zoneValue = 1;
}
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 = punchedEmpListDataRepository.getPunchedLorryUserId(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(punchedEmpListDataRepository.getPunchedLorryUserName(PunchedUserId.get(i)).trim());
PunchedUserDesignation
.add(punchedEmpListDataRepository.getPunchedLorryDesignation(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++) {
final ArrayList<String> myListKey = new ArrayList<String>();
final 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());
final 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;
}
final ArrayList<String> myListKey2 = new ArrayList<String>();
final ArrayList<String> myListValue2 = new ArrayList<String>();
myListKey2.add("UserId");
myListValue2.add("0");
myListKey2.add("UserName");
myListValue2.add("0");
myListKey2.add("Designation");
myListValue2.add("0");
final 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;
}
// // ----------------------zonal office Enrolled-----------------------
@GetMapping({ "/getZonalPunchedEmpList/{zone}/{tempDate}" })
public List<Map<String, String>> getZonalPunchedEmpList(@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 = punchedEmpListDataRepository.getPunchedZonalUserId(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(punchedEmpListDataRepository.getPunchedZonalUserName(PunchedUserId.get(i)).trim());
PunchedUserDesignation
.add(punchedEmpListDataRepository.getPunchedZonalDesignation(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++) {
final ArrayList<String> myListKey = new ArrayList<String>();
final 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());
final 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;
}
final ArrayList<String> myListKey2 = new ArrayList<String>();
final ArrayList<String> myListValue2 = new ArrayList<String>();
myListKey2.add("UserId");
myListValue2.add("0");
myListKey2.add("UserName");
myListValue2.add("0");
myListKey2.add("Designation");
myListValue2.add("0");
final 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;
}
// // ----------------------Department office Enrolled---------------------------
@GetMapping({ "/getDeptPunchedEmpList/{dept}/{tempDate}" })
public List<Map<String, String>> getDeptPunchedEmpList(@PathVariable String dept,
@PathVariable final String tempDate) {
String zoneValue = dept;
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 = punchedEmpListDataRepository.getPunchedDeptUserId(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(punchedEmpListDataRepository.getPunchedDeptUserName(PunchedUserId.get(i)).trim());
PunchedUserDesignation
.add(punchedEmpListDataRepository.getPunchedDeptDesignation(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;
}
// // ----------------------RDC office Enrolled---------------------------
@GetMapping({ "/getRDCPunchedEmpList/{zone}/{tempDate}" })
public List<Map<String, String>> getRDCPunchedEmpList(@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 = punchedEmpListDataRepository.getPunchedRDCUserId(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(punchedEmpListDataRepository.getPunchedRDCUserName(PunchedUserId.get(i)).trim());
PunchedUserDesignation
.add(punchedEmpListDataRepository.getPunchedRDCDesignation(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;
}
}

121
src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/RegionalDeputyCommissionerController.java

@ -0,0 +1,121 @@
package com.gcc.biometric.api.GccBioMetricApi.controller;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.LinkedHashMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.repository.Query;
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.HeadQuaterZonesEntriesRepository;
import com.gcc.biometric.api.GccBioMetricApi.repo.RegionalDeputyCommissionerRepository;
@RestController
@RequestMapping("/gcc.com")
public class RegionalDeputyCommissionerController {
@Autowired
private RegionalDeputyCommissionerRepository regionalDeputyCommissionerRepository;
// inject employee dao
@Autowired
public RegionalDeputyCommissionerController(RegionalDeputyCommissionerRepository theRegionalDeputyCommissionerRepository) {
regionalDeputyCommissionerRepository = theRegionalDeputyCommissionerRepository;
}
ArrayList<Integer> arrRDCEnroll;
ArrayList<Integer> arrRDCPunched;
ArrayList<String> arrRDCZoneNames;
@GetMapping("/RegionalDeputyCommissionerOfficeData/{tempDate}")
public LinkedHashMap<String, Object> getZoneEnrollPunchAbsentPercentage(@PathVariable String tempDate) //@RequestParam(value = "date")@DateTimeFormat(pattern="yyyy-MM-dd") LocalDate date
{
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(date);
LinkedHashMap<String, String> map = new LinkedHashMap<>();
LinkedHashMap<String, Object> resultMap = new LinkedHashMap<>();
arrRDCPunched = regionalDeputyCommissionerRepository.getRDCPunched(date);
System.out.println("Punched: "+arrRDCPunched);
arrRDCEnroll = regionalDeputyCommissionerRepository.getRDCEnrolled();
System.out.println("Enrolled: "+arrRDCEnroll);
arrRDCZoneNames = regionalDeputyCommissionerRepository.getRDCZoneNames();
System.out.println("Enrolled: "+arrRDCZoneNames);
Integer zoneAbsent=0;
Integer zonePercentage=0;
for(int i=0;i<arrRDCEnroll.size();i++)
{
if(arrRDCPunched.isEmpty())
{
System.out.println("Printing for zone_"+i);
map.put(arrRDCZoneNames.get(i), arrRDCZoneNames.get(i));
map.put(arrRDCZoneNames.get(i)+"_Enrolled", arrRDCEnroll.get(i).toString());
map.put(arrRDCZoneNames.get(i)+"_Punched", "0");
zoneAbsent = arrRDCEnroll.get(i) - 0;
zonePercentage = ((0 *100)/ arrRDCEnroll.get(i));
map.put(arrRDCZoneNames.get(i)+"_Absent", zoneAbsent.toString());
map.put(arrRDCZoneNames.get(i)+"_Percentage", zonePercentage.toString());
zoneAbsent=0;
zonePercentage=0;
}
else
{
System.out.println("Printing for zone_"+i);
map.put(arrRDCZoneNames.get(i), arrRDCZoneNames.get(i));
map.put(arrRDCZoneNames.get(i)+"_Enrolled", arrRDCEnroll.get(i).toString());
map.put(arrRDCZoneNames.get(i)+"_Punched", arrRDCPunched.get(i).toString());
zoneAbsent = arrRDCEnroll.get(i) - arrRDCPunched.get(i);
zonePercentage = ((arrRDCPunched.get(i) *100)/ arrRDCEnroll.get(i));
map.put(arrRDCZoneNames.get(i)+"_Absent", zoneAbsent.toString());
map.put(arrRDCZoneNames.get(i)+"_Percentage", zonePercentage.toString());
zoneAbsent=0;
zonePercentage=0;
}
}
resultMap.put("Data", map);
resultMap.put("Message", "Success");
resultMap.put("ResultStatus", "True");
return resultMap;
}
}

94
src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/ZonalOfficeTotalDateController.java

@ -0,0 +1,94 @@
package com.gcc.biometric.api.GccBioMetricApi.controller;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.LinkedHashMap;
import org.springframework.beans.factory.annotation.Autowired;
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.HeadQuaterZonesEntriesRepository;
import com.gcc.biometric.api.GccBioMetricApi.repo.ZonalOfficeTotalDataRepository;
@RestController
@RequestMapping("/gcc.com")
public class ZonalOfficeTotalDateController {
@Autowired
private ZonalOfficeTotalDataRepository zonalOfficeTotalDataRepository;
// inject employee dao
@Autowired
public ZonalOfficeTotalDateController(ZonalOfficeTotalDataRepository theZonalOfficeTotalDataRepository) {
zonalOfficeTotalDataRepository = theZonalOfficeTotalDataRepository;
}
ArrayList<Integer> arrZonalTotalEnroll;
ArrayList<Integer> arrZonalTotalPunched;
@GetMapping("/TotalZonalOfficeEmployeeData/{tempDate}")
public LinkedHashMap<String, Object> getZoneEnrollPunchAbsentPercentage(@PathVariable String tempDate) //@RequestParam(value = "date")@DateTimeFormat(pattern="yyyy-MM-dd") LocalDate date
{
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(date);
LinkedHashMap<String, Integer> map = new LinkedHashMap<>();
LinkedHashMap<String, Object> resultmap = new LinkedHashMap<>();
arrZonalTotalEnroll = zonalOfficeTotalDataRepository.getZonalOfficeTotalEnrolled();
arrZonalTotalPunched = zonalOfficeTotalDataRepository.getZonalOfficeTotalPunched(date);
System.out.println("Enrolled: "+arrZonalTotalEnroll);
System.out.println("Punched: "+arrZonalTotalPunched);
Integer zoneAbsent=0;
Integer zonePercentage=0;
for(int i=0;i<arrZonalTotalEnroll.size();i++)
{
map.put("Zonal Office Eenrolled", arrZonalTotalEnroll.get(i));
map.put("Zonal Office Punched", arrZonalTotalPunched.get(i));
zoneAbsent = arrZonalTotalEnroll.get(i) - arrZonalTotalPunched.get(i);
zonePercentage = ((arrZonalTotalPunched.get(i) *100)/ arrZonalTotalEnroll.get(i));
map.put("Absent", zoneAbsent);
map.put("Percentage", zonePercentage);
zoneAbsent=0;
zonePercentage=0;
}
resultmap.put("Data", map);
resultmap.put("Message", "Success");
resultmap.put("ResultStatus", "True");
return resultmap;
}
}

523
src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/ZoneDivisionOfficeController.java

@ -0,0 +1,523 @@
package com.gcc.biometric.api.GccBioMetricApi.controller;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
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.ZoneDivisionOfficeRepository;
@RestController
@RequestMapping("/gcc.com")
public class ZoneDivisionOfficeController {
@Autowired
private ZoneDivisionOfficeRepository zoneDivMasterRepository;
@Autowired
public ZoneDivisionOfficeController(ZoneDivisionOfficeRepository theZoneDivMasterRepository) {
zoneDivMasterRepository = theZoneDivMasterRepository;
}
@GetMapping("/DivEmpCountPresentAbsentPercentage/{zone}/{officeTypes}/{tempDate}")
public ResponseEntity<List<Map<String, String>>> getDivEnrollPunchAbsentPercentage(@PathVariable Integer zone,
@PathVariable String officeTypes, @PathVariable String tempDate)
{
System.out.println("Inside getDivEnrollPunchAbsentPercentage() method!");
Integer zoneValue = zone;
String officeType = officeTypes;
//Division Office
if (officeType.equals("DO")) {
System.out.println("for Division Office Data");
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(zoneValue);
System.out.println(officeType);
System.out.println(date);
ArrayList<String> zoneDivisions;
ArrayList<String> zoneDivisionsOnDate;
ArrayList<String> divEnrolled;
ArrayList<String> divPunched;
if(zoneValue==1)
{
System.out.println("Inside division 1: Special case");
divPunched = zoneDivMasterRepository.getDivisionOfficePunchedPerDiv_1(zoneValue, date);
zoneDivisionsOnDate = zoneDivMasterRepository.getDivisionOfficeZoneDivAsPerDate(zoneValue, date);
Collections.sort(zoneDivisionsOnDate);
zoneDivisions = zoneDivMasterRepository.getDivisionOfficeZoneDivisions(zoneValue);
System.out.println("Divisions: "+zoneDivisions);
System.out.println("Divisions as per Date: "+zoneDivisionsOnDate);
System.out.println("Punched: "+divPunched);
divEnrolled = zoneDivMasterRepository.getDivisionOfficeEnrolledPerDiv_1(zoneValue);
System.out.println("Enrolled: "+divEnrolled);
}
else
{
divPunched = zoneDivMasterRepository.getDivisionOfficePunchedPerDiv(zoneValue, date);
zoneDivisionsOnDate = zoneDivMasterRepository.getDivisionOfficeZoneDivAsPerDate(zoneValue, date);
Collections.sort(zoneDivisionsOnDate);
zoneDivisions = zoneDivMasterRepository.getDivisionOfficeZoneDivisions(zoneValue);
System.out.println("Divisions: "+zoneDivisions);
System.out.println("Divisions as per Date: "+zoneDivisionsOnDate);
System.out.println("Punched: "+divPunched);
divEnrolled = zoneDivMasterRepository.getDivisionOfficeEnrolledPerDiv(zoneValue);
System.out.println("Enrolled: "+divEnrolled);
}
String divAbsent = null;
String divPercentage = null;
Integer j = 0;
List<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
for (int i = 0; i <zoneDivisions.size(); i++) {
ArrayList<String> myListKey = new ArrayList<>();
ArrayList<String> myListValue = new ArrayList<>();
myListKey.add("Division"); myListValue.add(zoneDivisions.get(i));
myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i));
if (zoneDivisionsOnDate.contains(zoneDivisions.get(i)))
{
myListKey.add("Punched"); myListValue.add(divPunched.get(j));
Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt(divPunched.get(j));
Integer xdivPercentage = ((Integer.parseInt((divPunched.get(j))) *100)/ Integer.parseInt(divEnrolled.get(i)));
divAbsent = xDivAbsent.toString();
divPercentage = xdivPercentage.toString();
j++;
}
else
{
myListKey.add("Punched"); myListValue.add("0");
divAbsent = divEnrolled.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);
}
//Unit Office
else if (officeType.equals("UO")) {
System.out.println("for Unit Office Data");
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(zoneValue);
System.out.println(officeType);
System.out.println(date);
ArrayList<String> allUnitsAsPerZone;
ArrayList<String> unitEnrolled;
ArrayList<String> unitAsEnrolled;
ArrayList<String> unitPunched;
ArrayList<String> unitAsPunched;
allUnitsAsPerZone = zoneDivMasterRepository.getAllUnitOfficeAsPerZone(zoneValue);
unitEnrolled = zoneDivMasterRepository.getUnitOfficeEnrolledPerZone(zoneValue);
unitAsEnrolled = zoneDivMasterRepository.getAllUnitOfficeAsPerZoneAsPerEnrolled(zoneValue);
unitPunched = zoneDivMasterRepository.getUnitOfficePunchedPerZone(zoneValue, date);
unitAsPunched = zoneDivMasterRepository.getAllUnitOfficeAsPerZoneAsPerPunched(zoneValue, date);
System.out.println("All unit office as per Zone "+allUnitsAsPerZone);
System.out.println("Unit Office Enrolled per zone "+unitEnrolled);
System.out.println("Unit office Which have enrolled data "+unitAsEnrolled);
System.out.println("Unit office Punched "+unitPunched);
System.out.println("Unit office which have punched data "+unitAsPunched);
String divAbsent = null;
String divPercentage = null;
Integer j = 0;
Integer k = 0;
List<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
for (int i = 0; i <allUnitsAsPerZone.size(); i++) {
ArrayList<String> myListKey = new ArrayList<>();
ArrayList<String> myListValue = new ArrayList<>();
myListKey.add("Division"); myListValue.add(allUnitsAsPerZone.get(i));
if(unitAsEnrolled.contains(allUnitsAsPerZone.get(i)))
{
myListKey.add("Enrolled"); myListValue.add(unitEnrolled.get(k));
String enrolled = unitEnrolled.get(k);
k++;
if (unitAsPunched.contains(allUnitsAsPerZone.get(i)))
{
myListKey.add("Punched"); myListValue.add(unitPunched.get(j));
Integer xDivAbsent = Integer.parseInt(enrolled) - Integer.parseInt(unitPunched.get(j));
Integer xdivPercentage = ((Integer.parseInt((unitPunched.get(j))) *100)/ Integer.parseInt(enrolled));
divAbsent = xDivAbsent.toString();
divPercentage = xdivPercentage.toString();
myListKey.add("Absent"); myListValue.add(divAbsent);
myListKey.add("Percentage"); myListValue.add(divPercentage);
j++;
}
else
{
myListKey.add("Punched"); myListValue.add("0");
divAbsent = unitEnrolled.get(i);
divPercentage = "0";
myListKey.add("Absent"); myListValue.add(divAbsent);
myListKey.add("Percentage"); myListValue.add(divPercentage);
}
}
else
{
myListKey.add("Enrolled"); myListValue.add("0");
myListKey.add("Punched"); myListValue.add("0");
myListKey.add("Absent"); myListValue.add("0");
myListKey.add("Percentage"); myListValue.add("0");
}
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);
}
//Zonal Office
else if (officeType.equals("ZO")) {
System.out.println("for Zonal Office Data");
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(zoneValue);
System.out.println(officeType);
System.out.println(date);
ArrayList<String> zoneDivisions;
ArrayList<String> zoneDivisionsOnDate;
ArrayList<String> divEnrolled;
ArrayList<String> divPunched;
divPunched = zoneDivMasterRepository.getZonalOfficePunchedPerDiv(zoneValue, date);
zoneDivisionsOnDate = zoneDivMasterRepository.getZonalOfficeZoneDivAsPerDate(zoneValue, date);
Collections.sort(zoneDivisionsOnDate);
zoneDivisions = zoneDivMasterRepository.getZonalOfficeZoneDivisions(zoneValue);
System.out.println("Divisions: "+zoneDivisions);
System.out.println("Divisionsas per Date: "+zoneDivisionsOnDate);
System.out.println("Punched: "+divPunched);
divEnrolled = zoneDivMasterRepository.getZonalOfficeEnrolledPerDiv(zoneValue);
System.out.println("Enrolled: "+divEnrolled);
String divAbsent = null;
String divPercentage = null;
Integer j = 0;
List<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
for (int i = 0; i <zoneDivisions.size(); i++) {
ArrayList<String> myListKey = new ArrayList<>();
ArrayList<String> myListValue = new ArrayList<>();
myListKey.add("Division"); myListValue.add(zoneDivisions.get(i));
myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i));
if (zoneDivisionsOnDate.contains(zoneDivisions.get(i)))
{
myListKey.add("Punched"); myListValue.add(divPunched.get(j));
Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt(divPunched.get(j));
Integer xdivPercentage = ((Integer.parseInt((divPunched.get(j))) *100)/ Integer.parseInt(divEnrolled.get(i)));
divAbsent = xDivAbsent.toString();
divPercentage = xdivPercentage.toString();
j++;
}
else
{
myListKey.add("Punched"); myListValue.add("0");
divAbsent = divEnrolled.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);
}
//Lorry Station
else if (officeType.equals("LS")) {
System.out.println("for Lorry Station Data");
if(zoneValue==2 || zoneValue==3)
{
System.out.println("zone value passed as 2 or 3");
zoneValue=1;
}
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(zoneValue);
System.out.println(officeType);
System.out.println(date);
ArrayList<String> zoneDivisions;
ArrayList<String> zoneDivisionsOnDate;
ArrayList<String> divEnrolled;
ArrayList<String> divPunched;
divEnrolled = zoneDivMasterRepository.getLorryStationEnrolledPerDiv(zoneValue);
divPunched = zoneDivMasterRepository.getLorryStationPunchedPerDiv(zoneValue, date);
zoneDivisionsOnDate = zoneDivMasterRepository.getLorryStationZoneDivAsPerDate(zoneValue, date);
Collections.sort(zoneDivisionsOnDate);
zoneDivisions = zoneDivMasterRepository.getLorryStationZoneDivisions(zoneValue);
System.out.println("Divisions: "+zoneDivisions);
System.out.println("Divisionsas per Date: "+zoneDivisionsOnDate);
System.out.println("Enrolled: "+divEnrolled);
System.out.println("Punched: "+divPunched);
String divAbsent = null;
String divPercentage = null;
Integer j = 0;
List<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
for (int i = 0; i <zoneDivisions.size(); i++) {
ArrayList<String> myListKey = new ArrayList<>();
ArrayList<String> myListValue = new ArrayList<>();
myListKey.add("Division"); myListValue.add(zoneDivisions.get(i));
myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i));
if (zoneDivisionsOnDate.contains(zoneDivisions.get(i)))
{
myListKey.add("Punched"); myListValue.add(divPunched.get(j));
Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt(divPunched.get(j));
Integer xdivPercentage = ((Integer.parseInt((divPunched.get(j))) *100)/ Integer.parseInt(divEnrolled.get(i)));
divAbsent = xDivAbsent.toString();
divPercentage = xdivPercentage.toString();
j++;
}
else
{
myListKey.add("Punched"); myListValue.add("0");
divAbsent = divEnrolled.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);
}
else if (officeType.equals("ZONAL")) {
System.out.println("for Zonal Office zone data Data");
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(zoneValue);
System.out.println(officeType);
System.out.println(date);
ArrayList<String> zoneDivisions;
ArrayList<String> zoneDivisionsOnDate;
ArrayList<String> divEnrolled;
ArrayList<String> divPunched;
divPunched = zoneDivMasterRepository.getAllZonalOfficesPunchedOfAllZones(date);
zoneDivisionsOnDate = zoneDivMasterRepository.getAllZonalOfficesZoneAsPerDate(date);
// Collections.sort(zoneDivisionsOnDate);
zoneDivisions = zoneDivMasterRepository.getAllZonalOfficesZones();
System.out.println("Divisions: "+zoneDivisions);
System.out.println("Divisions as per Date: "+zoneDivisionsOnDate);
System.out.println("Punched: "+divPunched);
divEnrolled = zoneDivMasterRepository.getAllZonalOfficesEnrolledOfAllZones();
System.out.println("Enrolled: "+divEnrolled);
String divAbsent = null;
String divPercentage = null;
Integer j = 0;
List<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
for (Integer i = 0; i <zoneDivisions.size(); i++) {
Integer n = 1+i;
ArrayList<String> myListKey = new ArrayList<>();
ArrayList<String> myListValue = new ArrayList<>();
myListKey.add("Division"); myListValue.add((n).toString());
myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i));
if (zoneDivisionsOnDate.contains(zoneDivisions.get(i)))
{
myListKey.add("Punched"); myListValue.add(divPunched.get(j));
Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt(divPunched.get(j));
Integer xdivPercentage = ((Integer.parseInt((divPunched.get(j))) *100)/ Integer.parseInt(divEnrolled.get(i)));
divAbsent = xDivAbsent.toString();
divPercentage = xdivPercentage.toString();
j++;
}
else
{
myListKey.add("Punched"); myListValue.add("0");
divAbsent = divEnrolled.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);
}
return null;
}
}

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

148
src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMRDeptHeadQuaterOfficeController.java

@ -0,0 +1,148 @@
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.NMRDeptHeadQuaterOfficeRepository;
@RestController
@RequestMapping("/gcc.com/NMR")
public class NMRDeptHeadQuaterOfficeController {
@Autowired
private NMRDeptHeadQuaterOfficeRepository nMRDeptHeadQuaterOfficeRepository;
@Autowired
public NMRDeptHeadQuaterOfficeController(NMRDeptHeadQuaterOfficeRepository theNMRDeptHeadQuaterOfficeRepository) {
nMRDeptHeadQuaterOfficeRepository = theNMRDeptHeadQuaterOfficeRepository;
}
@GetMapping("/HeadQuaterDepartmentOfficeData/{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> allHQDepartments;
ArrayList<String> allHQDeptAsperPunched;
ArrayList<String> hqDeptEnrolled;
ArrayList<String> hqDeptPunched;
ArrayList<String> allHQDeptAsPerEnrolled;
allHQDepartments = nMRDeptHeadQuaterOfficeRepository.getAllHQDepartmentOffices();
allHQDeptAsperPunched = nMRDeptHeadQuaterOfficeRepository.getHQDepartmentOfficesAsPerDate(date);
hqDeptPunched = nMRDeptHeadQuaterOfficeRepository.getHQDepartmentOfficePunched(date);
System.out.println("All Departments: "+allHQDepartments);
hqDeptEnrolled = nMRDeptHeadQuaterOfficeRepository.getHQDepartmentOfficeEnrolled();
allHQDeptAsPerEnrolled = nMRDeptHeadQuaterOfficeRepository.getAllHQDepartmentOfficeAsPerEnrolled();
System.out.println("All Departments as per Enrolled: " + allHQDeptAsPerEnrolled);
System.out.println("Enrolled: "+hqDeptEnrolled);
System.out.println("All Departments as per Punched: "+allHQDeptAsperPunched);
System.out.println("Punched: "+hqDeptPunched);
String divAbsent = null;
String divPercentage = null;
Integer j = 0;
Integer k = 0;
List<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
for (int i = 0; i <allHQDepartments.size(); i++) {
ArrayList<String> myListKey = new ArrayList<>();
ArrayList<String> myListValue = new ArrayList<>();
myListKey.add("Department"); myListValue.add(allHQDepartments.get(i));
if(allHQDeptAsPerEnrolled.contains(allHQDepartments.get(i)))
{
myListKey.add("Enrolled"); myListValue.add(hqDeptEnrolled.get(k));
if (allHQDeptAsperPunched.contains(allHQDepartments.get(i)))
{
myListKey.add("Punched"); myListValue.add(hqDeptPunched.get(j));
Integer xDivAbsent = Integer.parseInt(hqDeptEnrolled.get(k)) - Integer.parseInt(hqDeptPunched.get(j));
Integer xdivPercentage = ((Integer.parseInt((hqDeptPunched.get(j))) *100)/ Integer.parseInt(hqDeptEnrolled.get(k)));
divAbsent = xDivAbsent.toString();
divPercentage = xdivPercentage.toString();
j++;
}
else
{
myListKey.add("Punched"); myListValue.add("0");
Integer xDivAbsent = Integer.parseInt(hqDeptEnrolled.get(k)) - Integer.parseInt("0");
Integer xdivPercentage = ((Integer.parseInt(("0")) *100)/ Integer.parseInt(hqDeptEnrolled.get(k)));
divAbsent = xDivAbsent.toString();
divPercentage = xdivPercentage.toString();
}
k++;
}
else
{
myListKey.add("Enrolled"); myListValue.add("0");
myListKey.add("Punched"); myListValue.add("0");
divAbsent = "0";
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++)
{
System.out.print(myListKey.get(x));
System.out.print(myListValue.get(x));
System.out.println();
map.put(myListKey.get(x), myListValue.get(x));
}
listMap.add(map);
divAbsent=null;
divPercentage=null;
}
return ResponseEntity.ok(listMap);
}
}

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

308
src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMRHeadQuaterTotalEntriesRestController.java

@ -0,0 +1,308 @@
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 org.springframework.beans.factory.annotation.Autowired;
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.NMRHeadQuaterTotalEntriesRepository;
@RestController
@RequestMapping("/gcc.com/NMR")
public class NMRHeadQuaterTotalEntriesRestController {
@Autowired
private NMRHeadQuaterTotalEntriesRepository nMRHeadQuaterTotalEntriesRepository;
// inject employee dao
@Autowired
public NMRHeadQuaterTotalEntriesRestController(NMRHeadQuaterTotalEntriesRepository theNMRHeadQuaterTotalEntriesRepository) {
nMRHeadQuaterTotalEntriesRepository = theNMRHeadQuaterTotalEntriesRepository;
}
ArrayList<Integer> arrZoneEnroll;
ArrayList<Integer> arrZonePunched;
@GetMapping("/HQTotalEmpCountPresentAbsentPercentage/{tempDate}")
public LinkedHashMap<String, Integer> getZoneEnrollPunchAbsentPercentage(@PathVariable String tempDate) //@RequestParam(value = "date")@DateTimeFormat(pattern="yyyy-MM-dd") LocalDate date
{
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(date);
LinkedHashMap<String, Integer> map = new LinkedHashMap<>();
arrZoneEnroll = nMRHeadQuaterTotalEntriesRepository.getEnrolled();
arrZonePunched = nMRHeadQuaterTotalEntriesRepository.getPunched(date);
System.out.println("Enrolled: "+arrZoneEnroll);
System.out.println("Punched: "+arrZonePunched);
System.out.println(arrZonePunched.isEmpty());
Integer zoneAbsent=0;
Integer zonePercentage=0;
for(int i=0;i<arrZoneEnroll.size();i++)
{
System.out.println("Printing for zone_"+i);
if(arrZonePunched.isEmpty())
{
map.put("Zone_"+(i+1)+"", i+1);
map.put("Zone_"+(i+1)+"_enrolled", arrZoneEnroll.get(i));
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("Percentage_"+(i+1)+"", zonePercentage);
zoneAbsent=0;
zonePercentage=0;
}
else
{
map.put("Zone_"+(i+1)+"", i+1);
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));
map.put("Absent_"+(i+1)+"", zoneAbsent);
map.put("Percentage_"+(i+1)+"", zonePercentage);
zoneAbsent=0;
zonePercentage=0;
}
}
return map;
}
// @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;
// }
}

135
src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMRHeadQuaterZonesEntriesRestController.java

@ -0,0 +1,135 @@
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 org.springframework.beans.factory.annotation.Autowired;
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.NMRHeadQuaterZonesEntriesRepository;
@RestController
@RequestMapping("/gcc.com/NMR")
public class NMRHeadQuaterZonesEntriesRestController {
@Autowired
private NMRHeadQuaterZonesEntriesRepository nMRHeadQuaterZonesEntriesRepository;
// inject employee dao
@Autowired
public NMRHeadQuaterZonesEntriesRestController(
NMRHeadQuaterZonesEntriesRepository theNMRHeadQuaterZonesEntriesRepository) {
nMRHeadQuaterZonesEntriesRepository = theNMRHeadQuaterZonesEntriesRepository;
}
ArrayList<Integer> arrZoneEnroll;
ArrayList<Integer> arrZonePunched;
ArrayList<Integer> zonesAsPerEnroll;
ArrayList<Integer> zonesAsPerPunched;
@GetMapping("/HQZonesEmpCountPresentAbsentPercentage/{tempDate}")
public LinkedHashMap<String, Integer> getZoneEnrollPunchAbsentPercentage(@PathVariable String tempDate) // @RequestParam(value
// =
// "date")@DateTimeFormat(pattern="yyyy-MM-dd")
// LocalDate
// date
{
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(date);
arrZoneEnroll = nMRHeadQuaterZonesEntriesRepository.getEnrolled();
arrZonePunched = nMRHeadQuaterZonesEntriesRepository.getPunched(date);
zonesAsPerEnroll = nMRHeadQuaterZonesEntriesRepository.getZonesAsPerEnrolled();
zonesAsPerPunched = nMRHeadQuaterZonesEntriesRepository.getZonesAsPerPunched(date);
System.out.println("Enrolled: " + arrZoneEnroll);
System.out.println("Punched: " + arrZonePunched);
System.out.println("Zones As Per Enrolled: " + zonesAsPerEnroll);
System.out.println("Zones As Per Punched: " + zonesAsPerPunched);
System.out.println("Enrolled: " + arrZoneEnroll.size());
System.out.println("Punched: " + arrZonePunched.size());
System.out.println("Zones As Per Enrolled: " + zonesAsPerEnroll.size());
System.out.println("Zones As Per Punched: " + zonesAsPerPunched.size());
Integer zoneAbsent = 0;
Integer zonePercentage = 0;
Integer j = 0;
Integer k = 0;
LinkedHashMap<String, Integer> map = new LinkedHashMap<>();
for (int i = 0; i < 15; i++) {
System.out.println("Printing for zone_" + i);
Integer zoneValue = i+1;
map.put("Zone_" + (zoneValue) + "", zoneValue);
if (zonesAsPerEnroll.contains(zoneValue)) {
map.put("Zone_" + (zoneValue) + "_enrolled", arrZoneEnroll.get(k));
if(zonesAsPerPunched.contains(zoneValue))
{
map.put("Zone_" + (zoneValue) + "_punched", arrZonePunched.get(j));
zoneAbsent = arrZoneEnroll.get(k) - arrZonePunched.get(j);
zonePercentage = ((arrZonePunched.get(j) * 100) / arrZoneEnroll.get(k));
map.put("Absent_" + (zoneValue) + "", zoneAbsent);
map.put("Percentage_" + (zoneValue) + "", zonePercentage);
zoneAbsent = 0;
zonePercentage = 0;
j++;
}
else
{
map.put("Zone_" + (zoneValue) + "_punched", 0);
zoneAbsent = arrZoneEnroll.get(k) - 0;
zonePercentage = ((0 * 100) / arrZoneEnroll.get(k));
map.put("Absent_" + (zoneValue) + "", zoneAbsent);
map.put("Percentage_" + (zoneValue) + "", zonePercentage);
zoneAbsent = 0;
zonePercentage = 0;
}
k++;
}
else {
map.put("Zone_" + (zoneValue) + "", zoneValue);
map.put("Zone_" + (zoneValue) + "_enrolled", 0);
map.put("Zone_" + (zoneValue) + "_punched", 0);
map.put("Absent_" + (zoneValue) + "", 0);
map.put("Percentage_" + (zoneValue) + "", 0);
zoneAbsent = 0;
zonePercentage = 0;
}
}
return map;
}
}

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

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

139
src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMRRegionalDeputyCommissionerController.java

@ -0,0 +1,139 @@
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 org.springframework.beans.factory.annotation.Autowired;
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.NMRRegionalDeputyCommissionerRepository;
@RestController
@RequestMapping("/gcc.com/NMR")
public class NMRRegionalDeputyCommissionerController {
@Autowired
private NMRRegionalDeputyCommissionerRepository nMRRegionalDeputyCommissionerRepository;
// inject employee dao
@Autowired
public NMRRegionalDeputyCommissionerController(NMRRegionalDeputyCommissionerRepository theNMRRegionalDeputyCommissionerRepository) {
nMRRegionalDeputyCommissionerRepository = theNMRRegionalDeputyCommissionerRepository;
}
ArrayList<Integer> arrRDCEnroll;
ArrayList<Integer> arrRDCAsPerEnroll;
ArrayList<Integer> arrRDCPunched;
ArrayList<String> arrRDCZoneNames;
ArrayList<String> arrRDCZoneNamesAsPerPunched;
@GetMapping("/RegionalDeputyCommissionerOfficeData/{tempDate}")
public LinkedHashMap<String, String> getZoneEnrollPunchAbsentPercentage(@PathVariable String tempDate) //@RequestParam(value = "date")@DateTimeFormat(pattern="yyyy-MM-dd") LocalDate date
{
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(date);
LinkedHashMap<String, String> map = new LinkedHashMap<>();
arrRDCPunched = nMRRegionalDeputyCommissionerRepository.getRDCPunched(date);
System.out.println("Punched: "+arrRDCPunched);
arrRDCEnroll = nMRRegionalDeputyCommissionerRepository.getRDCEnrolled();
System.out.println("Enrolled: "+arrRDCEnroll);
arrRDCAsPerEnroll = nMRRegionalDeputyCommissionerRepository.getRDCAsPerEnrolled();
System.out.println("Zones As Per Enrolled: "+arrRDCAsPerEnroll);
arrRDCZoneNames = nMRRegionalDeputyCommissionerRepository.getRDCZoneNames();
System.out.println("All Zones: "+arrRDCZoneNames);
arrRDCZoneNamesAsPerPunched = nMRRegionalDeputyCommissionerRepository.getRDCOfficesAsPerPunched(date);
System.out.println("ZoneNamesAsPerPunched: "+arrRDCZoneNamesAsPerPunched);
Integer zoneAbsent=0;
Integer zonePercentage=0;
Integer j = 0;
for(int i=0;i<arrRDCZoneNames.size();i++)
{
if(arrRDCAsPerEnroll.isEmpty())
{
System.out.println(arrRDCZoneNames.get(i));
map.put(arrRDCZoneNames.get(i), arrRDCZoneNames.get(i));
map.put(arrRDCZoneNames.get(i)+"_Enrolled", "0");
map.put(arrRDCZoneNames.get(i)+"_Punched", "0");
map.put(arrRDCZoneNames.get(i)+"_Absent", "0");
map.put(arrRDCZoneNames.get(i)+"_Percentage", "0");
zoneAbsent=0;
zonePercentage=0;
}
else
{
System.out.println(arrRDCZoneNames.get(i));
map.put(arrRDCZoneNames.get(i), arrRDCZoneNames.get(i));
map.put(arrRDCZoneNames.get(i)+"_Enrolled", arrRDCEnroll.get(i).toString());
if(arrRDCZoneNamesAsPerPunched.contains(arrRDCZoneNames.get(i)))
{
map.put(arrRDCZoneNames.get(i)+"_Punched", arrRDCPunched.get(j).toString());
zoneAbsent = arrRDCEnroll.get(i) - arrRDCPunched.get(j);
zonePercentage = ((arrRDCPunched.get(j) *100)/ arrRDCEnroll.get(i));
map.put(arrRDCZoneNames.get(i)+"_Absent", zoneAbsent.toString());
map.put(arrRDCZoneNames.get(i)+"_Percentage", zonePercentage.toString());
zoneAbsent=0;
zonePercentage=0;
j++;
}
else
{
map.put(arrRDCZoneNames.get(i)+"_Punched", "0");
zoneAbsent = arrRDCEnroll.get(i) - 0;
zonePercentage = ((0 *100)/ arrRDCEnroll.get(i));
map.put(arrRDCZoneNames.get(i)+"_Absent", zoneAbsent.toString());
map.put(arrRDCZoneNames.get(i)+"_Percentage", zonePercentage.toString());
zoneAbsent=0;
zonePercentage=0;
}
}
}
return map;
}
}

84
src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMRZonalOfficeTotalDateController.java

@ -0,0 +1,84 @@
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 org.springframework.beans.factory.annotation.Autowired;
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.NMRZonalOfficeTotalDataRepository;
@RestController
@RequestMapping("/gcc.com/NMR")
public class NMRZonalOfficeTotalDateController {
@Autowired
private NMRZonalOfficeTotalDataRepository nMRZonalOfficeTotalDataRepository;
// inject employee dao
@Autowired
public NMRZonalOfficeTotalDateController(NMRZonalOfficeTotalDataRepository theNMRZonalOfficeTotalDataRepository) {
nMRZonalOfficeTotalDataRepository = theNMRZonalOfficeTotalDataRepository;
}
ArrayList<Integer> arrZonalTotalEnroll;
ArrayList<Integer> arrZonalTotalPunched;
@GetMapping("/TotalZonalOfficeEmployeeData/{tempDate}")
public LinkedHashMap<String, Integer> getZoneEnrollPunchAbsentPercentage(@PathVariable String tempDate) //@RequestParam(value = "date")@DateTimeFormat(pattern="yyyy-MM-dd") LocalDate date
{
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(date);
LinkedHashMap<String, Integer> map = new LinkedHashMap<>();
arrZonalTotalEnroll = nMRZonalOfficeTotalDataRepository.getZonalOfficeTotalEnrolled();
arrZonalTotalPunched = nMRZonalOfficeTotalDataRepository.getZonalOfficeTotalPunched(date);
System.out.println("Enrolled: "+arrZonalTotalEnroll);
System.out.println("Punched: "+arrZonalTotalPunched);
Integer zoneAbsent=0;
Integer zonePercentage=0;
for(int i=0;i<arrZonalTotalEnroll.size();i++)
{
map.put("Zonal Office Eenrolled", arrZonalTotalEnroll.get(i));
map.put("Zonal Office Punched", arrZonalTotalPunched.get(i));
zoneAbsent = arrZonalTotalEnroll.get(i) - arrZonalTotalPunched.get(i);
zonePercentage = ((arrZonalTotalPunched.get(i) *100)/ arrZonalTotalEnroll.get(i));
map.put("Absent", zoneAbsent);
map.put("Percentage", zonePercentage);
zoneAbsent=0;
zonePercentage=0;
}
return map;
}
}

625
src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMRZoneDivisionOfficeController.java

@ -0,0 +1,625 @@
package com.gcc.biometric.api.GccBioMetricApi.controller.nmr;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
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.NMRZoneDivisionOfficeRepository;
@RestController
@RequestMapping("/gcc.com/NMR")
public class NMRZoneDivisionOfficeController {
@Autowired
private NMRZoneDivisionOfficeRepository nMRZoneDivisionOfficeRepository;
@Autowired
public NMRZoneDivisionOfficeController(NMRZoneDivisionOfficeRepository theNMRZoneDivisionOfficeRepository) {
nMRZoneDivisionOfficeRepository = theNMRZoneDivisionOfficeRepository;
}
@GetMapping("/DivEmpCountPresentAbsentPercentage/{zone}/{officeTypes}/{tempDate}")
public ResponseEntity<List<Map<String, String>>> getDivEnrollPunchAbsentPercentage(@PathVariable Integer zone,
@PathVariable String officeTypes, @PathVariable String tempDate)
{
System.out.println("Inside getDivEnrollPunchAbsentPercentage() method!");
Integer zoneValue = zone;
String officeType = officeTypes;
//Division Office
if (officeType.equals("DO")) {
System.out.println("for Division Office Data");
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(zoneValue);
System.out.println(officeType);
System.out.println(date);
ArrayList<String> zoneDivisions;
ArrayList<String> zoneDivisionsOnDate;
ArrayList<String> divEnrolled;
ArrayList<String> divAsPerEnrolled;
ArrayList<String> divPunched;
if(zoneValue==1)
{
System.out.println("Inside division 1: Special case");
divPunched = nMRZoneDivisionOfficeRepository.getDivisionOfficePunchedPerDiv_1(zoneValue, date);
zoneDivisionsOnDate = nMRZoneDivisionOfficeRepository.getDivisionOfficeZoneDivAsPerDate(zoneValue, date);
Collections.sort(zoneDivisionsOnDate);
zoneDivisions = nMRZoneDivisionOfficeRepository.getDivisionOfficeZoneDivisions(zoneValue);
System.out.println("Divisions: "+zoneDivisions);
System.out.println("Divisions as per Date: "+zoneDivisionsOnDate);
System.out.println("Punched: "+divPunched);
divEnrolled = nMRZoneDivisionOfficeRepository.getDivisionOfficeEnrolledPerDiv_1(zoneValue);
System.out.println("Enrolled: "+divEnrolled);
divAsPerEnrolled = nMRZoneDivisionOfficeRepository.getDivisionOfficesAsPerEnrolled(zoneValue);
System.out.println("Divisions as per Enrolled: "+divAsPerEnrolled);
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());
System.out.println("Divisions as per Enrolled: "+divAsPerEnrolled.size());
}
else if(zoneValue==8)
{
System.out.println("Inside division 8: Special case");
divPunched = nMRZoneDivisionOfficeRepository.getDivisionOfficePunchedPerDiv_8(zoneValue, date);
zoneDivisionsOnDate = nMRZoneDivisionOfficeRepository.getDivisionOfficeZoneDivAsPerDate_8(zoneValue, date);
Collections.sort(zoneDivisionsOnDate);
zoneDivisions = nMRZoneDivisionOfficeRepository.getDivisionOfficeZoneDivisions_8(zoneValue);
System.out.println("Divisions: "+zoneDivisions);
System.out.println("Divisions as per Date: "+zoneDivisionsOnDate);
System.out.println("Punched: "+divPunched);
divEnrolled = nMRZoneDivisionOfficeRepository.getDivisionOfficeEnrolledPerDiv_8(zoneValue);
System.out.println("Enrolled: "+divEnrolled);
divAsPerEnrolled = nMRZoneDivisionOfficeRepository.getDivisionOfficesAsPerEnrolled_8(zoneValue);
System.out.println("Divisions as per Enrolled: "+divAsPerEnrolled);
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());
System.out.println("Divisions as per Enrolled: "+divAsPerEnrolled.size());
}
else
{
divPunched = nMRZoneDivisionOfficeRepository.getDivisionOfficePunchedPerDiv(zoneValue, date);
zoneDivisionsOnDate = nMRZoneDivisionOfficeRepository.getDivisionOfficeZoneDivAsPerDate(zoneValue, date);
Collections.sort(zoneDivisionsOnDate);
zoneDivisions = nMRZoneDivisionOfficeRepository.getDivisionOfficeZoneDivisions(zoneValue);
System.out.println("Divisions: "+zoneDivisions);
System.out.println("Divisions as per Date: "+zoneDivisionsOnDate);
System.out.println("Punched: "+divPunched);
divEnrolled = nMRZoneDivisionOfficeRepository.getDivisionOfficeEnrolledPerDiv(zoneValue);
System.out.println("Enrolled: "+divEnrolled);
divAsPerEnrolled = nMRZoneDivisionOfficeRepository.getDivisionOfficesAsPerEnrolled(zoneValue);
System.out.println("Divisions as per Enrolled: "+divAsPerEnrolled);
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());
System.out.println("Divisions as per Enrolled: "+divAsPerEnrolled.size());
}
String divAbsent = null;
String divPercentage = null;
Integer j = 0;
Integer k = 0;
List<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
for (int i = 0; i <zoneDivisions.size(); i++) {
ArrayList<String> myListKey = new ArrayList<>();
ArrayList<String> myListValue = new ArrayList<>();
myListKey.add("Division"); myListValue.add(zoneDivisions.get(i));
if(divAsPerEnrolled.contains(zoneDivisions.get(i)))
{
myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(k));
if (zoneDivisionsOnDate.contains(zoneDivisions.get(i)))
{
myListKey.add("Punched"); myListValue.add(divPunched.get(j));
Integer xDivAbsent = Integer.parseInt(divEnrolled.get(k)) - Integer.parseInt(divPunched.get(j));
Integer xdivPercentage = ((Integer.parseInt((divPunched.get(j))) *100)/ Integer.parseInt(divEnrolled.get(k)));
divAbsent = xDivAbsent.toString();
divPercentage = xdivPercentage.toString();
j++;
}
else
{
myListKey.add("Punched"); myListValue.add("0");
divAbsent = divEnrolled.get(k);
divPercentage = "0";
}
myListKey.add("Absent"); myListValue.add(divAbsent);
myListKey.add("Percentage"); myListValue.add(divPercentage);
k++;
}
else
{
myListKey.add("Enrolled"); myListValue.add("0");
myListKey.add("Punched"); myListValue.add("0");
myListKey.add("Absent"); myListValue.add("0");
myListKey.add("Percentage"); myListValue.add("0");
}
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);
}
//Unit Office
else if (officeType.equals("UO")) {
System.out.println("for Unit Office Data");
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(zoneValue);
System.out.println(officeType);
System.out.println(date);
ArrayList<String> allUnitsAsPerZone;
ArrayList<String> unitEnrolled;
ArrayList<String> unitAsEnrolled;
ArrayList<String> unitPunched;
ArrayList<String> unitAsPunched;
allUnitsAsPerZone = nMRZoneDivisionOfficeRepository.getAllUnitOfficeAsPerZone(zoneValue);
unitEnrolled = nMRZoneDivisionOfficeRepository.getUnitOfficeEnrolledPerZone(zoneValue);
unitAsEnrolled = nMRZoneDivisionOfficeRepository.getAllUnitOfficeAsPerZoneAsPerEnrolled(zoneValue);
unitPunched = nMRZoneDivisionOfficeRepository.getUnitOfficePunchedPerZone(zoneValue, date);
unitAsPunched = nMRZoneDivisionOfficeRepository.getAllUnitOfficeAsPerZoneAsPerPunched(zoneValue, date);
System.out.println("All unit office as per Zone "+allUnitsAsPerZone);
System.out.println("Unit Office Enrolled per zone "+unitEnrolled);
System.out.println("Unit office Which have enrolled data "+unitAsEnrolled);
System.out.println("Unit office Punched "+unitPunched);
System.out.println("Unit office which have punched data "+unitAsPunched);
String divAbsent = null;
String divPercentage = null;
Integer j = 0;
Integer k = 0;
List<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
for (int i = 0; i <allUnitsAsPerZone.size(); i++) {
ArrayList<String> myListKey = new ArrayList<>();
ArrayList<String> myListValue = new ArrayList<>();
myListKey.add("Division"); myListValue.add(allUnitsAsPerZone.get(i));
if(unitAsEnrolled.contains(allUnitsAsPerZone.get(i)))
{
myListKey.add("Enrolled"); myListValue.add(unitEnrolled.get(k));
String enrolled = unitEnrolled.get(k);
if (unitAsPunched.contains(allUnitsAsPerZone.get(i)))
{
myListKey.add("Punched"); myListValue.add(unitPunched.get(j));
Integer xDivAbsent = Integer.parseInt(enrolled) - Integer.parseInt(unitPunched.get(j));
Integer xdivPercentage = ((Integer.parseInt((unitPunched.get(j))) *100)/ Integer.parseInt(enrolled));
divAbsent = xDivAbsent.toString();
divPercentage = xdivPercentage.toString();
myListKey.add("Absent"); myListValue.add(divAbsent);
myListKey.add("Percentage"); myListValue.add(divPercentage);
j++;
}
else
{
myListKey.add("Punched"); myListValue.add("0");
divAbsent = unitEnrolled.get(k);
divPercentage = "0";
myListKey.add("Absent"); myListValue.add(divAbsent);
myListKey.add("Percentage"); myListValue.add(divPercentage);
}
k++;
}
else
{
myListKey.add("Enrolled"); myListValue.add("0");
myListKey.add("Punched"); myListValue.add("0");
myListKey.add("Absent"); myListValue.add("0");
myListKey.add("Percentage"); myListValue.add("0");
}
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);
}
//Zonal Office
else if (officeType.equals("ZO")) {
System.out.println("for Zonal Office Data");
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(zoneValue);
System.out.println(officeType);
System.out.println(date);
ArrayList<String> zoneDivisions;
ArrayList<String> zoneDivisionsOnDate;
ArrayList<String> divEnrolled;
ArrayList<String> divPunched;
divPunched = nMRZoneDivisionOfficeRepository.getZonalOfficePunchedPerDiv(zoneValue, date);
zoneDivisionsOnDate = nMRZoneDivisionOfficeRepository.getZonalOfficeZoneDivAsPerDate(zoneValue, date);
Collections.sort(zoneDivisionsOnDate);
zoneDivisions = nMRZoneDivisionOfficeRepository.getZonalOfficeZoneDivisions(zoneValue);
System.out.println("Divisions: "+zoneDivisions);
System.out.println("Divisionsas per Date: "+zoneDivisionsOnDate);
System.out.println("Punched: "+divPunched);
divEnrolled = nMRZoneDivisionOfficeRepository.getZonalOfficeEnrolledPerDiv(zoneValue);
System.out.println("Enrolled: "+divEnrolled);
String divAbsent = null;
String divPercentage = null;
Integer j = 0;
Integer k = 0;
List<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
for (int i = 0; i <zoneDivisions.size(); i++) {
ArrayList<String> myListKey = new ArrayList<>();
ArrayList<String> myListValue = new ArrayList<>();
myListKey.add("Division"); myListValue.add(zoneDivisions.get(i));
if(!divEnrolled.isEmpty())
{
myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(k));
if (zoneDivisionsOnDate.contains(zoneDivisions.get(i)))
{
myListKey.add("Punched"); myListValue.add(divPunched.get(j));
Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt(divPunched.get(j));
Integer xdivPercentage = ((Integer.parseInt((divPunched.get(j))) *100)/ Integer.parseInt(divEnrolled.get(i)));
divAbsent = xDivAbsent.toString();
divPercentage = xdivPercentage.toString();
j++;
}
else
{
myListKey.add("Punched"); myListValue.add("0");
divAbsent = divEnrolled.get(k);
divPercentage = "0";
}
myListKey.add("Absent"); myListValue.add(divAbsent);
myListKey.add("Percentage"); myListValue.add(divPercentage);
k++;
}
else
{
myListKey.add("Enrolled"); myListValue.add("0");
myListKey.add("Punched"); myListValue.add("0");
myListKey.add("Absent"); myListValue.add("0");
myListKey.add("Percentage"); myListValue.add("0");
}
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);
}
//Lorry Station
else if (officeType.equals("LS")) {
System.out.println("for Lorry Station Data");
if(zoneValue==2 || zoneValue==3)
{
System.out.println("zone value passed as 2 or 3");
zoneValue=1;
}
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(zoneValue);
System.out.println(officeType);
System.out.println(date);
ArrayList<String> zoneDivisions;
ArrayList<String> zoneDivisionsOnDate;
ArrayList<String> divEnrolled;
ArrayList<String> divPunched;
divEnrolled = nMRZoneDivisionOfficeRepository.getLorryStationEnrolledPerDiv(zoneValue);
divPunched = nMRZoneDivisionOfficeRepository.getLorryStationPunchedPerDiv(zoneValue, date);
zoneDivisionsOnDate = nMRZoneDivisionOfficeRepository.getLorryStationZoneDivAsPerDate(zoneValue, date);
Collections.sort(zoneDivisionsOnDate);
zoneDivisions = nMRZoneDivisionOfficeRepository.getLorryStationZoneDivisions(zoneValue);
System.out.println("Divisions: "+zoneDivisions);
System.out.println("Divisionsas per Date: "+zoneDivisionsOnDate);
System.out.println("Enrolled: "+divEnrolled);
System.out.println("Punched: "+divPunched);
String divAbsent = null;
String divPercentage = null;
Integer j = 0;
List<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
for (int i = 0; i <zoneDivisions.size(); i++) {
ArrayList<String> myListKey = new ArrayList<>();
ArrayList<String> myListValue = new ArrayList<>();
myListKey.add("Division"); myListValue.add(zoneDivisions.get(i));
if(!divEnrolled.isEmpty())
{
myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i));
if (zoneDivisionsOnDate.contains(zoneDivisions.get(i)))
{
myListKey.add("Punched"); myListValue.add(divPunched.get(j));
Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt(divPunched.get(j));
Integer xdivPercentage = ((Integer.parseInt((divPunched.get(j))) *100)/ Integer.parseInt(divEnrolled.get(i)));
divAbsent = xDivAbsent.toString();
divPercentage = xdivPercentage.toString();
j++;
}
else
{
myListKey.add("Punched"); myListValue.add("0");
divAbsent = divEnrolled.get(i);
divPercentage = "0";
}
myListKey.add("Absent"); myListValue.add(divAbsent);
myListKey.add("Percentage"); myListValue.add(divPercentage);
}
else
{
myListKey.add("Enrolled"); myListValue.add("0");
myListKey.add("Punched"); myListValue.add("0");
myListKey.add("Absent"); myListValue.add("0");
myListKey.add("Percentage"); myListValue.add("0");
}
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);
}
else if (officeType.equals("ZONAL")) {
System.out.println("for Zonal Office zone data Data");
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(zoneValue);
System.out.println(officeType);
System.out.println(date);
ArrayList<String> zoneDivisions;
ArrayList<String> zoneDivisionsOnDate;
ArrayList<String> divEnrolled;
ArrayList<String> divAsPerEnrolled;
ArrayList<String> divPunched;
divPunched = nMRZoneDivisionOfficeRepository.getAllZonalOfficesPunchedOfAllZones(date);
zoneDivisionsOnDate = nMRZoneDivisionOfficeRepository.getAllZonalOfficesZoneAsPerDate(date);
// Collections.sort(zoneDivisionsOnDate);
zoneDivisions = nMRZoneDivisionOfficeRepository.getAllZonalOfficesZones();
divAsPerEnrolled = nMRZoneDivisionOfficeRepository.getAllZonalOfficesAsPerEnrolled();
System.out.println("All Divisions: "+zoneDivisions);
System.out.println("Divisions as per Enrolled: "+divAsPerEnrolled);
System.out.println("Divisions as per Date: "+zoneDivisionsOnDate);
System.out.println("Punched: "+divPunched);
divEnrolled = nMRZoneDivisionOfficeRepository.getAllZonalOfficesEnrolledOfAllZones();
System.out.println("Enrolled: "+divEnrolled);
String divAbsent = null;
String divPercentage = null;
Integer j = 0;
Integer k = 0;
List<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
for (Integer i = 0; i <zoneDivisions.size(); i++) {
Integer n = 1+i;
ArrayList<String> myListKey = new ArrayList<>();
ArrayList<String> myListValue = new ArrayList<>();
myListKey.add("Division"); myListValue.add((n).toString());
if(divAsPerEnrolled.contains(n.toString()))
{
myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(k));
if (zoneDivisionsOnDate.contains(zoneDivisions.get(i)))
{
myListKey.add("Punched"); myListValue.add(divPunched.get(j));
Integer xDivAbsent = Integer.parseInt(divEnrolled.get(k)) - Integer.parseInt(divPunched.get(j));
Integer xdivPercentage = ((Integer.parseInt((divPunched.get(j))) *100)/ Integer.parseInt(divEnrolled.get(k)));
divAbsent = xDivAbsent.toString();
divPercentage = xdivPercentage.toString();
j++;
}
else
{
myListKey.add("Punched"); myListValue.add("0");
divAbsent = divEnrolled.get(k);
divPercentage = "0";
}
myListKey.add("Absent"); myListValue.add(divAbsent);
myListKey.add("Percentage"); myListValue.add(divPercentage);
k++;
}
else
{
myListKey.add("Enrolled"); myListValue.add("0");
myListKey.add("Punched"); myListValue.add("0");
myListKey.add("Absent"); myListValue.add("0");
myListKey.add("Percentage"); myListValue.add("0");
}
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);
}
return null;
}
}

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

146
src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMDeptHeadQuaterOfficeController.java

@ -0,0 +1,146 @@
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.NULMDeptHeadQuaterOfficeRepository;
@RestController
@RequestMapping("/gcc.com/NULM")
public class NULMDeptHeadQuaterOfficeController {
@Autowired
private NULMDeptHeadQuaterOfficeRepository nULMDeptHeadQuaterOfficeRepository;
@Autowired
public NULMDeptHeadQuaterOfficeController(NULMDeptHeadQuaterOfficeRepository theNULMDeptHeadQuaterOfficeRepository) {
nULMDeptHeadQuaterOfficeRepository = theNULMDeptHeadQuaterOfficeRepository;
}
@GetMapping("/HeadQuaterDepartmentOfficeData/{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> allHQDepartments;
ArrayList<String> allHQDeptAsperPunched;
ArrayList<String> hqDeptEnrolled;
ArrayList<String> hqDeptPunched;
ArrayList<String> allHQDeptAsPerEnrolled;
allHQDepartments = nULMDeptHeadQuaterOfficeRepository.getAllHQDepartmentOffices();
allHQDeptAsperPunched = nULMDeptHeadQuaterOfficeRepository.getHQDepartmentOfficesAsPerDate(date);
hqDeptPunched = nULMDeptHeadQuaterOfficeRepository.getHQDepartmentOfficePunched(date);
System.out.println("All Departments: "+allHQDepartments);
hqDeptEnrolled = nULMDeptHeadQuaterOfficeRepository.getHQDepartmentOfficeEnrolled();
allHQDeptAsPerEnrolled = nULMDeptHeadQuaterOfficeRepository.getAllHQDepartmentOfficeAsPerEnrolled();
System.out.println("All Departments as per Enrolled: " + allHQDeptAsPerEnrolled);
System.out.println("Enrolled: "+hqDeptEnrolled);
System.out.println("All Departments as per Punched: "+allHQDeptAsperPunched);
System.out.println("Punched: "+hqDeptPunched);
String divAbsent = null;
String divPercentage = null;
Integer j = 0;
Integer k = 0;
List<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
for (int i = 0; i <allHQDepartments.size(); i++) {
ArrayList<String> myListKey = new ArrayList<>();
ArrayList<String> myListValue = new ArrayList<>();
myListKey.add("Department"); myListValue.add(allHQDepartments.get(i));
if(allHQDeptAsPerEnrolled.contains(allHQDepartments.get(i)))
{
myListKey.add("Enrolled"); myListValue.add(hqDeptEnrolled.get(k));
if (allHQDeptAsperPunched.contains(allHQDepartments.get(i)))
{
myListKey.add("Punched"); myListValue.add(hqDeptPunched.get(j));
Integer xDivAbsent = Integer.parseInt(hqDeptEnrolled.get(k)) - Integer.parseInt(hqDeptPunched.get(j));
Integer xdivPercentage = ((Integer.parseInt((hqDeptPunched.get(j))) *100)/ Integer.parseInt(hqDeptEnrolled.get(k)));
divAbsent = xDivAbsent.toString();
divPercentage = xdivPercentage.toString();
j++;
}
else
{
myListKey.add("Punched"); myListValue.add("0");
Integer xDivAbsent = Integer.parseInt(hqDeptEnrolled.get(k)) - Integer.parseInt("0");
Integer xdivPercentage = ((Integer.parseInt(("0")) *100)/ Integer.parseInt(hqDeptEnrolled.get(k)));
divAbsent = xDivAbsent.toString();
divPercentage = xdivPercentage.toString();
}
k++;
}
else
{
myListKey.add("Enrolled"); myListValue.add("0");
myListKey.add("Punched"); myListValue.add("0");
divAbsent = "0";
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++)
{
System.out.print(myListKey.get(x));
System.out.print(myListValue.get(x));
System.out.println();
map.put(myListKey.get(x), myListValue.get(x));
}
listMap.add(map);
divAbsent=null;
divPercentage=null;
}
return ResponseEntity.ok(listMap);
}
}

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

306
src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMHeadQuaterTotalEntriesRestController.java

@ -0,0 +1,306 @@
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 org.springframework.beans.factory.annotation.Autowired;
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.NULMHeadQuaterTotalEntriesRepository;
@RestController
@RequestMapping("/gcc.com/NULM")
public class NULMHeadQuaterTotalEntriesRestController {
@Autowired
private NULMHeadQuaterTotalEntriesRepository nULMHeadQuaterTotalEntriesRepository;
// inject employee dao
@Autowired
public NULMHeadQuaterTotalEntriesRestController(NULMHeadQuaterTotalEntriesRepository theNULMHeadQuaterTotalEntriesRepository) {
nULMHeadQuaterTotalEntriesRepository = theNULMHeadQuaterTotalEntriesRepository;
}
ArrayList<Integer> arrZoneEnroll;
ArrayList<Integer> arrZonePunched;
@GetMapping("/HQTotalEmpCountPresentAbsentPercentage/{tempDate}")
public LinkedHashMap<String, Integer> getZoneEnrollPunchAbsentPercentage(@PathVariable String tempDate) //@RequestParam(value = "date")@DateTimeFormat(pattern="yyyy-MM-dd") LocalDate date
{
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(date);
LinkedHashMap<String, Integer> map = new LinkedHashMap<>();
arrZoneEnroll = nULMHeadQuaterTotalEntriesRepository.getEnrolled();
arrZonePunched = nULMHeadQuaterTotalEntriesRepository.getPunched(date);
System.out.println("Enrolled: "+arrZoneEnroll);
System.out.println("Punched: "+arrZonePunched);
System.out.println(arrZonePunched.isEmpty());
Integer zoneAbsent=0;
Integer zonePercentage=0;
for(int i=0;i<arrZoneEnroll.size();i++)
{
System.out.println("Printing for zone_"+i);
if(arrZonePunched.isEmpty())
{
map.put("Zone_"+(i+1)+"", i+1);
map.put("Zone_"+(i+1)+"_enrolled", arrZoneEnroll.get(i));
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("Percentage_"+(i+1)+"", zonePercentage);
zoneAbsent=0;
zonePercentage=0;
}
else
{
map.put("Zone_"+(i+1)+"", i+1);
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));
map.put("Absent_"+(i+1)+"", zoneAbsent);
map.put("Percentage_"+(i+1)+"", zonePercentage);
zoneAbsent=0;
zonePercentage=0;
}
}
return map;
}
// @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;
// }
}

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

@ -0,0 +1,305 @@
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 org.springframework.beans.factory.annotation.Autowired;
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.NULMHeadQuaterZonesEntriesRepository;
@RestController
@RequestMapping("/gcc.com/NULM")
public class NULMHeadQuaterZonesEntriesRestController {
@Autowired
private NULMHeadQuaterZonesEntriesRepository nULMHeadQuaterZonesEntriesRepository;
// inject employee dao
@Autowired
public NULMHeadQuaterZonesEntriesRestController(NULMHeadQuaterZonesEntriesRepository theNULMHeadQuaterZonesEntriesRepository) {
nULMHeadQuaterZonesEntriesRepository = theNULMHeadQuaterZonesEntriesRepository;
}
ArrayList<Integer> arrZoneEnroll;
ArrayList<Integer> arrZonePunched;
@GetMapping("/HQZonesEmpCountPresentAbsentPercentage/{tempDate}")
public LinkedHashMap<String, Integer> getZoneEnrollPunchAbsentPercentage(@PathVariable String tempDate) //@RequestParam(value = "date")@DateTimeFormat(pattern="yyyy-MM-dd") LocalDate date
{
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(date);
LinkedHashMap<String, Integer> map = new LinkedHashMap<>();
arrZoneEnroll = nULMHeadQuaterZonesEntriesRepository.getEnrolled();
arrZonePunched = nULMHeadQuaterZonesEntriesRepository.getPunched(date);
System.out.println("Enrolled: "+arrZoneEnroll);
System.out.println("Punched: "+arrZonePunched);
System.out.println(arrZonePunched.isEmpty());
Integer zoneAbsent=0;
Integer zonePercentage=0;
for(int i=0;i<arrZoneEnroll.size();i++)
{
System.out.println("Printing for zone_"+i);
if(arrZonePunched.isEmpty())
{
map.put("Zone_"+(i+1)+"", i+1);
map.put("Zone_"+(i+1)+"_enrolled", arrZoneEnroll.get(i));
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("Percentage_"+(i+1)+"", zonePercentage);
zoneAbsent=0;
zonePercentage=0;
}
else
{
map.put("Zone_"+(i+1)+"", i+1);
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));
map.put("Absent_"+(i+1)+"", zoneAbsent);
map.put("Percentage_"+(i+1)+"", zonePercentage);
zoneAbsent=0;
zonePercentage=0;
}
}
return map;
}
// @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;
// }
}

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

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

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

@ -0,0 +1,137 @@
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 org.springframework.beans.factory.annotation.Autowired;
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.NULMRegionalDeputyCommissionerRepository;
@RestController
@RequestMapping("/gcc.com/NULM")
public class NULMRegionalDeputyCommissionerController {
@Autowired
private NULMRegionalDeputyCommissionerRepository nULMRegionalDeputyCommissionerRepository;
// inject employee dao
@Autowired
public NULMRegionalDeputyCommissionerController(NULMRegionalDeputyCommissionerRepository theNULMRegionalDeputyCommissionerRepository) {
nULMRegionalDeputyCommissionerRepository = theNULMRegionalDeputyCommissionerRepository;
}
ArrayList<Integer> arrRDCEnroll;
ArrayList<Integer> arrRDCPunched;
ArrayList<String> arrRDCZoneNames;
ArrayList<String> arrRDCZoneNamesAsPerPunched;
@GetMapping("/RegionalDeputyCommissionerOfficeData/{tempDate}")
public LinkedHashMap<String, String> getZoneEnrollPunchAbsentPercentage(@PathVariable String tempDate) //@RequestParam(value = "date")@DateTimeFormat(pattern="yyyy-MM-dd") LocalDate date
{
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(date);
LinkedHashMap<String, String> map = new LinkedHashMap<>();
arrRDCPunched = nULMRegionalDeputyCommissionerRepository.getRDCPunched(date);
System.out.println("Punched: "+arrRDCPunched);
arrRDCEnroll = nULMRegionalDeputyCommissionerRepository.getRDCEnrolled();
System.out.println("Enrolled: "+arrRDCEnroll);
arrRDCZoneNames = nULMRegionalDeputyCommissionerRepository.getRDCZoneNames();
System.out.println("Enrolled: "+arrRDCZoneNames);
arrRDCZoneNamesAsPerPunched = nULMRegionalDeputyCommissionerRepository.getRDCOfficesAsPerPunched(date);
System.out.println("ZoneNamesAsPerPunched: "+arrRDCZoneNamesAsPerPunched);
Integer zoneAbsent=0;
Integer zonePercentage=0;
Integer j = 0;
for(int i=0;i<arrRDCEnroll.size();i++)
{
if(arrRDCPunched.isEmpty())
{
System.out.println(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)+"_Punched", "0");
zoneAbsent = arrRDCEnroll.get(i) - 0;
zonePercentage = ((0 *100)/ arrRDCEnroll.get(i));
map.put(arrRDCZoneNames.get(i)+"_Absent", zoneAbsent.toString());
map.put(arrRDCZoneNames.get(i)+"_Percentage", zonePercentage.toString());
zoneAbsent=0;
zonePercentage=0;
}
else
{
System.out.println(arrRDCZoneNames.get(i));
map.put(arrRDCZoneNames.get(i), arrRDCZoneNames.get(i));
map.put(arrRDCZoneNames.get(i)+"_Enrolled", arrRDCEnroll.get(i).toString());
if(arrRDCZoneNamesAsPerPunched.contains(arrRDCZoneNames.get(i)))
{
map.put(arrRDCZoneNames.get(i)+"_Punched", arrRDCPunched.get(j).toString());
zoneAbsent = arrRDCEnroll.get(i) - arrRDCPunched.get(j);
zonePercentage = ((arrRDCPunched.get(j) *100)/ arrRDCEnroll.get(i));
map.put(arrRDCZoneNames.get(i)+"_Absent", zoneAbsent.toString());
map.put(arrRDCZoneNames.get(i)+"_Percentage", zonePercentage.toString());
zoneAbsent=0;
zonePercentage=0;
j++;
}
else
{
map.put(arrRDCZoneNames.get(i)+"_Punched", "0");
zoneAbsent = arrRDCEnroll.get(i) - 0;
zonePercentage = ((0 *100)/ arrRDCEnroll.get(i));
map.put(arrRDCZoneNames.get(i)+"_Absent", zoneAbsent.toString());
map.put(arrRDCZoneNames.get(i)+"_Percentage", zonePercentage.toString());
zoneAbsent=0;
zonePercentage=0;
}
}
}
return map;
}
}

82
src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMZonalOfficeTotalDateController.java

@ -0,0 +1,82 @@
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 org.springframework.beans.factory.annotation.Autowired;
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.NULMZonalOfficeTotalDataRepository;
@RestController
@RequestMapping("/gcc.com/NULM")
public class NULMZonalOfficeTotalDateController {
@Autowired
private NULMZonalOfficeTotalDataRepository nULMZonalOfficeTotalDataRepository;
// inject employee dao
@Autowired
public NULMZonalOfficeTotalDateController(NULMZonalOfficeTotalDataRepository theNULMZonalOfficeTotalDataRepository) {
nULMZonalOfficeTotalDataRepository = theNULMZonalOfficeTotalDataRepository;
}
ArrayList<Integer> arrZonalTotalEnroll;
ArrayList<Integer> arrZonalTotalPunched;
@GetMapping("/TotalZonalOfficeEmployeeData/{tempDate}")
public LinkedHashMap<String, Integer> getZoneEnrollPunchAbsentPercentage(@PathVariable String tempDate) //@RequestParam(value = "date")@DateTimeFormat(pattern="yyyy-MM-dd") LocalDate date
{
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(date);
LinkedHashMap<String, Integer> map = new LinkedHashMap<>();
arrZonalTotalEnroll = nULMZonalOfficeTotalDataRepository.getZonalOfficeTotalEnrolled();
arrZonalTotalPunched = nULMZonalOfficeTotalDataRepository.getZonalOfficeTotalPunched(date);
System.out.println("Enrolled: "+arrZonalTotalEnroll);
System.out.println("Punched: "+arrZonalTotalPunched);
Integer zoneAbsent=0;
Integer zonePercentage=0;
for(int i=0;i<arrZonalTotalEnroll.size();i++)
{
map.put("Zonal Office Eenrolled", arrZonalTotalEnroll.get(i));
map.put("Zonal Office Punched", arrZonalTotalPunched.get(i));
zoneAbsent = arrZonalTotalEnroll.get(i) - arrZonalTotalPunched.get(i);
zonePercentage = ((arrZonalTotalPunched.get(i) *100)/ arrZonalTotalEnroll.get(i));
map.put("Absent", zoneAbsent);
map.put("Percentage", zonePercentage);
zoneAbsent=0;
zonePercentage=0;
}
return map;
}
}

623
src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMZoneDivisionOfficeController.java

@ -0,0 +1,623 @@
package com.gcc.biometric.api.GccBioMetricApi.controller.nulm;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
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.NULMZoneDivisionOfficeRepository;
@RestController
@RequestMapping("/gcc.com/NULM")
public class NULMZoneDivisionOfficeController {
@Autowired
private NULMZoneDivisionOfficeRepository nULMZoneDivisionOfficeRepository;
@Autowired
public NULMZoneDivisionOfficeController(NULMZoneDivisionOfficeRepository theNULMZoneDivisionOfficeRepository) {
nULMZoneDivisionOfficeRepository = theNULMZoneDivisionOfficeRepository;
}
@GetMapping("/DivEmpCountPresentAbsentPercentage/{zone}/{officeTypes}/{tempDate}")
public ResponseEntity<List<Map<String, String>>> getDivEnrollPunchAbsentPercentage(@PathVariable Integer zone,
@PathVariable String officeTypes, @PathVariable String tempDate)
{
System.out.println("Inside getDivEnrollPunchAbsentPercentage() method!");
Integer zoneValue = zone;
String officeType = officeTypes;
//Division Office
if (officeType.equals("DO")) {
System.out.println("for Division Office Data");
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(zoneValue);
System.out.println(officeType);
System.out.println(date);
ArrayList<String> zoneDivisions;
ArrayList<String> zoneDivisionsOnDate;
ArrayList<String> divEnrolled;
ArrayList<String> divAsPerEnrolled;
ArrayList<String> divPunched;
if(zoneValue==1)
{
System.out.println("Inside division 1: Special case");
divPunched = nULMZoneDivisionOfficeRepository.getDivisionOfficePunchedPerDiv_1(zoneValue, date);
zoneDivisionsOnDate = nULMZoneDivisionOfficeRepository.getDivisionOfficeZoneDivAsPerDate(zoneValue, date);
Collections.sort(zoneDivisionsOnDate);
zoneDivisions = nULMZoneDivisionOfficeRepository.getDivisionOfficeZoneDivisions(zoneValue);
System.out.println("Divisions: "+zoneDivisions);
System.out.println("Divisions as per Date: "+zoneDivisionsOnDate);
System.out.println("Punched: "+divPunched);
divEnrolled = nULMZoneDivisionOfficeRepository.getDivisionOfficeEnrolledPerDiv_1(zoneValue);
System.out.println("Enrolled: "+divEnrolled);
divAsPerEnrolled = nULMZoneDivisionOfficeRepository.getDivisionOfficesAsPerEnrolled(zoneValue);
System.out.println("Divisions as per Enrolled: "+divAsPerEnrolled);
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());
System.out.println("Divisions as per Enrolled: "+divAsPerEnrolled.size());
}
else if(zoneValue==8)
{
System.out.println("Inside division 8: Special case");
divPunched = nULMZoneDivisionOfficeRepository.getDivisionOfficePunchedPerDiv_8(zoneValue, date);
zoneDivisionsOnDate = nULMZoneDivisionOfficeRepository.getDivisionOfficeZoneDivAsPerDate_8(zoneValue, date);
Collections.sort(zoneDivisionsOnDate);
zoneDivisions = nULMZoneDivisionOfficeRepository.getDivisionOfficeZoneDivisions_8(zoneValue);
System.out.println("Divisions: "+zoneDivisions);
System.out.println("Divisions as per Date: "+zoneDivisionsOnDate);
System.out.println("Punched: "+divPunched);
divEnrolled = nULMZoneDivisionOfficeRepository.getDivisionOfficeEnrolledPerDiv_8(zoneValue);
System.out.println("Enrolled: "+divEnrolled);
divAsPerEnrolled = nULMZoneDivisionOfficeRepository.getDivisionOfficesAsPerEnrolled_8(zoneValue);
System.out.println("Divisions as per Enrolled: "+divAsPerEnrolled);
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());
System.out.println("Divisions as per Enrolled: "+divAsPerEnrolled.size());
}
else
{
divPunched = nULMZoneDivisionOfficeRepository.getDivisionOfficePunchedPerDiv(zoneValue, date);
zoneDivisionsOnDate = nULMZoneDivisionOfficeRepository.getDivisionOfficeZoneDivAsPerDate(zoneValue, date);
Collections.sort(zoneDivisionsOnDate);
zoneDivisions = nULMZoneDivisionOfficeRepository.getDivisionOfficeZoneDivisions(zoneValue);
System.out.println("Divisions: "+zoneDivisions);
System.out.println("Divisions as per Date: "+zoneDivisionsOnDate);
System.out.println("Punched: "+divPunched);
divEnrolled = nULMZoneDivisionOfficeRepository.getDivisionOfficeEnrolledPerDiv(zoneValue);
System.out.println("Enrolled: "+divEnrolled);
divAsPerEnrolled = nULMZoneDivisionOfficeRepository.getDivisionOfficesAsPerEnrolled(zoneValue);
System.out.println("Divisions as per Enrolled: "+divAsPerEnrolled);
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());
System.out.println("Divisions as per Enrolled: "+divAsPerEnrolled.size());
}
String divAbsent = null;
String divPercentage = null;
Integer j = 0;
Integer k = 0;
List<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
for (int i = 0; i <zoneDivisions.size(); i++) {
ArrayList<String> myListKey = new ArrayList<>();
ArrayList<String> myListValue = new ArrayList<>();
myListKey.add("Division"); myListValue.add(zoneDivisions.get(i));
if(divAsPerEnrolled.contains(zoneDivisions.get(i)))
{
myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(k));
if (zoneDivisionsOnDate.contains(zoneDivisions.get(i)))
{
myListKey.add("Punched"); myListValue.add(divPunched.get(j));
Integer xDivAbsent = Integer.parseInt(divEnrolled.get(k)) - Integer.parseInt(divPunched.get(j));
Integer xdivPercentage = ((Integer.parseInt((divPunched.get(j))) *100)/ Integer.parseInt(divEnrolled.get(k)));
divAbsent = xDivAbsent.toString();
divPercentage = xdivPercentage.toString();
j++;
}
else
{
myListKey.add("Punched"); myListValue.add("0");
divAbsent = divEnrolled.get(k);
divPercentage = "0";
}
myListKey.add("Absent"); myListValue.add(divAbsent);
myListKey.add("Percentage"); myListValue.add(divPercentage);
k++;
}
else
{
myListKey.add("Enrolled"); myListValue.add("0");
myListKey.add("Punched"); myListValue.add("0");
myListKey.add("Absent"); myListValue.add("0");
myListKey.add("Percentage"); myListValue.add("0");
}
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);
}
//Unit Office
else if (officeType.equals("UO")) {
System.out.println("for Unit Office Data");
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(zoneValue);
System.out.println(officeType);
System.out.println(date);
ArrayList<String> allUnitsAsPerZone;
ArrayList<String> unitEnrolled;
ArrayList<String> unitAsEnrolled;
ArrayList<String> unitPunched;
ArrayList<String> unitAsPunched;
allUnitsAsPerZone = nULMZoneDivisionOfficeRepository.getAllUnitOfficeAsPerZone(zoneValue);
unitEnrolled = nULMZoneDivisionOfficeRepository.getUnitOfficeEnrolledPerZone(zoneValue);
unitAsEnrolled = nULMZoneDivisionOfficeRepository.getAllUnitOfficeAsPerZoneAsPerEnrolled(zoneValue);
unitPunched = nULMZoneDivisionOfficeRepository.getUnitOfficePunchedPerZone(zoneValue, date);
unitAsPunched = nULMZoneDivisionOfficeRepository.getAllUnitOfficeAsPerZoneAsPerPunched(zoneValue, date);
System.out.println("All unit office as per Zone "+allUnitsAsPerZone);
System.out.println("Unit Office Enrolled per zone "+unitEnrolled);
System.out.println("Unit office Which have enrolled data "+unitAsEnrolled);
System.out.println("Unit office Punched "+unitPunched);
System.out.println("Unit office which have punched data "+unitAsPunched);
String divAbsent = null;
String divPercentage = null;
Integer j = 0;
Integer k = 0;
List<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
for (int i = 0; i <allUnitsAsPerZone.size(); i++) {
ArrayList<String> myListKey = new ArrayList<>();
ArrayList<String> myListValue = new ArrayList<>();
myListKey.add("Division"); myListValue.add(allUnitsAsPerZone.get(i));
if(unitAsEnrolled.contains(allUnitsAsPerZone.get(i)))
{
myListKey.add("Enrolled"); myListValue.add(unitEnrolled.get(k));
String enrolled = unitEnrolled.get(k);
if (unitAsPunched.contains(allUnitsAsPerZone.get(i)))
{
myListKey.add("Punched"); myListValue.add(unitPunched.get(j));
Integer xDivAbsent = Integer.parseInt(enrolled) - Integer.parseInt(unitPunched.get(j));
Integer xdivPercentage = ((Integer.parseInt((unitPunched.get(j))) *100)/ Integer.parseInt(enrolled));
divAbsent = xDivAbsent.toString();
divPercentage = xdivPercentage.toString();
myListKey.add("Absent"); myListValue.add(divAbsent);
myListKey.add("Percentage"); myListValue.add(divPercentage);
j++;
}
else
{
myListKey.add("Punched"); myListValue.add("0");
divAbsent = unitEnrolled.get(k);
divPercentage = "0";
myListKey.add("Absent"); myListValue.add(divAbsent);
myListKey.add("Percentage"); myListValue.add(divPercentage);
}
k++;
}
else
{
myListKey.add("Enrolled"); myListValue.add("0");
myListKey.add("Punched"); myListValue.add("0");
myListKey.add("Absent"); myListValue.add("0");
myListKey.add("Percentage"); myListValue.add("0");
}
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);
}
//Zonal Office
else if (officeType.equals("ZO")) {
System.out.println("for Zonal Office Data");
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(zoneValue);
System.out.println(officeType);
System.out.println(date);
ArrayList<String> zoneDivisions;
ArrayList<String> zoneDivisionsOnDate;
ArrayList<String> divEnrolled;
ArrayList<String> divPunched;
divPunched = nULMZoneDivisionOfficeRepository.getZonalOfficePunchedPerDiv(zoneValue, date);
zoneDivisionsOnDate = nULMZoneDivisionOfficeRepository.getZonalOfficeZoneDivAsPerDate(zoneValue, date);
Collections.sort(zoneDivisionsOnDate);
zoneDivisions = nULMZoneDivisionOfficeRepository.getZonalOfficeZoneDivisions(zoneValue);
System.out.println("Divisions: "+zoneDivisions);
System.out.println("Divisionsas per Date: "+zoneDivisionsOnDate);
System.out.println("Punched: "+divPunched);
divEnrolled = nULMZoneDivisionOfficeRepository.getZonalOfficeEnrolledPerDiv(zoneValue);
System.out.println("Enrolled: "+divEnrolled);
String divAbsent = null;
String divPercentage = null;
Integer j = 0;
Integer k = 0;
List<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
for (int i = 0; i <zoneDivisions.size(); i++) {
ArrayList<String> myListKey = new ArrayList<>();
ArrayList<String> myListValue = new ArrayList<>();
myListKey.add("Division"); myListValue.add(zoneDivisions.get(i));
if(!divEnrolled.isEmpty())
{
myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(k));
if (zoneDivisionsOnDate.contains(zoneDivisions.get(i)))
{
myListKey.add("Punched"); myListValue.add(divPunched.get(j));
Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt(divPunched.get(j));
Integer xdivPercentage = ((Integer.parseInt((divPunched.get(j))) *100)/ Integer.parseInt(divEnrolled.get(i)));
divAbsent = xDivAbsent.toString();
divPercentage = xdivPercentage.toString();
j++;
}
else
{
myListKey.add("Punched"); myListValue.add("0");
divAbsent = divEnrolled.get(k);
divPercentage = "0";
}
myListKey.add("Absent"); myListValue.add(divAbsent);
myListKey.add("Percentage"); myListValue.add(divPercentage);
k++;
}
else
{
myListKey.add("Enrolled"); myListValue.add("0");
myListKey.add("Punched"); myListValue.add("0");
myListKey.add("Absent"); myListValue.add("0");
myListKey.add("Percentage"); myListValue.add("0");
}
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);
}
//Lorry Station
else if (officeType.equals("LS")) {
System.out.println("for Lorry Station Data");
if(zoneValue==2 || zoneValue==3)
{
System.out.println("zone value passed as 2 or 3");
zoneValue=1;
}
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(zoneValue);
System.out.println(officeType);
System.out.println(date);
ArrayList<String> zoneDivisions;
ArrayList<String> zoneDivisionsOnDate;
ArrayList<String> divEnrolled;
ArrayList<String> divPunched;
divEnrolled = nULMZoneDivisionOfficeRepository.getLorryStationEnrolledPerDiv(zoneValue);
divPunched = nULMZoneDivisionOfficeRepository.getLorryStationPunchedPerDiv(zoneValue, date);
zoneDivisionsOnDate = nULMZoneDivisionOfficeRepository.getLorryStationZoneDivAsPerDate(zoneValue, date);
Collections.sort(zoneDivisionsOnDate);
zoneDivisions = nULMZoneDivisionOfficeRepository.getLorryStationZoneDivisions(zoneValue);
System.out.println("Divisions: "+zoneDivisions);
System.out.println("Divisionsas per Date: "+zoneDivisionsOnDate);
System.out.println("Enrolled: "+divEnrolled);
System.out.println("Punched: "+divPunched);
String divAbsent = null;
String divPercentage = null;
Integer j = 0;
List<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
for (int i = 0; i <zoneDivisions.size(); i++) {
ArrayList<String> myListKey = new ArrayList<>();
ArrayList<String> myListValue = new ArrayList<>();
myListKey.add("Division"); myListValue.add(zoneDivisions.get(i));
if(!divEnrolled.isEmpty())
{
myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i));
if (zoneDivisionsOnDate.contains(zoneDivisions.get(i)))
{
myListKey.add("Punched"); myListValue.add(divPunched.get(j));
Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt(divPunched.get(j));
Integer xdivPercentage = ((Integer.parseInt((divPunched.get(j))) *100)/ Integer.parseInt(divEnrolled.get(i)));
divAbsent = xDivAbsent.toString();
divPercentage = xdivPercentage.toString();
j++;
}
else
{
myListKey.add("Punched"); myListValue.add("0");
divAbsent = divEnrolled.get(i);
divPercentage = "0";
}
myListKey.add("Absent"); myListValue.add(divAbsent);
myListKey.add("Percentage"); myListValue.add(divPercentage);
}
else
{
myListKey.add("Enrolled"); myListValue.add("0");
myListKey.add("Punched"); myListValue.add("0");
myListKey.add("Absent"); myListValue.add("0");
myListKey.add("Percentage"); myListValue.add("0");
}
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);
}
else if (officeType.equals("ZONAL")) {
System.out.println("for Zonal Office zone data Data");
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(zoneValue);
System.out.println(officeType);
System.out.println(date);
ArrayList<String> zoneDivisions;
ArrayList<String> zoneDivisionsOnDate;
ArrayList<String> divEnrolled;
ArrayList<String> divAsPerEnrolled;
ArrayList<String> divPunched;
divPunched = nULMZoneDivisionOfficeRepository.getAllZonalOfficesPunchedOfAllZones(date);
zoneDivisionsOnDate = nULMZoneDivisionOfficeRepository.getAllZonalOfficesZoneAsPerDate(date);
// Collections.sort(zoneDivisionsOnDate);
zoneDivisions = nULMZoneDivisionOfficeRepository.getAllZonalOfficesZones();
divAsPerEnrolled = nULMZoneDivisionOfficeRepository.getAllZonalOfficesAsPerEnrolled();
System.out.println("All Divisions: "+zoneDivisions);
System.out.println("Divisions as per Enrolled: "+divAsPerEnrolled);
System.out.println("Divisions as per Date: "+zoneDivisionsOnDate);
System.out.println("Punched: "+divPunched);
divEnrolled = nULMZoneDivisionOfficeRepository.getAllZonalOfficesEnrolledOfAllZones();
System.out.println("Enrolled: "+divEnrolled);
String divAbsent = null;
String divPercentage = null;
Integer j = 0;
Integer k = 0;
List<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
for (Integer i = 0; i <zoneDivisions.size(); i++) {
Integer n = 1+i;
ArrayList<String> myListKey = new ArrayList<>();
ArrayList<String> myListValue = new ArrayList<>();
myListKey.add("Division"); myListValue.add((n).toString());
if(divAsPerEnrolled.contains(n.toString()))
{
myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(k));
if (zoneDivisionsOnDate.contains(zoneDivisions.get(i)))
{
myListKey.add("Punched"); myListValue.add(divPunched.get(j));
Integer xDivAbsent = Integer.parseInt(divEnrolled.get(k)) - Integer.parseInt(divPunched.get(j));
Integer xdivPercentage = ((Integer.parseInt((divPunched.get(j))) *100)/ Integer.parseInt(divEnrolled.get(k)));
divAbsent = xDivAbsent.toString();
divPercentage = xdivPercentage.toString();
j++;
}
else
{
myListKey.add("Punched"); myListValue.add("0");
divAbsent = divEnrolled.get(k);
divPercentage = "0";
}
myListKey.add("Absent"); myListValue.add(divAbsent);
myListKey.add("Percentage"); myListValue.add(divPercentage);
k++;
}
else
{
myListKey.add("Enrolled"); myListValue.add("0");
myListKey.add("Punched"); myListValue.add("0");
myListKey.add("Absent"); myListValue.add("0");
myListKey.add("Percentage"); myListValue.add("0");
}
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);
}
return null;
}
}

1296
src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMAbsenteesEmpListDataController.java
File diff suppressed because it is too large
View File

124
src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMDeptHeadQuaterOfficeController.java

@ -0,0 +1,124 @@
package com.gcc.biometric.api.GccBioMetricApi.controller.perm;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
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.DeptHeadQuaterOfficeRepository;
import com.gcc.biometric.api.GccBioMetricApi.repo.ZoneDivisionOfficeRepository;
@RestController
@RequestMapping("/gcc.com/PERM")
public class PERMDeptHeadQuaterOfficeController {
@Autowired
private DeptHeadQuaterOfficeRepository deptHeadQuaterOfficeRepository;
@Autowired
public PERMDeptHeadQuaterOfficeController(DeptHeadQuaterOfficeRepository theDeptHeadQuaterOfficeRepository) {
deptHeadQuaterOfficeRepository = theDeptHeadQuaterOfficeRepository;
}
@GetMapping("/HeadQuaterDepartmentOfficeData/{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> allHQDepartments;
ArrayList<String> allHQDepartmentsAsperDate;
ArrayList<String> hqDepartmentsEnrolled;
ArrayList<String> hqDepartmentsPunched;
allHQDepartments = deptHeadQuaterOfficeRepository.getAllHQDepartmentOffices();
allHQDepartmentsAsperDate = deptHeadQuaterOfficeRepository.getHQDepartmentOfficesAsPerDate(date);
hqDepartmentsPunched = deptHeadQuaterOfficeRepository.getHQDepartmentOfficePunched(date);
System.out.println("All Departments: "+allHQDepartments);
System.out.println("All Departments as per date: "+allHQDepartmentsAsperDate);
hqDepartmentsEnrolled = deptHeadQuaterOfficeRepository.getHQDepartmentOfficeEnrolled();
System.out.println("Enrolled: "+hqDepartmentsEnrolled);
System.out.println("Punched: "+hqDepartmentsPunched);
String divAbsent = null;
String divPercentage = null;
Integer j = 0;
List<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
for (int i = 0; i <allHQDepartments.size(); i++) {
ArrayList<String> myListKey = new ArrayList<>();
ArrayList<String> myListValue = new ArrayList<>();
myListKey.add("Department"); myListValue.add(allHQDepartments.get(i));
myListKey.add("Enrolled"); myListValue.add(hqDepartmentsEnrolled.get(i));
if (allHQDepartmentsAsperDate.contains(allHQDepartments.get(i)))
{
myListKey.add("Punched"); myListValue.add(hqDepartmentsPunched.get(j));
Integer xDivAbsent = Integer.parseInt(hqDepartmentsEnrolled.get(i)) - Integer.parseInt(hqDepartmentsPunched.get(j));
Integer xdivPercentage = ((Integer.parseInt((hqDepartmentsPunched.get(j))) *100)/ Integer.parseInt(hqDepartmentsEnrolled.get(i)));
divAbsent = xDivAbsent.toString();
divPercentage = xdivPercentage.toString();
j++;
}
else
{
myListKey.add("Punched"); myListValue.add("0");
divAbsent = hqDepartmentsEnrolled.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);
}
}

1051
src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMEnrolledEmpListDataController.java
File diff suppressed because it is too large
View File

308
src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMHeadQuaterTotalEntriesRestController.java

@ -0,0 +1,308 @@
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 org.springframework.beans.factory.annotation.Autowired;
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.HeadQuaterTotalEntriesRepository;
import com.gcc.biometric.api.GccBioMetricApi.repo.ZoneDivisionOfficeRepository;
@RestController
@RequestMapping("/gcc.com/PERM")
public class PERMHeadQuaterTotalEntriesRestController {
@Autowired
private HeadQuaterTotalEntriesRepository headQuaterTotalEntriesRepository;
// inject employee dao
@Autowired
public PERMHeadQuaterTotalEntriesRestController(HeadQuaterTotalEntriesRepository theHeadQuaterTotalEntriesRepository) {
headQuaterTotalEntriesRepository = theHeadQuaterTotalEntriesRepository;
}
ArrayList<Integer> arrZoneEnroll;
ArrayList<Integer> arrZonePunched;
@GetMapping("/HQTotalEmpCountPresentAbsentPercentage/{tempDate}")
public LinkedHashMap<String, Integer> getZoneEnrollPunchAbsentPercentage(@PathVariable String tempDate) //@RequestParam(value = "date")@DateTimeFormat(pattern="yyyy-MM-dd") LocalDate date
{
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(date);
LinkedHashMap<String, Integer> map = new LinkedHashMap<>();
arrZoneEnroll = headQuaterTotalEntriesRepository.getEnrolled();
arrZonePunched = headQuaterTotalEntriesRepository.getPunched(date);
System.out.println("Enrolled: "+arrZoneEnroll);
System.out.println("Punched: "+arrZonePunched);
System.out.println(arrZonePunched.isEmpty());
Integer zoneAbsent=0;
Integer zonePercentage=0;
for(int i=0;i<arrZoneEnroll.size();i++)
{
System.out.println("Printing for zone_"+i);
if(arrZonePunched.isEmpty())
{
map.put("Zone_"+(i+1)+"", i+1);
map.put("Zone_"+(i+1)+"_enrolled", arrZoneEnroll.get(i));
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("Percentage_"+(i+1)+"", zonePercentage);
zoneAbsent=0;
zonePercentage=0;
}
else
{
map.put("Zone_"+(i+1)+"", i+1);
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));
map.put("Absent_"+(i+1)+"", zoneAbsent);
map.put("Percentage_"+(i+1)+"", zonePercentage);
zoneAbsent=0;
zonePercentage=0;
}
}
return map;
}
// @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;
// }
}

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

@ -0,0 +1,304 @@
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 org.springframework.beans.factory.annotation.Autowired;
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.HeadQuaterZonesEntriesRepository;
@RestController
@RequestMapping("/gcc.com/PERM")
public class PERMHeadQuaterZonesEntriesRestController {
@Autowired
private HeadQuaterZonesEntriesRepository headQuaterZonesEntriesRepository;
// inject employee dao
@Autowired
public PERMHeadQuaterZonesEntriesRestController(HeadQuaterZonesEntriesRepository theHeadQuaterEntriesRepository) {
headQuaterZonesEntriesRepository = theHeadQuaterEntriesRepository;
}
ArrayList<Integer> arrZoneEnroll;
ArrayList<Integer> arrZonePunched;
@GetMapping("/HQZonesEmpCountPresentAbsentPercentage/{tempDate}")
public LinkedHashMap<String, Integer> getZoneEnrollPunchAbsentPercentage(@PathVariable String tempDate) //@RequestParam(value = "date")@DateTimeFormat(pattern="yyyy-MM-dd") LocalDate date
{
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(date);
LinkedHashMap<String, Integer> map = new LinkedHashMap<>();
arrZoneEnroll = headQuaterZonesEntriesRepository.getEnrolled();
arrZonePunched = headQuaterZonesEntriesRepository.getPunched(date);
System.out.println("Enrolled: "+arrZoneEnroll);
System.out.println("Punched: "+arrZonePunched);
System.out.println(arrZonePunched.isEmpty());
Integer zoneAbsent=0;
Integer zonePercentage=0;
for(int i=0;i<arrZoneEnroll.size();i++)
{
System.out.println("Printing for zone_"+i);
if(arrZonePunched.isEmpty())
{
map.put("Zone_"+(i+1)+"", i+1);
map.put("Zone_"+(i+1)+"_enrolled", arrZoneEnroll.get(i));
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("Percentage_"+(i+1)+"", zonePercentage);
zoneAbsent=0;
zonePercentage=0;
}
else
{
map.put("Zone_"+(i+1)+"", i+1);
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));
map.put("Absent_"+(i+1)+"", zoneAbsent);
map.put("Percentage_"+(i+1)+"", zonePercentage);
zoneAbsent=0;
zonePercentage=0;
}
}
return map;
}
// @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;
// }
}

1070
src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMOtherZoneOfficesController.java
File diff suppressed because it is too large
View File

1295
src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMPunchedEmpListDataController.java
File diff suppressed because it is too large
View File

113
src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMRegionalDeputyCommissionerController.java

@ -0,0 +1,113 @@
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 org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.repository.Query;
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.HeadQuaterZonesEntriesRepository;
import com.gcc.biometric.api.GccBioMetricApi.repo.RegionalDeputyCommissionerRepository;
@RestController
@RequestMapping("/gcc.com/PERM")
public class PERMRegionalDeputyCommissionerController {
@Autowired
private RegionalDeputyCommissionerRepository regionalDeputyCommissionerRepository;
// inject employee dao
@Autowired
public PERMRegionalDeputyCommissionerController(RegionalDeputyCommissionerRepository theRegionalDeputyCommissionerRepository) {
regionalDeputyCommissionerRepository = theRegionalDeputyCommissionerRepository;
}
ArrayList<Integer> arrRDCEnroll;
ArrayList<Integer> arrRDCPunched;
ArrayList<String> arrRDCZoneNames;
@GetMapping("/RegionalDeputyCommissionerOfficeData/{tempDate}")
public LinkedHashMap<String, String> getZoneEnrollPunchAbsentPercentage(@PathVariable String tempDate) //@RequestParam(value = "date")@DateTimeFormat(pattern="yyyy-MM-dd") LocalDate date
{
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(date);
LinkedHashMap<String, String> map = new LinkedHashMap<>();
arrRDCPunched = regionalDeputyCommissionerRepository.getRDCPunched(date);
System.out.println("Punched: "+arrRDCPunched);
arrRDCEnroll = regionalDeputyCommissionerRepository.getRDCEnrolled();
System.out.println("Enrolled: "+arrRDCEnroll);
arrRDCZoneNames = regionalDeputyCommissionerRepository.getRDCZoneNames();
System.out.println("Enrolled: "+arrRDCZoneNames);
Integer zoneAbsent=0;
Integer zonePercentage=0;
for(int i=0;i<arrRDCEnroll.size();i++)
{
if(arrRDCPunched.isEmpty())
{
System.out.println("Printing for zone_"+i);
map.put(arrRDCZoneNames.get(i), arrRDCZoneNames.get(i));
map.put(arrRDCZoneNames.get(i)+"_Enrolled", arrRDCEnroll.get(i).toString());
map.put(arrRDCZoneNames.get(i)+"_Punched", "0");
zoneAbsent = arrRDCEnroll.get(i) - 0;
zonePercentage = ((0 *100)/ arrRDCEnroll.get(i));
map.put(arrRDCZoneNames.get(i)+"_Absent", zoneAbsent.toString());
map.put(arrRDCZoneNames.get(i)+"_Percentage", zonePercentage.toString());
zoneAbsent=0;
zonePercentage=0;
}
else
{
System.out.println("Printing for zone_"+i);
map.put(arrRDCZoneNames.get(i), arrRDCZoneNames.get(i));
map.put(arrRDCZoneNames.get(i)+"_Enrolled", arrRDCEnroll.get(i).toString());
map.put(arrRDCZoneNames.get(i)+"_Punched", arrRDCPunched.get(i).toString());
zoneAbsent = arrRDCEnroll.get(i) - arrRDCPunched.get(i);
zonePercentage = ((arrRDCPunched.get(i) *100)/ arrRDCEnroll.get(i));
map.put(arrRDCZoneNames.get(i)+"_Absent", zoneAbsent.toString());
map.put(arrRDCZoneNames.get(i)+"_Percentage", zonePercentage.toString());
zoneAbsent=0;
zonePercentage=0;
}
}
return map;
}
}

85
src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMZonalOfficeTotalDateController.java

@ -0,0 +1,85 @@
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 org.springframework.beans.factory.annotation.Autowired;
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.HeadQuaterZonesEntriesRepository;
import com.gcc.biometric.api.GccBioMetricApi.repo.ZonalOfficeTotalDataRepository;
@RestController
@RequestMapping("/gcc.com/PERM")
public class PERMZonalOfficeTotalDateController {
@Autowired
private ZonalOfficeTotalDataRepository zonalOfficeTotalDataRepository;
// inject employee dao
@Autowired
public PERMZonalOfficeTotalDateController(ZonalOfficeTotalDataRepository theZonalOfficeTotalDataRepository) {
zonalOfficeTotalDataRepository = theZonalOfficeTotalDataRepository;
}
ArrayList<Integer> arrZonalTotalEnroll;
ArrayList<Integer> arrZonalTotalPunched;
@GetMapping("/TotalZonalOfficeEmployeeData/{tempDate}")
public LinkedHashMap<String, Integer> getZoneEnrollPunchAbsentPercentage(@PathVariable String tempDate) //@RequestParam(value = "date")@DateTimeFormat(pattern="yyyy-MM-dd") LocalDate date
{
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(date);
LinkedHashMap<String, Integer> map = new LinkedHashMap<>();
arrZonalTotalEnroll = zonalOfficeTotalDataRepository.getZonalOfficeTotalEnrolled();
arrZonalTotalPunched = zonalOfficeTotalDataRepository.getZonalOfficeTotalPunched(date);
System.out.println("Enrolled: "+arrZonalTotalEnroll);
System.out.println("Punched: "+arrZonalTotalPunched);
Integer zoneAbsent=0;
Integer zonePercentage=0;
for(int i=0;i<arrZonalTotalEnroll.size();i++)
{
map.put("Zonal Office Eenrolled", arrZonalTotalEnroll.get(i));
map.put("Zonal Office Punched", arrZonalTotalPunched.get(i));
zoneAbsent = arrZonalTotalEnroll.get(i) - arrZonalTotalPunched.get(i);
zonePercentage = ((arrZonalTotalPunched.get(i) *100)/ arrZonalTotalEnroll.get(i));
map.put("Absent", zoneAbsent);
map.put("Percentage", zonePercentage);
zoneAbsent=0;
zonePercentage=0;
}
return map;
}
}

548
src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMZoneDivisionOfficeController.java

@ -0,0 +1,548 @@
package com.gcc.biometric.api.GccBioMetricApi.controller.perm;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
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.ZoneDivisionOfficeRepository;
@RestController
@RequestMapping("/gcc.com/PERM")
public class PERMZoneDivisionOfficeController {
@Autowired
private ZoneDivisionOfficeRepository zoneDivMasterRepository;
@Autowired
public PERMZoneDivisionOfficeController(ZoneDivisionOfficeRepository theZoneDivMasterRepository) {
zoneDivMasterRepository = theZoneDivMasterRepository;
}
@GetMapping("/DivEmpCountPresentAbsentPercentage/{zone}/{officeTypes}/{tempDate}")
public ResponseEntity<List<Map<String, String>>> getDivEnrollPunchAbsentPercentage(@PathVariable Integer zone,
@PathVariable String officeTypes, @PathVariable String tempDate)
{
System.out.println("Inside getDivEnrollPunchAbsentPercentage() method!");
Integer zoneValue = zone;
String officeType = officeTypes;
//Division Office
if (officeType.equals("DO")) {
System.out.println("for Division Office Data");
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(zoneValue);
System.out.println(officeType);
System.out.println(date);
ArrayList<String> zoneDivisions;
ArrayList<String> zoneDivisionsOnDate;
ArrayList<String> divEnrolled;
ArrayList<String> divPunched;
ArrayList<String> divAsPerEnrolled;
if(zoneValue==1)
{
System.out.println("Inside division 1: Special case");
divPunched = zoneDivMasterRepository.getDivisionOfficePunchedPerDiv_1(zoneValue, date);
zoneDivisionsOnDate = zoneDivMasterRepository.getDivisionOfficeZoneDivAsPerDate(zoneValue, date);
Collections.sort(zoneDivisionsOnDate);
zoneDivisions = zoneDivMasterRepository.getDivisionOfficeZoneDivisions(zoneValue);
System.out.println("Divisions: "+zoneDivisions);
System.out.println("Divisions as per Date: "+zoneDivisionsOnDate);
System.out.println("Punched: "+divPunched);
divEnrolled = zoneDivMasterRepository.getDivisionOfficeEnrolledPerDiv_1(zoneValue);
System.out.println("Enrolled: "+divEnrolled);
}
else if(zoneValue==8)
{
System.out.println("Inside division 8: Special case");
divPunched = zoneDivMasterRepository.getDivisionOfficePunchedPerDiv_8(zoneValue, date);
zoneDivisionsOnDate = zoneDivMasterRepository.getDivisionOfficeZoneDivAsPerDate_8(zoneValue, date);
Collections.sort(zoneDivisionsOnDate);
zoneDivisions = zoneDivMasterRepository.getDivisionOfficeZoneDivisions_8(zoneValue);
System.out.println("Divisions: "+zoneDivisions);
System.out.println("Divisions as per Date: "+zoneDivisionsOnDate);
System.out.println("Punched: "+divPunched);
divEnrolled = zoneDivMasterRepository.getDivisionOfficeEnrolledPerDiv_8(zoneValue);
System.out.println("Enrolled: "+divEnrolled);
divAsPerEnrolled = zoneDivMasterRepository.getDivisionOfficesAsPerEnrolled_8(zoneValue);
System.out.println("Divisions as per Enrolled: "+divAsPerEnrolled);
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());
System.out.println("Divisions as per Enrolled: "+divAsPerEnrolled.size());
}
else
{
divPunched = zoneDivMasterRepository.getDivisionOfficePunchedPerDiv(zoneValue, date);
zoneDivisionsOnDate = zoneDivMasterRepository.getDivisionOfficeZoneDivAsPerDate(zoneValue, date);
Collections.sort(zoneDivisionsOnDate);
zoneDivisions = zoneDivMasterRepository.getDivisionOfficeZoneDivisions(zoneValue);
System.out.println("Divisions: "+zoneDivisions);
System.out.println("Divisions as per Date: "+zoneDivisionsOnDate);
System.out.println("Punched: "+divPunched);
divEnrolled = zoneDivMasterRepository.getDivisionOfficeEnrolledPerDiv(zoneValue);
System.out.println("Enrolled: "+divEnrolled);
}
String divAbsent = null;
String divPercentage = null;
Integer j = 0;
List<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
for (int i = 0; i <zoneDivisions.size(); i++) {
ArrayList<String> myListKey = new ArrayList<>();
ArrayList<String> myListValue = new ArrayList<>();
myListKey.add("Division"); myListValue.add(zoneDivisions.get(i));
myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i));
if (zoneDivisionsOnDate.contains(zoneDivisions.get(i)))
{
myListKey.add("Punched"); myListValue.add(divPunched.get(j));
Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt(divPunched.get(j));
Integer xdivPercentage = ((Integer.parseInt((divPunched.get(j))) *100)/ Integer.parseInt(divEnrolled.get(i)));
divAbsent = xDivAbsent.toString();
divPercentage = xdivPercentage.toString();
j++;
}
else
{
myListKey.add("Punched"); myListValue.add("0");
divAbsent = divEnrolled.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);
}
//Unit Office
else if (officeType.equals("UO")) {
System.out.println("for Unit Office Data");
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(zoneValue);
System.out.println(officeType);
System.out.println(date);
ArrayList<String> allUnitsAsPerZone;
ArrayList<String> unitEnrolled;
ArrayList<String> unitAsEnrolled;
ArrayList<String> unitPunched;
ArrayList<String> unitAsPunched;
allUnitsAsPerZone = zoneDivMasterRepository.getAllUnitOfficeAsPerZone(zoneValue);
unitEnrolled = zoneDivMasterRepository.getUnitOfficeEnrolledPerZone(zoneValue);
unitAsEnrolled = zoneDivMasterRepository.getAllUnitOfficeAsPerZoneAsPerEnrolled(zoneValue);
unitPunched = zoneDivMasterRepository.getUnitOfficePunchedPerZone(zoneValue, date);
unitAsPunched = zoneDivMasterRepository.getAllUnitOfficeAsPerZoneAsPerPunched(zoneValue, date);
System.out.println("All unit office as per Zone "+allUnitsAsPerZone);
System.out.println("Unit Office Enrolled per zone "+unitEnrolled);
System.out.println("Unit office Which have enrolled data "+unitAsEnrolled);
System.out.println("Unit office Punched "+unitPunched);
System.out.println("Unit office which have punched data "+unitAsPunched);
String divAbsent = null;
String divPercentage = null;
Integer j = 0;
Integer k = 0;
List<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
for (int i = 0; i <allUnitsAsPerZone.size(); i++) {
ArrayList<String> myListKey = new ArrayList<>();
ArrayList<String> myListValue = new ArrayList<>();
myListKey.add("Division"); myListValue.add(allUnitsAsPerZone.get(i));
if(unitAsEnrolled.contains(allUnitsAsPerZone.get(i)))
{
myListKey.add("Enrolled"); myListValue.add(unitEnrolled.get(k));
String enrolled = unitEnrolled.get(k);
k++;
if (unitAsPunched.contains(allUnitsAsPerZone.get(i)))
{
myListKey.add("Punched"); myListValue.add(unitPunched.get(j));
Integer xDivAbsent = Integer.parseInt(enrolled) - Integer.parseInt(unitPunched.get(j));
Integer xdivPercentage = ((Integer.parseInt((unitPunched.get(j))) *100)/ Integer.parseInt(enrolled));
divAbsent = xDivAbsent.toString();
divPercentage = xdivPercentage.toString();
myListKey.add("Absent"); myListValue.add(divAbsent);
myListKey.add("Percentage"); myListValue.add(divPercentage);
j++;
}
else
{
myListKey.add("Punched"); myListValue.add("0");
divAbsent = unitEnrolled.get(i);
divPercentage = "0";
myListKey.add("Absent"); myListValue.add(divAbsent);
myListKey.add("Percentage"); myListValue.add(divPercentage);
}
}
else
{
myListKey.add("Enrolled"); myListValue.add("0");
myListKey.add("Punched"); myListValue.add("0");
myListKey.add("Absent"); myListValue.add("0");
myListKey.add("Percentage"); myListValue.add("0");
}
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);
}
//Zonal Office
else if (officeType.equals("ZO")) {
System.out.println("for Zonal Office Data");
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(zoneValue);
System.out.println(officeType);
System.out.println(date);
ArrayList<String> zoneDivisions;
ArrayList<String> zoneDivisionsOnDate;
ArrayList<String> divEnrolled;
ArrayList<String> divPunched;
divPunched = zoneDivMasterRepository.getZonalOfficePunchedPerDiv(zoneValue, date);
zoneDivisionsOnDate = zoneDivMasterRepository.getZonalOfficeZoneDivAsPerDate(zoneValue, date);
Collections.sort(zoneDivisionsOnDate);
zoneDivisions = zoneDivMasterRepository.getZonalOfficeZoneDivisions(zoneValue);
System.out.println("Divisions: "+zoneDivisions);
System.out.println("Divisionsas per Date: "+zoneDivisionsOnDate);
System.out.println("Punched: "+divPunched);
divEnrolled = zoneDivMasterRepository.getZonalOfficeEnrolledPerDiv(zoneValue);
System.out.println("Enrolled: "+divEnrolled);
String divAbsent = null;
String divPercentage = null;
Integer j = 0;
List<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
for (int i = 0; i <zoneDivisions.size(); i++) {
ArrayList<String> myListKey = new ArrayList<>();
ArrayList<String> myListValue = new ArrayList<>();
myListKey.add("Division"); myListValue.add(zoneDivisions.get(i));
myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i));
if (zoneDivisionsOnDate.contains(zoneDivisions.get(i)))
{
myListKey.add("Punched"); myListValue.add(divPunched.get(j));
Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt(divPunched.get(j));
Integer xdivPercentage = ((Integer.parseInt((divPunched.get(j))) *100)/ Integer.parseInt(divEnrolled.get(i)));
divAbsent = xDivAbsent.toString();
divPercentage = xdivPercentage.toString();
j++;
}
else
{
myListKey.add("Punched"); myListValue.add("0");
divAbsent = divEnrolled.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);
}
//Lorry Station
else if (officeType.equals("LS")) {
System.out.println("for Lorry Station Data");
if(zoneValue==2 || zoneValue==3)
{
System.out.println("zone value passed as 2 or 3");
zoneValue=1;
}
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(zoneValue);
System.out.println(officeType);
System.out.println(date);
ArrayList<String> zoneDivisions;
ArrayList<String> zoneDivisionsOnDate;
ArrayList<String> divEnrolled;
ArrayList<String> divPunched;
divEnrolled = zoneDivMasterRepository.getLorryStationEnrolledPerDiv(zoneValue);
divPunched = zoneDivMasterRepository.getLorryStationPunchedPerDiv(zoneValue, date);
zoneDivisionsOnDate = zoneDivMasterRepository.getLorryStationZoneDivAsPerDate(zoneValue, date);
Collections.sort(zoneDivisionsOnDate);
zoneDivisions = zoneDivMasterRepository.getLorryStationZoneDivisions(zoneValue);
System.out.println("Divisions: "+zoneDivisions);
System.out.println("Divisionsas per Date: "+zoneDivisionsOnDate);
System.out.println("Enrolled: "+divEnrolled);
System.out.println("Punched: "+divPunched);
String divAbsent = null;
String divPercentage = null;
Integer j = 0;
List<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
for (int i = 0; i <zoneDivisions.size(); i++) {
ArrayList<String> myListKey = new ArrayList<>();
ArrayList<String> myListValue = new ArrayList<>();
myListKey.add("Division"); myListValue.add(zoneDivisions.get(i));
myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i));
if (zoneDivisionsOnDate.contains(zoneDivisions.get(i)))
{
myListKey.add("Punched"); myListValue.add(divPunched.get(j));
Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt(divPunched.get(j));
Integer xdivPercentage = ((Integer.parseInt((divPunched.get(j))) *100)/ Integer.parseInt(divEnrolled.get(i)));
divAbsent = xDivAbsent.toString();
divPercentage = xdivPercentage.toString();
j++;
}
else
{
myListKey.add("Punched"); myListValue.add("0");
divAbsent = divEnrolled.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);
}
else if (officeType.equals("ZONAL")) {
System.out.println("for Zonal Office zone data Data");
Date date = null;
try {
date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate);
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(zoneValue);
System.out.println(officeType);
System.out.println(date);
ArrayList<String> zoneDivisions;
ArrayList<String> zoneDivisionsOnDate;
ArrayList<String> divEnrolled;
ArrayList<String> divPunched;
divPunched = zoneDivMasterRepository.getAllZonalOfficesPunchedOfAllZones(date);
zoneDivisionsOnDate = zoneDivMasterRepository.getAllZonalOfficesZoneAsPerDate(date);
// Collections.sort(zoneDivisionsOnDate);
zoneDivisions = zoneDivMasterRepository.getAllZonalOfficesZones();
System.out.println("Divisions: "+zoneDivisions);
System.out.println("Divisions as per Date: "+zoneDivisionsOnDate);
System.out.println("Punched: "+divPunched);
divEnrolled = zoneDivMasterRepository.getAllZonalOfficesEnrolledOfAllZones();
System.out.println("Enrolled: "+divEnrolled);
String divAbsent = null;
String divPercentage = null;
Integer j = 0;
List<Map<String, String>> listMap = new ArrayList<Map<String, String>>();
for (Integer i = 0; i <zoneDivisions.size(); i++) {
Integer n = 1+i;
ArrayList<String> myListKey = new ArrayList<>();
ArrayList<String> myListValue = new ArrayList<>();
myListKey.add("Division"); myListValue.add((n).toString());
myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i));
if (zoneDivisionsOnDate.contains(zoneDivisions.get(i)))
{
myListKey.add("Punched"); myListValue.add(divPunched.get(j));
Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt(divPunched.get(j));
Integer xdivPercentage = ((Integer.parseInt((divPunched.get(j))) *100)/ Integer.parseInt(divEnrolled.get(i)));
divAbsent = xDivAbsent.toString();
divPercentage = xdivPercentage.toString();
j++;
}
else
{
myListKey.add("Punched"); myListValue.add("0");
divAbsent = divEnrolled.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);
}
return null;
}
}

18
src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/CustomerDAO.java

@ -0,0 +1,18 @@
//package com.gcc.biometric.api.GccBioMetricApi.dao;
//
//import java.util.List;
//
//import com.gcc.biometric.api.GccBioMetricApi.entity.Customer;
//
//public interface CustomerDAO {
//
// public List<Customer> findAll();
//
// public Customer findById(int theId);
//
// public void save(Customer theCustomer);
//
// public void deleteById(int thId);
//
//
//}

71
src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/CustomerDAOImpl.java

@ -0,0 +1,71 @@
//package com.gcc.biometric.api.GccBioMetricApi.dao;
//
//import java.util.List;
//
//import javax.persistence.EntityManager;
//
//import org.hibernate.Session;
//import org.hibernate.query.Query;
//import org.springframework.stereotype.Repository;
//import com.gcc.biometric.api.GccBioMetricApi.entity.Customer;
//
//@Repository
//public class CustomerDAOImpl implements CustomerDAO {
//
// // define fields for entity manager
// private EntityManager entityManager;
//
// // set up constructor injection
// public CustomerDAOImpl(EntityManager theEntityManager) {
// entityManager = theEntityManager;
// }
//
// @Override
//// @Transactional //removing this @Transactional bcs we are gonna add a service to handle @Transactional
// public List<Customer> findAll() {
//
// // get the current hibernate session
// Session currentSession = entityManager.unwrap(Session.class);
// System.out.println("Session Created");
// // create a query
// Query<Customer> theQuery = currentSession.createQuery("from Customer", Customer.class);
// System.out.println("Reading Query");
// // execute query and get result
// List<Customer> customers = theQuery.getResultList();
// // return the result
// System.out.println("Returning query");
// return customers;
// }
//
// @Override
// public Customer findById(int theId) {
// // get the current hibernate session
// Session currentSession = entityManager.unwrap(Session.class);
// // get the employee
// Customer theCustomer = currentSession.get(Customer.class, theId);
// // return the employee
// return theCustomer;
// }
//
// @Override
// public void save(Customer theCustomer) {
// // get the current hibernate session
// Session currentSession = entityManager.unwrap(Session.class);
// // save customer
// currentSession.saveOrUpdate(theCustomer);
//
// }
//
// @Override
// public void deleteById(int theId) {
// // get the current hibernate session
// Session currentSession = entityManager.unwrap(Session.class);
//
// //delete object with primary key
// Query<Customer> theQuery = currentSession.createQuery("delete from Customer where id="+theId);
// //theQuery.setParameter("customerId", theId);
// theQuery.executeUpdate();
//
// }
//
//}

59
src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/CustomerDAOJpaImpl.java

@ -0,0 +1,59 @@
//package com.gcc.biometric.api.GccBioMetricApi.dao;
//
//import java.util.List;
//
//import javax.persistence.EntityManager;
//import javax.persistence.Query;
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Repository;
//
//import com.gcc.biometric.api.GccBioMetricApi.entity.Customer;
//
//
//@Repository
//public class CustomerDAOJpaImpl implements CustomerDAO {
//
// //define entity manager
// private EntityManager entityManager;
//
// // Constructor Injection
// @Autowired
// public CustomerDAOJpaImpl(EntityManager theEntityManager) {
// entityManager = theEntityManager;
// }
//
// @Override
// public List<Customer> findAll() {
// // create query
// Query theQuery = entityManager.createQuery("from Customer");
// // execute query and get the results
// List<Customer> customers = theQuery.getResultList();
// // return the results
// return customers;
// }
//
// @Override
// public Customer findById(int theId) {
// // create query
//
// // execute query and get the results
//
// // return the results
// return null;
// }
//
// @Override
// public void save(Customer theCustomer) {
// // TODO Auto-generated method stub
//
// }
//
// @Override
// public void deleteById(int thId) {
// // TODO Auto-generated method stub
//
// }
//
//
//}

12
src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/DeviceStatusDAO.java

@ -0,0 +1,12 @@
//package com.gcc.biometric.api.GccBioMetricApi.dao;
//
//import java.util.List;
//
//import com.gcc.biometric.api.GccBioMetricApi.entity.DeviceStatus;
//
//
//public interface DeviceStatusDAO {
//
// public List<DeviceStatus> getAllDevices();
//
//}

37
src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/DeviceStatusDAOImpl.java

@ -0,0 +1,37 @@
//package com.gcc.biometric.api.GccBioMetricApi.dao;
//
//import java.util.List;
//import javax.persistence.EntityManager;
//import org.hibernate.Session;
//import org.hibernate.query.Query;
//import org.springframework.stereotype.Repository;
//import com.gcc.biometric.api.GccBioMetricApi.entity.DeviceStatus;
//
//
//@Repository
//public class DeviceStatusDAOImpl implements DeviceStatusDAO {
//
// // define fields for entity manager
// private EntityManager entityManager;
//
// // set up constructor injection
// public DeviceStatusDAOImpl(EntityManager theEntityManager) {
// entityManager = theEntityManager;
// }
//
// @Override
// public List<DeviceStatus> getAllDevices() {
// // get the current hibernate session
// Session currentSession = entityManager.unwrap(Session.class);
// System.out.println("Session Created");
// // create a query
// Query<DeviceStatus> theQuery = currentSession.createQuery("from DeviceStatus", DeviceStatus.class);
// System.out.println("Reading Query");
// // execute query and get result
// List<DeviceStatus> deviceStatus = theQuery.getResultList();
// // return the result
// System.out.println("Returning query");
// return deviceStatus;
// }
//
//}

13
src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/EmployeeDAO.java

@ -0,0 +1,13 @@
//package com.gcc.biometric.api.GccBioMetricApi.dao;
//
//import java.util.List;
//
//import com.gcc.biometric.api.GccBioMetricApi.entity.Employee;
//
//public interface EmployeeDAO {
//
// public List<Employee> getAllEmployee();
//
// public Employee findEmpBySnn(String snn);
//
//}

59
src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/EmployeeDAOImpl.java

@ -0,0 +1,59 @@
//package com.gcc.biometric.api.GccBioMetricApi.dao;
//
//import java.util.List;
//
//import javax.persistence.EntityManager;
//
//import org.hibernate.Session;
//import org.hibernate.query.Query;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.jdbc.core.JdbcTemplate;
//import org.springframework.stereotype.Repository;
//
//import com.gcc.biometric.api.GccBioMetricApi.entity.DeviceStatus;
//import com.gcc.biometric.api.GccBioMetricApi.entity.Employee;
//
//@Repository
//public class EmployeeDAOImpl implements EmployeeDAO {
//
// // define fields for entity manager
// private EntityManager entityManager;
//
// @Autowired
// private JdbcTemplate jbbcTemplate;
//
// // set up constructor injection
// public EmployeeDAOImpl(EntityManager theEntityManager) {
// entityManager = theEntityManager;
// }
//
//
//
// @Override
// public List<Employee> getAllEmployee() {
// // get the current hibernate session
// Session currentSession = entityManager.unwrap(Session.class);
// System.out.println("Session Created");
// // create a query
// Query<Employee> theQuery = currentSession.createQuery("from Employee", Employee.class);
// System.out.println("Reading Query");
// // execute query and get result
// List<Employee> employees = theQuery.getResultList();
// // return the result
// System.out.println("Returning query");
// return employees;
// }
//
// @Override
// public Employee findEmpBySnn(String snn) {
// // get the current hibernate session
// Session currentSession = entityManager.unwrap(Session.class);
// // get the employee
// Employee theEmployee = currentSession.get(Employee.class, snn);
// // return the employee
// return theEmployee;
//
// }
//
//
//}

10
src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/MachineRawPunchDAO.java

@ -0,0 +1,10 @@
//package com.gcc.biometric.api.GccBioMetricApi.dao;
//
//import java.util.List;
//import com.gcc.biometric.api.GccBioMetricApi.entity.MachineRawPunch;
//
//public interface MachineRawPunchDAO {
//
// public List<MachineRawPunch> getAllRawPunch();
//
//}

36
src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/MachineRawPunchDAOImpl.java

@ -0,0 +1,36 @@
//package com.gcc.biometric.api.GccBioMetricApi.dao;
//
//import java.util.List;
//import javax.persistence.EntityManager;
//import org.hibernate.Session;
//import org.hibernate.query.Query;
//import org.springframework.stereotype.Repository;
//import com.gcc.biometric.api.GccBioMetricApi.entity.MachineRawPunch;
//
//@Repository
//public class MachineRawPunchDAOImpl implements MachineRawPunchDAO {
//
// // define fields for entity manager
// private EntityManager entityManager;
//
// // set up constructor injection
// public MachineRawPunchDAOImpl(EntityManager theEntityManager) {
// entityManager = theEntityManager;
// }
//
// @Override
// public List<MachineRawPunch> getAllRawPunch() {
// // get the current hibernate session
// Session currentSession = entityManager.unwrap(Session.class);
// System.out.println("Session Created");
// // create a query
// Query<MachineRawPunch> theQuery = currentSession.createQuery("from MachineRawPunch", MachineRawPunch.class);
// System.out.println("Reading Query");
// // execute query and get result
// List<MachineRawPunch> machineRawPunch = theQuery.getResultList();
// // return the result
// System.out.println("Returning query");
// return machineRawPunch;
// }
//
//}

11
src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/RealTimeUserInfoDAO.java

@ -0,0 +1,11 @@
//package com.gcc.biometric.api.GccBioMetricApi.dao;
//
//import java.util.List;
//
//import com.gcc.biometric.api.GccBioMetricApi.entity.RealTimeUserInfo;
//
//public interface RealTimeUserInfoDAO {
//
// public List<RealTimeUserInfo> getAllUserInfo();
//
//}

55
src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/RealTimeUserInfoDAOImpl.java

@ -0,0 +1,55 @@
//package com.gcc.biometric.api.GccBioMetricApi.dao;
//
//import java.util.List;
//import javax.persistence.EntityManager;
//import org.hibernate.Session;
//import org.hibernate.query.Query;
//import org.springframework.stereotype.Repository;
//
//import com.gcc.biometric.api.GccBioMetricApi.entity.Employee;
//import com.gcc.biometric.api.GccBioMetricApi.entity.RealTimeUserInfo;
//
//@Repository
//public class RealTimeUserInfoDAOImpl implements RealTimeUserInfoDAO {
//
// // define fields for entity manager
// private EntityManager entityManager;
//
// // set up constructor injection
// public RealTimeUserInfoDAOImpl(EntityManager theEntityManager) {
// entityManager = theEntityManager;
// }
//
// @Override
// public List<RealTimeUserInfo> getAllUserInfo() {
//
// // get the current hibernate session
// Session currentSession = entityManager.unwrap(Session.class);
// System.out.println("Session Created");
// // create a query
// Query<RealTimeUserInfo> theQuery = currentSession.createQuery("from RealTimeUserInfo", RealTimeUserInfo.class);
// System.out.println("Reading Query");
// // execute query and get result
// List<RealTimeUserInfo> realTimeUserInfo = theQuery.getResultList();
// // return the result
// System.out.println("Returning query");
// return realTimeUserInfo;
//
// }
//
//// @Override
//// public List<RealTimeUserInfo> getAllUserInfo() {
//// // get the current hibernate session
//// Session currentSession = entityManager.unwrap(Session.class);
//// System.out.println("Session Created");
//// // create a query
//// Query<RealTimeUserInfo> theQuery = currentSession.createQuery("from RealTimeUserInfo", RealTimeUserInfo.class);
//// System.out.println("Reading Query");
//// // execute query and get result
//// List<RealTimeUserInfo> employees = theQuery.getResultList();
//// // return the result
//// System.out.println("Returning query");
//// return employees;
//// }
//
//}

91
src/main/java/com/gcc/biometric/api/GccBioMetricApi/entity/Customer.java

@ -0,0 +1,91 @@
//package com.gcc.biometric.api.GccBioMetricApi.entity;
//
//import javax.persistence.Column;
//import javax.persistence.Entity;
//import javax.persistence.GeneratedValue;
//import javax.persistence.GenerationType;
//import javax.persistence.Id;
//import javax.persistence.Table;
//
//
//@Entity
////@Scope(value = "singleton")
//@Table(name="customers")
//public class Customer {
//
//
// //define fields
// @Id
// @GeneratedValue(strategy = GenerationType.IDENTITY)
// @Column(name="id")
// int id;
//
// @Column(name="first_name")
// String firstname;
//
// @Column(name="last_name")
// String lastname;
//
// @Column(name="email")
// String email;
//
//
// //define constrcutors
//
// public Customer(){}
//
//
// public Customer(int id, String firstname, String lastname, String email) {
// super();
// this.id = id;
// this.firstname = firstname;
// this.lastname = lastname;
// this.email = email;
// }
//
// public Customer(String firstname, String lastname, String email) {
// this.firstname = firstname;
// this.lastname = lastname;
// this.email = email;
// }
//
//
//
// //define getters and setters
// public int getId() {
// return id;
// }
//
// public void setId(int id) {
// this.id = id;
// }
// public String getFirstname() {
// return firstname;
// }
// public void setFirstname(String firstname) {
// this.firstname = firstname;
// }
// public String getLast_name() {
// return lastname;
// }
// public void setLast_name(String last_name) {
// this.lastname = last_name;
// }
// public String getEmail() {
// return email;
// }
// public void setEmail(String email) {
// this.email = email;
// }
//
// //define toString method
// @Override
// public String toString() {
// return "Customer [id=" + id + ", firstname=" + firstname + ", lastname=" + lastname + ", email=" + email
// + "]";
// }
//
//
//
//
//}

84
src/main/java/com/gcc/biometric/api/GccBioMetricApi/entity/DeviceStatus.java

@ -0,0 +1,84 @@
package com.gcc.biometric.api.GccBioMetricApi.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "tbl_fkdevice_status")
public class DeviceStatus {
// define fields
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "device_id")
String deviceId;
@Column(name = "device_name")
String deviceName;
/*
* // @Column(name="connected") // String connected; //
* // @Column(name="last_update_time") // String lastUpadteTime; //
* // @Column(name="last_update_fk_time") // String lastUpdateFkTime; //
* // @Column(name="device_info") // String deviceInfo; //
* // @Column(name="user_count") // String userCount; //
* // @Column(name="manager_count") // String managerCount; //
* // @Column(name="fp_count") // String fpCount; //
* // @Column(name="face_count") // String faceCount; //
* // @Column(name="password_count") // String passwordCount; //
* // @Column(name="idcard_count") // String idCardCount; //
* // @Column(name="total_log_count") // String totalLogCount; //
* // @Column(name="total_user_count") // String totalUserCount; //
* // @Column(name="IsMasterDevice") // String isMasterDevice; //
* // @Column(name="GroupID") // String groupId; // // @Column(name="IPAddrss")
* // String ipAddress;
*
* // @Column(name = "IsAUTHORIZED") // String isAuth;
*
* // @Column(name="TimeZone") // String timeZone;
*
* // @Column(name = "CompanyCode") // String companyCode; //
* // @Column(name="dev_model") // String devModel; //
* // @Column(name="dev_status_info") // String devStatusInfo;
*/
// Defining Constructors
public DeviceStatus() {
}
public DeviceStatus(String deviceId, String deviceName) {
super();
this.deviceId = deviceId;
this.deviceName = deviceName;
}
public String getDeviceId() {
return deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public String getDeviceName() {
return deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
@Override
public String toString() {
return "DeviceStatus [deviceId=" + deviceId + ", deviceName=" + deviceName + "]";
}
}

214
src/main/java/com/gcc/biometric/api/GccBioMetricApi/entity/Employee.java

@ -0,0 +1,214 @@
package com.gcc.biometric.api.GccBioMetricApi.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "tblemployee")
public class Employee {
// Define fields
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "PAYCODE")
String payCode;
@Column(name = "SSN")
String ssn;
@Column(name = "ACTIVE")
Character active;
@Column(name = "EMPNAME")
String empName;
@Column(name = "DateOFBIRTH")
String dob;
@Column(name = "DateOFJOIN")
String doj;
@Column(name = "PRESENTCARDNO")
String presentCardNo;
@Column(name = "DESIGNATION")
String designation;
@Column(name = "DepartmentCODE")
String deptCode;
/*
* // // @Column(name = "COMPANYCODE") // String companyCode; // // @Column(name
* = "DivisionCODE") // String divisionCode; // // @Column(name = "CAT") //
* String cat; // // @Column(name = "ISMARRIED") // String isMarried; //
*
* // // @Column(name = "DepartmentCODE") // String deptCode; // // @Column(name
* = "GradeCODE") // String gradeCode; // // @Column(name = "BRANCHCODE") //
* String branchCode; // // @Column(name = "headid") // String headid; //
* // @Column(name = "Grade") // String grade; // // @Column(name = "GroupID")
* // String groupId;
*
* // @Column(name = "GUARDIANNAME") // String gaurdianName; // // @Column(name
* = "SEX") // String sex; // @Column(name = "BUS") // String bus;
* // @Column(name = "QUALIFICATION") // String qualification; // @Column(name =
* "EXPERIENCE") // String experience; // @Column(name="ADDRESS1") // String
* add1; // // @Column(name="PINCODE1") String pinCode1; //
* // @Column(name="TELEPHONE1") String telephone1; //
* // @Column(name="E_MAIL1") String email1; // // @Column(name="ADDRESS2")
* String add2; // // @Column(name="PINCODE2") String pinCode2; //
* // @Column(name="TELEPHONE2") String telephone2; //
* // @Column(name="BLOODGROUP") String bloodGroup; //
* // @Column(name="EMPPHOTO") String empPhoto; //
* // @Column(name="EMPSIGNATURE") String empSignature; // // //
* // @Column(name="Leavingdate") String leavingDate; //
* // @Column(name="LeavingReason") String leavingReason; //
* // @Column(name="VehicleNo") String vehicleNo; // // @Column(name="PFNO")
* String pfno; // // @Column(name="PF_NO") String pf_no; //
* // @Column(name="ESINO") String esino; //
* // @Column(name="AUTHORISEDMACHINE") String authMachine; //
* // @Column(name="EMPTYPE") String empType; // // @Column(name="bankACOUNT")
* String bankAcc; // // @Column(name="bankCODE") String bankCode; //
* // @Column(name="Reporting1") String reporting1; //
* // @Column(name="Reporting2") String reporting2; //
*
* // // @Column(name="DESPANSARYCODE") String despansaryCode; //
*
* // // @Column(name="Email_CC") String emailCC; //
* // @Column(name="LeaveApprovalStages") String leaveApprovalStage; //
* // @Column(name="IsFixedShift") String isFixedShift; //
* // @Column(name="involuntary") String involuntary; //
* // @Column(name="EmpBioData") String empBioData; //
* // @Column(name="dateofexp") String dateOfExp; // // @Column(name="Disable")
* String disable; // // @Column(name="Group_Index") String groupIndex; //
* // @Column(name="OnRoll") String onRoll; // // @Column(name="teamid") String
* teamId; // // @Column(name="PSCODE") String psCode; //
* // @Column(name="SUBAREACODE") String subAreaCode; //
* // @Column(name="SECTIONID") String sectionId; //
* // @Column(name="POSITIONCODE") String positionCode; //
* // @Column(name="trainer") String trainer; // // @Column(name="trainee")
* String trainee; // // @Column(name="TraineeLevel") String trainLvl; //
* // @Column(name="RockWellid") String rockWellId; //
* // @Column(name="Template_Send") String templateSend; //
*
* // // @Column(name="headid_2") String headid2; // // @Column(name="HOD_Codd")
* String hodCode; // // @Column(name="logid") String logId; //
* // @Column(name="GroupCode") String groupCode; //
* // @Column(name="ClassCODE") String classCode; //
* // @Column(name="ReligionCode") String religionCode; //
* // @Column(name="ValidityStartDate") String validateStartDate; //
* // @Column(name="ValidityEndDate") String validateEndtDate;
*
* // @Column(name="DeviceGROUPID") String deviceGroupId; //
* // @Column(name="ClientID") String clientId; //
*
* // @Column(name = "MachineCardNo") // String machineCardNo;
*/
// Defining Constructor
public Employee() {
}
public Employee(String ssn, Character active, String payCode, String empName, String dob, String doj,
String presentCardNo, String designation, String deptCode) {
super();
this.ssn = ssn;
this.active = active;
this.payCode = payCode;
this.empName = empName;
this.dob = dob;
this.doj = doj;
this.presentCardNo = presentCardNo;
this.designation = designation;
this.deptCode = deptCode;
}
public String getSsn() {
return ssn;
}
public void setSsn(String ssn) {
this.ssn = ssn;
}
public Character getActive() {
return active;
}
public void setActive(Character active) {
this.active = active;
}
public String getPayCode() {
return payCode;
}
public void setPayCode(String payCode) {
this.payCode = payCode;
}
public String getEmpName() {
return empName;
}
public void setEmpName(String empName) {
this.empName = empName;
}
public String getDob() {
return dob;
}
public void setDob(String dob) {
this.dob = dob;
}
public String getDoj() {
return doj;
}
public void setDoj(String doj) {
this.doj = doj;
}
public String getPresentCardNo() {
return presentCardNo;
}
public void setPresentCardNo(String presentCardNo) {
this.presentCardNo = presentCardNo;
}
public String getDesignation() {
return designation;
}
public void setDesignation(String designation) {
this.designation = designation;
}
public String getDeptCode() {
return deptCode;
}
public void setDeptCode(String deptCode) {
this.deptCode = deptCode;
}
@Override
public String toString() {
return "Employee [payCode=" + payCode + ", ssn=" + ssn + ", active=" + active + ", empName=" + empName
+ ", dob=" + dob + ", doj=" + doj + ", presentCardNo=" + presentCardNo + ", designation=" + designation
+ ", deptCode=" + deptCode + "]";
}
}

53
src/main/java/com/gcc/biometric/api/GccBioMetricApi/entity/HeadQuaterEntries.java

@ -0,0 +1,53 @@
package com.gcc.biometric.api.GccBioMetricApi.entity;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
@Entity
public class HeadQuaterEntries {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Integer zone_1;
public Integer enrolled_1;
public Integer punched_1;
public Integer absent_1;
public HeadQuaterEntries(Integer zone_1, Integer enrolled_1, Integer punched_1, Integer absent_1) {
super();
this.zone_1 = zone_1;
this.enrolled_1 = enrolled_1;
this.punched_1 = punched_1;
this.absent_1 = absent_1;
}
public Integer getZone_1() {
return zone_1;
}
public Integer getEnrolled_1() {
return enrolled_1;
}
public Integer getPunched_1() {
return punched_1;
}
public Integer getAbsent_1() {
return absent_1;
}
@Override
public String toString() {
return "HeadQuaterEntries [zone_1=" + zone_1 + ", enrolled_1=" + enrolled_1 + ", punched_1=" + punched_1
+ ", absent_1=" + absent_1 + "]";
}
}

113
src/main/java/com/gcc/biometric/api/GccBioMetricApi/entity/MachineRawPunchh.java

@ -0,0 +1,113 @@
package com.gcc.biometric.api.GccBioMetricApi.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "MachineRawPunch")
public class MachineRawPunchh {
// define fields
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "CARDNO")
String cardNo;
@Column(name = "OFFICEPUNCH")
String officePunch;
@Column(name = "PAYCODE")
String payCode;
@Column(name = "SSN")
String ssn;
@Column(name = "DeviceID")
String deviceId;
/*
* // @Column(name = "ISMANUAL") // String isManual;
* // @Column(name="ReasonCode") // String regionCode; // @Column(name =
* "MC_NO") // String mcNo; // @Column(name = "INOUT") // String inOut;
*
* //// @Column(name="Lcode") //// String lCode;
*
* // @Column(name="CompanyCode") // String companyCode;
*
* // @Column(name = "Temperature") // String temperature; //// @Column(name =
* "MaskStatus") //// String maskStatus; //// @Column(name="IsAbnomal") ////
* String isAbnormal;
*/
// Defining Constructor
public MachineRawPunchh() {
}
public MachineRawPunchh(String cardNo, String officePunch, String payCode, String ssn, String deviceId) {
super();
this.cardNo = cardNo;
this.officePunch = officePunch;
this.payCode = payCode;
this.ssn = ssn;
this.deviceId = deviceId;
}
public String getCardNo() {
return cardNo;
}
public void setCardNo(String cardNo) {
this.cardNo = cardNo;
}
public String getOfficePunch() {
return officePunch;
}
public void setOfficePunch(String officePunch) {
this.officePunch = officePunch;
}
public String getPayCode() {
return payCode;
}
public void setPayCode(String payCode) {
this.payCode = payCode;
}
public String getSsn() {
return ssn;
}
public void setSsn(String ssn) {
this.ssn = ssn;
}
public String getDeviceId() {
return deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
@Override
public String toString() {
return "MachineRawPunch [cardNo=" + cardNo + ", officePunch=" + officePunch + ", payCode=" + payCode + ", ssn="
+ ssn + ", deviceId=" + deviceId + "]";
}
}

108
src/main/java/com/gcc/biometric/api/GccBioMetricApi/entity/RealTimeUserInfo.java

@ -0,0 +1,108 @@
package com.gcc.biometric.api.GccBioMetricApi.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "tbl_realtime_userinfo")
public class RealTimeUserInfo{
//define fields
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name="user_id")
String userId;
@Column(name="user_name")
String userName;
@Column(name="Device_ID")
String deviceId;
/*
* // @Column(name="privilige") // String privilige; // // @Column(name="card")
* // String card; // // @Column(name="Password") // String Password; //
* // @Column(name="Face") // String face; // // @Column(name="photo") // String
* photo; // // @Column(name="Fp_0") // String Fp_0; // // @Column(name="Fp_1")
* // String Fp_1; // // @Column(name="Fp_2") // String Fp_2; //
* // @Column(name="Fp_3") // String Fp_3; // // @Column(name="Fp_4") // String
* Fp_4; // // @Column(name="Fp_5") // String Fp_5; // // @Column(name="Fp_6")
* // String Fp_6; // // @Column(name="Fp_7") // String Fp_7; //
* // @Column(name="Fp_8") // String Fp_8; // // @Column(name="Fp_9") // String
* Fp_9;
*/
//defining constructor
public RealTimeUserInfo() {}
public RealTimeUserInfo(String userId, String userName, String deviceId) {
super();
this.userId = userId;
this.userName = userName;
this.deviceId = deviceId;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getDeviceId() {
return deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
@Override
public String toString() {
return "RealTimeUserInfo [userId=" + userId + ", userName=" + userName + ", deviceId=" + deviceId + "]";
}
}

44
src/main/java/com/gcc/biometric/api/GccBioMetricApi/entity/ZoneDivMaster.java

@ -0,0 +1,44 @@
package com.gcc.biometric.api.GccBioMetricApi.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Entity
@Table(name="zone_div_mast")
@NoArgsConstructor
@AllArgsConstructor
public class ZoneDivMaster {
@Column(name="zone")
@JsonIgnore
private Integer zone;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name="division")
private String division;
@Column(name="devname")
private String devname;
public static void main(String[] args) {
// HashMap<Integer,String> zones =new HashMap<>(Map.of(1,"zone_1"));
// zones.put(2,"");
}
}

37
src/main/java/com/gcc/biometric/api/GccBioMetricApi/exception/CustomizedResponseEntityExceptionHandler.java

@ -0,0 +1,37 @@
package com.gcc.biometric.api.GccBioMetricApi.exception;
import java.time.LocalDateTime;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.context.request.WebRequest;
import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;
@ControllerAdvice
public class CustomizedResponseEntityExceptionHandler extends ResponseEntityExceptionHandler {
// This is for all exceptions
@ExceptionHandler(Exception.class)
public final ResponseEntity<ExceptionResponse> handleAllException(Exception ex, WebRequest request)
throws Exception {
ExceptionResponse errorDetails = new ExceptionResponse(LocalDateTime.now(), ex.getMessage(),
request.getDescription(false));
return new ResponseEntity<ExceptionResponse>(errorDetails, HttpStatus.INTERNAL_SERVER_ERROR);
}
// Only for UserNotFound
// In above method we replaced <Object> Response entity to ErrorDetail to remove
// warning
// @ExceptionHandler(UserNotFoundException.class)
// public final ResponseEntity<Object> handleUserNotFoundException(Exception ex, WebRequest request) throws Exception {
//
// ExceptionResponse errorDetails = new ExceptionResponse(LocalDateTime.now(), ex.getMessage(), request.getDescription(false));
//
// return new ResponseEntity(errorDetails, HttpStatus.NOT_FOUND);
// }
}

29
src/main/java/com/gcc/biometric/api/GccBioMetricApi/exception/ExceptionResponse.java

@ -0,0 +1,29 @@
package com.gcc.biometric.api.GccBioMetricApi.exception;
import java.time.LocalDateTime;
public class ExceptionResponse {
private LocalDateTime timestamp;
private String message;
private String details;
public ExceptionResponse(LocalDateTime timestamp, String message, String details) {
super();
this.timestamp = timestamp;
this.message = message;
this.details = details;
}
public LocalDateTime getTimestamp() {
return timestamp;
}
public String getMessage() {
return message;
}
public String getDetails() {
return details;
}
}

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

@ -0,0 +1,328 @@
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 org.springframework.stereotype.Repository;
import com.gcc.biometric.api.GccBioMetricApi.entity.ZoneDivMaster;
@Repository
public interface AbsenteesEmpListDataRepository extends JpaRepository<ZoneDivMaster, String> {
// ----------------------Division office Enrolled-----------------------------------------
@Query(value = "select a.userId "
+ "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,RealTimeUserInfo b,DeviceStatus c,ZoneDivMaster d \r\n"
+ "where cast(a.officePunch as date) =:date and a.payCode=b.userId and \r\n"
+ "d.devname=c.deviceName and b.deviceId=c.deviceId \r\n"
+ "AND d.division=:divValue and a.payCode not like '%1100%' and a.payCode not like '%1200%' and d.devname like '%DIV%')\r\n"
+ "and c.division=:divValue and a.userId not like '%1100%' and a.userId not like '%1200%' and c.devname like '%DIV%'\r\n"
+ "order by c.zone,c.division,a.userId")
public ArrayList<String> getAbsentDivUserId(String divValue, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentDivUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentDivDesignation(String userId);
// ----------------------Unit Office Punched-----------------------------------------
@Query(value = "select a.userId "
+ "from RealTimeUserInfo a,DeviceStatus b, \r\n"
+ "ZoneDivMaster c , Employee d\r\nwhere 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 c.division =:unitValue and a.payCode not like '%1100%' and a.payCode not like '%1200%')\r\n"
+ "and c.division =:unitValue and a.userId not like '%1100%' and a.userId not like '%1200%'\r\n"
+ "order by c.zone,a.userId")
public ArrayList<String> getAbsentUnitUserId(String unitValue, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentUnitUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentUnitDesignation(String userId);
// ----------------------Lorry Office Punched-----------------------------------------
@Query(value = "select a.userId "
+ "from RealTimeUserInfo a,DeviceStatus b, \r\nZoneDivMaster 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,RealTimeUserInfo b,DeviceStatus c,ZoneDivMaster d \r\n"
+ "where cast(a.officePunch as date) =:date and a.payCode=b.userId and \r\n"
+ "d.devname=c.deviceName and b.deviceId=c.deviceId \r\n"
+ "AND d.zone=:zone and d.devname like '%LORRY%')\r\n"
+ "and c.zone=:zone and c.devname like '%LORRY%'\r\n"
+ "order by c.zone,c.division,a.userId")
public ArrayList<String> getAbsentLorryUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentLorryUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentLorryDesignation(String userId);
// ----------------------Zonal Office Punched-----------------------------------------
@Query(value = "select a.userId\r\n" +
"from RealTimeUserInfo a,DeviceStatus b, 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 c.zone=:zone and a.payCode not like '%1100%' and a.payCode not like '%1200%' "+
"and c.division like '%ZONAL%')\r\n" +
"and c.zone=:zone and a.userId not like '%1100%' and a.userId not like '%1200%' " +
"and c.division like '%ZONAL%'\r\n" +
"order by a.userId")
public ArrayList<String> getAbsentZonalUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentZonalUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentZonalDesignation(String userId);
// ----------------------Department Office Punched-----------------------------------------
@Query("select a.userId "
+ "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 c.devname LIKE :dept and a.payCode not like '%1100%' and a.payCode not like '%1200%' and a.payCode not like '%1913%' AND c.division like '%HQ%')\r\n"
+ "and c.division like '%HQ%' and a.userId not like '%1100%' and a.userId not like '%1200%' and a.userId not like '%1913%' AND c.devname LIKE :dept \r\n"
+ "order by c.zone,a.userId")
public ArrayList<String> getAbsentDeptUserId(String dept, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentDeptUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentDeptDesignation(String userId);
// ----------------------RDC Office Punched-----------------------------------------
@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 DISTINCT 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 c.zone=:zone and a.payCode not like '%1100%' and a.payCode not like '%1200%' and c.devname like '%RDC%')\r\n"
+ "and c.zone=:zone and a.userId not like '%1100%' and a.userId not like '%1200%' and c.devname like '%RDC%'\r\n"
+ "order by c.zone,c.division,a.userId")
public ArrayList<String> getAbsentRDCUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentRDCUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentRDCDesignation(String userId);
// ----------------------LFZ-----------------------------------------
@Query(value="select a.userId"+
" 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 c.zone=:zone and a.payCode not like '%1100%' and a.payCode not like '%1200%' and c.division like '%LFZ%')\r\n" +
"and c.zone=:zone and a.userId not like '%1100%' and a.userId not like '%1200%' and c.division like '%LFZ%'\r\n" +
"order by a.userId")
public ArrayList<String> getAbsentLFZUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentLFZUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentLFZDesignation(String userId);
// ----------------------PRINTING PRESS-----------------------------------------
@Query(value="select a.userId 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 c.zone=:zone and a.payCode not like '%1100%' and a.payCode not like '%1200%' and c.division like '%PRINTING%')\r\n" +
"and c.zone=:zone and a.userId not like '%1100%' and a.userId not like '%1200%' and c.division like '%PRINTING%'\r\n" +
"order by a.userId")
public ArrayList<String> getAbsentPPUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentPPUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentPPDesignation(String userId);
// ----------------------NORTH CHENNAI DEPOT-----------------------------------------
@Query(value="select a.userId 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 c.zone=:zone and a.payCode not like '%1100%' and a.payCode not like '%1200%' and c.devname like '%DEPOT%')\r\n" +
"and c.zone=:zone and a.userId not like '%1100%' and a.userId not like '%1200%' and c.devname like '%DEPOT%'\r\n" +
"order by a.userId")
public ArrayList<String> getAbsentNCDUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentNCDUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentNCDDesignation(String userId);
// ----------------------TASK FORCE-----------------------------------------
@Query(value="select a.userId 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 c.zone=:zone and a.payCode not like '%1100%' and a.payCode not like '%1200%' and c.devname like '%TASK%')\r\n" +
"and c.zone=:zone and a.userId not like '%1100%' and a.userId not like '%1200%' and c.devname like '%TASK%'\r\n" +
"order by a.userId")
public ArrayList<String> getAbsentTFUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentTFUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentTFDesignation(String userId);
// ----------------------TPF-----------------------------------------
@Query(value="select a.userId 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 c.zone=:zone and a.payCode not like '%1100%' and a.payCode not like '%1200%' and c.devname like '%TPF%')\r\n" +
"and c.zone=:zone and a.userId not like '%1100%' and a.userId not like '%1200%' and c.devname like '%TPF%'\r\n" +
"order by a.userId")
public ArrayList<String> getAbsentTPFUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentTPFUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentTPFDesignation(String userId);
// ----------------------CENTRAL CHENNAI DEPOT-----------------------------------------
@Query(value="select a.userId 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 c.zone=:zone and a.payCode not like '%1100%' and a.payCode not like '%1200%' and c.devname like '%DEPOT%')\r\n" +
"and c.zone=:zone and a.userId not like '%1100%' and a.userId not like '%1200%' and c.devname like '%DEPOT%'\r\n" +
"order by a.userId")
public ArrayList<String> getAbsentCCDUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentCCDUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentCCDDesignation(String userId);
// ----------------------PDG-----------------------------------------
@Query(value="select a.userId 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 c.zone=:zone and a.payCode not like '%1100%' and a.payCode not like '%1200%' and c.devname like '%PDG%')\r\n" +
"and c.zone=:zone and a.userId not like '%1100%' and a.userId not like '%1200%' and c.devname like '%PDG%'\r\n" +
"order by a.userId")
public ArrayList<String> getAbsentPDGUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentPDGUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentPDGDesignation(String userId);
// ----------------------SOUTH CHENNAI DEPOT SCD-----------------------------------------
@Query(value="select a.userId 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 c.zone=:zone and a.payCode not like '%1100%' and a.payCode not like '%1200%' and c.devname like '%DEPOT%')\r\n" +
"and c.zone=:zone and a.userId not like '%1100%' and a.userId not like '%1200%' and c.devname like '%DEPOT%'\r\n" +
"order by a.userId")
public ArrayList<String> getAbsentSCDUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentSCDUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentSCDDesignation(String userId);
// ----------------------INSPECTION VEHICLE-----------------------------------------
@Query(value="select a.userId 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 c.zone=:zone and a.payCode not like '%1100%' and a.payCode not like '%1200%' and c.devname like '%INSPECTION%')\r\n" +
"and c.zone=:zone and a.userId not like '%1100%' and a.userId not like '%1200%' and c.devname like '%INSPECTION%'\r\n" +
"order by a.userId")
public ArrayList<String> getAbsentIVUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentIVUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentIVDesignation(String userId);
// ----------------------KDG-----------------------------------------
@Query(value="select a.userId 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 c.zone=:zone and a.payCode not like '%1100%' and a.payCode not like '%1200%' and c.devname like '%KDG%')\r\n" +
"and c.zone=:zone and a.userId not like '%1100%' and a.userId not like '%1200%' and c.devname like '%KDG%'\r\n" +
"order by a.userId")
public ArrayList<String> getAbsentKDGUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentKDGUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentKDGDesignation(String userId);
}

12
src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/CustomerRepository.java

@ -0,0 +1,12 @@
//package com.gcc.biometric.api.GccBioMetricApi.repo;
//
//import org.springframework.data.jpa.repository.JpaRepository;
//
//import com.gcc.biometric.api.GccBioMetricApi.entity.Customer;
//
//
//public interface CustomerRepository extends JpaRepository<Customer, String> {
//
//
//
//}

57
src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/DeptHeadQuaterOfficeRepository.java

@ -0,0 +1,57 @@
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 org.springframework.stereotype.Repository;
import com.gcc.biometric.api.GccBioMetricApi.entity.ZoneDivMaster;
@Repository
public interface DeptHeadQuaterOfficeRepository extends JpaRepository<ZoneDivMaster, String> {
// # # # # # # # # # # # # # # # # Department Office # # # # # # # # # # # # # # # # # # #
@Query(value="select count(a.userId) as Enrolled \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 c.payCode=a.userId\r\n"
+ "and d.division like '%HQ%'\r\n"
+ "and a.userId not like '%1100%' and a.userId not like '%1200%' and a.userId not like '%1913%'\r\n"
+ "and d.devname=b.deviceName\r\n"
+ "group by d.division,d.devname")
public ArrayList<String> getHQDepartmentOfficeEnrolled();
@Query(value="select COUNT(distinct a.payCode) as punched\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 '%HQ%'\r\n"
+ "and a.payCode not like '%1100%' and a.payCode not like '%1200%' and a.payCode not like '%1913%'\r\n"
+ "and cast(a.officePunch as date) =:date\r\n"
+ "group by c.division,c.devname")
public ArrayList<String> getHQDepartmentOfficePunched(Date date);
@Query(value="select c.devname\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 '%HQ%'\r\n"
+ "and a.payCode not like '%1100%' and a.payCode not like '%1200%' and a.payCode not like '%1913%'\r\n"
+ "and cast(a.officePunch as date) =:date\r\n"
+ "group by c.division,c.devname")
public ArrayList<String> getHQDepartmentOfficesAsPerDate(Date date);
@Query(value="select distinct c.devname from ZoneDivMaster c where c.division like '%HQ%'")
public ArrayList<String> getAllHQDepartmentOffices();
// # # # # # # # # # # # # # # # # Department Office # # # # # # # # # # # # # # # # # # #
}

13
src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/DeviceStatusRepository.java

@ -0,0 +1,13 @@
package com.gcc.biometric.api.GccBioMetricApi.repo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import com.gcc.biometric.api.GccBioMetricApi.entity.DeviceStatus;
@Repository
public interface DeviceStatusRepository extends JpaRepository<DeviceStatus, String> {
}

49
src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/EmployeeRepository.java

@ -0,0 +1,49 @@
package com.gcc.biometric.api.GccBioMetricApi.repo;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import com.gcc.biometric.api.GccBioMetricApi.entity.Employee;
@Repository
public interface EmployeeRepository extends JpaRepository<Employee, String> {
@Query(value="Select d.zone, count(*) as empCount\r\n"
+ "from RealTimeUserInfo a, DeviceStatus b,Employee c,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=c.payCode and b.deviceName=d.devname AND a.userId not like '1100%' AND a.userId not like '1200%' \r\n"
+ "and d.division not like '%ZONE%'\r\n"
+ "group by d.zone order by d.zone")
List<String> getEmpCountPerZone();
@Query(value="SELECT e.zone , count(*) as punched\r\n"
+ "FROM Employee a , MachineRawPunchh b,DeviceStatus c, ZoneDivMaster e\r\n"
+ "where a.payCode = b.payCode\r\n"
+ "AND e.devname=c.deviceName\r\n"
+ "AND b.deviceId=c.deviceId\r\n"
+ "and cast(b.officePunch as date)='2022-10-26'\r\n"
+ "group by e.zone\r\n"
+ " order by e.zone")
public List<String> getEmpCountPresentAbsent();
}

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

@ -0,0 +1,478 @@
package com.gcc.biometric.api.GccBioMetricApi.repo;
import java.util.ArrayList;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import com.gcc.biometric.api.GccBioMetricApi.entity.ZoneDivMaster;
@Repository
public interface EnrolledEmpListDataRepository extends JpaRepository<ZoneDivMaster, String> {
// ----------------------Division office Enrolled-----------------------------------------
@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 a.userId not like '%1100%' and a.userId not like '%1200%'" +
"AND a.deviceId=b.deviceId \r\n" +
"and c.payCode=a.userId\r\n" +
" and d.division=:divValue\r\n" +
"and d.devname like '%DIV%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledDivUserId(String divValue);
@Query(value="select a.userName\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 a.userId not like '%1100%' and a.userId not like '%1200%'" +
"AND a.deviceId=b.deviceId \r\n" +
"and c.payCode=a.userId\r\n" +
" and d.division=:divValue\r\n" +
"and d.devname like '%DIV%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledDivUserName(String divValue);
@Query(value="select 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 a.userId not like '%1100%' and a.userId not like '%1200%'" +
"AND a.deviceId=b.deviceId \r\n" +
"and c.payCode=a.userId\r\n" +
" and d.division=:divValue\r\n" +
"and d.devname like '%DIV%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledDivDesignation(String divValue);
//
//
//
//// ----------------------Unit Office Enrolled-----------------------------------------
@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 a.userId not like '%1100%' and a.userId not like '%1200%'" +
"and c.payCode=a.userId\r\n" +
"and d.division like '%UNIT%'\r\n" +
"AND d.division=:unitValue\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledUnitUserId(String unitValue);
@Query(value="select a.userName\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 a.userId not like '%1100%' and a.userId not like '%1200%'" +
"and c.payCode=a.userId\r\n" +
"and d.division like '%UNIT%'\r\n" +
"AND d.division=:unitValue\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledUnitUserName(String unitValue);
@Query(value="select 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 a.userId not like '%1100%' and a.userId not like '%1200%'" +
"and c.payCode=a.userId\r\n" +
"and d.division like '%UNIT%'\r\n" +
"AND d.division=:unitValue\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledUnitDesignation(String unitValue);
//// ----------------------Lorry Office Enrolled-----------------------------------------
@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 a.userId not like '%1100%' and a.userId not like '%1200%'" +
" and c.payCode=a.userId\r\n" +
"and d.zone=:zoneValue\r\n" +
"and d.devname like '%LORRY%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledLorryUserId(Integer zoneValue);
@Query(value="select a.userName\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 a.userId not like '%1100%' and a.userId not like '%1200%'" +
" and c.payCode=a.userId\r\n" +
"and d.zone=:zoneValue\r\n" +
"and d.devname like '%LORRY%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledLorryUserName(Integer zoneValue);
@Query(value="select 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 a.userId not like '%1100%' and a.userId not like '%1200%'" +
" and c.payCode=a.userId\r\n" +
"and d.zone=:zoneValue\r\n" +
"and d.devname like '%LORRY%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledLorryDesignation(Integer zoneValue);
//// ----------------------Zonal Office Enrolled-----------------------------------------
@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 a.userId not like '%1100%' and a.userId not like '%1200%'" +
"and d.division like '%ZONAL%'\r\n" +
"AND a.deviceId=b.deviceId\r\n" +
"and d.zone =:zonaValue\r\n" +
"and c.payCode=a.userId\r\n" +
"and d.devname=b.deviceName")
public ArrayList<String> getEnrolledZonalUserId(Integer zonaValue);
@Query(value="select a.userName \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 a.userId not like '%1100%' and a.userId not like '%1200%'" +
"and d.division like '%ZONAL%'\r\n" +
"AND a.deviceId=b.deviceId\r\n" +
"and d.zone =:zonaValue\r\n" +
"and c.payCode=a.userId\r\n" +
"and d.devname=b.deviceName")
public ArrayList<String> getEnrolledZonalUserName(Integer zonaValue);
@Query(value="select 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 a.userId not like '%1100%' and a.userId not like '%1200%'" +
"and d.division like '%ZONAL%'\r\n" +
"AND a.deviceId=b.deviceId\r\n" +
"and d.zone =:zonaValue\r\n" +
"and c.payCode=a.userId\r\n" +
"and d.devname=b.deviceName")
public ArrayList<String> getEnrolledZonalDesignation(Integer zonaValue);
//// ----------------------Department Office Enrolled-----------------------------------------
@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 a.userId not like '%1100%' and a.userId not like '%1200%'" +
"and c.payCode=a.userId\r\n" +
"and d.division like '%HQ%'\r\n" +
"and d.devname=:deptValue\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledDeptUserId(String deptValue);
@Query(value="select a.userName\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 a.userId not like '%1100%' and a.userId not like '%1200%'" +
"and c.payCode=a.userId\r\n" +
"and d.division like '%HQ%'\r\n" +
"and d.devname=:deptValue\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledDeptUserName(String deptValue);
@Query(value="select 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 a.userId not like '%1100%' and a.userId not like '%1200%'" +
"and c.payCode=a.userId\r\n" +
"and d.division like '%HQ%'\r\n" +
"and d.devname=:deptValue\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledDeptDesignation(String deptValue);
//// ----------------------RDC Office Enrolled-----------------------------------------
@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 a.userId not like '%1100%' and a.userId not like '%1200%'" +
"and c.payCode=a.userId\r\n" +
"and d.zone=:zoneValue\r\n" +
"and d.division like '%RDC%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by d.division")
public ArrayList<String> getEnrolledRDCUserId(Integer zoneValue);
@Query(value="select a.userName\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 a.userId not like '%1100%' and a.userId not like '%1200%'" +
"and c.payCode=a.userId\r\n" +
"and d.zone=:zoneValue\r\n" +
"and d.division like '%RDC%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by d.division")
public ArrayList<String> getEnrolledRDCUserName(Integer zoneValue);
@Query(value="select 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 a.userId not like '%1100%' and a.userId not like '%1200%'" +
"and c.payCode=a.userId\r\n" +
"and d.zone=:zoneValue\r\n" +
"and d.division like '%RDC%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by d.division")
public ArrayList<String> getEnrolledRDCDesignation(Integer zoneValue);
// ----------------------LFZ-----------------------------------------
@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 d.zone=:zone\r\n" +
"and a.userId not like '%1100%' and a.userId not like '%1200%'\r\n" +
"and d.devname like '%LFZ%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledLFZUserId(Integer zone);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getEnrolledLFZUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getEnrolledLFZDesignation(String userId);
// ----------------------PRINTING PRESS-----------------------------------------
@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 d.zone=:zone\r\n" +
"and a.userId not like '%1100%' and a.userId not like '%1200%'\r\n" +
"and d.devname like '%PRINTING%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledPPUserId(Integer zone);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getEnrolledPPUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getEnrolledPPDesignation(String userId);
// ----------------------NORTH CHENNAI DEPOT-----------------------------------------
@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 d.zone=:zone\r\n" +
"and a.userId not like '%1100%' and a.userId not like '%1200%'\r\n" +
"and d.devname like '%DEPOT%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledNCDUserId(Integer zone);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getEnrolledNCDUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getEnrolledNCDDesignation(String userId);
// ----------------------TASK FORCE-----------------------------------------
@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 d.zone=:zone\r\n" +
"and a.userId not like '%1100%' and a.userId not like '%1200%'\r\n" +
"and d.devname like '%TASK%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledTFUserId(Integer zone);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getEnrolledTFUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getEnrolledTFDesignation(String userId);
// ----------------------TPF-----------------------------------------
@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 d.zone=:zone\r\n" +
"and a.userId not like '%1100%' and a.userId not like '%1200%'\r\n" +
"and d.devname like '%TPF%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledTPFUserId(Integer zone);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getEnrolledTPFUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getEnrolledTPFDesignation(String userId);
// ----------------------CENTRAL CHENNAI DEPOT-----------------------------------------
@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 d.zone=:zone\r\n" +
"and a.userId not like '%1100%' and a.userId not like '%1200%'\r\n" +
"and d.devname like '%DEPOT%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledCCDUserId(Integer zone);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getEnrolledCCDUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getEnrolledCCDDesignation(String userId);
// ----------------------PDG-----------------------------------------
@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 d.zone=:zone\r\n" +
"and a.userId not like '%1100%' and a.userId not like '%1200%'\r\n" +
"and d.devname like '%PDG%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledPDGUserId(Integer zone);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getEnrolledPDGUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getEnrolledPDGDesignation(String userId);
// ----------------------SOUTH CHENNAI DEPOT SCD-----------------------------------------
@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 d.zone=:zone\r\n" +
"and a.userId not like '%1100%' and a.userId not like '%1200%'\r\n" +
"and d.devname like '%DEPOT%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledSCDUserId(Integer zone);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getEnrolledSCDUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getEnrolledSCDDesignation(String userId);
// ----------------------INSPECTION VEHICLE-----------------------------------------
@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 d.zone=:zone\r\n" +
"and a.userId not like '%1100%' and a.userId not like '%1200%'\r\n" +
"and d.devname like '%INSPECTION%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledIVUserId(Integer zone);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getEnrolledIVUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getEnrolledIVDesignation(String userId);
// ----------------------KDG-----------------------------------------
@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 d.zone=:zone\r\n" +
"and a.userId not like '%1100%' and a.userId not like '%1200%'\r\n" +
"and d.devname like '%KDG%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledKDGUserId(Integer zone);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getEnrolledKDGUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getEnrolledKDGDesignation(String userId);
}

327
src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/HeadQuaterTotalEntriesRepository.java

@ -0,0 +1,327 @@
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 HeadQuaterTotalEntriesRepository extends JpaRepository<HeadQuaterEntries, Integer> {
@Query(value = "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 d.division like '%HQ%'\r\n" +
"and a.userId not like '%1100%' and a.userId not like '%1200%' and a.userId not like '%1913%'\r\n" +
"and d.devname=b.deviceName")
ArrayList<Integer> getEnrolled();
@Query(value = "select COUNT(distinct a.payCode) as punched\r\n" +
"from MachineRawPunchh a , DeviceStatus b, ZoneDivMaster c \r\n" +
"where c.devname=b.deviceName\r\n" +
"and a.deviceId=b.deviceId \r\n" +
"and c.division like '%HQ%'\r\n" +
"and a.payCode not like '%1100%' and a.payCode not like '%1200%' and a.payCode not like '%1913%'\r\n" +
"and cast(a.officePunch as 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();
//
}

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

@ -0,0 +1,328 @@
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 HeadQuaterZonesEntriesRepository extends JpaRepository<HeadQuaterEntries, Integer> {
@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.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> getEnrolled();
@Query("select count(distinct a.payCode)\r\n"
+ "from MachineRawPunchh a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n"
+ "and a.deviceId=b.deviceId \r\n"
+ "and a.payCode not like '%1100%' and a.payCode not like '%1200%'\r\n"
+ "and c.division not like '%ZONAL%' and c.division not like '%HQ%' and c.division not like '%RDC%'"
+ "and cast(a.officePunch as date) =?1\r\n"
+ "group by c.zone")
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();
//
}

12
src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/MachineRawPunchRepository.java

@ -0,0 +1,12 @@
package com.gcc.biometric.api.GccBioMetricApi.repo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import com.gcc.biometric.api.GccBioMetricApi.entity.MachineRawPunchh;
@Repository
public interface MachineRawPunchRepository extends JpaRepository<MachineRawPunchh, String> {
}

350
src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/OtherZoneOfficesRepository.java

@ -0,0 +1,350 @@
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 org.springframework.stereotype.Repository;
import com.gcc.biometric.api.GccBioMetricApi.entity.ZoneDivMaster;
@Repository
public interface OtherZoneOfficesRepository extends JpaRepository<ZoneDivMaster, String> {
// # # # # # # # # # # # # # # # # LFZ # # # # # # # # # # # # # # # # # # #
@Query(value="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 d.zone=:zoneValue\r\n" +
"and a.userId not like '%1100%' and a.userId not like '%1200%'\r\n" +
"and d.devname like '%LFZ%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"group by d.division\r\n" +
"order by d.division")
public ArrayList<String> getLFZEnrolled(Integer zoneValue);
@Query(value="select COUNT(distinct a.payCode) as punched\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 c.devname like '%LFZ%'\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 c.division\r\n" +
"order by c.division")
public ArrayList<String> getLFZPunched(Integer zoneValue, Date date);
// # # # # # # # # # # # # # # # # LFZ # # # # # # # # # # # # # # # # # # #
// # # # # # # # # # # # # # # # # PRINTINGPRESS # # # # # # # # # # # # # # # # # # #
@Query(value="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 d.zone=:zoneValue\r\n" +
"and a.userId not like '%1100%' and a.userId not like '%1200%'\r\n" +
"and d.devname like '%PRINTING%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"group by d.division\r\n" +
"order by d.division")
public ArrayList<String> getPRINTINGPRESSEnrolled(Integer zoneValue);
@Query(value="select COUNT(distinct a.payCode) as punched\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 c.devname like '%PRINTING%'\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 c.division\r\n" +
"order by c.division")
public ArrayList<String> getPRINTINGPRESSPunched(Integer zoneValue, Date date);
//// # # # # # # # # # # # # # # # # PRINTINGPRESS # # # # # # # # # # # # # # # # # # #
//
//// # # # # # # # # # # # # # # # # NORTH CHENNAI DEPOT NCD# # # # # # # # # # # # # # # # # # #
@Query(value="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 d.zone=:zoneValue\r\n" +
"and a.userId not like '%1100%' and a.userId not like '%1200%'\r\n" +
"and d.devname like '%DEPOT%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"group by devname\r\n" +
"order by devname asc")
public ArrayList<String> getNCDEnrolled(Integer zoneValue);
@Query(value="select COUNT(distinct a.payCode) as punched\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 c.devname like '%DEPOT%'\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 c.devname\r\n" +
"order by c.devname")
public ArrayList<String> getNCDPunched(Integer zoneValue, Date date);
//// # # # # # # # # # # # # # # # # NORTH CHENNAI DEPOT NCD # # # # # # # # # # # # # # # # # # #
//
//// # # # # # # # # # # # # # # # # TASKFORCE # # # # # # # # # # # # # # # # # # #
@Query(value="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 d.zone=:zoneValue\r\n" +
"and a.userId not like '%1100%' and a.userId not like '%1200%'\r\n" +
"and d.devname like '%TASK%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"group by devname\r\n" +
"order by devname asc")
public ArrayList<String> getTFEnrolled(Integer zoneValue);
@Query(value="select COUNT(distinct a.payCode) as punched\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 c.devname like '%TASK%'\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 c.devname\r\n" +
"order by c.devname")
public ArrayList<String> getTFPunched(Integer zoneValue, Date date);
//// # # # # # # # # # # # # # # # # TASKFORCE # # # # # # # # # # # # # # # # # # #
//
//
//// # # # # # # # # # # # # # # # # TPF # # # # # # # # # # # # # # # # # # #
@Query(value="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 d.zone=:zoneValue\r\n" +
"and a.userId not like '%1100%' and a.userId not like '%1200%'\r\n" +
"and d.devname like '%TPF%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"group by devname\r\n" +
"order by devname asc")
public ArrayList<String> getTPFEnrolled(Integer zoneValue);
@Query(value="select COUNT(distinct a.payCode) as punched\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 c.devname like '%TPF%'\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 c.devname\r\n" +
"order by c.devname")
public ArrayList<String> getTPFPunched(Integer zoneValue, Date date);
//// # # # # # # # # # # # # # # # # TPF # # # # # # # # # # # # # # # # # # #
//
//
//// # # # # # # # # # # # # # # # # CENTRAL CHENNAI DEPOT CCD# # # # # # # # # # # # # # # # # # #
@Query(value="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 d.zone=:zoneValue\r\n" +
"and a.userId not like '%1100%' and a.userId not like '%1200%'\r\n" +
"and d.devname like '%DEPOT%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"group by devname\r\n" +
"order by devname asc")
public ArrayList<String> getCCDEnrolled(Integer zoneValue);
@Query(value="select COUNT(distinct a.payCode) as punched\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 c.devname like '%DEPOT%'\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 c.devname\r\n" +
"order by c.devname")
public ArrayList<String> getCCDPunched(Integer zoneValue, Date date);
//// # # # # # # # # # # # # # # # # CENTRAL CHENNAI DEPOT CCD # # # # # # # # # # # # # # # # # # #
//
//
//// # # # # # # # # # # # # # # # # PDG # # # # # # # # # # # # # # # # # # #
@Query(value="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 d.zone=:zoneValue\r\n" +
"and a.userId not like '%1100%' and a.userId not like '%1200%'\r\n" +
"and d.devname like '%PDG%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"group by division\r\n" +
"order by division asc")
public ArrayList<String> getPDGEnrolled(Integer zoneValue);
@Query(value="select COUNT(distinct a.payCode) as punched\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 c.devname like '%PDG%'\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 c.division\r\n" +
"order by c.division")
public ArrayList<String> getPDGPunched(Integer zoneValue, Date date);
//// # # # # # # # # # # # # # # # # PDG # # # # # # # # # # # # # # # # # # #
//
//
//
//// # # # # # # # # # # # # # # # # SCD # # # # # # # # # # # # # # # # # # #
@Query(value="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 d.zone=:zoneValue\r\n" +
"and a.userId not like '%1100%' and a.userId not like '%1200%'\r\n" +
"and d.devname like '%DEPOT%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"group by devname\r\n" +
"order by devname asc")
public ArrayList<String> getSCDEnrolled(Integer zoneValue);
@Query(value="select COUNT(distinct a.payCode) as punched\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 c.devname like '%DEPOT%'\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 c.devname\r\n" +
"order by c.devname")
public ArrayList<String> getSCDPunched(Integer zoneValue, Date date);
//// # # # # # # # # # # # # # # # # SCD # # # # # # # # # # # # # # # # # # #
//
//
//// # # # # # # # # # # # # # # # # INSPECTIONVEHICLE # # # # # # # # # # # # # # # # # # #
@Query(value="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 d.zone=:zoneValue\r\n" +
"and a.userId not like '%1100%' and a.userId not like '%1200%'\r\n" +
"and d.devname like '%INSPECTION%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"group by devname\r\n" +
"order by devname asc")
public ArrayList<String> getINSPECTIONVEHICLEEnrolled(Integer zoneValue);
@Query(value="select COUNT(distinct a.payCode) as punched\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 c.devname like '%INSPECTION%'\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 c.devname\r\n" +
"order by c.devname")
public ArrayList<String> getINSPECTIONVEHICLEPunched(Integer zoneValue, Date date);
//// # # # # # # # # # # # # # # # # INSPECTIONVEHICLE # # # # # # # # # # # # # # # # # # #
//
//
//
//// # # # # # # # # # # # # # # # # KDG # # # # # # # # # # # # # # # # # # #
@Query(value="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 d.zone=:zoneValue\r\n" +
"and a.userId not like '%1100%' and a.userId not like '%1200%'\r\n" +
"and d.devname like '%KDG%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"group by d.division\r\n" +
"order by d.division asc")
public ArrayList<String> getKDGEnrolled(Integer zoneValue);
@Query(value="select COUNT(distinct a.payCode) as punched\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 c.devname like '%KDG%'\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 c.division\r\n" +
"order by c.division")
public ArrayList<String> getKDGPunched(Integer zoneValue, Date date);
// # # # # # # # # # # # # # # # # KDG # # # # # # # # # # # # # # # # # # #
}

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

@ -0,0 +1,366 @@
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 org.springframework.stereotype.Repository;
import com.gcc.biometric.api.GccBioMetricApi.entity.ZoneDivMaster;
@Repository
public interface PunchedEmpListDataRepository extends JpaRepository<ZoneDivMaster, String> {
// ----------------------Division office Punched-----------------------------------------
@Query(value="select distinct a.payCode\r\n" +
"from MachineRawPunchh a , DeviceStatus b, ZoneDivMaster c,\r\n" +
"Employee d where \r\n" +
"d.payCode=a.payCode and\r\n" +
"c.devname=b.deviceName\r\n" +
"and a.deviceId=b.deviceId \r\n" +
"AND c.division=:divValue\r\n" +
"and a.payCode not like '%1100%' and a.payCode not like '%1200%'" +
"and c.devname like '%DIV%'\r\n" +
"and cast(a.officePunch as date) =:date\r\n" +
"order by a.payCode asc")
public ArrayList<String> getPunchedDivUserId(String divValue, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedDivUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedDivDesignation(String userId);
// ----------------------Unit Office Punched-----------------------------------------
@Query(value="select distinct a.payCode\r\n" +
"from MachineRawPunchh a, DeviceStatus b, ZoneDivMaster c,\r\n" +
"Employee d\r\n" +
"where a.payCode=d.payCode\r\n" +
"and c.devname=b.deviceName\r\n" +
"and a.deviceId=b.deviceId \r\n" +
"and c.division=:divValue\r\n" +
"and a.payCode not like '%1100%' and a.payCode not like '%1200%'" +
"and cast(a.officePunch as date) =:date\r\n" +
"order by a.payCode asc")
public ArrayList<String> getPunchedUnitUserId(String divValue, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedUnitUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedUnitDesignation(String userId);
// ----------------------Lorry Office Punched-----------------------------------------
@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 c.zone=:divValue\r\n" +
"and a.payCode not like '%1100%' and a.payCode not like '%1200%'" +
"and c.devname like '%LORRY%'\r\n" +
"and cast(a.officePunch as date) =:date\r\n" +
"order by a.payCode asc")
public ArrayList<String> getPunchedLorryUserId(Integer divValue, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedLorryUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedLorryDesignation(String userId);
// ----------------------Zonal Office Punched-----------------------------------------
@Query(value="select distinct a.payCode\r\n" +
"from MachineRawPunchh a , DeviceStatus b, ZoneDivMaster c,\r\n" +
"Employee d where \r\n" +
"d.payCode=a.payCode and\r\n" +
"c.devname=b.deviceName\r\n" +
"and a.deviceId=b.deviceId \r\n" +
"AND c.zone=:divValue\r\n" +
"and a.payCode not like '%1100%' and a.payCode not like '%1200%'" +
"and c.division like '%ZONAL%'\r\n" +
"and cast(a.officePunch as date) =:date\r\n" +
"order by a.payCode asc")
public ArrayList<String> getPunchedZonalUserId(Integer divValue, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedZonalUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedZonalDesignation(String userId);
// ----------------------Department Office Punched-----------------------------------------
@Query(value="select distinct a.payCode \r\n" +
"from MachineRawPunchh a,DeviceStatus b,ZoneDivMaster c,\r\n" +
"Employee d\r\n" +
"where cast(a.officePunch as date) =:date \r\n" +
"and a.payCode=d.payCode \r\n" +
"and c.devname=b.deviceName \r\n" +
"and a.deviceId=b.deviceId \r\n" +
"AND c.devname=:divValue \r\n" +
"and a.payCode not like '%1100%' and a.payCode not like '%1200%'" +
"AND c.division like '%HQ%' \r\n" +
"order by a.payCode asc")
public ArrayList<String> getPunchedDeptUserId(String divValue, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedDeptUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedDeptDesignation(String userId);
// ----------------------RDC Office Punched-----------------------------------------
@Query(value="select distinct a.payCode\r\n" +
"from MachineRawPunchh a , DeviceStatus b, ZoneDivMaster c,\r\n" +
"Employee d where\r\n" +
"a.payCode=d.payCode \r\n" +
"and c.zone=:divValue\r\n" +
"and a.payCode not like '%1100%' and a.payCode not like '%1200%'" +
"and c.devname=b.deviceName\r\n" +
"and a.deviceId=b.deviceId \r\n" +
"and c.division like '%RDC%'\r\n" +
"and cast(a.officePunch as date) =:date\r\n" +
"order by a.payCode asc")
public ArrayList<String> getPunchedRDCUserId(Integer divValue, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedRDCUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedRDCDesignation(String userId);
// ----------------------LFZ-----------------------------------------
@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 c.zone=:zone\r\n" +
"and c.devname like '%LFZ%'\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> getPunchedLFZUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedLFZUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedLFZDesignation(String userId);
// ----------------------PRINTING PRESS-----------------------------------------
@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 c.zone=:zone\r\n" +
"and c.devname like '%PRINTING%'\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> getPunchedPPUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedPPUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedPPDesignation(String userId);
// ----------------------NORTH CHENNAI DEPOT-----------------------------------------
@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 c.zone=:zone\r\n" +
"and c.devname like '%DEPOT%'\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> getPunchedNCDUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedNCDUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedNCDDesignation(String userId);
// ----------------------TASK FORCE-----------------------------------------
@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 c.zone=:zone\r\n" +
"and c.devname like '%TASK%'\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> getPunchedTFUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedTFUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedTFDesignation(String userId);
// ----------------------TPF-----------------------------------------
@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 c.zone=:zone\r\n" +
"and c.devname like '%TPF%'\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> getPunchedTPFUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedTPFUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedTPFDesignation(String userId);
// ----------------------CENTRAL CHENNAI DEPOT-----------------------------------------
@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 c.zone=:zone\r\n" +
"and c.devname like '%DEPOT%'\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> getPunchedCCDUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedCCDUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedCCDDesignation(String userId);
// ----------------------PDG-----------------------------------------
@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 c.zone=:zone\r\n" +
"and c.devname like '%PDG%'\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> getPunchedPDGUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedPDGUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedPDGDesignation(String userId);
// ----------------------SOUTH CHENNAI DEPOT SCD-----------------------------------------
@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 c.zone=:zone\r\n" +
"and c.devname like '%DEPOT%'\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> getPunchedSCDUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedSCDUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedSCDDesignation(String userId);
// ----------------------INSPECTION VEHICLE-----------------------------------------
@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 c.zone=:zone\r\n" +
"and c.devname like '%INSPECTION%'\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> getPunchedIVUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedIVUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedIVDesignation(String userId);
// ----------------------KDG-----------------------------------------
@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 c.zone=:zone\r\n" +
"and c.devname like '%PDG%'\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> getPunchedKDGUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedKDGUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedKDGDesignation(String userId);
}

13
src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/RealTimeUserInfoRepository.java

@ -0,0 +1,13 @@
package com.gcc.biometric.api.GccBioMetricApi.repo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import com.gcc.biometric.api.GccBioMetricApi.entity.RealTimeUserInfo;
@Repository
public interface RealTimeUserInfoRepository extends JpaRepository<RealTimeUserInfo, String> {
}

341
src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/RegionalDeputyCommissionerRepository.java

@ -0,0 +1,341 @@
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 RegionalDeputyCommissionerRepository extends JpaRepository<HeadQuaterEntries, Integer> {
@Query("select count(a.userId) as Enrolled \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 c.payCode=a.userId\r\n"
+ "and d.division like '%RDC%'\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 d.division\r\n"
+ "order by d.division ")
ArrayList<Integer> getRDCEnrolled();
@Query("select COUNT(distinct a.payCode) as punched\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 not like '%1100%' and a.payCode not like '%1200%'\r\n"
+ "and cast(a.officePunch as date) =:date\r\n"
+ "group by c.division\r\n"
+ "order by c.division")
ArrayList<Integer> getRDCPunched(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 not like '%1100%' and a.payCode not like '%1200%'\r\n"
+ "group by c.division\r\n"
+ "order by c.division")
ArrayList<String> getRDCZoneNames();
// ========================================================================================
// @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();
//
}

36
src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/ZonalOfficeTotalDataRepository.java

@ -0,0 +1,36 @@
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 org.springframework.stereotype.Repository;
import com.gcc.biometric.api.GccBioMetricApi.entity.ZoneDivMaster;
@Repository
public interface ZonalOfficeTotalDataRepository extends JpaRepository<ZoneDivMaster, String> {
@Query(value="select count(a.userId) as Enrolled \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%' and a.userId not like '%1913%'\r\n"
+ "and c.payCode=a.userId\r\n"
+ "and d.division like '%ZONAL%'\r\n"
+ "and d.devname=b.deviceName")
public ArrayList<Integer> getZonalOfficeTotalEnrolled();
@Query(value="select COUNT(distinct a.payCode) as punched\r\n"
+ "from MachineRawPunchh a , DeviceStatus b, ZoneDivMaster c where \r\n"
+ "c.devname=b.deviceName\r\n"
+ "and a.payCode not like '%1100%' and a.payCode not like '%1200%' and a.payCode not like '%1913%'\r\n"
+ "and a.deviceId=b.deviceId \r\n"
+ "and c.division like '%ZONAL%'\r\n"
+ "and cast(a.officePunch as date) =:date")
public ArrayList<Integer> getZonalOfficeTotalPunched(Date date);
}

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

@ -0,0 +1,346 @@
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 org.springframework.stereotype.Repository;
import com.gcc.biometric.api.GccBioMetricApi.entity.ZoneDivMaster;
@Repository
public interface ZoneDivisionOfficeRepository extends JpaRepository<ZoneDivMaster, String> {
// # # # # # # # # # # # # # # # # DivisionOffice # # # # # # # # # # # # # # # # # # #
//because div_1 date is different so for matching
@Query(value="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.userId not like '%1100%' and a.userId not like '%1200%'"
+ "and c.payCode=a.userId\r\n"
+ "and d.zone=:zoneValue\r\n"
+ "and d.devname like '%DIV%'\r\n"
+ "and d.devname=b.deviceName\r\n"
+ "group by d.division\r\n"
+ "order by d.division + 0 asc")
public ArrayList<String> getDivisionOfficeEnrolledPerDiv_1(Integer zoneValue);
@Query(value="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.userId not like '%1100%' and a.userId not like '%1200%'"
+ "and c.payCode=a.userId\r\n"
+ "and d.zone=:zoneValue\r\n"
+ "and d.devname like '%DIV%'\r\n"
+ "and d.devname=b.deviceName\r\n"
+ "group by d.division\r\n"
+ "order by d.division asc")
public ArrayList<String> getDivisionOfficeEnrolledPerDiv(Integer zoneValue);
@Query(value="select count(distinct a.payCode)\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.devname like '%DIV%'\r\n"
+ "and c.zone= :zoneValue\r\n"
+ "and a.payCode not like '%1100%' and a.payCode not like '%1200%'"
+ "and cast(a.officePunch as date) = :date\r\n"
+ "group by c.division\r\n"
+"order by c.division + 0 asc")
public ArrayList<String> getDivisionOfficePunchedPerDiv_1(Integer zoneValue, Date date);
@Query(value="select count(distinct a.payCode)\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.devname like '%DIV%'\r\n"
+ "and c.zone= :zoneValue\r\n"
+ "and a.payCode not like '%1100%' and a.payCode not like '%1200%'"
+ "and cast(a.officePunch as date) = :date\r\n"
+ "group by c.division\r\n"
+"order by c.division asc")
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")
public ArrayList<String> getDivisionOfficeZoneDivAsPerDate(Integer zoneValue, Date date);
@Query(value="select division from ZoneDivMaster c where c.zone= :zoneValue and c.devname like '%DIV%'")
public ArrayList<String> getDivisionOfficeZoneDivisions(Integer zoneValue);
// # # # # # # # # # # # # # # # # DivisionOffice # # # # # # # # # # # # # # # # # # #
// # # # # # # # # # # # # # # # # Division 8 Office Special case # # # # # # # # # # # # # # # # # # #
@Query(value="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 a.deviceId=b.deviceId \r\n" +
"and c.payCode=a.userId\r\n" +
" and d.zone=:zoneValue \r\n" +
" and a.userId not like '%1100%' and a.userId not like '%1200%'\r\n" +
"and d.devname like '%DIV%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"group by d.division,d.devname\r\n" +
"order by d.division + 0 asc")
public ArrayList<String> getDivisionOfficeEnrolledPerDiv_8(Integer zoneValue);
@Query(value="select SUBSTRING(d.devname,5,9) AS 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 a.deviceId=b.deviceId \r\n" +
"and c.payCode=a.userId\r\n" +
" and d.zone=:zoneValue \r\n" +
" and a.userId not like '%1100%' and a.userId not like '%1200%'\r\n" +
"and d.devname like '%DIV%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"group by d.division,d.devname\r\n" +
"order by d.division + 0 asc")
public ArrayList<String> getDivisionOfficesAsPerEnrolled_8(Integer zoneValue);
@Query(value="select count(distinct a.payCode) as Punched\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,c.devname\r\n" +
"order by c.division +0 asc")
public ArrayList<String> getDivisionOfficePunchedPerDiv_8(Integer zoneValue, Date date);
@Query(value="select SUBSTRING(c.devname,5,9) AS 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,c.devname\r\n" +
"order by c.division +0 asc")
public ArrayList<String> getDivisionOfficeZoneDivAsPerDate_8(Integer zoneValue, Date date);
@Query(value="select SUBSTRING(c.devname,5,9)from ZoneDivMaster c where c.zone=:zoneValue and c.devname like '%DIV%'")
public ArrayList<String> getDivisionOfficeZoneDivisions_8(Integer zoneValue);
// # # # # # # # # # # # # # # # # Division 8 Office Special case # # # # # # # # # # # # # # # # # # #
// # # # # # # # # # # # # # # # # Unit Office # # # # # # # # # # # # # # # # # # #
@Query(value="select count(a.userId) as enrolled\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%'"
+ "and c.payCode=a.userId\r\n"
+ "and d.zone=:zoneValue\r\n"
+ "and d.division like '%UNIT%'\r\n"
+ "and d.devname=b.deviceName\r\n"
+ "group by d.zone,d.division\r\n"
+ "order by d.zone")
public ArrayList<String> getUnitOfficeEnrolledPerZone(Integer zoneValue);
@Query(value="select COUNT(distinct a.payCode) as punched\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 a.payCode not like '%1100%' and a.payCode not like '%1200%'"
+ "and c.division like '%UNIT%'\r\n"
+ "and cast(a.officePunch as date) =:date\r\n"
+ "group by c.zone,c.division\r\n"
+ "order by c.zone")
public ArrayList<String> getUnitOfficePunchedPerZone(Integer zoneValue, Date date);
@Query(value="select d.division\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%'"
+ "and c.payCode=a.userId\r\n"
+ "and d.zone=:zoneValue\r\n"
+ "and d.division like '%UNIT%'\r\n"
+ "and d.devname=b.deviceName\r\n"
+ "group by d.zone,d.division\r\n"
+ "order by d.zone")
public ArrayList<String> getAllUnitOfficeAsPerZoneAsPerEnrolled(Integer zoneValue);
@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 a.payCode not like '%1100%' and a.payCode not like '%1200%'"
+ "and c.division like '%UNIT%'\r\n"
+ "and cast(a.officePunch as date) =:date\r\n"
+ "group by c.zone,c.division\r\n"
+ "order by c.zone")
public ArrayList<String> getAllUnitOfficeAsPerZoneAsPerPunched(Integer zoneValue, Date date);
@Query(value="select division from ZoneDivMaster c where c.zone=:zoneValue and c.division like '%UNIT%'")
public ArrayList<String> getAllUnitOfficeAsPerZone(Integer zoneValue);
// # # # # # # # # # # # # # # # # Unit Office # # # # # # # # # # # # # # # # # # #
// # # # # # # # # # # # # # # # # Zonal Office As per Zone# # # # # # # # # # # # # # # # # # #
@Query(value="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.userId not like '%1100%' and a.userId not like '%1200%'"
+ "and c.payCode=a.userId\r\n"
+ "and d.zone= :zoneValue\r\n"
+ "and d.division like '%ZONAL%'\r\n"
+ "and d.devname=b.deviceName\r\n"
+ "group by d.division\r\n"
+ "order by d.division")
public ArrayList<String> getZonalOfficeEnrolledPerDiv(Integer zoneValue);
@Query(value="select COUNT(distinct a.payCode)\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 a.payCode not like '%1100%' and a.payCode not like '%1200%'"
+ "and c.division like '%ZONAL%'\r\n"
+ "and cast(a.officePunch as date) = :date\r\n"
+ "group by c.division\r\n"
+ "order by c.division")
public ArrayList<String> getZonalOfficePunchedPerDiv(Integer zoneValue, Date date);
@Query(value="select c.devname\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 a.payCode not like '%1100%' and a.payCode not like '%1200%'"
+ "and c.division like '%ZONAL%'\r\n"
+ "and cast(a.officePunch as date) =:date\r\n"
+ "group by c.devname\r\n"
+ "order by c.devname")
public ArrayList<String> getZonalOfficeZoneDivAsPerDate(Integer zoneValue, Date date);
@Query(value="select devname from ZoneDivMaster c where c.zone= :zoneValue and c.division like '%ZONAL%'")
public ArrayList<String> getZonalOfficeZoneDivisions(Integer zoneValue);
// # # # # # # # # # # # # # # # # Zonal Office As per Zone # # # # # # # # # # # # # # # # # # #
// # # # # # # # # # # # # # # # # Zonal Office of all 15 Zones # # # # # # # # # # # # # # # # # # #
@Query(value="select count(a.userId) as Enrolled \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%'"
+ "and c.payCode=a.userId\r\n"
+ "and d.division like '%ZONAL%'\r\n"
+ "and d.devname=b.deviceName\r\n"
+ "group by d.zone,d.devname\r\n"
+ "order by d.zone")
public ArrayList<String> getAllZonalOfficesEnrolledOfAllZones();
@Query(value="select COUNT(distinct a.payCode) as punched\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 '%ZONAL%'\r\n"
+ "and a.payCode not like '%1100%' and a.payCode not like '%1200%'"
+ "and cast(a.officePunch as date) =:date\r\n"
+ "group by c.zone,c.division\r\n"
+ "order by c.zone")
public ArrayList<String> getAllZonalOfficesPunchedOfAllZones(Date date);
@Query(value="select c.devname\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 '%ZONAL%'\r\n"
+ "and a.payCode not like '%1100%' and a.payCode not like '%1200%'"
+ "and cast(a.officePunch as date) =:date\r\n"
+ "group by c.devname\r\n"
+ "order by c.devname")
public ArrayList<String> getAllZonalOfficesZoneAsPerDate(Date date);
@Query(value="select devname from ZoneDivMaster c where c.division like '%ZONAL%'")
public ArrayList<String> getAllZonalOfficesZones();
// # # # # # # # # # # # # # # # # Zonal Office of all 15 Zones # # # # # # # # # # # # # # # # # # #
// # # # # # # # # # # # # # # # # Lorry Station # # # # # # # # # # # # # # # # # # #
@Query(value="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.userId not like '%1100%' and a.userId not like '%1200%'"
+ "and c.payCode=a.userId\r\n"
+ "and d.zone=:zoneValue\r\n"
+ "and d.devname like '%LORRY%'\r\n"
+ "and d.devname=b.deviceName\r\n"
+ "group by d.division\r\n"
+ "order by d.division asc")
public ArrayList<String> getLorryStationEnrolledPerDiv(Integer zoneValue);
@Query(value="select COUNT(distinct a.payCode)\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 a.payCode not like '%1100%' and a.payCode not like '%1200%'"
+ "and c.devname like '%LORRY%'\r\n"
+ "and cast(a.officePunch as date) =:date\r\n"
+ "group by c.division\r\n"
+ "order by c.division")
public ArrayList<String> getLorryStationPunchedPerDiv(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 a.payCode not like '%1100%' and a.payCode not like '%1200%'"
+ "and c.devname like '%LORRY%'\r\n"
+ "and cast(a.officePunch as date) =:date\r\n"
+ "group by c.division\r\n"
+ "order by c.division")
public ArrayList<String> getLorryStationZoneDivAsPerDate(Integer zoneValue, Date date);
@Query(value="select division from ZoneDivMaster c where c.zone= :zoneValue and c.devname like '%LORRY%'")
public ArrayList<String> getLorryStationZoneDivisions(Integer zoneValue);
// # # # # # # # # # # # # # # # # Lorry Station # # # # # # # # # # # # # # # # # # #
}

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

@ -0,0 +1,329 @@
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 org.springframework.stereotype.Repository;
import com.gcc.biometric.api.GccBioMetricApi.entity.ZoneDivMaster;
@Repository
public interface NMRAbsenteesEmpListDataRepository extends JpaRepository<ZoneDivMaster, String> {
// ----------------------Division office Enrolled-----------------------------------------
@Query(value = "select a.userId "
+ "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,RealTimeUserInfo b,DeviceStatus c,ZoneDivMaster d \r\n"
+ "where cast(a.officePunch as date) =:date and a.payCode=b.userId and \r\n"
+ "d.devname=c.deviceName and b.deviceId=c.deviceId \r\n"
+ "AND d.division=:divValue and a.payCode like '%1200%' and d.devname like '%DIV%')\r\n"
+ "and c.division=:divValue and a.userId like '%1200%' and c.devname like '%DIV%'\r\n"
+ "order by c.zone,c.division,a.userId")
public ArrayList<String> getAbsentDivUserId(String divValue, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentDivUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentDivDesignation(String userId);
// ----------------------Unit Office Punched-----------------------------------------
@Query(value = "select a.userId "
+ "from RealTimeUserInfo a,DeviceStatus b, \r\n"
+ "ZoneDivMaster c , Employee d\r\nwhere 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 c.division =:unitValue and a.payCode like '%1200%')\r\n"
+ "and c.division =:unitValue and a.userId like '%1200%'\r\n"
+ "order by c.zone,a.userId")
public ArrayList<String> getAbsentUnitUserId(String unitValue, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentUnitUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentUnitDesignation(String userId);
// ----------------------Lorry Office Punched-----------------------------------------
@Query(value = "select a.userId "
+ "from RealTimeUserInfo a,DeviceStatus b, \r\nZoneDivMaster 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,RealTimeUserInfo b,DeviceStatus c,ZoneDivMaster d \r\n"
+ "where cast(a.officePunch as date) =:date and a.payCode=b.userId and \r\n"
+ "d.devname=c.deviceName and b.deviceId=c.deviceId \r\n"
+ "AND d.zone=:zone and a.payCode like '%1200%' and d.devname like '%LORRY%')\r\n"
+ "and c.zone=:zone and a.userId like '%1200%' and c.devname like '%LORRY%'\r\n"
+ "order by c.zone,c.division,a.userId")
public ArrayList<String> getAbsentLorryUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentLorryUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentLorryDesignation(String userId);
// ----------------------Zonal Office Punched-----------------------------------------
@Query(value = "select a.userId\r\n" +
"from RealTimeUserInfo a,DeviceStatus b, 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 c.zone=:zone and a.payCode like '%1200%' "+
"and c.division like '%ZONAL%')\r\n" +
"and c.zone=:zone and a.userId like '%1200%'" +
"and c.division like '%ZONAL%'\r\n" +
"order by a.userId")
public ArrayList<String> getAbsentZonalUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentZonalUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentZonalDesignation(String userId);
// ----------------------Department Office Punched-----------------------------------------
@Query("select a.userId "
+ "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 c.devname LIKE :dept and a.payCode like '%1200%' AND c.division like '%HQ%')\r\n"
+ "and c.division like '%HQ%' and a.userId like '%1200%' AND c.devname LIKE :dept \r\n"
+ "order by c.zone,a.userId")
public ArrayList<String> getAbsentDeptUserId(String dept, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentDeptUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentDeptDesignation(String userId);
// ----------------------RDC Office Punched-----------------------------------------
@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 DISTINCT 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 c.zone=:zone and a.payCode like '%1200%' and c.devname like '%RDC%')\r\n"
+ "and c.zone=:zone and a.userId like '%1200%' and c.devname like '%RDC%'\r\n"
+ "order by c.zone,c.division,a.userId")
public ArrayList<String> getAbsentRDCUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentRDCUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentRDCDesignation(String userId);
// ----------------------LFZ-----------------------------------------
@Query(value="select a.userId"+
" 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 c.zone=:zone and a.payCode like '%1200%' and c.division like '%LFZ%')\r\n" +
"and c.zone=:zone and a.userId like '%1200%' and c.division like '%LFZ%'\r\n" +
"order by a.userId")
public ArrayList<String> getAbsentLFZUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentLFZUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentLFZDesignation(String userId);
// ----------------------PRINTING PRESS-----------------------------------------
@Query(value="select a.userId 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 c.zone=:zone and a.payCode like '%1200%' and c.division like '%PRINTING%')\r\n" +
"and c.zone=:zone and a.userId like '%1200%' and c.division like '%PRINTING%'\r\n" +
"order by a.userId")
public ArrayList<String> getAbsentPPUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentPPUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentPPDesignation(String userId);
// ----------------------NORTH CHENNAI DEPOT-----------------------------------------
@Query(value="select a.userId 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 c.zone=:zone and a.payCode like '%1200%' and c.devname like '%DEPOT%')\r\n" +
"and c.zone=:zone and a.userId like '%1200%' and c.devname like '%DEPOT%'\r\n" +
"order by a.userId")
public ArrayList<String> getAbsentNCDUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentNCDUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentNCDDesignation(String userId);
// ----------------------TASK FORCE-----------------------------------------
@Query(value="select a.userId 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 c.zone=:zone and a.payCode like '%1200%' and c.devname like '%TASK%')\r\n" +
"and c.zone=:zone and a.userId like '%1200%' and c.devname like '%TASK%'\r\n" +
"order by a.userId")
public ArrayList<String> getAbsentTFUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentTFUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentTFDesignation(String userId);
// ----------------------TPF-----------------------------------------
@Query(value="select a.userId 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 c.zone=:zone and a.payCode like '%1200%' and c.devname like '%TPF%')\r\n" +
"and c.zone=:zone and a.userId like '%1200%' and c.devname like '%TPF%'\r\n" +
"order by a.userId")
public ArrayList<String> getAbsentTPFUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentTPFUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentTPFDesignation(String userId);
// ----------------------CENTRAL CHENNAI DEPOT-----------------------------------------
@Query(value="select a.userId 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 c.zone=:zone and a.payCode like '%1200%' and c.devname like '%DEPOT%')\r\n" +
"and c.zone=:zone and a.userId like '%1200%' and c.devname like '%DEPOT%'\r\n" +
"order by a.userId")
public ArrayList<String> getAbsentCCDUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentCCDUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentCCDDesignation(String userId);
// ----------------------PDG-----------------------------------------
@Query(value="select a.userId 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 c.zone=:zone and a.payCode like '%1200%' and c.devname like '%PDG%')\r\n" +
"and c.zone=:zone and a.userId like '%1200%' and c.devname like '%PDG%'\r\n" +
"order by a.userId")
public ArrayList<String> getAbsentPDGUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentPDGUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentPDGDesignation(String userId);
// ----------------------SOUTH CHENNAI DEPOT SCD-----------------------------------------
@Query(value="select a.userId 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 c.zone=:zone and a.payCode like '%1200%' and c.devname like '%DEPOT%')\r\n" +
"and c.zone=:zone and a.userId like '%1200%' and c.devname like '%DEPOT%'\r\n" +
"order by a.userId")
public ArrayList<String> getAbsentSCDUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentSCDUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentSCDDesignation(String userId);
// ----------------------INSPECTION VEHICLE-----------------------------------------
@Query(value="select a.userId 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 c.zone=:zone and a.payCode like '%1200%' and c.devname like '%INSPECTION%')\r\n" +
"and c.zone=:zone and a.userId like '%1200%' and c.devname like '%INSPECTION%'\r\n" +
"order by a.userId")
public ArrayList<String> getAbsentIVUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentIVUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentIVDesignation(String userId);
// ----------------------KDG-----------------------------------------
@Query(value="select a.userId 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 c.zone=:zone and a.payCode like '%1200%' and c.devname like '%KDG%')\r\n" +
"and c.zone=:zone and a.userId like '%1200%' and c.devname like '%KDG%'\r\n" +
"order by a.userId")
public ArrayList<String> getAbsentKDGUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentKDGUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentKDGDesignation(String userId);
}

70
src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRDeptHeadQuaterOfficeRepository.java

@ -0,0 +1,70 @@
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 org.springframework.stereotype.Repository;
import com.gcc.biometric.api.GccBioMetricApi.entity.ZoneDivMaster;
@Repository
public interface NMRDeptHeadQuaterOfficeRepository extends JpaRepository<ZoneDivMaster, String> {
// # # # # # # # # # # # # # # # # Department Office # # # # # # # # # # # # # # # # # # #
@Query(value="select count(a.userId) as Enrolled \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 c.payCode=a.userId\r\n"
+ "and d.division like '%HQ%'\r\n"
+ "and a.userId like '%1200%'\r\n"
+ "and d.devname=b.deviceName\r\n"
+ "group by d.division,d.devname")
public ArrayList<String> getHQDepartmentOfficeEnrolled();
@Query(value="select d.devname \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 c.payCode=a.userId\r\n"
+ "and d.division like '%HQ%'\r\n"
+ "and a.userId like '%1200%'\r\n"
+ "and d.devname=b.deviceName\r\n"
+ "group by d.division,d.devname")
public ArrayList<String> getAllHQDepartmentOfficeAsPerEnrolled();
@Query(value="select COUNT(distinct a.payCode) as punched\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 '%HQ%'\r\n"
+ "and a.payCode like '%1200%'\r\n"
+ "and cast(a.officePunch as date) =:date\r\n"
+ "group by c.division,c.devname")
public ArrayList<String> getHQDepartmentOfficePunched(Date date);
@Query(value="select c.devname\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 '%HQ%'\r\n"
+ "and a.payCode like '%1200%'\r\n"
+ "and cast(a.officePunch as date) =:date\r\n"
+ "group by c.division,c.devname")
public ArrayList<String> getHQDepartmentOfficesAsPerDate(Date date);
@Query(value="select distinct c.devname from ZoneDivMaster c where c.division like '%HQ%'")
public ArrayList<String> getAllHQDepartmentOffices();
// # # # # # # # # # # # # # # # # Department Office # # # # # # # # # # # # # # # # # # #
}

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

@ -0,0 +1,475 @@
package com.gcc.biometric.api.GccBioMetricApi.repo.nmr;
import java.util.ArrayList;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import com.gcc.biometric.api.GccBioMetricApi.entity.ZoneDivMaster;
@Repository
public interface NMREnrolledEmpListDataRepository extends JpaRepository<ZoneDivMaster, String> {
// ----------------------Division office Enrolled-----------------------------------------
@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 a.userId like '%1200%'" +
"AND a.deviceId=b.deviceId \r\n" +
"and c.payCode=a.userId\r\n" +
" and d.division=:divValue\r\n" +
"and d.devname like '%DIV%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledDivUserId(String divValue);
@Query(value="select a.userName\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 a.userId like '%1200%'" +
"AND a.deviceId=b.deviceId \r\n" +
"and c.payCode=a.userId\r\n" +
" and d.division=:divValue\r\n" +
"and d.devname like '%DIV%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledDivUserName(String divValue);
@Query(value="select 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 a.userId like '%1200%'" +
"AND a.deviceId=b.deviceId \r\n" +
"and c.payCode=a.userId\r\n" +
" and d.division=:divValue\r\n" +
"and d.devname like '%DIV%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledDivDesignation(String divValue);
//
//
//
//// ----------------------Unit Office Enrolled-----------------------------------------
@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 a.userId like '%1200%'" +
"and c.payCode=a.userId\r\n" +
"and d.division like '%UNIT%'\r\n" +
"AND d.division=:unitValue\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledUnitUserId(String unitValue);
@Query(value="select a.userName\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 a.userId like '%1200%'" +
"and c.payCode=a.userId\r\n" +
"and d.division like '%UNIT%'\r\n" +
"AND d.division=:unitValue\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledUnitUserName(String unitValue);
@Query(value="select 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 a.userId like '%1200%'" +
"and c.payCode=a.userId\r\n" +
"and d.division like '%UNIT%'\r\n" +
"AND d.division=:unitValue\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledUnitDesignation(String unitValue);
//// ----------------------Lorry Office Enrolled-----------------------------------------
@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 a.userId like '%1200%'" +
" and c.payCode=a.userId\r\n" +
"and d.zone=:zoneValue\r\n" +
"and d.devname like '%LORRY%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledLorryUserId(Integer zoneValue);
@Query(value="select a.userName\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 a.userId like '%1200%'" +
" and c.payCode=a.userId\r\n" +
"and d.zone=:zoneValue\r\n" +
"and d.devname like '%LORRY%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledLorryUserName(Integer zoneValue);
@Query(value="select 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 a.userId like '%1200%'" +
" and c.payCode=a.userId\r\n" +
"and d.zone=:zoneValue\r\n" +
"and d.devname like '%LORRY%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledLorryDesignation(Integer zoneValue);
//// ----------------------Zonal Office Enrolled-----------------------------------------
@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 a.userId like '%1200%'" +
"and d.division like '%ZONAL%'\r\n" +
"AND a.deviceId=b.deviceId\r\n" +
"and d.zone =:zonaValue\r\n" +
"and c.payCode=a.userId\r\n" +
"and d.devname=b.deviceName")
public ArrayList<String> getEnrolledZonalUserId(Integer zonaValue);
@Query(value="select a.userName \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 a.userId like '%1200%'" +
"and d.division like '%ZONAL%'\r\n" +
"AND a.deviceId=b.deviceId\r\n" +
"and d.zone =:zonaValue\r\n" +
"and c.payCode=a.userId\r\n" +
"and d.devname=b.deviceName")
public ArrayList<String> getEnrolledZonalUserName(Integer zonaValue);
@Query(value="select 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 a.userId like '%1200%'" +
"and d.division like '%ZONAL%'\r\n" +
"AND a.deviceId=b.deviceId\r\n" +
"and d.zone =:zonaValue\r\n" +
"and c.payCode=a.userId\r\n" +
"and d.devname=b.deviceName")
public ArrayList<String> getEnrolledZonalDesignation(Integer zonaValue);
//// ----------------------Department Office Enrolled-----------------------------------------
@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 a.userId like '%1200%'" +
"and c.payCode=a.userId\r\n" +
"and d.division like '%HQ%'\r\n" +
"and d.devname=:deptValue\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledDeptUserId(String deptValue);
@Query(value="select a.userName\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 a.userId like '%1200%'" +
"and c.payCode=a.userId\r\n" +
"and d.division like '%HQ%'\r\n" +
"and d.devname=:deptValue\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledDeptUserName(String deptValue);
@Query(value="select 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 a.userId like '%1200%'" +
"and c.payCode=a.userId\r\n" +
"and d.division like '%HQ%'\r\n" +
"and d.devname=:deptValue\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledDeptDesignation(String deptValue);
//// ----------------------RDC Office Enrolled-----------------------------------------
@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 a.userId like '%1200%'" +
"and c.payCode=a.userId\r\n" +
"and d.zone=:zoneValue\r\n" +
"and d.division like '%RDC%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by d.division")
public ArrayList<String> getEnrolledRDCUserId(Integer zoneValue);
@Query(value="select a.userName\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 a.userId like '%1200%'" +
"and c.payCode=a.userId\r\n" +
"and d.zone=:zoneValue\r\n" +
"and d.division like '%RDC%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by d.division")
public ArrayList<String> getEnrolledRDCUserName(Integer zoneValue);
@Query(value="select 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 a.userId like '%1200%'" +
"and c.payCode=a.userId\r\n" +
"and d.zone=:zoneValue\r\n" +
"and d.division like '%RDC%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by d.division")
public ArrayList<String> getEnrolledRDCDesignation(Integer zoneValue);
// ----------------------LFZ-----------------------------------------
@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 d.zone=:zone\r\n" +
"and a.userId like '%1200%'\r\n" +
"and d.devname like '%LFZ%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledLFZUserId(Integer zone);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getEnrolledLFZUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getEnrolledLFZDesignation(String userId);
// ----------------------PRINTING PRESS-----------------------------------------
@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 d.zone=:zone\r\n" +
"and a.userId like '%1200%'\r\n" +
"and d.devname like '%PRINTING%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledPPUserId(Integer zone);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getEnrolledPPUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getEnrolledPPDesignation(String userId);
// ----------------------NORTH CHENNAI DEPOT-----------------------------------------
@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 d.zone=:zone\r\n" +
"and a.userId like '%1200%'\r\n" +
"and d.devname like '%DEPOT%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledNCDUserId(Integer zone);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getEnrolledNCDUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getEnrolledNCDDesignation(String userId);
// ----------------------TASK FORCE-----------------------------------------
@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 d.zone=:zone\r\n" +
"and a.userId like '%1200%'\r\n" +
"and d.devname like '%TASK%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledTFUserId(Integer zone);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getEnrolledTFUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getEnrolledTFDesignation(String userId);
// ----------------------TPF-----------------------------------------
@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 d.zone=:zone\r\n" +
"and a.userId like '%1200%'\r\n" +
"and d.devname like '%TPF%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledTPFUserId(Integer zone);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getEnrolledTPFUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getEnrolledTPFDesignation(String userId);
// ----------------------CENTRAL CHENNAI DEPOT-----------------------------------------
@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 d.zone=:zone\r\n" +
"and a.userId like '%1200%'\r\n" +
"and d.devname like '%DEPOT%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledCCDUserId(Integer zone);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getEnrolledCCDUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getEnrolledCCDDesignation(String userId);
// ----------------------PDG-----------------------------------------
@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 d.zone=:zone\r\n" +
"and a.userId like '%1200%'\r\n" +
"and d.devname like '%PDG%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledPDGUserId(Integer zone);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getEnrolledPDGUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getEnrolledPDGDesignation(String userId);
// ----------------------SOUTH CHENNAI DEPOT SCD-----------------------------------------
@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 d.zone=:zone\r\n" +
"and a.userId like '%1200%'\r\n" +
"and d.devname like '%DEPOT%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledSCDUserId(Integer zone);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getEnrolledSCDUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getEnrolledSCDDesignation(String userId);
// ----------------------INSPECTION VEHICLE-----------------------------------------
@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 d.zone=:zone\r\n" +
"and a.userId like '%1200%'\r\n" +
"and d.devname like '%INSPECTION%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledIVUserId(Integer zone);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getEnrolledIVUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getEnrolledIVDesignation(String userId);
// ----------------------KDG-----------------------------------------
@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 d.zone=:zone\r\n" +
"and a.userId like '%1200%'\r\n" +
"and d.devname like '%KDG%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledKDGUserId(Integer zone);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getEnrolledKDGUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getEnrolledKDGDesignation(String userId);
}

327
src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRHeadQuaterTotalEntriesRepository.java

@ -0,0 +1,327 @@
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 NMRHeadQuaterTotalEntriesRepository extends JpaRepository<HeadQuaterEntries, Integer> {
@Query(value = "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 d.division like '%HQ%'\r\n" +
"and a.userId like '%1200%'\r\n" +
"and d.devname=b.deviceName")
ArrayList<Integer> getEnrolled();
@Query(value = "select COUNT(distinct a.payCode) as punched\r\n" +
"from MachineRawPunchh a , DeviceStatus b, ZoneDivMaster c \r\n" +
"where c.devname=b.deviceName\r\n" +
"and a.deviceId=b.deviceId \r\n" +
"and c.division like '%HQ%'\r\n" +
"and a.payCode like '%1200%'\r\n" +
"and cast(a.officePunch as 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();
//
}

66
src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRHeadQuaterZonesEntriesRepository.java

@ -0,0 +1,66 @@
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 NMRHeadQuaterZonesEntriesRepository extends JpaRepository<HeadQuaterEntries, Integer> {
@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.userId 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> 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 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> getZonesAsPerEnrolled();
@Query("select count(distinct a.payCode)\r\n"
+ "from MachineRawPunchh a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n"
+ "and a.deviceId=b.deviceId \r\n"
+ "and a.payCode 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> 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 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> getZonesAsPerPunched(Date date);
}

350
src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMROtherZoneOfficesRepository.java

@ -0,0 +1,350 @@
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 org.springframework.stereotype.Repository;
import com.gcc.biometric.api.GccBioMetricApi.entity.ZoneDivMaster;
@Repository
public interface NMROtherZoneOfficesRepository extends JpaRepository<ZoneDivMaster, String> {
// # # # # # # # # # # # # # # # # LFZ # # # # # # # # # # # # # # # # # # #
@Query(value="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 d.zone=:zoneValue\r\n" +
"and a.userId like '%1200%'\r\n" +
"and d.devname like '%LFZ%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"group by d.division\r\n" +
"order by d.division")
public ArrayList<String> getLFZEnrolled(Integer zoneValue);
@Query(value="select COUNT(distinct a.payCode) as punched\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 c.devname like '%LFZ%'\r\n" +
"and a.payCode like '%1200%'\r\n" +
"and cast(a.officePunch as date) =:date\r\n" +
"group by c.division\r\n" +
"order by c.division")
public ArrayList<String> getLFZPunched(Integer zoneValue, Date date);
// # # # # # # # # # # # # # # # # LFZ # # # # # # # # # # # # # # # # # # #
// # # # # # # # # # # # # # # # # PRINTINGPRESS # # # # # # # # # # # # # # # # # # #
@Query(value="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 d.zone=:zoneValue\r\n" +
"and a.userId like '%1200%'\r\n" +
"and d.devname like '%PRINTING%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"group by d.division\r\n" +
"order by d.division")
public ArrayList<String> getPRINTINGPRESSEnrolled(Integer zoneValue);
@Query(value="select COUNT(distinct a.payCode) as punched\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 c.devname like '%PRINTING%'\r\n" +
"and a.payCode like '%1200%'\r\n" +
"and cast(a.officePunch as date) =:date\r\n" +
"group by c.division\r\n" +
"order by c.division")
public ArrayList<String> getPRINTINGPRESSPunched(Integer zoneValue, Date date);
//// # # # # # # # # # # # # # # # # PRINTINGPRESS # # # # # # # # # # # # # # # # # # #
//
//// # # # # # # # # # # # # # # # # NORTH CHENNAI DEPOT NCD# # # # # # # # # # # # # # # # # # #
@Query(value="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 d.zone=:zoneValue\r\n" +
"and a.userId like '%1200%'\r\n" +
"and d.devname like '%DEPOT%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"group by devname\r\n" +
"order by devname asc")
public ArrayList<String> getNCDEnrolled(Integer zoneValue);
@Query(value="select COUNT(distinct a.payCode) as punched\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 c.devname like '%DEPOT%'\r\n" +
"and a.payCode like '%1200%'\r\n" +
"and cast(a.officePunch as date) =:date\r\n" +
"group by c.devname\r\n" +
"order by c.devname")
public ArrayList<String> getNCDPunched(Integer zoneValue, Date date);
//// # # # # # # # # # # # # # # # # NORTH CHENNAI DEPOT NCD # # # # # # # # # # # # # # # # # # #
//
//// # # # # # # # # # # # # # # # # TASKFORCE # # # # # # # # # # # # # # # # # # #
@Query(value="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 d.zone=:zoneValue\r\n" +
"and a.userId like '%1200%'\r\n" +
"and d.devname like '%TASK%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"group by devname\r\n" +
"order by devname asc")
public ArrayList<String> getTFEnrolled(Integer zoneValue);
@Query(value="select COUNT(distinct a.payCode) as punched\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 c.devname like '%TASK%'\r\n" +
"and a.payCode like '%1200%'\r\n" +
"and cast(a.officePunch as date) =:date\r\n" +
"group by c.devname\r\n" +
"order by c.devname")
public ArrayList<String> getTFPunched(Integer zoneValue, Date date);
//// # # # # # # # # # # # # # # # # TASKFORCE # # # # # # # # # # # # # # # # # # #
//
//
//// # # # # # # # # # # # # # # # # TPF # # # # # # # # # # # # # # # # # # #
@Query(value="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 d.zone=:zoneValue\r\n" +
"and a.userId like '%1200%'\r\n" +
"and d.devname like '%TPF%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"group by devname\r\n" +
"order by devname asc")
public ArrayList<String> getTPFEnrolled(Integer zoneValue);
@Query(value="select COUNT(distinct a.payCode) as punched\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 c.devname like '%TPF%'\r\n" +
"and a.payCode like '%1200%'\r\n" +
"and cast(a.officePunch as date) =:date\r\n" +
"group by c.devname\r\n" +
"order by c.devname")
public ArrayList<String> getTPFPunched(Integer zoneValue, Date date);
//// # # # # # # # # # # # # # # # # TPF # # # # # # # # # # # # # # # # # # #
//
//
//// # # # # # # # # # # # # # # # # CENTRAL CHENNAI DEPOT CCD# # # # # # # # # # # # # # # # # # #
@Query(value="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 d.zone=:zoneValue\r\n" +
"and a.userId like '%1200%'\r\n" +
"and d.devname like '%DEPOT%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"group by devname\r\n" +
"order by devname asc")
public ArrayList<String> getCCDEnrolled(Integer zoneValue);
@Query(value="select COUNT(distinct a.payCode) as punched\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 c.devname like '%DEPOT%'\r\n" +
"and a.payCode like '%1200%'\r\n" +
"and cast(a.officePunch as date) =:date\r\n" +
"group by c.devname\r\n" +
"order by c.devname")
public ArrayList<String> getCCDPunched(Integer zoneValue, Date date);
//// # # # # # # # # # # # # # # # # CENTRAL CHENNAI DEPOT CCD # # # # # # # # # # # # # # # # # # #
//
//
//// # # # # # # # # # # # # # # # # PDG # # # # # # # # # # # # # # # # # # #
@Query(value="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 d.zone=:zoneValue\r\n" +
"and a.userId like '%1200%'\r\n" +
"and d.devname like '%PDG%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"group by division\r\n" +
"order by division asc")
public ArrayList<String> getPDGEnrolled(Integer zoneValue);
@Query(value="select COUNT(distinct a.payCode) as punched\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 c.devname like '%PDG%'\r\n" +
"and a.payCode like '%1200%'\r\n" +
"and cast(a.officePunch as date) =:date\r\n" +
"group by c.division\r\n" +
"order by c.division")
public ArrayList<String> getPDGPunched(Integer zoneValue, Date date);
//// # # # # # # # # # # # # # # # # PDG # # # # # # # # # # # # # # # # # # #
//
//
//
//// # # # # # # # # # # # # # # # # SCD # # # # # # # # # # # # # # # # # # #
@Query(value="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 d.zone=:zoneValue\r\n" +
"and a.userId like '%1200%'\r\n" +
"and d.devname like '%DEPOT%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"group by devname\r\n" +
"order by devname asc")
public ArrayList<String> getSCDEnrolled(Integer zoneValue);
@Query(value="select COUNT(distinct a.payCode) as punched\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 c.devname like '%DEPOT%'\r\n" +
"and a.payCode like '%1200%'\r\n" +
"and cast(a.officePunch as date) =:date\r\n" +
"group by c.devname\r\n" +
"order by c.devname")
public ArrayList<String> getSCDPunched(Integer zoneValue, Date date);
//// # # # # # # # # # # # # # # # # SCD # # # # # # # # # # # # # # # # # # #
//
//
//// # # # # # # # # # # # # # # # # INSPECTIONVEHICLE # # # # # # # # # # # # # # # # # # #
@Query(value="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 d.zone=:zoneValue\r\n" +
"and a.userId like '%1200%'\r\n" +
"and d.devname like '%INSPECTION%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"group by devname\r\n" +
"order by devname asc")
public ArrayList<String> getINSPECTIONVEHICLEEnrolled(Integer zoneValue);
@Query(value="select COUNT(distinct a.payCode) as punched\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 c.devname like '%INSPECTION%'\r\n" +
"and a.payCode like '%1200%'\r\n" +
"and cast(a.officePunch as date) =:date\r\n" +
"group by c.devname\r\n" +
"order by c.devname")
public ArrayList<String> getINSPECTIONVEHICLEPunched(Integer zoneValue, Date date);
//// # # # # # # # # # # # # # # # # INSPECTIONVEHICLE # # # # # # # # # # # # # # # # # # #
//
//
//
//// # # # # # # # # # # # # # # # # KDG # # # # # # # # # # # # # # # # # # #
@Query(value="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 d.zone=:zoneValue\r\n" +
"and a.userId like '%1200%'\r\n" +
"and d.devname like '%KDG%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"group by d.division\r\n" +
"order by d.division asc")
public ArrayList<String> getKDGEnrolled(Integer zoneValue);
@Query(value="select COUNT(distinct a.payCode) as punched\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 c.devname like '%KDG%'\r\n" +
"and a.payCode like '%1200%'\r\n" +
"and cast(a.officePunch as date) =:date\r\n" +
"group by c.division\r\n" +
"order by c.division")
public ArrayList<String> getKDGPunched(Integer zoneValue, Date date);
// # # # # # # # # # # # # # # # # KDG # # # # # # # # # # # # # # # # # # #
}

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

@ -0,0 +1,363 @@
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 org.springframework.stereotype.Repository;
import com.gcc.biometric.api.GccBioMetricApi.entity.ZoneDivMaster;
@Repository
public interface NMRPunchedEmpListDataRepository extends JpaRepository<ZoneDivMaster, String> {
// ----------------------Division office Punched-----------------------------------------
@Query(value="select distinct a.payCode\r\n" +
"from MachineRawPunchh a , DeviceStatus b, ZoneDivMaster c,\r\n" +
"Employee d where \r\n" +
"d.payCode=a.payCode and\r\n" +
"c.devname=b.deviceName\r\n" +
"and a.deviceId=b.deviceId \r\n" +
"AND c.division=:divValue\r\n" +
"and a.payCode like '%1200%'" +
"and c.devname like '%DIV%'\r\n" +
"and cast(a.officePunch as date) =:date\r\n" +
"order by a.payCode asc")
public ArrayList<String> getPunchedDivUserId(String divValue, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedDivUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedDivDesignation(String userId);
// ----------------------Unit Office Punched-----------------------------------------
@Query(value="select distinct a.payCode\r\n" +
"from MachineRawPunchh a, DeviceStatus b, ZoneDivMaster c,\r\n" +
"Employee d\r\n" +
"where a.payCode=d.payCode\r\n" +
"and c.devname=b.deviceName\r\n" +
"and a.deviceId=b.deviceId \r\n" +
"and c.division=:divValue\r\n" +
"and a.payCode like '%1200%'" +
"and cast(a.officePunch as date) =:date\r\n" +
"order by a.payCode asc")
public ArrayList<String> getPunchedUnitUserId(String divValue, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedUnitUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedUnitDesignation(String userId);
// ----------------------Lorry Office Punched-----------------------------------------
@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 c.zone=:divValue\r\n" +
"and a.payCode like '%1200%'" +
"and c.devname like '%LORRY%'\r\n" +
"and cast(a.officePunch as date) =:date\r\n" +
"order by a.payCode asc")
public ArrayList<String> getPunchedLorryUserId(Integer divValue, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedLorryUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedLorryDesignation(String userId);
// ----------------------Zonal Office Punched-----------------------------------------
@Query(value="select distinct a.payCode\r\n" +
"from MachineRawPunchh a , DeviceStatus b, ZoneDivMaster c,\r\n" +
"Employee d where \r\n" +
"d.payCode=a.payCode and\r\n" +
"c.devname=b.deviceName\r\n" +
"and a.deviceId=b.deviceId \r\n" +
"AND c.zone=:divValue\r\n" +
"and a.payCode like '%1200%'" +
"and c.division like '%ZONAL%'\r\n" +
"and cast(a.officePunch as date) =:date\r\n" +
"order by a.payCode asc")
public ArrayList<String> getPunchedZonalUserId(Integer divValue, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedZonalUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedZonalDesignation(String userId);
// ----------------------Department Office Punched-----------------------------------------
@Query(value="select distinct a.payCode \r\n" +
"from MachineRawPunchh a,DeviceStatus b,ZoneDivMaster c,\r\n" +
"Employee d\r\n" +
"where cast(a.officePunch as date) =:date \r\n" +
"and a.payCode=d.payCode \r\n" +
"and c.devname=b.deviceName \r\n" +
"and a.deviceId=b.deviceId \r\n" +
"AND c.devname=:divValue \r\n" +
"and a.payCode like '%1200%'" +
"AND c.division like '%HQ%' \r\n" +
"order by a.payCode asc")
public ArrayList<String> getPunchedDeptUserId(String divValue, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedDeptUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedDeptDesignation(String userId);
// ----------------------RDC Office Punched-----------------------------------------
@Query(value="select distinct a.payCode\r\n" +
"from MachineRawPunchh a , DeviceStatus b, ZoneDivMaster c,\r\n" +
"Employee d where\r\n" +
"a.payCode=d.payCode \r\n" +
"and c.zone=:divValue\r\n" +
"and a.payCode like '%1200%'" +
"and c.devname=b.deviceName\r\n" +
"and a.deviceId=b.deviceId \r\n" +
"and c.division like '%RDC%'\r\n" +
"and cast(a.officePunch as date) =:date\r\n" +
"order by a.payCode asc")
public ArrayList<String> getPunchedRDCUserId(Integer divValue, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedRDCUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedRDCDesignation(String userId);
// ----------------------LFZ-----------------------------------------
@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 c.zone=:zone\r\n" +
"and c.devname like '%LFZ%'\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> getPunchedLFZUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedLFZUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedLFZDesignation(String userId);
// ----------------------PRINTING PRESS-----------------------------------------
@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 c.zone=:zone\r\n" +
"and c.devname like '%PRINTING%'\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> getPunchedPPUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedPPUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedPPDesignation(String userId);
// ----------------------NORTH CHENNAI DEPOT-----------------------------------------
@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 c.zone=:zone\r\n" +
"and c.devname like '%DEPOT%'\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> getPunchedNCDUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedNCDUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedNCDDesignation(String userId);
// ----------------------TASK FORCE-----------------------------------------
@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 c.zone=:zone\r\n" +
"and c.devname like '%TASK%'\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> getPunchedTFUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedTFUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedTFDesignation(String userId);
// ----------------------TPF-----------------------------------------
@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 c.zone=:zone\r\n" +
"and c.devname like '%TPF%'\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> getPunchedTPFUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedTPFUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedTPFDesignation(String userId);
// ----------------------CENTRAL CHENNAI DEPOT-----------------------------------------
@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 c.zone=:zone\r\n" +
"and c.devname like '%DEPOT%'\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> getPunchedCCDUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedCCDUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedCCDDesignation(String userId);
// ----------------------PDG-----------------------------------------
@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 c.zone=:zone\r\n" +
"and c.devname like '%PDG%'\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> getPunchedPDGUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedPDGUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedPDGDesignation(String userId);
// ----------------------SOUTH CHENNAI DEPOT SCD-----------------------------------------
@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 c.zone=:zone\r\n" +
"and c.devname like '%DEPOT%'\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> getPunchedSCDUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedSCDUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedSCDDesignation(String userId);
// ----------------------INSPECTION VEHICLE-----------------------------------------
@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 c.zone=:zone\r\n" +
"and c.devname like '%INSPECTION%'\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> getPunchedIVUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedIVUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedIVDesignation(String userId);
// ----------------------KDG-----------------------------------------
@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 c.zone=:zone\r\n" +
"and c.devname like '%PDG%'\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> getPunchedKDGUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedKDGUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedKDGDesignation(String userId);
}

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

@ -0,0 +1,81 @@
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 NMRRegionalDeputyCommissionerRepository extends JpaRepository<HeadQuaterEntries, Integer> {
@Query("select count(a.userId) as Enrolled \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 c.payCode=a.userId\r\n"
+ "and d.division like '%RDC%'\r\n"
+ "and a.userId like '%1200%'\r\n"
+ "and d.devname=b.deviceName\r\n"
+ "group by d.division\r\n"
+ "order by d.division ")
ArrayList<Integer> getRDCEnrolled();
@Query("select d.division \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 c.payCode=a.userId\r\n"
+ "and d.division like '%RDC%'\r\n"
+ "and a.userId like '%1200%'\r\n"
+ "and d.devname=b.deviceName\r\n"
+ "group by d.division\r\n"
+ "order by d.division ")
ArrayList<Integer> getRDCAsPerEnrolled();
@Query("select COUNT(distinct a.payCode) as punched\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 '%1200%'\r\n"
+ "and cast(a.officePunch as date) =:date\r\n"
+ "group by c.division\r\n"
+ "order by c.division")
ArrayList<Integer> getRDCPunched(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 '%1200%'\r\n"
+ "and cast(a.officePunch as date) =:date\r\n"
+ "group by c.division\r\n"
+ "order by c.division")
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" //since in NMR no Zones no enrolled
+ "group by c.division\r\n"
+ "order by c.division")
ArrayList<String> getRDCZoneNames();
}

36
src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRZonalOfficeTotalDataRepository.java

@ -0,0 +1,36 @@
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 org.springframework.stereotype.Repository;
import com.gcc.biometric.api.GccBioMetricApi.entity.ZoneDivMaster;
@Repository
public interface NMRZonalOfficeTotalDataRepository extends JpaRepository<ZoneDivMaster, String> {
@Query(value="select count(a.userId) as Enrolled \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 like '%1200%' \r\n"
+ "and c.payCode=a.userId\r\n"
+ "and d.division like '%ZONAL%'\r\n"
+ "and d.devname=b.deviceName")
public ArrayList<Integer> getZonalOfficeTotalEnrolled();
@Query(value="select COUNT(distinct a.payCode) as punched\r\n"
+ "from MachineRawPunchh a , DeviceStatus b, ZoneDivMaster c where \r\n"
+ "c.devname=b.deviceName\r\n"
+ "and a.payCode like '%1200%'\r\n"
+ "and a.deviceId=b.deviceId \r\n"
+ "and c.division like '%ZONAL%'\r\n"
+ "and cast(a.officePunch as date) =:date")
public ArrayList<Integer> getZonalOfficeTotalPunched(Date date);
}

372
src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRZoneDivisionOfficeRepository.java

@ -0,0 +1,372 @@
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 org.springframework.stereotype.Repository;
import com.gcc.biometric.api.GccBioMetricApi.entity.ZoneDivMaster;
@Repository
public interface NMRZoneDivisionOfficeRepository extends JpaRepository<ZoneDivMaster, String> {
// # # # # # # # # # # # # # # # # DivisionOffice # # # # # # # # # # # # # # # # # # #
//because div_1 date is different so for matching
@Query(value="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.userId like '%1200%' "
+ "and c.payCode=a.userId\r\n"
+ "and d.zone=:zoneValue\r\n"
+ "and d.devname like '%DIV%'\r\n"
+ "and d.devname=b.deviceName\r\n"
+ "group by d.division\r\n"
+ "order by d.division + 0 asc")
public ArrayList<String> getDivisionOfficeEnrolledPerDiv_1(Integer zoneValue);
@Query(value="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.userId like '%1200%'"
+ "and c.payCode=a.userId\r\n"
+ "and d.zone=:zoneValue\r\n"
+ "and d.devname like '%DIV%'\r\n"
+ "and d.devname=b.deviceName\r\n"
+ "group by d.division\r\n"
+ "order by d.division asc")
public ArrayList<String> getDivisionOfficeEnrolledPerDiv(Integer zoneValue);
@Query(value="select d.division\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 like '%1200%'"
+ "and c.payCode=a.userId\r\n"
+ "and d.zone=:zoneValue\r\n"
+ "and d.devname like '%DIV%'\r\n"
+ "and d.devname=b.deviceName\r\n"
+ "group by d.division\r\n"
+ "order by d.division asc")
public ArrayList<String> getDivisionOfficesAsPerEnrolled(Integer zoneValue);
@Query(value="select count(distinct a.payCode)\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.devname like '%DIV%'\r\n"
+ "and c.zone= :zoneValue\r\n"
+ "and a.payCode like '%1200%'"
+ "and cast(a.officePunch as date) = :date\r\n"
+ "group by c.division\r\n"
+"order by c.division + 0 asc")
public ArrayList<String> getDivisionOfficePunchedPerDiv_1(Integer zoneValue, Date date);
@Query(value="select count(distinct a.payCode)\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.devname like '%DIV%'\r\n"
+ "and c.zone= :zoneValue\r\n"
+ "and a.payCode like '%1200%'"
+ "and cast(a.officePunch as date) = :date\r\n"
+ "group by c.division\r\n"
+"order by c.division asc")
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.devname like '%DIV%'\r\n"
+ "and c.zone= :zoneValue\r\n"
+ "and a.payCode like '%1200%'"
+ "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);
@Query(value="select division from ZoneDivMaster c where c.zone= :zoneValue and c.devname like '%DIV%'")
public ArrayList<String> getDivisionOfficeZoneDivisions(Integer zoneValue);
// # # # # # # # # # # # # # # # # DivisionOffice # # # # # # # # # # # # # # # # # # #
// # # # # # # # # # # # # # # # # Division 8 Office Special case # # # # # # # # # # # # # # # # # # #
@Query(value="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 a.deviceId=b.deviceId \r\n" +
"and c.payCode=a.userId\r\n" +
" and d.zone=:zoneValue \r\n" +
" and a.userId like '%1200%' \r\n" +
"and d.devname like '%DIV%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"group by d.division,d.devname\r\n" +
"order by d.division + 0 asc")
public ArrayList<String> getDivisionOfficeEnrolledPerDiv_8(Integer zoneValue);
@Query(value="select SUBSTRING(d.devname,5,9) AS 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 a.deviceId=b.deviceId \r\n" +
"and c.payCode=a.userId\r\n" +
" and d.zone=:zoneValue \r\n" +
" and a.userId like '%1200%' \r\n" +
"and d.devname like '%DIV%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"group by d.division,d.devname\r\n" +
"order by d.division + 0 asc")
public ArrayList<String> getDivisionOfficesAsPerEnrolled_8(Integer zoneValue);
@Query(value="select count(distinct a.payCode) as Punched\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 like '%1200%' \r\n" +
"and c.devname like '%DIV%'\r\n" +
"and cast(a.officePunch as date) =:date\r\n" +
"group by c.division,c.devname\r\n" +
"order by c.division +0 asc")
public ArrayList<String> getDivisionOfficePunchedPerDiv_8(Integer zoneValue, Date date);
@Query(value="select SUBSTRING(c.devname,5,9) AS 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 like '%1200%' \r\n" +
"and c.devname like '%DIV%'\r\n" +
"and cast(a.officePunch as date) =:date\r\n" +
"group by c.division,c.devname\r\n" +
"order by c.division +0 asc")
public ArrayList<String> getDivisionOfficeZoneDivAsPerDate_8(Integer zoneValue, Date date);
@Query(value="select SUBSTRING(c.devname,5,9)from ZoneDivMaster c where c.zone=:zoneValue and c.devname like '%DIV%'")
public ArrayList<String> getDivisionOfficeZoneDivisions_8(Integer zoneValue);
// # # # # # # # # # # # # # # # # Division 8 Office Special case # # # # # # # # # # # # # # # # # # #
// # # # # # # # # # # # # # # # # Unit Office # # # # # # # # # # # # # # # # # # #
@Query(value="select count(a.userId) as enrolled\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 like '%1200%'"
+ "and c.payCode=a.userId\r\n"
+ "and d.zone=:zoneValue\r\n"
+ "and d.division like '%UNIT%'\r\n"
+ "and d.devname=b.deviceName\r\n"
+ "group by d.zone,d.division\r\n"
+ "order by d.zone")
public ArrayList<String> getUnitOfficeEnrolledPerZone(Integer zoneValue);
@Query(value="select COUNT(distinct a.payCode) as punched\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 a.payCode like '%1200%'"
+ "and c.division like '%UNIT%'\r\n"
+ "and cast(a.officePunch as date) =:date\r\n"
+ "group by c.zone,c.division\r\n"
+ "order by c.zone")
public ArrayList<String> getUnitOfficePunchedPerZone(Integer zoneValue, Date date);
@Query(value="select d.division\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 like '%1200%'"
+ "and c.payCode=a.userId\r\n"
+ "and d.zone=:zoneValue\r\n"
+ "and d.division like '%UNIT%'\r\n"
+ "and d.devname=b.deviceName\r\n"
+ "group by d.zone,d.division\r\n"
+ "order by d.zone")
public ArrayList<String> getAllUnitOfficeAsPerZoneAsPerEnrolled(Integer zoneValue);
@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 a.payCode like '%1200%'"
+ "and c.division like '%UNIT%'\r\n"
+ "and cast(a.officePunch as date) =:date\r\n"
+ "group by c.zone,c.division\r\n"
+ "order by c.zone")
public ArrayList<String> getAllUnitOfficeAsPerZoneAsPerPunched(Integer zoneValue, Date date);
@Query(value="select division from ZoneDivMaster c where c.zone=:zoneValue and c.division like '%UNIT%'")
public ArrayList<String> getAllUnitOfficeAsPerZone(Integer zoneValue);
// # # # # # # # # # # # # # # # # Unit Office # # # # # # # # # # # # # # # # # # #
// # # # # # # # # # # # # # # # # Zonal Office As per Zone# # # # # # # # # # # # # # # # # # #
@Query(value="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.userId like '%1200%'"
+ "and c.payCode=a.userId\r\n"
+ "and d.zone= :zoneValue\r\n"
+ "and d.division like '%ZONAL%'\r\n"
+ "and d.devname=b.deviceName\r\n"
+ "group by d.division\r\n"
+ "order by d.division")
public ArrayList<String> getZonalOfficeEnrolledPerDiv(Integer zoneValue);
@Query(value="select COUNT(distinct a.payCode)\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 a.payCode like '%1200%'"
+ "and c.division like '%ZONAL%'\r\n"
+ "and cast(a.officePunch as date) = :date\r\n"
+ "group by c.division\r\n"
+ "order by c.division")
public ArrayList<String> getZonalOfficePunchedPerDiv(Integer zoneValue, Date date);
@Query(value="select c.devname\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 a.payCode like '%1200%'"
+ "and c.division like '%ZONAL%'\r\n"
+ "and cast(a.officePunch as date) =:date\r\n"
+ "group by c.devname\r\n"
+ "order by c.devname")
public ArrayList<String> getZonalOfficeZoneDivAsPerDate(Integer zoneValue, Date date);
@Query(value="select devname from ZoneDivMaster c where c.zone= :zoneValue and c.division like '%ZONAL%'")
public ArrayList<String> getZonalOfficeZoneDivisions(Integer zoneValue);
// # # # # # # # # # # # # # # # # Zonal Office As per Zone # # # # # # # # # # # # # # # # # # #
// # # # # # # # # # # # # # # # # Zonal Office of all 15 Zones # # # # # # # # # # # # # # # # # # #
@Query(value="select count(a.userId) as Enrolled \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 like '%1200%' "
+ "and c.payCode=a.userId\r\n"
+ "and d.division like '%ZONAL%'\r\n"
+ "and d.devname=b.deviceName\r\n"
+ "group by d.zone,d.devname\r\n"
+ "order by d.zone")
public ArrayList<String> getAllZonalOfficesEnrolledOfAllZones();
@Query(value="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 like '%1200%' "
+ "and c.payCode=a.userId\r\n"
+ "and d.division like '%ZONAL%'\r\n"
+ "and d.devname=b.deviceName\r\n"
+ "group by d.zone,d.devname\r\n"
+ "order by d.zone")
public ArrayList<String> getAllZonalOfficesAsPerEnrolled();
@Query(value="select COUNT(distinct a.payCode) as punched\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 '%ZONAL%'\r\n"
+ "and a.payCode like '%1200%'"
+ "and cast(a.officePunch as date) =:date\r\n"
+ "group by c.zone,c.division\r\n"
+ "order by c.zone")
public ArrayList<String> getAllZonalOfficesPunchedOfAllZones(Date date);
@Query(value="select c.devname\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 '%ZONAL%'\r\n"
+ "and a.payCode like '%1200%'"
+ "and cast(a.officePunch as date) =:date\r\n"
+ "group by c.devname\r\n"
+ "order by c.devname")
public ArrayList<String> getAllZonalOfficesZoneAsPerDate(Date date);
@Query(value="select devname from ZoneDivMaster c where c.division like '%ZONAL%'")
public ArrayList<String> getAllZonalOfficesZones();
// # # # # # # # # # # # # # # # # Zonal Office of all 15 Zones # # # # # # # # # # # # # # # # # # #
// # # # # # # # # # # # # # # # # Lorry Station # # # # # # # # # # # # # # # # # # #
@Query(value="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.userId like '%1200%'"
+ "and c.payCode=a.userId\r\n"
+ "and d.zone=:zoneValue\r\n"
+ "and d.devname like '%LORRY%'\r\n"
+ "and d.devname=b.deviceName\r\n"
+ "group by d.division\r\n"
+ "order by d.division asc")
public ArrayList<String> getLorryStationEnrolledPerDiv(Integer zoneValue);
@Query(value="select COUNT(distinct a.payCode)\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 a.payCode like '%1200%'"
+ "and c.devname like '%LORRY%'\r\n"
+ "and cast(a.officePunch as date) =:date\r\n"
+ "group by c.division\r\n"
+ "order by c.division")
public ArrayList<String> getLorryStationPunchedPerDiv(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 a.payCode like '%1200%'"
+ "and c.devname like '%LORRY%'\r\n"
+ "and cast(a.officePunch as date) =:date\r\n"
+ "group by c.division\r\n"
+ "order by c.division")
public ArrayList<String> getLorryStationZoneDivAsPerDate(Integer zoneValue, Date date);
@Query(value="select division from ZoneDivMaster c where c.zone= :zoneValue and c.devname like '%LORRY%'")
public ArrayList<String> getLorryStationZoneDivisions(Integer zoneValue);
// # # # # # # # # # # # # # # # # Lorry Station # # # # # # # # # # # # # # # # # # #
}

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

@ -0,0 +1,328 @@
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 org.springframework.stereotype.Repository;
import com.gcc.biometric.api.GccBioMetricApi.entity.ZoneDivMaster;
@Repository
public interface NULMAbsenteesEmpListDataRepository extends JpaRepository<ZoneDivMaster, String> {
// ----------------------Division office Enrolled-----------------------------------------
@Query(value = "select a.userId "
+ "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,RealTimeUserInfo b,DeviceStatus c,ZoneDivMaster d \r\n"
+ "where cast(a.officePunch as date) =:date and a.payCode=b.userId and \r\n"
+ "d.devname=c.deviceName and b.deviceId=c.deviceId \r\n"
+ "AND d.division=:divValue and a.payCode like '%1100%' and d.devname like '%DIV%')\r\n"
+ "and c.division=:divValue and a.userId like '%1100%' and c.devname like '%DIV%'\r\n"
+ "order by c.zone,c.division,a.userId")
public ArrayList<String> getAbsentDivUserId(String divValue, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentDivUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentDivDesignation(String userId);
// ----------------------Unit Office Punched-----------------------------------------
@Query(value = "select a.userId "
+ "from RealTimeUserInfo a,DeviceStatus b, \r\n"
+ "ZoneDivMaster c , Employee d\r\nwhere 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 c.division =:unitValue and a.payCode like '%1100%')\r\n"
+ "and c.division =:unitValue and a.userId like '%1100%'\r\n"
+ "order by c.zone,a.userId")
public ArrayList<String> getAbsentUnitUserId(String unitValue, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentUnitUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentUnitDesignation(String userId);
// ----------------------Lorry Office Punched-----------------------------------------
@Query(value = "select a.userId "
+ "from RealTimeUserInfo a,DeviceStatus b, \r\nZoneDivMaster 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,RealTimeUserInfo b,DeviceStatus c,ZoneDivMaster d \r\n"
+ "where cast(a.officePunch as date) =:date and a.payCode=b.userId and \r\n"
+ "d.devname=c.deviceName and b.deviceId=c.deviceId \r\n"
+ "AND d.zone=:zone and a.payCode like '%1100%' and d.devname like '%LORRY%')\r\n"
+ "and c.zone=:zone and a.userId like '%1100%' and c.devname like '%LORRY%'\r\n"
+ "order by c.zone,c.division,a.userId")
public ArrayList<String> getAbsentLorryUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentLorryUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentLorryDesignation(String userId);
// ----------------------Zonal Office Punched-----------------------------------------
@Query(value = "select a.userId\r\n" +
"from RealTimeUserInfo a,DeviceStatus b, 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 c.zone=:zone and a.payCode like '%1100%' "+
"and c.division like '%ZONAL%')\r\n" +
"and c.zone=:zone and a.userId like '%1100%'" +
"and c.division like '%ZONAL%'\r\n" +
"order by a.userId")
public ArrayList<String> getAbsentZonalUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentZonalUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentZonalDesignation(String userId);
// ----------------------Department Office Punched-----------------------------------------
@Query("select a.userId "
+ "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 c.devname LIKE :dept and a.payCode like '%1100%' AND c.division like '%HQ%')\r\n"
+ "and c.division like '%HQ%' and a.userId like '%1100%' AND c.devname LIKE :dept \r\n"
+ "order by c.zone,a.userId")
public ArrayList<String> getAbsentDeptUserId(String dept, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentDeptUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentDeptDesignation(String userId);
// ----------------------RDC Office Punched-----------------------------------------
@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 DISTINCT 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 c.zone=:zone and a.payCode like '%1100%' and c.devname like '%RDC%')\r\n"
+ "and c.zone=:zone and a.userId like '%1100%' and c.devname like '%RDC%'\r\n"
+ "order by c.zone,c.division,a.userId")
public ArrayList<String> getAbsentRDCUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentRDCUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentRDCDesignation(String userId);
// ----------------------LFZ-----------------------------------------
@Query(value="select a.userId"+
" 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 c.zone=:zone and a.payCode like '%1100%' and c.division like '%LFZ%')\r\n" +
"and c.zone=:zone and a.userId like '%1100%' and c.division like '%LFZ%'\r\n" +
"order by a.userId")
public ArrayList<String> getAbsentLFZUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentLFZUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentLFZDesignation(String userId);
// ----------------------PRINTING PRESS-----------------------------------------
@Query(value="select a.userId 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 c.zone=:zone and a.payCode like '%1100%' and c.division like '%PRINTING%')\r\n" +
"and c.zone=:zone and a.userId like '%1100%' and c.division like '%PRINTING%'\r\n" +
"order by a.userId")
public ArrayList<String> getAbsentPPUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentPPUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentPPDesignation(String userId);
// ----------------------NORTH CHENNAI DEPOT-----------------------------------------
@Query(value="select a.userId 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 c.zone=:zone and a.payCode like '%1100%' and c.devname like '%DEPOT%')\r\n" +
"and c.zone=:zone and a.userId like '%1100%' and c.devname like '%DEPOT%'\r\n" +
"order by a.userId")
public ArrayList<String> getAbsentNCDUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentNCDUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentNCDDesignation(String userId);
// ----------------------TASK FORCE-----------------------------------------
@Query(value="select a.userId 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 c.zone=:zone and a.payCode like '%1100%' and c.devname like '%TASK%')\r\n" +
"and c.zone=:zone and a.userId like '%1100%' and c.devname like '%TASK%'\r\n" +
"order by a.userId")
public ArrayList<String> getAbsentTFUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentTFUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentTFDesignation(String userId);
// ----------------------TPF-----------------------------------------
@Query(value="select a.userId 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 c.zone=:zone and a.payCode like '%1100%' and c.devname like '%TPF%')\r\n" +
"and c.zone=:zone and a.userId like '%1100%' and c.devname like '%TPF%'\r\n" +
"order by a.userId")
public ArrayList<String> getAbsentTPFUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentTPFUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentTPFDesignation(String userId);
// ----------------------CENTRAL CHENNAI DEPOT-----------------------------------------
@Query(value="select a.userId 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 c.zone=:zone and a.payCode like '%1100%' and c.devname like '%DEPOT%')\r\n" +
"and c.zone=:zone and a.userId like '%1100%' and c.devname like '%DEPOT%'\r\n" +
"order by a.userId")
public ArrayList<String> getAbsentCCDUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentCCDUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentCCDDesignation(String userId);
// ----------------------PDG-----------------------------------------
@Query(value="select a.userId 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 c.zone=:zone and a.payCode like '%1100%' and c.devname like '%PDG%')\r\n" +
"and c.zone=:zone and a.userId like '%1100%' and c.devname like '%PDG%'\r\n" +
"order by a.userId")
public ArrayList<String> getAbsentPDGUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentPDGUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentPDGDesignation(String userId);
// ----------------------SOUTH CHENNAI DEPOT SCD-----------------------------------------
@Query(value="select a.userId 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 c.zone=:zone and a.payCode like '%1100%' and c.devname like '%DEPOT%')\r\n" +
"and c.zone=:zone and a.userId like '%1100%' and c.devname like '%DEPOT%'\r\n" +
"order by a.userId")
public ArrayList<String> getAbsentSCDUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentSCDUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentSCDDesignation(String userId);
// ----------------------INSPECTION VEHICLE-----------------------------------------
@Query(value="select a.userId 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 c.zone=:zone and a.payCode like '%1100%' and c.devname like '%INSPECTION%')\r\n" +
"and c.zone=:zone and a.userId like '%1100%' and c.devname like '%INSPECTION%'\r\n" +
"order by a.userId")
public ArrayList<String> getAbsentIVUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentIVUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentIVDesignation(String userId);
// ----------------------KDG-----------------------------------------
@Query(value="select a.userId 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 c.zone=:zone and a.payCode like '%1100%' and c.devname like '%KDG%')\r\n" +
"and c.zone=:zone and a.userId like '%1100%' and c.devname like '%KDG%'\r\n" +
"order by a.userId")
public ArrayList<String> getAbsentKDGUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getAbsentKDGUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getAbsentKDGDesignation(String userId);
}

70
src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMDeptHeadQuaterOfficeRepository.java

@ -0,0 +1,70 @@
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 org.springframework.stereotype.Repository;
import com.gcc.biometric.api.GccBioMetricApi.entity.ZoneDivMaster;
@Repository
public interface NULMDeptHeadQuaterOfficeRepository extends JpaRepository<ZoneDivMaster, String> {
// # # # # # # # # # # # # # # # # Department Office # # # # # # # # # # # # # # # # # # #
@Query(value="select count(a.userId) as Enrolled \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 c.payCode=a.userId\r\n"
+ "and d.division like '%HQ%'\r\n"
+ "and a.userId like '%1100%'\r\n"
+ "and d.devname=b.deviceName\r\n"
+ "group by d.division,d.devname")
public ArrayList<String> getHQDepartmentOfficeEnrolled();
@Query(value="select d.devname \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 c.payCode=a.userId\r\n"
+ "and d.division like '%HQ%'\r\n"
+ "and a.userId like '%1100%'\r\n"
+ "and d.devname=b.deviceName\r\n"
+ "group by d.division,d.devname")
public ArrayList<String> getAllHQDepartmentOfficeAsPerEnrolled();
@Query(value="select COUNT(distinct a.payCode) as punched\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 '%HQ%'\r\n"
+ "and a.payCode like '%1100%'\r\n"
+ "and cast(a.officePunch as date) =:date\r\n"
+ "group by c.division,c.devname")
public ArrayList<String> getHQDepartmentOfficePunched(Date date);
@Query(value="select c.devname\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 '%HQ%'\r\n"
+ "and a.payCode like '%1100%'\r\n"
+ "and cast(a.officePunch as date) =:date\r\n"
+ "group by c.division,c.devname")
public ArrayList<String> getHQDepartmentOfficesAsPerDate(Date date);
@Query(value="select distinct c.devname from ZoneDivMaster c where c.division like '%HQ%'")
public ArrayList<String> getAllHQDepartmentOffices();
// # # # # # # # # # # # # # # # # Department Office # # # # # # # # # # # # # # # # # # #
}

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

@ -0,0 +1,477 @@
package com.gcc.biometric.api.GccBioMetricApi.repo.nulm;
import java.util.ArrayList;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import com.gcc.biometric.api.GccBioMetricApi.entity.ZoneDivMaster;
@Repository
public interface NULMEnrolledEmpListDataRepository extends JpaRepository<ZoneDivMaster, String> {
// ----------------------Division office Enrolled-----------------------------------------
@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 a.userId like '%1100%'" +
"AND a.deviceId=b.deviceId \r\n" +
"and c.payCode=a.userId\r\n" +
" and d.division=:divValue\r\n" +
"and d.devname like '%DIV%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledDivUserId(String divValue);
@Query(value="select a.userName\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 a.userId like '%1100%'" +
"AND a.deviceId=b.deviceId \r\n" +
"and c.payCode=a.userId\r\n" +
" and d.division=:divValue\r\n" +
"and d.devname like '%DIV%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledDivUserName(String divValue);
@Query(value="select 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 a.userId like '%1100%'" +
"AND a.deviceId=b.deviceId \r\n" +
"and c.payCode=a.userId\r\n" +
" and d.division=:divValue\r\n" +
"and d.devname like '%DIV%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledDivDesignation(String divValue);
//
//
//
//// ----------------------Unit Office Enrolled-----------------------------------------
@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 a.userId like '%1100%'" +
"and c.payCode=a.userId\r\n" +
"and d.division like '%UNIT%'\r\n" +
"AND d.division=:unitValue\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledUnitUserId(String unitValue);
@Query(value="select a.userName\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 a.userId like '%1100%'" +
"and c.payCode=a.userId\r\n" +
"and d.division like '%UNIT%'\r\n" +
"AND d.division=:unitValue\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledUnitUserName(String unitValue);
@Query(value="select 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 a.userId like '%1100%'" +
"and c.payCode=a.userId\r\n" +
"and d.division like '%UNIT%'\r\n" +
"AND d.division=:unitValue\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledUnitDesignation(String unitValue);
//// ----------------------Lorry Office Enrolled-----------------------------------------
@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 a.userId like '%1100%'" +
" and c.payCode=a.userId\r\n" +
"and d.zone=:zoneValue\r\n" +
"and d.devname like '%LORRY%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledLorryUserId(Integer zoneValue);
@Query(value="select a.userName\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 a.userId like '%1100%'" +
" and c.payCode=a.userId\r\n" +
"and d.zone=:zoneValue\r\n" +
"and d.devname like '%LORRY%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledLorryUserName(Integer zoneValue);
@Query(value="select 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 a.userId like '%1100%'" +
" and c.payCode=a.userId\r\n" +
"and d.zone=:zoneValue\r\n" +
"and d.devname like '%LORRY%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledLorryDesignation(Integer zoneValue);
//// ----------------------Zonal Office Enrolled-----------------------------------------
@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 a.userId like '%1100%'" +
"and d.division like '%ZONAL%'\r\n" +
"AND a.deviceId=b.deviceId\r\n" +
"and d.zone =:zonaValue\r\n" +
"and c.payCode=a.userId\r\n" +
"and d.devname=b.deviceName")
public ArrayList<String> getEnrolledZonalUserId(Integer zonaValue);
@Query(value="select a.userName \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 a.userId like '%1100%'" +
"and d.division like '%ZONAL%'\r\n" +
"AND a.deviceId=b.deviceId\r\n" +
"and d.zone =:zonaValue\r\n" +
"and c.payCode=a.userId\r\n" +
"and d.devname=b.deviceName")
public ArrayList<String> getEnrolledZonalUserName(Integer zonaValue);
@Query(value="select 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 a.userId like '%1100%'" +
"and d.division like '%ZONAL%'\r\n" +
"AND a.deviceId=b.deviceId\r\n" +
"and d.zone =:zonaValue\r\n" +
"and c.payCode=a.userId\r\n" +
"and d.devname=b.deviceName")
public ArrayList<String> getEnrolledZonalDesignation(Integer zonaValue);
//// ----------------------Department Office Enrolled-----------------------------------------
@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 a.userId like '%1100%'" +
"and c.payCode=a.userId\r\n" +
"and d.division like '%HQ%'\r\n" +
"and d.devname=:deptValue\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledDeptUserId(String deptValue);
@Query(value="select a.userName\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 a.userId like '%1100%'" +
"and c.payCode=a.userId\r\n" +
"and d.division like '%HQ%'\r\n" +
"and d.devname=:deptValue\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledDeptUserName(String deptValue);
@Query(value="select 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 a.userId like '%1100%'" +
"and c.payCode=a.userId\r\n" +
"and d.division like '%HQ%'\r\n" +
"and d.devname=:deptValue\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledDeptDesignation(String deptValue);
//// ----------------------RDC Office Enrolled-----------------------------------------
@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 a.userId like '%1100%'" +
"and c.payCode=a.userId\r\n" +
"and d.zone=:zoneValue\r\n" +
"and d.division like '%RDC%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by d.division")
public ArrayList<String> getEnrolledRDCUserId(Integer zoneValue);
@Query(value="select a.userName\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 a.userId like '%1100%'" +
"and c.payCode=a.userId\r\n" +
"and d.zone=:zoneValue\r\n" +
"and d.division like '%RDC%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by d.division")
public ArrayList<String> getEnrolledRDCUserName(Integer zoneValue);
@Query(value="select 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 a.userId like '%1100%'" +
"and c.payCode=a.userId\r\n" +
"and d.zone=:zoneValue\r\n" +
"and d.division like '%RDC%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by d.division")
public ArrayList<String> getEnrolledRDCDesignation(Integer zoneValue);
// ----------------------LFZ-----------------------------------------
@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 d.zone=:zone\r\n" +
"and a.userId like '%1100%'\r\n" +
"and d.devname like '%LFZ%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledLFZUserId(Integer zone);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getEnrolledLFZUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getEnrolledLFZDesignation(String userId);
// ----------------------PRINTING PRESS-----------------------------------------
@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 d.zone=:zone\r\n" +
"and a.userId like '%1100%'\r\n" +
"and d.devname like '%PRINTING%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledPPUserId(Integer zone);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getEnrolledPPUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getEnrolledPPDesignation(String userId);
// ----------------------NORTH CHENNAI DEPOT-----------------------------------------
@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 d.zone=:zone\r\n" +
"and a.userId like '%1100%'\r\n" +
"and d.devname like '%DEPOT%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledNCDUserId(Integer zone);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getEnrolledNCDUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getEnrolledNCDDesignation(String userId);
// ----------------------TASK FORCE-----------------------------------------
@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 d.zone=:zone\r\n" +
"and a.userId like '%1100%'\r\n" +
"and d.devname like '%TASK%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledTFUserId(Integer zone);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getEnrolledTFUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getEnrolledTFDesignation(String userId);
// ----------------------TPF-----------------------------------------
@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 d.zone=:zone\r\n" +
"and a.userId like '%1100%'\r\n" +
"and d.devname like '%TPF%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledTPFUserId(Integer zone);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getEnrolledTPFUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getEnrolledTPFDesignation(String userId);
// ----------------------CENTRAL CHENNAI DEPOT-----------------------------------------
@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 d.zone=:zone\r\n" +
"and a.userId like '%1100%'\r\n" +
"and d.devname like '%DEPOT%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledCCDUserId(Integer zone);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getEnrolledCCDUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getEnrolledCCDDesignation(String userId);
// ----------------------PDG-----------------------------------------
@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 d.zone=:zone\r\n" +
"and a.userId like '%1100%'\r\n" +
"and d.devname like '%PDG%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledPDGUserId(Integer zone);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getEnrolledPDGUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getEnrolledPDGDesignation(String userId);
// ----------------------SOUTH CHENNAI DEPOT SCD-----------------------------------------
@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 d.zone=:zone\r\n" +
"and a.userId like '%1100%'\r\n" +
"and d.devname like '%DEPOT%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledSCDUserId(Integer zone);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getEnrolledSCDUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getEnrolledSCDDesignation(String userId);
// ----------------------INSPECTION VEHICLE-----------------------------------------
@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 d.zone=:zone\r\n" +
"and a.userId like '%1100%'\r\n" +
"and d.devname like '%INSPECTION%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledIVUserId(Integer zone);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getEnrolledIVUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getEnrolledIVDesignation(String userId);
// ----------------------KDG-----------------------------------------
@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 d.zone=:zone\r\n" +
"and a.userId like '%1100%'\r\n" +
"and d.devname like '%KDG%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"order by a.userId")
public ArrayList<String> getEnrolledKDGUserId(Integer zone);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getEnrolledKDGUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getEnrolledKDGDesignation(String userId);
}

327
src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMHeadQuaterTotalEntriesRepository.java

@ -0,0 +1,327 @@
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 NULMHeadQuaterTotalEntriesRepository extends JpaRepository<HeadQuaterEntries, Integer> {
@Query(value = "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 d.division like '%HQ%'\r\n" +
"and a.userId like '%1100%'\r\n" +
"and d.devname=b.deviceName")
ArrayList<Integer> getEnrolled();
@Query(value = "select COUNT(distinct a.payCode) as punched\r\n" +
"from MachineRawPunchh a , DeviceStatus b, ZoneDivMaster c \r\n" +
"where c.devname=b.deviceName\r\n" +
"and a.deviceId=b.deviceId \r\n" +
"and c.division like '%HQ%'\r\n" +
"and a.payCode like '%1100%'\r\n" +
"and cast(a.officePunch as 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();
//
}

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

@ -0,0 +1,328 @@
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 NULMHeadQuaterZonesEntriesRepository extends JpaRepository<HeadQuaterEntries, Integer> {
@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.userId like '%1100%'\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> getEnrolled();
@Query("select count(distinct a.payCode)\r\n"
+ "from MachineRawPunchh a , DeviceStatus b, ZoneDivMaster c where c.devname=b.deviceName\r\n"
+ "and a.deviceId=b.deviceId \r\n"
+ "and a.payCode like '%1100%'\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> 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();
//
}

350
src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMOtherZoneOfficesRepository.java

@ -0,0 +1,350 @@
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 org.springframework.stereotype.Repository;
import com.gcc.biometric.api.GccBioMetricApi.entity.ZoneDivMaster;
@Repository
public interface NULMOtherZoneOfficesRepository extends JpaRepository<ZoneDivMaster, String> {
// # # # # # # # # # # # # # # # # LFZ # # # # # # # # # # # # # # # # # # #
@Query(value="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 d.zone=:zoneValue\r\n" +
"and a.userId like '%1100%'\r\n" +
"and d.devname like '%LFZ%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"group by d.division\r\n" +
"order by d.division")
public ArrayList<String> getLFZEnrolled(Integer zoneValue);
@Query(value="select COUNT(distinct a.payCode) as punched\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 c.devname like '%LFZ%'\r\n" +
"and a.payCode like '%1100%'\r\n" +
"and cast(a.officePunch as date) =:date\r\n" +
"group by c.division\r\n" +
"order by c.division")
public ArrayList<String> getLFZPunched(Integer zoneValue, Date date);
// # # # # # # # # # # # # # # # # LFZ # # # # # # # # # # # # # # # # # # #
// # # # # # # # # # # # # # # # # PRINTINGPRESS # # # # # # # # # # # # # # # # # # #
@Query(value="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 d.zone=:zoneValue\r\n" +
"and a.userId like '%1100%'\r\n" +
"and d.devname like '%PRINTING%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"group by d.division\r\n" +
"order by d.division")
public ArrayList<String> getPRINTINGPRESSEnrolled(Integer zoneValue);
@Query(value="select COUNT(distinct a.payCode) as punched\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 c.devname like '%PRINTING%'\r\n" +
"and a.payCode like '%1100%'\r\n" +
"and cast(a.officePunch as date) =:date\r\n" +
"group by c.division\r\n" +
"order by c.division")
public ArrayList<String> getPRINTINGPRESSPunched(Integer zoneValue, Date date);
//// # # # # # # # # # # # # # # # # PRINTINGPRESS # # # # # # # # # # # # # # # # # # #
//
//// # # # # # # # # # # # # # # # # NORTH CHENNAI DEPOT NCD# # # # # # # # # # # # # # # # # # #
@Query(value="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 d.zone=:zoneValue\r\n" +
"and a.userId like '%1100%'\r\n" +
"and d.devname like '%DEPOT%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"group by devname\r\n" +
"order by devname asc")
public ArrayList<String> getNCDEnrolled(Integer zoneValue);
@Query(value="select COUNT(distinct a.payCode) as punched\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 c.devname like '%DEPOT%'\r\n" +
"and a.payCode like '%1100%'\r\n" +
"and cast(a.officePunch as date) =:date\r\n" +
"group by c.devname\r\n" +
"order by c.devname")
public ArrayList<String> getNCDPunched(Integer zoneValue, Date date);
//// # # # # # # # # # # # # # # # # NORTH CHENNAI DEPOT NCD # # # # # # # # # # # # # # # # # # #
//
//// # # # # # # # # # # # # # # # # TASKFORCE # # # # # # # # # # # # # # # # # # #
@Query(value="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 d.zone=:zoneValue\r\n" +
"and a.userId like '%1100%'\r\n" +
"and d.devname like '%TASK%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"group by devname\r\n" +
"order by devname asc")
public ArrayList<String> getTFEnrolled(Integer zoneValue);
@Query(value="select COUNT(distinct a.payCode) as punched\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 c.devname like '%TASK%'\r\n" +
"and a.payCode like '%1100%'\r\n" +
"and cast(a.officePunch as date) =:date\r\n" +
"group by c.devname\r\n" +
"order by c.devname")
public ArrayList<String> getTFPunched(Integer zoneValue, Date date);
//// # # # # # # # # # # # # # # # # TASKFORCE # # # # # # # # # # # # # # # # # # #
//
//
//// # # # # # # # # # # # # # # # # TPF # # # # # # # # # # # # # # # # # # #
@Query(value="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 d.zone=:zoneValue\r\n" +
"and a.userId like '%1100%'\r\n" +
"and d.devname like '%TPF%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"group by devname\r\n" +
"order by devname asc")
public ArrayList<String> getTPFEnrolled(Integer zoneValue);
@Query(value="select COUNT(distinct a.payCode) as punched\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 c.devname like '%TPF%'\r\n" +
"and a.payCode like '%1100%'\r\n" +
"and cast(a.officePunch as date) =:date\r\n" +
"group by c.devname\r\n" +
"order by c.devname")
public ArrayList<String> getTPFPunched(Integer zoneValue, Date date);
//// # # # # # # # # # # # # # # # # TPF # # # # # # # # # # # # # # # # # # #
//
//
//// # # # # # # # # # # # # # # # # CENTRAL CHENNAI DEPOT CCD# # # # # # # # # # # # # # # # # # #
@Query(value="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 d.zone=:zoneValue\r\n" +
"and a.userId like '%1100%'\r\n" +
"and d.devname like '%DEPOT%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"group by devname\r\n" +
"order by devname asc")
public ArrayList<String> getCCDEnrolled(Integer zoneValue);
@Query(value="select COUNT(distinct a.payCode) as punched\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 c.devname like '%DEPOT%'\r\n" +
"and a.payCode like '%1100%'\r\n" +
"and cast(a.officePunch as date) =:date\r\n" +
"group by c.devname\r\n" +
"order by c.devname")
public ArrayList<String> getCCDPunched(Integer zoneValue, Date date);
//// # # # # # # # # # # # # # # # # CENTRAL CHENNAI DEPOT CCD # # # # # # # # # # # # # # # # # # #
//
//
//// # # # # # # # # # # # # # # # # PDG # # # # # # # # # # # # # # # # # # #
@Query(value="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 d.zone=:zoneValue\r\n" +
"and a.userId like '%1100%'\r\n" +
"and d.devname like '%PDG%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"group by division\r\n" +
"order by division asc")
public ArrayList<String> getPDGEnrolled(Integer zoneValue);
@Query(value="select COUNT(distinct a.payCode) as punched\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 c.devname like '%PDG%'\r\n" +
"and a.payCode like '%1100%'\r\n" +
"and cast(a.officePunch as date) =:date\r\n" +
"group by c.division\r\n" +
"order by c.division")
public ArrayList<String> getPDGPunched(Integer zoneValue, Date date);
//// # # # # # # # # # # # # # # # # PDG # # # # # # # # # # # # # # # # # # #
//
//
//
//// # # # # # # # # # # # # # # # # SCD # # # # # # # # # # # # # # # # # # #
@Query(value="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 d.zone=:zoneValue\r\n" +
"and a.userId like '%1100%'\r\n" +
"and d.devname like '%DEPOT%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"group by devname\r\n" +
"order by devname asc")
public ArrayList<String> getSCDEnrolled(Integer zoneValue);
@Query(value="select COUNT(distinct a.payCode) as punched\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 c.devname like '%DEPOT%'\r\n" +
"and a.payCode like '%1100%'\r\n" +
"and cast(a.officePunch as date) =:date\r\n" +
"group by c.devname\r\n" +
"order by c.devname")
public ArrayList<String> getSCDPunched(Integer zoneValue, Date date);
//// # # # # # # # # # # # # # # # # SCD # # # # # # # # # # # # # # # # # # #
//
//
//// # # # # # # # # # # # # # # # # INSPECTIONVEHICLE # # # # # # # # # # # # # # # # # # #
@Query(value="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 d.zone=:zoneValue\r\n" +
"and a.userId like '%1100%'\r\n" +
"and d.devname like '%INSPECTION%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"group by devname\r\n" +
"order by devname asc")
public ArrayList<String> getINSPECTIONVEHICLEEnrolled(Integer zoneValue);
@Query(value="select COUNT(distinct a.payCode) as punched\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 c.devname like '%INSPECTION%'\r\n" +
"and a.payCode like '%1100%'\r\n" +
"and cast(a.officePunch as date) =:date\r\n" +
"group by c.devname\r\n" +
"order by c.devname")
public ArrayList<String> getINSPECTIONVEHICLEPunched(Integer zoneValue, Date date);
//// # # # # # # # # # # # # # # # # INSPECTIONVEHICLE # # # # # # # # # # # # # # # # # # #
//
//
//
//// # # # # # # # # # # # # # # # # KDG # # # # # # # # # # # # # # # # # # #
@Query(value="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 d.zone=:zoneValue\r\n" +
"and a.userId not like '%1100%' and a.userId not like '%1200%'\r\n" +
"and d.devname like '%KDG%'\r\n" +
"and d.devname=b.deviceName\r\n" +
"group by d.division\r\n" +
"order by d.division asc")
public ArrayList<String> getKDGEnrolled(Integer zoneValue);
@Query(value="select COUNT(distinct a.payCode) as punched\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 c.devname like '%KDG%'\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 c.division\r\n" +
"order by c.division")
public ArrayList<String> getKDGPunched(Integer zoneValue, Date date);
// # # # # # # # # # # # # # # # # KDG # # # # # # # # # # # # # # # # # # #
}

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

@ -0,0 +1,363 @@
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 org.springframework.stereotype.Repository;
import com.gcc.biometric.api.GccBioMetricApi.entity.ZoneDivMaster;
@Repository
public interface NULMPunchedEmpListDataRepository extends JpaRepository<ZoneDivMaster, String> {
// ----------------------Division office Punched-----------------------------------------
@Query(value="select distinct a.payCode\r\n" +
"from MachineRawPunchh a , DeviceStatus b, ZoneDivMaster c,\r\n" +
"Employee d where \r\n" +
"d.payCode=a.payCode and\r\n" +
"c.devname=b.deviceName\r\n" +
"and a.deviceId=b.deviceId \r\n" +
"AND c.division=:divValue\r\n" +
"and a.payCode like '%1100%'" +
"and c.devname like '%DIV%'\r\n" +
"and cast(a.officePunch as date) =:date\r\n" +
"order by a.payCode asc")
public ArrayList<String> getPunchedDivUserId(String divValue, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedDivUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedDivDesignation(String userId);
// ----------------------Unit Office Punched-----------------------------------------
@Query(value="select distinct a.payCode\r\n" +
"from MachineRawPunchh a, DeviceStatus b, ZoneDivMaster c,\r\n" +
"Employee d\r\n" +
"where a.payCode=d.payCode\r\n" +
"and c.devname=b.deviceName\r\n" +
"and a.deviceId=b.deviceId \r\n" +
"and c.division=:divValue\r\n" +
"and a.payCode like '%1100%'" +
"and cast(a.officePunch as date) =:date\r\n" +
"order by a.payCode asc")
public ArrayList<String> getPunchedUnitUserId(String divValue, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedUnitUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedUnitDesignation(String userId);
// ----------------------Lorry Office Punched-----------------------------------------
@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 c.zone=:divValue\r\n" +
"and a.payCode like '%1100%'" +
"and c.devname like '%LORRY%'\r\n" +
"and cast(a.officePunch as date) =:date\r\n" +
"order by a.payCode asc")
public ArrayList<String> getPunchedLorryUserId(Integer divValue, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedLorryUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedLorryDesignation(String userId);
// ----------------------Zonal Office Punched-----------------------------------------
@Query(value="select distinct a.payCode\r\n" +
"from MachineRawPunchh a , DeviceStatus b, ZoneDivMaster c,\r\n" +
"Employee d where \r\n" +
"d.payCode=a.payCode and\r\n" +
"c.devname=b.deviceName\r\n" +
"and a.deviceId=b.deviceId \r\n" +
"AND c.zone=:divValue\r\n" +
"and a.payCode like '%1100%'" +
"and c.division like '%ZONAL%'\r\n" +
"and cast(a.officePunch as date) =:date\r\n" +
"order by a.payCode asc")
public ArrayList<String> getPunchedZonalUserId(Integer divValue, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedZonalUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedZonalDesignation(String userId);
// ----------------------Department Office Punched-----------------------------------------
@Query(value="select distinct a.payCode \r\n" +
"from MachineRawPunchh a,DeviceStatus b,ZoneDivMaster c,\r\n" +
"Employee d\r\n" +
"where cast(a.officePunch as date) =:date \r\n" +
"and a.payCode=d.payCode \r\n" +
"and c.devname=b.deviceName \r\n" +
"and a.deviceId=b.deviceId \r\n" +
"AND c.devname=:divValue \r\n" +
"and a.payCode like '%1100%'" +
"AND c.division like '%HQ%' \r\n" +
"order by a.payCode asc")
public ArrayList<String> getPunchedDeptUserId(String divValue, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedDeptUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedDeptDesignation(String userId);
// ----------------------RDC Office Punched-----------------------------------------
@Query(value="select distinct a.payCode\r\n" +
"from MachineRawPunchh a , DeviceStatus b, ZoneDivMaster c,\r\n" +
"Employee d where\r\n" +
"a.payCode=d.payCode \r\n" +
"and c.zone=:divValue\r\n" +
"and a.payCode like '%1100%'" +
"and c.devname=b.deviceName\r\n" +
"and a.deviceId=b.deviceId \r\n" +
"and c.division like '%RDC%'\r\n" +
"and cast(a.officePunch as date) =:date\r\n" +
"order by a.payCode asc")
public ArrayList<String> getPunchedRDCUserId(Integer divValue, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedRDCUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedRDCDesignation(String userId);
// ----------------------LFZ-----------------------------------------
@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 c.zone=:zone\r\n" +
"and c.devname like '%LFZ%'\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> getPunchedLFZUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedLFZUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedLFZDesignation(String userId);
// ----------------------PRINTING PRESS-----------------------------------------
@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 c.zone=:zone\r\n" +
"and c.devname like '%PRINTING%'\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> getPunchedPPUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedPPUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedPPDesignation(String userId);
// ----------------------NORTH CHENNAI DEPOT-----------------------------------------
@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 c.zone=:zone\r\n" +
"and c.devname like '%DEPOT%'\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> getPunchedNCDUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedNCDUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedNCDDesignation(String userId);
// ----------------------TASK FORCE-----------------------------------------
@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 c.zone=:zone\r\n" +
"and c.devname like '%TASK%'\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> getPunchedTFUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedTFUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedTFDesignation(String userId);
// ----------------------TPF-----------------------------------------
@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 c.zone=:zone\r\n" +
"and c.devname like '%TPF%'\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> getPunchedTPFUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedTPFUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedTPFDesignation(String userId);
// ----------------------CENTRAL CHENNAI DEPOT-----------------------------------------
@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 c.zone=:zone\r\n" +
"and c.devname like '%DEPOT%'\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> getPunchedCCDUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedCCDUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedCCDDesignation(String userId);
// ----------------------PDG-----------------------------------------
@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 c.zone=:zone\r\n" +
"and c.devname like '%PDG%'\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> getPunchedPDGUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedPDGUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedPDGDesignation(String userId);
// ----------------------SOUTH CHENNAI DEPOT SCD-----------------------------------------
@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 c.zone=:zone\r\n" +
"and c.devname like '%DEPOT%'\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> getPunchedSCDUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedSCDUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedSCDDesignation(String userId);
// ----------------------INSPECTION VEHICLE-----------------------------------------
@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 c.zone=:zone\r\n" +
"and c.devname like '%INSPECTION%'\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> getPunchedIVUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedIVUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedIVDesignation(String userId);
// ----------------------KDG-----------------------------------------
@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 c.zone=:zone\r\n" +
"and c.devname like '%PDG%'\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> getPunchedKDGUserId(Integer zone, Date date);
@Query(value="select d.empName from Employee d where d.payCode=:userId")
public String getPunchedKDGUserName(String userId);
@Query(value="select d.designation from Employee d where d.payCode=:userId")
public String getPunchedKDGDesignation(String userId);
}

352
src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMRegionalDeputyCommissionerRepository.java

@ -0,0 +1,352 @@
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 NULMRegionalDeputyCommissionerRepository extends JpaRepository<HeadQuaterEntries, Integer> {
@Query("select count(a.userId) as Enrolled \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 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<Integer> getRDCEnrolled();
@Query("select COUNT(distinct a.payCode) as punched\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"
+ "and cast(a.officePunch as date) =:date\r\n"
+ "group by c.division\r\n"
+ "order by c.division")
ArrayList<Integer> getRDCPunched(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"
+ "and cast(a.officePunch as date) =:date\r\n"
+ "group by c.division\r\n"
+ "order by c.division")
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")
ArrayList<String> getRDCZoneNames();
// ========================================================================================
// @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();
//
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save