commit 756956b6cb36ef0baad4ab9f7d15ce7ea9104f87 Author: sachinsavita Date: Mon Jan 23 11:51:34 2023 +0530 update diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..549e00a --- /dev/null +++ b/.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/ diff --git a/.mvn/wrapper/maven-wrapper.jar b/.mvn/wrapper/maven-wrapper.jar new file mode 100644 index 0000000..c1dd12f Binary files /dev/null and b/.mvn/wrapper/maven-wrapper.jar differ diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 0000000..b74bf7f --- /dev/null +++ b/.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 diff --git a/mvnw b/mvnw new file mode 100644 index 0000000..8a8fb22 --- /dev/null +++ b/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 "$@" diff --git a/mvnw.cmd b/mvnw.cmd new file mode 100644 index 0000000..1d8ab01 --- /dev/null +++ b/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% diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..10e6cf8 --- /dev/null +++ b/pom.xml @@ -0,0 +1,85 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.7.5 + + + com.gcc.biometric.api + GccBioMetricApi + 2.0.0-SNAPSHOT + war + GccBioMetricApi + Spring Boot Api + + 1.8 + + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-devtools + runtime + true + + + com.microsoft.sqlserver + mssql-jdbc + 8.4.1.jre8 + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + + + + org.json + json + 20171018 + + + + org.projectlombok + lombok + + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + 1.8 + 1.8 + + + + package + + + + diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/GccAttendanceApplication.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/GccAttendanceApplication.java new file mode 100644 index 0000000..a7a93dd --- /dev/null +++ b/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); + + } + + + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/TestApp.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/TestApp.java new file mode 100644 index 0000000..7fd8ebb --- /dev/null +++ b/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)); + } + + } + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/AbsenteesEmpListDataController.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/AbsenteesEmpListDataController.java new file mode 100644 index 0000000..304789f --- /dev/null +++ b/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 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 tempAbsentUserId = new ArrayList<>(); + ArrayList AbsentUserName = new ArrayList<>(); + ArrayList AbsentUserDesignation = new ArrayList<>(); + + tempAbsentUserId = absenteesEmpListDataRepository.getAbsentDivUserId(divValue, date); + + ArrayList AbsentUserId = new ArrayList(); + 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 listMap = new ArrayList<>(); + + if (!AbsentUserId.isEmpty()) { + + for (int i = 0; i < AbsentUserId.size(); i++) { + + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + 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 map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + listMap.add("Message: Success"); + listMap.add("ResultSet: True"); + return listMap; + } + else { + + + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + } + +// ----------------Unit office Enrolled--------------- + + @GetMapping({ "/getUnitAbsentEmpList/{unit}/{tempDate}" }) + public List 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + + tempPunchedUserId = absenteesEmpListDataRepository.getAbsentUnitUserId(unitValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(absenteesEmpListDataRepository.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 listMap = new ArrayList<>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + final Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------Lorry office Enrolled------------------------ + + @GetMapping({ "/getLorryAbsentEmpList/{zone}/{tempDate}" }) + public List> 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + + tempPunchedUserId = absenteesEmpListDataRepository.getAbsentLorryUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(absenteesEmpListDataRepository.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> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + final Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------zonal office Enrolled----------------------- + + @GetMapping({ "/getZonalAbsentEmpList/{zone}/{tempDate}" }) + public List> 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + + tempPunchedUserId = absenteesEmpListDataRepository.getAbsentZonalUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(absenteesEmpListDataRepository.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> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + final Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------Department office Enrolled--------------------------- + + @GetMapping({ "/getDeptAbsentEmpList/{dept}/{tempDate}" }) + public List> 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + + tempPunchedUserId = absenteesEmpListDataRepository.getAbsentDeptUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(absenteesEmpListDataRepository.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> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------RDC office Enrolled--------------------------- + + @GetMapping({ "/getRDCAbsentEmpList/{zone}/{tempDate}" }) + public List> 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = absenteesEmpListDataRepository.getAbsentRDCUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(absenteesEmpListDataRepository.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> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/DeptHeadQuaterOfficeController.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/DeptHeadQuaterOfficeController.java new file mode 100644 index 0000000..3c4f4a5 --- /dev/null +++ b/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>> 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 allHQDepartments; + ArrayList allHQDepartmentsAsperDate; + ArrayList hqDepartmentsEnrolled; + ArrayList 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> listMap = new ArrayList>(); + for (int i = 0; i myListKey = new ArrayList<>(); + ArrayList 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 map = new LinkedHashMap<>(); + for(int x=0;x EnrolledUserId; + ArrayList EnrolledUserName; + ArrayList EnrolledUserDesignation; + + + // ----------------------Division office Enrolled----------------------------------------- + + @GetMapping({ "/getDivEnrolledEmpList/{div}" }) + public List> 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> listMap = new ArrayList>(); + if (!EnrolledUserId.isEmpty()) { + for (int i = 0; i < EnrolledUserId.size(); ++i) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + 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 map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); ++x) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); ++x2) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + + // ----------------------Unit office Enrolled----------------------------------------- + + @GetMapping({ "/getUnitEnrolledEmpList/{unit}" }) + public List> 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> listMap = new ArrayList>(); + if (!EnrolledUserId.isEmpty()) { + for (int i = 0; i < EnrolledUserId.size(); ++i) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + 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 map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); ++x) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); ++x2) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------Lorry office Enrolled----------------------------------------- + + @GetMapping({ "/getLorryEnrolledEmpList/{zone}" }) + public List> 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> listMap = new ArrayList>(); + if (!EnrolledUserId.isEmpty()) { + for (int i = 0; i < EnrolledUserId.size(); ++i) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + 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 map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); ++x) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); ++x2) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + + +// // ----------------------zonal office Enrolled----------------------------------------- + + @GetMapping({ "/getZonalEnrolledEmpList/{zone}" }) + public List> 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> listMap = new ArrayList>(); + if (!EnrolledUserId.isEmpty()) { + for (int i = 0; i < EnrolledUserId.size(); ++i) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + 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 map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); ++x) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); ++x2) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------Department office Enrolled----------------------------------------- + + @GetMapping({ "/getDeptEnrolledEmpList/{dept}" }) + public List> 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> listMap = new ArrayList>(); + if (!EnrolledUserId.isEmpty()) { + for (int i = 0; i < EnrolledUserId.size(); ++i) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + 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 map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); ++x) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); ++x2) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------RDC office Enrolled----------------------------------------- + + @GetMapping({ "/getRDCEnrolledEmpList/{zone}" }) + public List> 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> listMap = new ArrayList>(); + if (!EnrolledUserId.isEmpty()) { + for (int i = 0; i < EnrolledUserId.size(); ++i) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + 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 map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); ++x) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); ++x2) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/HeadQuaterTotalEntriesRestController.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/HeadQuaterTotalEntriesRestController.java new file mode 100644 index 0000000..7e516f0 --- /dev/null +++ b/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 arrZoneEnroll; + ArrayList arrZonePunched; + + @GetMapping("/HQTotalEmpCountPresentAbsentPercentage/{tempDate}") + public LinkedHashMap 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 map = new LinkedHashMap<>(); + + LinkedHashMap 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 getTheEnrolledAndPunchedAbsPer(@RequestParam(value = "date")@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)String date) { +// +// arrEnroll = headQuaterEntriesRepository.getEnrolled(); +// arrPunched = headQuaterEntriesRepository.getPunched(date); +// LinkedHashMap map = new LinkedHashMap<>(); +// +// +// Integer Absent_1 = arrEnroll.get(0) - arrPunched.get(0); +// Integer Absent_2 = arrEnroll.get(1) - arrPunched.get(1); +// Integer Absent_3 = arrEnroll.get(2) - arrPunched.get(2); +// Integer Absent_4 = arrEnroll.get(3) - arrPunched.get(3); +// Integer Absent_5 = arrEnroll.get(4) - arrPunched.get(4); +// Integer Absent_6 = arrEnroll.get(5) - arrPunched.get(5); +// Integer Absent_7 = arrEnroll.get(6) - arrPunched.get(6); +// Integer Absent_8 = arrEnroll.get(7) - arrPunched.get(7); +// Integer Absent_9 = arrEnroll.get(8) - arrPunched.get(8); +// Integer Absent_10 = arrEnroll.get(9) - arrPunched.get(9); +// Integer Absent_11 = arrEnroll.get(10) - arrPunched.get(10); +// Integer Absent_12 = arrEnroll.get(11) - arrPunched.get(11); +// Integer Absent_13 = arrEnroll.get(12) - arrPunched.get(12); +// Integer Absent_14 = arrEnroll.get(13) - arrPunched.get(13); +// Integer Absent_15 = arrEnroll.get(14) - arrPunched.get(14); +// Integer Absent_16 = arrEnroll.get(15) - arrPunched.get(15); +// +// Integer Percentage_1 = ((arrPunched.get(0) *100)/ arrEnroll.get(0)); +// Integer Percentage_2 = ((arrPunched.get(1) *100)/ arrEnroll.get(1)); +// Integer Percentage_3 = ((arrPunched.get(2) *100)/ arrEnroll.get(2)); +// Integer Percentage_4 = ((arrPunched.get(3) *100)/ arrEnroll.get(3)); +// Integer Percentage_5 = ((arrPunched.get(4) *100)/ arrEnroll.get(4)); +// Integer Percentage_6 = ((arrPunched.get(5) *100)/ arrEnroll.get(5)); +// Integer Percentage_7 = ((arrPunched.get(6) *100)/ arrEnroll.get(6)); +// Integer Percentage_8 = ((arrPunched.get(7) *100)/ arrEnroll.get(7)); +// Integer Percentage_9 = ((arrPunched.get(8) *100)/ arrEnroll.get(8)); +// Integer Percentage_10 = ((arrPunched.get(9) *100)/ arrEnroll.get(9)); +// Integer Percentage_11 = ((arrPunched.get(10) *100)/ arrEnroll.get(10)); +// Integer Percentage_12 = ((arrPunched.get(11) *100)/ arrEnroll.get(11)); +// Integer Percentage_13 = ((arrPunched.get(12) *100)/ arrEnroll.get(12)); +// Integer Percentage_14 = ((arrPunched.get(13) *100)/ arrEnroll.get(13)); +// Integer Percentage_15 = ((arrPunched.get(14) *100)/ arrEnroll.get(14)); +// Integer Percentage_16 = ((arrPunched.get(15) *100)/ arrEnroll.get(15)); +// +// +// +// map.put("Zone_1", 1); +// map.put("Zone_1_enrolled", arrEnroll.get(0)); +// map.put("Zone_1_punched", arrPunched.get(0)); +// map.put("Absent_1", Absent_1); +// map.put("Percentage_1", Percentage_1); +// map.put("Zone_2", 2); +// map.put("Zone_2_enrolled", arrEnroll.get(1)); +// map.put("Zone_2_punched", arrPunched.get(1)); +// map.put("Absent_2", Absent_2); +// map.put("Percentage_2", Percentage_2); +// map.put("Zone_3", 3); +// map.put("Zone_3_enrolled", arrEnroll.get(2)); +// map.put("Zone_3_punched", arrPunched.get(2)); +// map.put("Absent_3", Absent_3); +// map.put("Percentage_3", Percentage_3); +// map.put("Zone_4", 4); +// map.put("Zone_4_enrolled", arrEnroll.get(3)); +// map.put("Zone_4_punched", arrPunched.get(0)); +// map.put("Absent_4", Absent_4); +// map.put("Percentage_4", Percentage_4); +// map.put("Zone_5", 5); +// map.put("Zone_5_enrolled", arrEnroll.get(4)); +// map.put("Zone_5_punched", arrPunched.get(4)); +// map.put("Absent_5", Absent_5); +// map.put("Percentage_5", Percentage_5); +// map.put("Zone_6", 6); +// map.put("Zone_6_enrolled", arrEnroll.get(5)); +// map.put("Zone_6_punched", arrPunched.get(5)); +// map.put("Absent_6", Absent_6); +// map.put("Percentage_6", Percentage_6); +// map.put("Zone_7", 7); +// map.put("Zone_7_enrolled", arrEnroll.get(6)); +// map.put("Zone_7_punched", arrPunched.get(6)); +// map.put("Absent_7", Absent_7); +// map.put("Percentage_7", Percentage_7); +// map.put("Zone_8", 8); +// map.put("Zone_8_enrolled", arrEnroll.get(7)); +// map.put("Zone_8_punched", arrPunched.get(7)); +// map.put("Absent_8", Absent_8); +// map.put("Percentage_8", Percentage_8); +// map.put("Zone_9", 9); +// map.put("Zone_9_enrolled", arrEnroll.get(8)); +// map.put("Zone_9_punched", arrPunched.get(8)); +// map.put("Absent_9", Absent_9); +// map.put("Percentage_9", Percentage_9); +// map.put("Zone_10", 10); +// map.put("Zone_10_enrolled", arrEnroll.get(9)); +// map.put("Zone_10_punched", arrPunched.get(9)); +// map.put("Absent_10", Absent_10); +// map.put("Percentage_10", Percentage_10); +// map.put("Zone_11", 11); +// map.put("Zone_11_enrolled", arrEnroll.get(10)); +// map.put("Zone_11_punched", arrPunched.get(10)); +// map.put("Absent_11", Absent_11); +// map.put("Percentage_11", Percentage_11); +// map.put("Zone_12", 12); +// map.put("Zone_12_enrolled", arrEnroll.get(11)); +// map.put("Zone_12_punched", arrPunched.get(11)); +// map.put("Absent_12", Absent_12); +// map.put("Percentage_12", Percentage_12); +// map.put("Zone_13", 13); +// map.put("Zone_13_enrolled", arrEnroll.get(12)); +// map.put("Zone_13_punched", arrPunched.get(12)); +// map.put("Absent_13", Absent_13); +// map.put("Percentage_13", Percentage_13); +// map.put("Zone_14", 14); +// map.put("Zone_14_enrolled", arrEnroll.get(13)); +// map.put("Zone_14_punched", arrPunched.get(13)); +// map.put("Absent_14", Absent_14); +// map.put("Percentage_14", Percentage_14); +// map.put("Zone_15", 15); +// map.put("Zone_15_enrolled", arrEnroll.get(14)); +// map.put("Zone_15_punched", arrPunched.get(14)); +// map.put("Absent_15", Absent_15); +// map.put("Percentage_15", Percentage_15); +// map.put("Zone_16", 16); +// map.put("Zone_16_enrolled", arrEnroll.get(15)); +// map.put("Zone_16_punched", arrPunched.get(15)); +// map.put("Absent_16", Absent_16); +// map.put("Percentage_16", Percentage_16); +// System.out.println("Till 15"); + + +// return map; +// } + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/HeadQuaterZonesEntriesRestController.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/HeadQuaterZonesEntriesRestController.java new file mode 100644 index 0000000..1ab14b2 --- /dev/null +++ b/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 arrZoneEnroll; + ArrayList arrZonePunched; + + @GetMapping("/HQZonesEmpCountPresentAbsentPercentage/{tempDate}") + public LinkedHashMap 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 resultMap = new LinkedHashMap<>(); + + LinkedHashMap 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 getTheEnrolledAndPunchedAbsPer(@RequestParam(value = "date")@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)String date) { +// +// arrEnroll = headQuaterEntriesRepository.getEnrolled(); +// arrPunched = headQuaterEntriesRepository.getPunched(date); +// LinkedHashMap map = new LinkedHashMap<>(); +// +// +// Integer Absent_1 = arrEnroll.get(0) - arrPunched.get(0); +// Integer Absent_2 = arrEnroll.get(1) - arrPunched.get(1); +// Integer Absent_3 = arrEnroll.get(2) - arrPunched.get(2); +// Integer Absent_4 = arrEnroll.get(3) - arrPunched.get(3); +// Integer Absent_5 = arrEnroll.get(4) - arrPunched.get(4); +// Integer Absent_6 = arrEnroll.get(5) - arrPunched.get(5); +// Integer Absent_7 = arrEnroll.get(6) - arrPunched.get(6); +// Integer Absent_8 = arrEnroll.get(7) - arrPunched.get(7); +// Integer Absent_9 = arrEnroll.get(8) - arrPunched.get(8); +// Integer Absent_10 = arrEnroll.get(9) - arrPunched.get(9); +// Integer Absent_11 = arrEnroll.get(10) - arrPunched.get(10); +// Integer Absent_12 = arrEnroll.get(11) - arrPunched.get(11); +// Integer Absent_13 = arrEnroll.get(12) - arrPunched.get(12); +// Integer Absent_14 = arrEnroll.get(13) - arrPunched.get(13); +// Integer Absent_15 = arrEnroll.get(14) - arrPunched.get(14); +// Integer Absent_16 = arrEnroll.get(15) - arrPunched.get(15); +// +// Integer Percentage_1 = ((arrPunched.get(0) *100)/ arrEnroll.get(0)); +// Integer Percentage_2 = ((arrPunched.get(1) *100)/ arrEnroll.get(1)); +// Integer Percentage_3 = ((arrPunched.get(2) *100)/ arrEnroll.get(2)); +// Integer Percentage_4 = ((arrPunched.get(3) *100)/ arrEnroll.get(3)); +// Integer Percentage_5 = ((arrPunched.get(4) *100)/ arrEnroll.get(4)); +// Integer Percentage_6 = ((arrPunched.get(5) *100)/ arrEnroll.get(5)); +// Integer Percentage_7 = ((arrPunched.get(6) *100)/ arrEnroll.get(6)); +// Integer Percentage_8 = ((arrPunched.get(7) *100)/ arrEnroll.get(7)); +// Integer Percentage_9 = ((arrPunched.get(8) *100)/ arrEnroll.get(8)); +// Integer Percentage_10 = ((arrPunched.get(9) *100)/ arrEnroll.get(9)); +// Integer Percentage_11 = ((arrPunched.get(10) *100)/ arrEnroll.get(10)); +// Integer Percentage_12 = ((arrPunched.get(11) *100)/ arrEnroll.get(11)); +// Integer Percentage_13 = ((arrPunched.get(12) *100)/ arrEnroll.get(12)); +// Integer Percentage_14 = ((arrPunched.get(13) *100)/ arrEnroll.get(13)); +// Integer Percentage_15 = ((arrPunched.get(14) *100)/ arrEnroll.get(14)); +// Integer Percentage_16 = ((arrPunched.get(15) *100)/ arrEnroll.get(15)); +// +// +// +// map.put("Zone_1", 1); +// map.put("Zone_1_enrolled", arrEnroll.get(0)); +// map.put("Zone_1_punched", arrPunched.get(0)); +// map.put("Absent_1", Absent_1); +// map.put("Percentage_1", Percentage_1); +// map.put("Zone_2", 2); +// map.put("Zone_2_enrolled", arrEnroll.get(1)); +// map.put("Zone_2_punched", arrPunched.get(1)); +// map.put("Absent_2", Absent_2); +// map.put("Percentage_2", Percentage_2); +// map.put("Zone_3", 3); +// map.put("Zone_3_enrolled", arrEnroll.get(2)); +// map.put("Zone_3_punched", arrPunched.get(2)); +// map.put("Absent_3", Absent_3); +// map.put("Percentage_3", Percentage_3); +// map.put("Zone_4", 4); +// map.put("Zone_4_enrolled", arrEnroll.get(3)); +// map.put("Zone_4_punched", arrPunched.get(0)); +// map.put("Absent_4", Absent_4); +// map.put("Percentage_4", Percentage_4); +// map.put("Zone_5", 5); +// map.put("Zone_5_enrolled", arrEnroll.get(4)); +// map.put("Zone_5_punched", arrPunched.get(4)); +// map.put("Absent_5", Absent_5); +// map.put("Percentage_5", Percentage_5); +// map.put("Zone_6", 6); +// map.put("Zone_6_enrolled", arrEnroll.get(5)); +// map.put("Zone_6_punched", arrPunched.get(5)); +// map.put("Absent_6", Absent_6); +// map.put("Percentage_6", Percentage_6); +// map.put("Zone_7", 7); +// map.put("Zone_7_enrolled", arrEnroll.get(6)); +// map.put("Zone_7_punched", arrPunched.get(6)); +// map.put("Absent_7", Absent_7); +// map.put("Percentage_7", Percentage_7); +// map.put("Zone_8", 8); +// map.put("Zone_8_enrolled", arrEnroll.get(7)); +// map.put("Zone_8_punched", arrPunched.get(7)); +// map.put("Absent_8", Absent_8); +// map.put("Percentage_8", Percentage_8); +// map.put("Zone_9", 9); +// map.put("Zone_9_enrolled", arrEnroll.get(8)); +// map.put("Zone_9_punched", arrPunched.get(8)); +// map.put("Absent_9", Absent_9); +// map.put("Percentage_9", Percentage_9); +// map.put("Zone_10", 10); +// map.put("Zone_10_enrolled", arrEnroll.get(9)); +// map.put("Zone_10_punched", arrPunched.get(9)); +// map.put("Absent_10", Absent_10); +// map.put("Percentage_10", Percentage_10); +// map.put("Zone_11", 11); +// map.put("Zone_11_enrolled", arrEnroll.get(10)); +// map.put("Zone_11_punched", arrPunched.get(10)); +// map.put("Absent_11", Absent_11); +// map.put("Percentage_11", Percentage_11); +// map.put("Zone_12", 12); +// map.put("Zone_12_enrolled", arrEnroll.get(11)); +// map.put("Zone_12_punched", arrPunched.get(11)); +// map.put("Absent_12", Absent_12); +// map.put("Percentage_12", Percentage_12); +// map.put("Zone_13", 13); +// map.put("Zone_13_enrolled", arrEnroll.get(12)); +// map.put("Zone_13_punched", arrPunched.get(12)); +// map.put("Absent_13", Absent_13); +// map.put("Percentage_13", Percentage_13); +// map.put("Zone_14", 14); +// map.put("Zone_14_enrolled", arrEnroll.get(13)); +// map.put("Zone_14_punched", arrPunched.get(13)); +// map.put("Absent_14", Absent_14); +// map.put("Percentage_14", Percentage_14); +// map.put("Zone_15", 15); +// map.put("Zone_15_enrolled", arrEnroll.get(14)); +// map.put("Zone_15_punched", arrPunched.get(14)); +// map.put("Absent_15", Absent_15); +// map.put("Percentage_15", Percentage_15); +// map.put("Zone_16", 16); +// map.put("Zone_16_enrolled", arrEnroll.get(15)); +// map.put("Zone_16_punched", arrPunched.get(15)); +// map.put("Absent_16", Absent_16); +// map.put("Percentage_16", Percentage_16); +// System.out.println("Till 15"); + + +// return map; +// } + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/PunchedEmpListDataController.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/PunchedEmpListDataController.java new file mode 100644 index 0000000..8fc3a11 --- /dev/null +++ b/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> 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + + tempPunchedUserId = punchedEmpListDataRepository.getPunchedDivUserId(divValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(punchedEmpListDataRepository.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> listMap = new ArrayList>(); + + if (!PunchedUserId.isEmpty()) { + + for (int i = 0; i < PunchedUserId.size(); i++) { + + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + final Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// ----------------Unit office Enrolled--------------- + + @GetMapping({ "/getUnitPunchedEmpList/{unit}/{tempDate}" }) + public List> 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + + tempPunchedUserId = punchedEmpListDataRepository.getPunchedUnitUserId(unitValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(punchedEmpListDataRepository.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> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + final Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------Lorry office Enrolled------------------------ + + @GetMapping({ "/getLorryPunchedEmpList/{zone}/{tempDate}" }) + public List> 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + + tempPunchedUserId = punchedEmpListDataRepository.getPunchedLorryUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(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> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + final Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------zonal office Enrolled----------------------- + + @GetMapping({ "/getZonalPunchedEmpList/{zone}/{tempDate}" }) + public List> 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + + tempPunchedUserId = punchedEmpListDataRepository.getPunchedZonalUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(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> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + final Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------Department office Enrolled--------------------------- + + @GetMapping({ "/getDeptPunchedEmpList/{dept}/{tempDate}" }) + public List> 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + + tempPunchedUserId = punchedEmpListDataRepository.getPunchedDeptUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(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> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------RDC office Enrolled--------------------------- + + @GetMapping({ "/getRDCPunchedEmpList/{zone}/{tempDate}" }) + public List> 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = punchedEmpListDataRepository.getPunchedRDCUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(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> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/RegionalDeputyCommissionerController.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/RegionalDeputyCommissionerController.java new file mode 100644 index 0000000..3e1fc67 --- /dev/null +++ b/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 arrRDCEnroll; + ArrayList arrRDCPunched; + ArrayList arrRDCZoneNames; + + @GetMapping("/RegionalDeputyCommissionerOfficeData/{tempDate}") + public LinkedHashMap 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 map = new LinkedHashMap<>(); + + LinkedHashMap 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 arrZonalTotalEnroll; + ArrayList arrZonalTotalPunched; + + @GetMapping("/TotalZonalOfficeEmployeeData/{tempDate}") + public LinkedHashMap 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 map = new LinkedHashMap<>(); + + LinkedHashMap 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>> 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 zoneDivisions; + ArrayList zoneDivisionsOnDate; + ArrayList divEnrolled; + ArrayList 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> listMap = new ArrayList>(); + for (int i = 0; i myListKey = new ArrayList<>(); + ArrayList 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 map = new LinkedHashMap<>(); + + for(int x=0;x allUnitsAsPerZone; + ArrayList unitEnrolled; + ArrayList unitAsEnrolled; + ArrayList unitPunched; + ArrayList 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> listMap = new ArrayList>(); + for (int i = 0; i myListKey = new ArrayList<>(); + ArrayList 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 map = new LinkedHashMap<>(); + for(int x=0;x zoneDivisions; + ArrayList zoneDivisionsOnDate; + ArrayList divEnrolled; + ArrayList 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> listMap = new ArrayList>(); + for (int i = 0; i myListKey = new ArrayList<>(); + ArrayList 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 map = new LinkedHashMap<>(); + for(int x=0;x zoneDivisions; + ArrayList zoneDivisionsOnDate; + ArrayList divEnrolled; + ArrayList 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> listMap = new ArrayList>(); + for (int i = 0; i myListKey = new ArrayList<>(); + ArrayList 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 map = new LinkedHashMap<>(); + for(int x=0;x zoneDivisions; + ArrayList zoneDivisionsOnDate; + ArrayList divEnrolled; + ArrayList 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> listMap = new ArrayList>(); + for (Integer i = 0; i myListKey = new ArrayList<>(); + ArrayList 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 map = new LinkedHashMap<>(); + for(int x=0;x> 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 tempAbsentUserId = new ArrayList<>(); + ArrayList AbsentUserName = new ArrayList<>(); + ArrayList AbsentUserDesignation = new ArrayList<>(); + + tempAbsentUserId = nMRAbsenteesEmpListDataRepository.getAbsentDivUserId(divValue, date); + + ArrayList AbsentUserId = new ArrayList(); + 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(nMRAbsenteesEmpListDataRepository.getAbsentDivUserName(AbsentUserId.get(i)).trim()); + AbsentUserDesignation.add(nMRAbsenteesEmpListDataRepository.getAbsentDivDesignation(AbsentUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(AbsentUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(AbsentUserDesignation.size()); + + List> listMap = new ArrayList>(); + + if (!AbsentUserId.isEmpty()) { + + for (int i = 0; i < AbsentUserId.size(); i++) { + + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + 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 map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// ----------------Unit office Enrolled--------------- + + @GetMapping({ "/getUnitAbsentEmpList/{unit}/{tempDate}" }) + public List> 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + + tempPunchedUserId = nMRAbsenteesEmpListDataRepository.getAbsentUnitUserId(unitValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRAbsenteesEmpListDataRepository.getAbsentUnitUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRAbsenteesEmpListDataRepository.getAbsentUnitDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + final Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------Lorry office Enrolled------------------------ + + @GetMapping({ "/getLorryAbsentEmpList/{zone}/{tempDate}" }) + public List> 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + + tempPunchedUserId = nMRAbsenteesEmpListDataRepository.getAbsentLorryUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRAbsenteesEmpListDataRepository.getAbsentLorryUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRAbsenteesEmpListDataRepository.getAbsentLorryDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + final Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------zonal office Enrolled----------------------- + + @GetMapping({ "/getZonalAbsentEmpList/{zone}/{tempDate}" }) + public List> 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + + tempPunchedUserId = nMRAbsenteesEmpListDataRepository.getAbsentZonalUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRAbsenteesEmpListDataRepository.getAbsentZonalUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRAbsenteesEmpListDataRepository.getAbsentZonalDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + final Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------Department office Enrolled--------------------------- + + @GetMapping({"/getDeptAbsentEmpList/{dept}/{tempDate}" }) + public List> 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + + tempPunchedUserId = nMRAbsenteesEmpListDataRepository.getAbsentDeptUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRAbsenteesEmpListDataRepository.getAbsentDeptUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRAbsenteesEmpListDataRepository.getAbsentDeptDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------RDC office Enrolled--------------------------- + + @GetMapping({"/getRDCAbsentEmpList/{zone}/{tempDate}" }) + public List> 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRAbsenteesEmpListDataRepository.getAbsentRDCUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRAbsenteesEmpListDataRepository.getAbsentRDCUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRAbsenteesEmpListDataRepository.getAbsentRDCDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------LFZ----------------------------------------- + +@GetMapping({ "/getLFZAbsentEmpList/{zone}/{tempDate}" }) +public List> getLFZAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRAbsenteesEmpListDataRepository.getAbsentLFZUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRAbsenteesEmpListDataRepository.getAbsentLFZUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRAbsenteesEmpListDataRepository.getAbsentLFZDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} + + + // ----------------------PRINTING PRESS----------------------------------------- + +@GetMapping({ "/getPPAbsentEmpList/{zone}/{tempDate}" }) +public List> getPPAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRAbsenteesEmpListDataRepository.getAbsentPPUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRAbsenteesEmpListDataRepository.getAbsentPPUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRAbsenteesEmpListDataRepository.getAbsentPPDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} + + // ----------------------NORTH CHENNAI DEPOT----------------------------------------- + +@GetMapping({ "/getNCDAbsentEmpList/{zone}/{tempDate}" }) +public List> getNCDPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRAbsenteesEmpListDataRepository.getAbsentNCDUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRAbsenteesEmpListDataRepository.getAbsentNCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRAbsenteesEmpListDataRepository.getAbsentNCDDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} + + // ----------------------TASK FORCE----------------------------------------- + +@GetMapping({ "/getTFAbsentEmpList/{zone}/{tempDate}" }) +public List> getTFAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRAbsenteesEmpListDataRepository.getAbsentTFUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRAbsenteesEmpListDataRepository.getAbsentTFUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRAbsenteesEmpListDataRepository.getAbsentTFDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} + + // ----------------------TPF----------------------------------------- + +@GetMapping({ "/getTPFAbsentEmpList/{zone}/{tempDate}" }) +public List> getTPFAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRAbsenteesEmpListDataRepository.getAbsentTPFUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRAbsenteesEmpListDataRepository.getAbsentTPFUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRAbsenteesEmpListDataRepository.getAbsentTPFDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} + + // ----------------------CENTRAL CHENNAI DEPOT----------------------------------------- + +@GetMapping({ "/getCCDAbsentEmpList/{zone}/{tempDate}" }) +public List> getCCDAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRAbsenteesEmpListDataRepository.getAbsentCCDUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRAbsenteesEmpListDataRepository.getAbsentCCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRAbsenteesEmpListDataRepository.getAbsentCCDDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} + + // ----------------------PDG----------------------------------------- + +@GetMapping({ "/getPDGAbsentEmpList/{zone}/{tempDate}" }) +public List> getPDGAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRAbsenteesEmpListDataRepository.getAbsentPDGUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRAbsenteesEmpListDataRepository.getAbsentPDGUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRAbsenteesEmpListDataRepository.getAbsentPDGDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} + + // ----------------------SOUTH CHENNAI DEPOT SCD----------------------------------------- + +@GetMapping({ "/getSCDAbsentEmpList/{zone}/{tempDate}" }) +public List> getSCDAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRAbsenteesEmpListDataRepository.getAbsentSCDUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRAbsenteesEmpListDataRepository.getAbsentSCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRAbsenteesEmpListDataRepository.getAbsentSCDDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} + + // ----------------------INSPECTION VEHICLE----------------------------------------- + +@GetMapping({ "/getIVAbsentEmpList/{zone}/{tempDate}" }) +public List> getIVAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRAbsenteesEmpListDataRepository.getAbsentIVUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRAbsenteesEmpListDataRepository.getAbsentIVUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRAbsenteesEmpListDataRepository.getAbsentIVDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} + + // ----------------------KDG----------------------------------------- + +@GetMapping({ "/getKDGAbsentEmpList/{zone}/{tempDate}" }) +public List> getKDGAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRAbsenteesEmpListDataRepository.getAbsentKDGUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRAbsenteesEmpListDataRepository.getAbsentKDGUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRAbsenteesEmpListDataRepository.getAbsentKDGDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMRDeptHeadQuaterOfficeController.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMRDeptHeadQuaterOfficeController.java new file mode 100644 index 0000000..9d53ddb --- /dev/null +++ b/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>> 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 allHQDepartments; + ArrayList allHQDeptAsperPunched; + ArrayList hqDeptEnrolled; + ArrayList hqDeptPunched; + ArrayList 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> listMap = new ArrayList>(); + for (int i = 0; i myListKey = new ArrayList<>(); + ArrayList 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 map = new LinkedHashMap<>(); + for(int x=0;x EnrolledUserId; + ArrayList EnrolledUserName; + ArrayList EnrolledUserDesignation; + + + // ----------------------Division office Enrolled----------------------------------------- + + @GetMapping({ "/getDivEnrolledEmpList/{div}" }) + public List> getDivEnrolledEmpList(@PathVariable String div) { + + String divValue = div; + + System.out.println(divValue); + + EnrolledUserId = nMREnrolledEmpListDataRepository.getEnrolledDivUserId(divValue); + EnrolledUserName = nMREnrolledEmpListDataRepository.getEnrolledDivUserName(divValue); + EnrolledUserDesignation = nMREnrolledEmpListDataRepository.getEnrolledDivDesignation(divValue); + + System.out.println(EnrolledUserId.size()); + List> listMap = new ArrayList>(); + if (!EnrolledUserId.isEmpty()) { + for (int i = 0; i < EnrolledUserId.size(); ++i) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + 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 map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); ++x) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); ++x2) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + + // ----------------------Unit office Enrolled----------------------------------------- + + @GetMapping({ "/getUnitEnrolledEmpList/{unit}" }) + public List> getUnitEnrolledEmpList(@PathVariable String unit) { + + String unitValue = unit; + + System.out.println(unitValue); + + EnrolledUserId = nMREnrolledEmpListDataRepository.getEnrolledUnitUserId(unitValue); + EnrolledUserName = nMREnrolledEmpListDataRepository.getEnrolledUnitUserName(unitValue); + EnrolledUserDesignation = nMREnrolledEmpListDataRepository.getEnrolledUnitDesignation(unitValue); + System.out.println(EnrolledUserId.size()); + List> listMap = new ArrayList>(); + if (!EnrolledUserId.isEmpty()) { + for (int i = 0; i < EnrolledUserId.size(); ++i) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + 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 map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); ++x) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); ++x2) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------Lorry office Enrolled----------------------------------------- + + @GetMapping({ "/getLorryEnrolledEmpList/{zone}" }) + public List> getLorryEnrolledEmpList(@PathVariable Integer zone) { + + Integer zoneValue = zone; + + if(zoneValue==1 || zoneValue==2 || zoneValue==3) + { + zoneValue = 1; + } + + System.out.println(zoneValue); + + EnrolledUserId = nMREnrolledEmpListDataRepository.getEnrolledLorryUserId(zoneValue); + EnrolledUserName = nMREnrolledEmpListDataRepository.getEnrolledLorryUserName(zoneValue); + EnrolledUserDesignation = nMREnrolledEmpListDataRepository.getEnrolledLorryDesignation(zoneValue); + System.out.println(EnrolledUserId.size()); + List> listMap = new ArrayList>(); + if (!EnrolledUserId.isEmpty()) { + for (int i = 0; i < EnrolledUserId.size(); ++i) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + 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 map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); ++x) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); ++x2) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + + +// // ----------------------zonal office Enrolled----------------------------------------- + + @GetMapping({ "/getZonalEnrolledEmpList/{zone}" }) + public List> getZonalEnrolledEmpList(@PathVariable Integer zone) { + + Integer zoneValue = zone; + + System.out.println(zoneValue); + + EnrolledUserId = nMREnrolledEmpListDataRepository.getEnrolledZonalUserId(zoneValue); + EnrolledUserName = nMREnrolledEmpListDataRepository.getEnrolledZonalUserName(zoneValue); + EnrolledUserDesignation = nMREnrolledEmpListDataRepository.getEnrolledZonalDesignation(zoneValue); + System.out.println(EnrolledUserId.size()); + List> listMap = new ArrayList>(); + if (!EnrolledUserId.isEmpty()) { + for (int i = 0; i < EnrolledUserId.size(); ++i) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + 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 map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); ++x) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); ++x2) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------Department office Enrolled----------------------------------------- + + @GetMapping({ "/getDeptEnrolledEmpList/{dept}" }) + public List> getDeptEnrolledEmpList(@PathVariable String dept) { + +String zoneValue = dept; + + System.out.println(zoneValue); + + EnrolledUserId = nMREnrolledEmpListDataRepository.getEnrolledDeptUserId(zoneValue); + EnrolledUserName = nMREnrolledEmpListDataRepository.getEnrolledDeptUserName(zoneValue); + EnrolledUserDesignation = nMREnrolledEmpListDataRepository.getEnrolledDeptDesignation(zoneValue); + System.out.println(EnrolledUserId.size()); + List> listMap = new ArrayList>(); + if (!EnrolledUserId.isEmpty()) { + for (int i = 0; i < EnrolledUserId.size(); ++i) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + 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 map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); ++x) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); ++x2) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------RDC office Enrolled----------------------------------------- + + @GetMapping({ "/getRDCEnrolledEmpList/{zone}" }) + public List> getRDCEnrolledEmpList(@PathVariable Integer zone) { + + Integer zoneValue = zone; + + System.out.println(zoneValue); + + EnrolledUserId = nMREnrolledEmpListDataRepository.getEnrolledRDCUserId(zoneValue); + EnrolledUserName = nMREnrolledEmpListDataRepository.getEnrolledRDCUserName(zoneValue); + EnrolledUserDesignation = nMREnrolledEmpListDataRepository.getEnrolledRDCDesignation(zoneValue); + System.out.println(EnrolledUserId.size()); + List> listMap = new ArrayList>(); + if (!EnrolledUserId.isEmpty()) { + for (int i = 0; i < EnrolledUserId.size(); ++i) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + 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 map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); ++x) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); ++x2) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------LFZ----------------------------------------- + + @GetMapping({ "/getLFZEnrolledEmpList/{zone}" }) + public List> getLFZEnrolledEmpList(@PathVariable Integer zone) { + + Integer zoneValue = zone; + + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMREnrolledEmpListDataRepository.getEnrolledLFZUserId(zoneValue); + System.out.println(tempPunchedUserId.size()); + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMREnrolledEmpListDataRepository.getEnrolledLFZUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMREnrolledEmpListDataRepository.getEnrolledLFZDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printedd"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------PRINTING PRESS----------------------------------------- + + @GetMapping({ "/getPPEnrolledEmpList/{zone}" }) + public List> getPPEnrolledEmpList(@PathVariable Integer zone) { + + Integer zoneValue = zone; + + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMREnrolledEmpListDataRepository.getEnrolledPPUserId(zoneValue); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMREnrolledEmpListDataRepository.getEnrolledPPUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMREnrolledEmpListDataRepository.getEnrolledPPDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------NORTH CHENNAI DEPOT----------------------------------------- + + @GetMapping({ "/getNCDEnrolledEmpList/{zone}" }) + public List> getNCDEnrolledEmpList(@PathVariable Integer zone) { + + Integer zoneValue = zone; + + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMREnrolledEmpListDataRepository.getEnrolledNCDUserId(zoneValue); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMREnrolledEmpListDataRepository.getEnrolledNCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMREnrolledEmpListDataRepository.getEnrolledNCDDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------TASK FORCE----------------------------------------- + + @GetMapping({ "/getTFEnrolledEmpList/{zone}" }) + public List> getTFEnrolledEmpList(@PathVariable Integer zone) { + + Integer zoneValue = zone; + + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMREnrolledEmpListDataRepository.getEnrolledTFUserId(zoneValue); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMREnrolledEmpListDataRepository.getEnrolledTFUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMREnrolledEmpListDataRepository.getEnrolledTFDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------TPF----------------------------------------- + + @GetMapping({ "/getTPFEnrolledEmpList/{zone}" }) + public List> getTPFEnrolledEmpList(@PathVariable Integer zone) { + + Integer zoneValue = zone; + + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMREnrolledEmpListDataRepository.getEnrolledTPFUserId(zoneValue); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMREnrolledEmpListDataRepository.getEnrolledTPFUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMREnrolledEmpListDataRepository.getEnrolledTPFDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------CENTRAL CHENNAI DEPOT----------------------------------------- + + @GetMapping({ "/getCCDEnrolledEmpList/{zone}" }) + public List> getCCDEnrolledEmpList(@PathVariable Integer zone) { + + Integer zoneValue = zone; + + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMREnrolledEmpListDataRepository.getEnrolledCCDUserId(zoneValue); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMREnrolledEmpListDataRepository.getEnrolledCCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMREnrolledEmpListDataRepository.getEnrolledCCDDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------PDG----------------------------------------- + + @GetMapping({ "/getPDGEnrolledEmpList/{zone}" }) + public List> getPDGEnrolledEmpList(@PathVariable Integer zone) { + + Integer zoneValue = zone; + + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMREnrolledEmpListDataRepository.getEnrolledPDGUserId(zoneValue); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMREnrolledEmpListDataRepository.getEnrolledPDGUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMREnrolledEmpListDataRepository.getEnrolledPDGDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------SOUTH CHENNAI DEPOT SCD----------------------------------------- + + @GetMapping({ "/getSCDEnrolledEmpList/{zone}" }) + public List> getSCDEnrolledEmpList(@PathVariable Integer zone) { + + Integer zoneValue = zone; + + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMREnrolledEmpListDataRepository.getEnrolledSCDUserId(zoneValue); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMREnrolledEmpListDataRepository.getEnrolledSCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMREnrolledEmpListDataRepository.getEnrolledSCDDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------INSPECTION VEHICLE----------------------------------------- + + @GetMapping({ "/getIVEnrolledEmpList/{zone}" }) + public List> getIVEnrolledEmpList(@PathVariable Integer zone) { + + Integer zoneValue = zone; + + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMREnrolledEmpListDataRepository.getEnrolledIVUserId(zoneValue); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMREnrolledEmpListDataRepository.getEnrolledIVUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMREnrolledEmpListDataRepository.getEnrolledIVDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------KDG----------------------------------------- + + @GetMapping({ "/getKDGEnrolledEmpList/{zone}" }) + public List> getKDGEnrolledEmpList(@PathVariable Integer zone) { + + Integer zoneValue = zone; + + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMREnrolledEmpListDataRepository.getEnrolledKDGUserId(zoneValue); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMREnrolledEmpListDataRepository.getEnrolledKDGUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMREnrolledEmpListDataRepository.getEnrolledKDGDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMRHeadQuaterTotalEntriesRestController.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMRHeadQuaterTotalEntriesRestController.java new file mode 100644 index 0000000..a3a0c02 --- /dev/null +++ b/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 arrZoneEnroll; + ArrayList arrZonePunched; + + @GetMapping("/HQTotalEmpCountPresentAbsentPercentage/{tempDate}") + public LinkedHashMap 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 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 getTheEnrolledAndPunchedAbsPer(@RequestParam(value = "date")@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)String date) { +// +// arrEnroll = headQuaterEntriesRepository.getEnrolled(); +// arrPunched = headQuaterEntriesRepository.getPunched(date); +// LinkedHashMap map = new LinkedHashMap<>(); +// +// +// Integer Absent_1 = arrEnroll.get(0) - arrPunched.get(0); +// Integer Absent_2 = arrEnroll.get(1) - arrPunched.get(1); +// Integer Absent_3 = arrEnroll.get(2) - arrPunched.get(2); +// Integer Absent_4 = arrEnroll.get(3) - arrPunched.get(3); +// Integer Absent_5 = arrEnroll.get(4) - arrPunched.get(4); +// Integer Absent_6 = arrEnroll.get(5) - arrPunched.get(5); +// Integer Absent_7 = arrEnroll.get(6) - arrPunched.get(6); +// Integer Absent_8 = arrEnroll.get(7) - arrPunched.get(7); +// Integer Absent_9 = arrEnroll.get(8) - arrPunched.get(8); +// Integer Absent_10 = arrEnroll.get(9) - arrPunched.get(9); +// Integer Absent_11 = arrEnroll.get(10) - arrPunched.get(10); +// Integer Absent_12 = arrEnroll.get(11) - arrPunched.get(11); +// Integer Absent_13 = arrEnroll.get(12) - arrPunched.get(12); +// Integer Absent_14 = arrEnroll.get(13) - arrPunched.get(13); +// Integer Absent_15 = arrEnroll.get(14) - arrPunched.get(14); +// Integer Absent_16 = arrEnroll.get(15) - arrPunched.get(15); +// +// Integer Percentage_1 = ((arrPunched.get(0) *100)/ arrEnroll.get(0)); +// Integer Percentage_2 = ((arrPunched.get(1) *100)/ arrEnroll.get(1)); +// Integer Percentage_3 = ((arrPunched.get(2) *100)/ arrEnroll.get(2)); +// Integer Percentage_4 = ((arrPunched.get(3) *100)/ arrEnroll.get(3)); +// Integer Percentage_5 = ((arrPunched.get(4) *100)/ arrEnroll.get(4)); +// Integer Percentage_6 = ((arrPunched.get(5) *100)/ arrEnroll.get(5)); +// Integer Percentage_7 = ((arrPunched.get(6) *100)/ arrEnroll.get(6)); +// Integer Percentage_8 = ((arrPunched.get(7) *100)/ arrEnroll.get(7)); +// Integer Percentage_9 = ((arrPunched.get(8) *100)/ arrEnroll.get(8)); +// Integer Percentage_10 = ((arrPunched.get(9) *100)/ arrEnroll.get(9)); +// Integer Percentage_11 = ((arrPunched.get(10) *100)/ arrEnroll.get(10)); +// Integer Percentage_12 = ((arrPunched.get(11) *100)/ arrEnroll.get(11)); +// Integer Percentage_13 = ((arrPunched.get(12) *100)/ arrEnroll.get(12)); +// Integer Percentage_14 = ((arrPunched.get(13) *100)/ arrEnroll.get(13)); +// Integer Percentage_15 = ((arrPunched.get(14) *100)/ arrEnroll.get(14)); +// Integer Percentage_16 = ((arrPunched.get(15) *100)/ arrEnroll.get(15)); +// +// +// +// map.put("Zone_1", 1); +// map.put("Zone_1_enrolled", arrEnroll.get(0)); +// map.put("Zone_1_punched", arrPunched.get(0)); +// map.put("Absent_1", Absent_1); +// map.put("Percentage_1", Percentage_1); +// map.put("Zone_2", 2); +// map.put("Zone_2_enrolled", arrEnroll.get(1)); +// map.put("Zone_2_punched", arrPunched.get(1)); +// map.put("Absent_2", Absent_2); +// map.put("Percentage_2", Percentage_2); +// map.put("Zone_3", 3); +// map.put("Zone_3_enrolled", arrEnroll.get(2)); +// map.put("Zone_3_punched", arrPunched.get(2)); +// map.put("Absent_3", Absent_3); +// map.put("Percentage_3", Percentage_3); +// map.put("Zone_4", 4); +// map.put("Zone_4_enrolled", arrEnroll.get(3)); +// map.put("Zone_4_punched", arrPunched.get(0)); +// map.put("Absent_4", Absent_4); +// map.put("Percentage_4", Percentage_4); +// map.put("Zone_5", 5); +// map.put("Zone_5_enrolled", arrEnroll.get(4)); +// map.put("Zone_5_punched", arrPunched.get(4)); +// map.put("Absent_5", Absent_5); +// map.put("Percentage_5", Percentage_5); +// map.put("Zone_6", 6); +// map.put("Zone_6_enrolled", arrEnroll.get(5)); +// map.put("Zone_6_punched", arrPunched.get(5)); +// map.put("Absent_6", Absent_6); +// map.put("Percentage_6", Percentage_6); +// map.put("Zone_7", 7); +// map.put("Zone_7_enrolled", arrEnroll.get(6)); +// map.put("Zone_7_punched", arrPunched.get(6)); +// map.put("Absent_7", Absent_7); +// map.put("Percentage_7", Percentage_7); +// map.put("Zone_8", 8); +// map.put("Zone_8_enrolled", arrEnroll.get(7)); +// map.put("Zone_8_punched", arrPunched.get(7)); +// map.put("Absent_8", Absent_8); +// map.put("Percentage_8", Percentage_8); +// map.put("Zone_9", 9); +// map.put("Zone_9_enrolled", arrEnroll.get(8)); +// map.put("Zone_9_punched", arrPunched.get(8)); +// map.put("Absent_9", Absent_9); +// map.put("Percentage_9", Percentage_9); +// map.put("Zone_10", 10); +// map.put("Zone_10_enrolled", arrEnroll.get(9)); +// map.put("Zone_10_punched", arrPunched.get(9)); +// map.put("Absent_10", Absent_10); +// map.put("Percentage_10", Percentage_10); +// map.put("Zone_11", 11); +// map.put("Zone_11_enrolled", arrEnroll.get(10)); +// map.put("Zone_11_punched", arrPunched.get(10)); +// map.put("Absent_11", Absent_11); +// map.put("Percentage_11", Percentage_11); +// map.put("Zone_12", 12); +// map.put("Zone_12_enrolled", arrEnroll.get(11)); +// map.put("Zone_12_punched", arrPunched.get(11)); +// map.put("Absent_12", Absent_12); +// map.put("Percentage_12", Percentage_12); +// map.put("Zone_13", 13); +// map.put("Zone_13_enrolled", arrEnroll.get(12)); +// map.put("Zone_13_punched", arrPunched.get(12)); +// map.put("Absent_13", Absent_13); +// map.put("Percentage_13", Percentage_13); +// map.put("Zone_14", 14); +// map.put("Zone_14_enrolled", arrEnroll.get(13)); +// map.put("Zone_14_punched", arrPunched.get(13)); +// map.put("Absent_14", Absent_14); +// map.put("Percentage_14", Percentage_14); +// map.put("Zone_15", 15); +// map.put("Zone_15_enrolled", arrEnroll.get(14)); +// map.put("Zone_15_punched", arrPunched.get(14)); +// map.put("Absent_15", Absent_15); +// map.put("Percentage_15", Percentage_15); +// map.put("Zone_16", 16); +// map.put("Zone_16_enrolled", arrEnroll.get(15)); +// map.put("Zone_16_punched", arrPunched.get(15)); +// map.put("Absent_16", Absent_16); +// map.put("Percentage_16", Percentage_16); +// System.out.println("Till 15"); + + +// return map; +// } + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMRHeadQuaterZonesEntriesRestController.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMRHeadQuaterZonesEntriesRestController.java new file mode 100644 index 0000000..51c9c3a --- /dev/null +++ b/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 arrZoneEnroll; + ArrayList arrZonePunched; + ArrayList zonesAsPerEnroll; + ArrayList zonesAsPerPunched; + + @GetMapping("/HQZonesEmpCountPresentAbsentPercentage/{tempDate}") + public LinkedHashMap 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 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; + + } + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMROtherZoneOfficesController.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMROtherZoneOfficesController.java new file mode 100644 index 0000000..f1f4fa2 --- /dev/null +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMROtherZoneOfficesController.java @@ -0,0 +1,1073 @@ +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.NMROtherZoneOfficesRepository; + +@RestController +@RequestMapping("/gcc.com/NMR") +public class NMROtherZoneOfficesController { + + @Autowired + private NMROtherZoneOfficesRepository nMROtherZoneOfficesRepository; + + @Autowired + public NMROtherZoneOfficesController(NMROtherZoneOfficesRepository theNMROtherZoneOfficesRepository) { + nMROtherZoneOfficesRepository = theNMROtherZoneOfficesRepository; + } + + + + @GetMapping("/OtherOfficesEmpCountPresentAbsentPercentage/{zone}/{officeTypes}/{tempDate}") + public ResponseEntity>> getDivEnrollPunchAbsentPercentage(@PathVariable Integer zone, + @PathVariable String officeTypes, @PathVariable String tempDate) + { + System.out.println("Inside OtherOfficesEmpCountPresentAbsentPercentage() method!"); + Integer zoneValue = zone; + String officeType = officeTypes; + + + //LFZ + + + if (officeType.equals("LFZ")) { + System.out.println("for LFZ 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 divEnrolled; + ArrayList divPunched; + + + divEnrolled = nMROtherZoneOfficesRepository.getLFZEnrolled(zoneValue); + divPunched = nMROtherZoneOfficesRepository.getLFZPunched(zoneValue, date); + + System.out.println("Enrolled: "+divEnrolled); + System.out.println("Punched: "+divPunched); + + String divAbsent = null; + String divPercentage = null; + Integer j = 0; + + List> listMap = new ArrayList>(); + if(!divEnrolled.isEmpty()) + { + for (int i = 0; i <1; i++) { + + + ArrayList myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("LFZ"); + myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i)); + + if(!divPunched.isEmpty()) + { + myListKey.add("Punched"); myListValue.add(divPunched.get(i)); + 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(); + } + else + { + myListKey.add("Punched"); myListValue.add("0"); + Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt("0"); + Integer xdivPercentage = ((Integer.parseInt("0")) *100)/ Integer.parseInt(divEnrolled.get(i)); + divAbsent = xDivAbsent.toString(); + divPercentage = xdivPercentage.toString(); + } + + myListKey.add("Absent"); myListValue.add(divAbsent); + myListKey.add("Percentage"); myListValue.add(divPercentage); + + Map map = new LinkedHashMap<>(); + + for(int x=0;x myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("LFZ"); + 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 map = new LinkedHashMap<>(); + + for(int x=0;x divEnrolled; + ArrayList divPunched; + + + divEnrolled = nMROtherZoneOfficesRepository.getPRINTINGPRESSEnrolled(zoneValue); + divPunched = nMROtherZoneOfficesRepository.getPRINTINGPRESSPunched(zoneValue, date); + + System.out.println("Enrolled: "+divEnrolled); + System.out.println("Punched: "+divPunched); + + String divAbsent = null; + String divPercentage = null; + Integer j = 0; + + List> listMap = new ArrayList>(); + if(!divEnrolled.isEmpty()) + { + for (int i = 0; i <1; i++) { + + + ArrayList myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("Printing Press"); + myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i)); + if(!divPunched.isEmpty()) + { + myListKey.add("Punched"); myListValue.add(divPunched.get(i)); + 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(); + } + else + { + myListKey.add("Punched"); myListValue.add("0"); + Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt("0"); + Integer xdivPercentage = ((Integer.parseInt("0")) *100)/ Integer.parseInt(divEnrolled.get(i)); + divAbsent = xDivAbsent.toString(); + divPercentage = xdivPercentage.toString(); + } + + myListKey.add("Absent"); myListValue.add(divAbsent); + myListKey.add("Percentage"); myListValue.add(divPercentage); + + Map map = new LinkedHashMap<>(); + + for(int x=0;x myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("Printing Press"); + 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 map = new LinkedHashMap<>(); + + for(int x=0;x divEnrolled; + ArrayList divPunched; + + + divEnrolled = nMROtherZoneOfficesRepository.getNCDEnrolled(zoneValue); + divPunched = nMROtherZoneOfficesRepository.getNCDPunched(zoneValue, date); + + + System.out.println("Enrolled: "+divEnrolled); + System.out.println("Punched: "+divPunched); + + + String divAbsent = null; + String divPercentage = null; + Integer j = 0; + + List> listMap = new ArrayList>(); + + if(!divEnrolled.isEmpty()) + { + for (int i = 0; i <1; i++) { + + + ArrayList myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("North Chennai Depot"); + myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i)); + if(!divPunched.isEmpty()) + { + myListKey.add("Punched"); myListValue.add(divPunched.get(i)); + 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(); + } + else + { + myListKey.add("Punched"); myListValue.add("0"); + Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt("0"); + Integer xdivPercentage = ((Integer.parseInt("0")) *100)/ Integer.parseInt(divEnrolled.get(i)); + divAbsent = xDivAbsent.toString(); + divPercentage = xdivPercentage.toString(); + } + + myListKey.add("Absent"); myListValue.add(divAbsent); + myListKey.add("Percentage"); myListValue.add(divPercentage); + + Map map = new LinkedHashMap<>(); + + for(int x=0;x myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("North Chennai Depot"); + 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 map = new LinkedHashMap<>(); + + for(int x=0;x divEnrolled; + ArrayList divPunched; + + + divEnrolled = nMROtherZoneOfficesRepository.getTFEnrolled(zoneValue); + divPunched = nMROtherZoneOfficesRepository.getTFPunched(zoneValue, date); + + System.out.println("Enrolled: "+divEnrolled); + System.out.println("Punched: "+divPunched); + + String divAbsent = null; + String divPercentage = null; + Integer j = 0; + + List> listMap = new ArrayList>(); + if(!divEnrolled.isEmpty()) + { + for (int i = 0; i <1; i++) { + + + ArrayList myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("Task Force"); + myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i)); + if(!divPunched.isEmpty()) + { + myListKey.add("Punched"); myListValue.add(divPunched.get(i)); + 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(); + } + else + { + myListKey.add("Punched"); myListValue.add("0"); + Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt("0"); + Integer xdivPercentage = ((Integer.parseInt("0")) *100)/ Integer.parseInt(divEnrolled.get(i)); + divAbsent = xDivAbsent.toString(); + divPercentage = xdivPercentage.toString(); + } + + + + + myListKey.add("Absent"); myListValue.add(divAbsent); + myListKey.add("Percentage"); myListValue.add(divPercentage); + + Map map = new LinkedHashMap<>(); + + for(int x=0;x myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("Task Force"); + 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 map = new LinkedHashMap<>(); + + for(int x=0;x divEnrolled; + ArrayList divPunched; + + + divEnrolled = nMROtherZoneOfficesRepository.getTPFEnrolled(zoneValue); + divPunched = nMROtherZoneOfficesRepository.getTPFPunched(zoneValue, date); + + System.out.println("Enrolled: "+divEnrolled); + System.out.println("Punched: "+divPunched); + + String divAbsent = null; + String divPercentage = null; + Integer j = 0; + + List> listMap = new ArrayList>(); + if(!divEnrolled.isEmpty()) + { + for (int i = 0; i <1; i++) { + + + ArrayList myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("TPF"); + myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i)); + if(!divPunched.isEmpty()) + { + myListKey.add("Punched"); myListValue.add(divPunched.get(i)); + 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(); + } + else + { + myListKey.add("Punched"); myListValue.add("0"); + Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt("0"); + Integer xdivPercentage = ((Integer.parseInt("0")) *100)/ Integer.parseInt(divEnrolled.get(i)); + divAbsent = xDivAbsent.toString(); + divPercentage = xdivPercentage.toString(); + } + + myListKey.add("Absent"); myListValue.add(divAbsent); + myListKey.add("Percentage"); myListValue.add(divPercentage); + + Map map = new LinkedHashMap<>(); + + for(int x=0;x myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("TPF"); + 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 map = new LinkedHashMap<>(); + + for(int x=0;x divEnrolled; + ArrayList divPunched; + + + divEnrolled = nMROtherZoneOfficesRepository.getCCDEnrolled(zoneValue); + divPunched = nMROtherZoneOfficesRepository.getCCDPunched(zoneValue, date); + + System.out.println("Enrolled: "+divEnrolled); + System.out.println("Punched: "+divPunched); + + String divAbsent = null; + String divPercentage = null; + Integer j = 0; + + List> listMap = new ArrayList>(); + if(!divEnrolled.isEmpty()) + { + for (int i = 0; i <1; i++) { + + + ArrayList myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("Central Chennai Depot"); + myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i)); + if(!divPunched.isEmpty()) + { + myListKey.add("Punched"); myListValue.add(divPunched.get(i)); + 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(); + } + else + { + myListKey.add("Punched"); myListValue.add("0"); + Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt("0"); + Integer xdivPercentage = ((Integer.parseInt("0")) *100)/ Integer.parseInt(divEnrolled.get(i)); + divAbsent = xDivAbsent.toString(); + divPercentage = xdivPercentage.toString(); + } + + myListKey.add("Absent"); myListValue.add(divAbsent); + myListKey.add("Percentage"); myListValue.add(divPercentage); + + Map map = new LinkedHashMap<>(); + + for(int x=0;x myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("Central Chennai Depot"); + 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 map = new LinkedHashMap<>(); + + for(int x=0;x divEnrolled; + ArrayList divPunched; + + + divEnrolled = nMROtherZoneOfficesRepository.getPDGEnrolled(zoneValue); + divPunched = nMROtherZoneOfficesRepository.getPDGPunched(zoneValue, date); + + System.out.println("Enrolled: "+divEnrolled); + System.out.println("Punched: "+divPunched); + + String divAbsent = null; + String divPercentage = null; + Integer j = 0; + + List> listMap = new ArrayList>(); + if(!divEnrolled.isEmpty()) + { + for (int i = 0; i <1; i++) { + + + ArrayList myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("PDG"); + myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i)); + if(!divPunched.isEmpty()) + { + myListKey.add("Punched"); myListValue.add(divPunched.get(i)); + 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(); + } + else + { + myListKey.add("Punched"); myListValue.add("0"); + Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt("0"); + Integer xdivPercentage = ((Integer.parseInt("0")) *100)/ Integer.parseInt(divEnrolled.get(i)); + divAbsent = xDivAbsent.toString(); + divPercentage = xdivPercentage.toString(); + } + + myListKey.add("Absent"); myListValue.add(divAbsent); + myListKey.add("Percentage"); myListValue.add(divPercentage); + + Map map = new LinkedHashMap<>(); + + for(int x=0;x myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("PDG"); + 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 map = new LinkedHashMap<>(); + + for(int x=0;x divEnrolled; + ArrayList divPunched; + + + divEnrolled = nMROtherZoneOfficesRepository.getSCDEnrolled(zoneValue); + divPunched = nMROtherZoneOfficesRepository.getSCDPunched(zoneValue, date); + + System.out.println("Enrolled: "+divEnrolled); + System.out.println("Punched: "+divPunched); + + String divAbsent = null; + String divPercentage = null; + Integer j = 0; + + List> listMap = new ArrayList>(); + + if(!divEnrolled.isEmpty()) + { + for (int i = 0; i <1; i++) { + + + ArrayList myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("South Chennai Depot"); + myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i)); + if(!divPunched.isEmpty()) + { + myListKey.add("Punched"); myListValue.add(divPunched.get(i)); + 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(); + } + else + { + myListKey.add("Punched"); myListValue.add("0"); + Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt("0"); + Integer xdivPercentage = ((Integer.parseInt("0")) *100)/ Integer.parseInt(divEnrolled.get(i)); + divAbsent = xDivAbsent.toString(); + divPercentage = xdivPercentage.toString(); + } + + myListKey.add("Absent"); myListValue.add(divAbsent); + myListKey.add("Percentage"); myListValue.add(divPercentage); + + Map map = new LinkedHashMap<>(); + + for(int x=0;x myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("South Chennai Depot"); + 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 map = new LinkedHashMap<>(); + + for(int x=0;x divEnrolled; + ArrayList divPunched; + + + divEnrolled = nMROtherZoneOfficesRepository.getINSPECTIONVEHICLEEnrolled(zoneValue); + divPunched = nMROtherZoneOfficesRepository.getINSPECTIONVEHICLEPunched(zoneValue, date); + + System.out.println("Enrolled: "+divEnrolled); + System.out.println("Punched: "+divPunched); + + String divAbsent = null; + String divPercentage = null; + Integer j = 0; + + List> listMap = new ArrayList>(); + + if(!divEnrolled.isEmpty()) + { + for (int i = 0; i <1; i++) { + + + ArrayList myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("INSPECTION VEHICLE"); + myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i)); + if(!divPunched.isEmpty()) + { + myListKey.add("Punched"); myListValue.add(divPunched.get(i)); + 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(); + } + else + { + myListKey.add("Punched"); myListValue.add("0"); + Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt("0"); + Integer xdivPercentage = ((Integer.parseInt("0")) *100)/ Integer.parseInt(divEnrolled.get(i)); + divAbsent = xDivAbsent.toString(); + divPercentage = xdivPercentage.toString(); + } + + myListKey.add("Absent"); myListValue.add(divAbsent); + myListKey.add("Percentage"); myListValue.add(divPercentage); + + Map map = new LinkedHashMap<>(); + + for(int x=0;x myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("INSPECTION VEHICLE"); + 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 map = new LinkedHashMap<>(); + + for(int x=0;x divEnrolled; + ArrayList divPunched; + + + divEnrolled = nMROtherZoneOfficesRepository.getKDGEnrolled(zoneValue); + divPunched = nMROtherZoneOfficesRepository.getKDGPunched(zoneValue, date); + + System.out.println("Enrolled: "+divEnrolled); + System.out.println("Punched: "+divPunched); + + String divAbsent = null; + String divPercentage = null; + Integer j = 0; + + List> listMap = new ArrayList>(); + + if(!divEnrolled.isEmpty()) + { + for (int i = 0; i <1; i++) { + + + ArrayList myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("KDG"); + myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i)); + if(!divPunched.isEmpty()) + { + myListKey.add("Punched"); myListValue.add(divPunched.get(i)); + 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(); + } + else + { + myListKey.add("Punched"); myListValue.add("0"); + Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt("0"); + Integer xdivPercentage = ((Integer.parseInt("0")) *100)/ Integer.parseInt(divEnrolled.get(i)); + divAbsent = xDivAbsent.toString(); + divPercentage = xdivPercentage.toString(); + } + + myListKey.add("Absent"); myListValue.add(divAbsent); + myListKey.add("Percentage"); myListValue.add(divPercentage); + + Map map = new LinkedHashMap<>(); + + for(int x=0;x myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("KDG"); + 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 map = new LinkedHashMap<>(); + + for(int x=0;x> 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + + tempPunchedUserId = nMRPunchedEmpListDataRepository.getPunchedDivUserId(divValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRPunchedEmpListDataRepository.getPunchedDivUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRPunchedEmpListDataRepository.getPunchedDivDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + + if (!PunchedUserId.isEmpty()) { + + for (int i = 0; i < PunchedUserId.size(); i++) { + + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + final Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// ----------------Unit office Enrolled--------------- + + @GetMapping({ "/getUnitPunchedEmpList/{unit}/{tempDate}" }) + public List> 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + + tempPunchedUserId = nMRPunchedEmpListDataRepository.getPunchedUnitUserId(unitValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRPunchedEmpListDataRepository.getPunchedUnitUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRPunchedEmpListDataRepository.getPunchedUnitDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + final Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------Lorry office Enrolled------------------------ + + @GetMapping({ "/getLorryPunchedEmpList/{zone}/{tempDate}" }) + public List> 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + + tempPunchedUserId = nMRPunchedEmpListDataRepository.getPunchedLorryUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRPunchedEmpListDataRepository.getPunchedLorryUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRPunchedEmpListDataRepository.getPunchedLorryDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + final Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------zonal office Enrolled----------------------- + + @GetMapping({ "/getZonalPunchedEmpList/{zone}/{tempDate}" }) + public List> 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + + tempPunchedUserId = nMRPunchedEmpListDataRepository.getPunchedZonalUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRPunchedEmpListDataRepository.getPunchedZonalUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRPunchedEmpListDataRepository.getPunchedZonalDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + final Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------Department office Enrolled--------------------------- + + @GetMapping({ "/getDeptPunchedEmpList/{dept}/{tempDate}" }) + public List> 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + + tempPunchedUserId = nMRPunchedEmpListDataRepository.getPunchedDeptUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRPunchedEmpListDataRepository.getPunchedDeptUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRPunchedEmpListDataRepository.getPunchedDeptDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------RDC office Enrolled--------------------------- + + @GetMapping({ "/getRDCPunchedEmpList/{zone}/{tempDate}" }) + public List> 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRPunchedEmpListDataRepository.getPunchedRDCUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRPunchedEmpListDataRepository.getPunchedRDCUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRPunchedEmpListDataRepository.getPunchedRDCDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------LFZ----------------------------------------- + +@GetMapping({ "/getLFZPunchedEmpList/{zone}/{tempDate}" }) +public List> getLFZPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRPunchedEmpListDataRepository.getPunchedLFZUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRPunchedEmpListDataRepository.getPunchedLFZUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRPunchedEmpListDataRepository.getPunchedLFZDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} + + // ----------------------PRINTING PRESS----------------------------------------- + +@GetMapping({ "/getPPPunchedEmpList/{zone}/{tempDate}" }) +public List> getPPPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRPunchedEmpListDataRepository.getPunchedPPUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRPunchedEmpListDataRepository.getPunchedPPUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRPunchedEmpListDataRepository.getPunchedPPDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} + + // ----------------------NORTH CHENNAI DEPOT----------------------------------------- + +@GetMapping({ "/getNCDPunchedEmpList/{zone}/{tempDate}" }) +public List> getNCDPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRPunchedEmpListDataRepository.getPunchedNCDUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRPunchedEmpListDataRepository.getPunchedNCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRPunchedEmpListDataRepository.getPunchedNCDDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} + + // ----------------------TASK FORCE----------------------------------------- + +@GetMapping({ "/getTFPunchedEmpList/{zone}/{tempDate}" }) +public List> getTFPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRPunchedEmpListDataRepository.getPunchedTFUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRPunchedEmpListDataRepository.getPunchedTFUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRPunchedEmpListDataRepository.getPunchedTFDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} + + // ----------------------TPF----------------------------------------- + +@GetMapping({ "/getTPFPunchedEmpList/{zone}/{tempDate}" }) +public List> getTPFPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRPunchedEmpListDataRepository.getPunchedTPFUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRPunchedEmpListDataRepository.getPunchedTPFUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRPunchedEmpListDataRepository.getPunchedTPFDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} + + // ----------------------CENTRAL CHENNAI DEPOT----------------------------------------- + +@GetMapping({ "/getCCDPunchedEmpList/{zone}/{tempDate}" }) +public List> getCCDPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRPunchedEmpListDataRepository.getPunchedCCDUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRPunchedEmpListDataRepository.getPunchedCCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRPunchedEmpListDataRepository.getPunchedCCDDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} + + // ----------------------PDG----------------------------------------- + +@GetMapping({ "/getPDGPunchedEmpList/{zone}/{tempDate}" }) +public List> getPDGPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRPunchedEmpListDataRepository.getPunchedPDGUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRPunchedEmpListDataRepository.getPunchedPDGUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRPunchedEmpListDataRepository.getPunchedPDGDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} + + // ----------------------SOUTH CHENNAI DEPOT SCD----------------------------------------- + +@GetMapping({ "/getSCDPunchedEmpList/{zone}/{tempDate}" }) +public List> getSCDPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRPunchedEmpListDataRepository.getPunchedSCDUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRPunchedEmpListDataRepository.getPunchedSCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRPunchedEmpListDataRepository.getPunchedSCDDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} + + // ----------------------INSPECTION VEHICLE----------------------------------------- + +@GetMapping({ "/getIVPunchedEmpList/{zone}/{tempDate}" }) +public List> getIVPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRPunchedEmpListDataRepository.getPunchedIVUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRPunchedEmpListDataRepository.getPunchedIVUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRPunchedEmpListDataRepository.getPunchedIVDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} + + // ----------------------KDG----------------------------------------- + +@GetMapping({ "/getKDGPunchedEmpList/{zone}/{tempDate}" }) +public List> getKDGPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nMRPunchedEmpListDataRepository.getPunchedKDGUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nMRPunchedEmpListDataRepository.getPunchedKDGUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nMRPunchedEmpListDataRepository.getPunchedKDGDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMRRegionalDeputyCommissionerController.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nmr/NMRRegionalDeputyCommissionerController.java new file mode 100644 index 0000000..f0d2842 --- /dev/null +++ b/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 arrRDCEnroll; + ArrayList arrRDCAsPerEnroll; + ArrayList arrRDCPunched; + ArrayList arrRDCZoneNames; + ArrayList arrRDCZoneNamesAsPerPunched; + + @GetMapping("/RegionalDeputyCommissionerOfficeData/{tempDate}") + public LinkedHashMap 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 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 arrZonalTotalEnroll; + ArrayList arrZonalTotalPunched; + + @GetMapping("/TotalZonalOfficeEmployeeData/{tempDate}") + public LinkedHashMap 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 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>> 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 zoneDivisions; + ArrayList zoneDivisionsOnDate; + ArrayList divEnrolled; + ArrayList divAsPerEnrolled; + ArrayList 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> listMap = new ArrayList>(); + for (int i = 0; i myListKey = new ArrayList<>(); + ArrayList 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 map = new LinkedHashMap<>(); + + for(int x=0;x allUnitsAsPerZone; + ArrayList unitEnrolled; + ArrayList unitAsEnrolled; + ArrayList unitPunched; + ArrayList 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> listMap = new ArrayList>(); + for (int i = 0; i myListKey = new ArrayList<>(); + ArrayList 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 map = new LinkedHashMap<>(); + for(int x=0;x zoneDivisions; + ArrayList zoneDivisionsOnDate; + ArrayList divEnrolled; + ArrayList 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> listMap = new ArrayList>(); + for (int i = 0; i myListKey = new ArrayList<>(); + ArrayList 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 map = new LinkedHashMap<>(); + for(int x=0;x zoneDivisions; + ArrayList zoneDivisionsOnDate; + ArrayList divEnrolled; + ArrayList 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> listMap = new ArrayList>(); + for (int i = 0; i myListKey = new ArrayList<>(); + ArrayList 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 map = new LinkedHashMap<>(); + for(int x=0;x zoneDivisions; + ArrayList zoneDivisionsOnDate; + ArrayList divEnrolled; + ArrayList divAsPerEnrolled; + ArrayList 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> listMap = new ArrayList>(); + for (Integer i = 0; i myListKey = new ArrayList<>(); + ArrayList 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 map = new LinkedHashMap<>(); + for(int x=0;x> 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 tempAbsentUserId = new ArrayList<>(); + ArrayList AbsentUserName = new ArrayList<>(); + ArrayList AbsentUserDesignation = new ArrayList<>(); + + tempAbsentUserId = nULMAbsenteesEmpListDataRepository.getAbsentDivUserId(divValue, date); + + ArrayList AbsentUserId = new ArrayList(); + 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(nULMAbsenteesEmpListDataRepository.getAbsentDivUserName(AbsentUserId.get(i)).trim()); + AbsentUserDesignation.add(nULMAbsenteesEmpListDataRepository.getAbsentDivDesignation(AbsentUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(AbsentUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(AbsentUserDesignation.size()); + + List> listMap = new ArrayList>(); + + if (!AbsentUserId.isEmpty()) { + + for (int i = 0; i < AbsentUserId.size(); i++) { + + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + 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 map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// ----------------Unit office Enrolled--------------- + + @GetMapping({ "/getUnitAbsentEmpList/{unit}/{tempDate}" }) + public List> 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + + tempPunchedUserId = nULMAbsenteesEmpListDataRepository.getAbsentUnitUserId(unitValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMAbsenteesEmpListDataRepository.getAbsentUnitUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMAbsenteesEmpListDataRepository.getAbsentUnitDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + final Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------Lorry office Enrolled------------------------ + + @GetMapping({ "/getLorryAbsentEmpList/{zone}/{tempDate}" }) + public List> 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + + tempPunchedUserId = nULMAbsenteesEmpListDataRepository.getAbsentLorryUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMAbsenteesEmpListDataRepository.getAbsentLorryUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMAbsenteesEmpListDataRepository.getAbsentLorryDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + final Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------zonal office Enrolled----------------------- + + @GetMapping({ "/getZonalAbsentEmpList/{zone}/{tempDate}" }) + public List> 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + + tempPunchedUserId = nULMAbsenteesEmpListDataRepository.getAbsentZonalUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMAbsenteesEmpListDataRepository.getAbsentZonalUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMAbsenteesEmpListDataRepository.getAbsentZonalDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + final Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------Department office Enrolled--------------------------- + + @GetMapping({"/getDeptAbsentEmpList/{dept}/{tempDate}" }) + public List> 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + + tempPunchedUserId = nULMAbsenteesEmpListDataRepository.getAbsentDeptUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMAbsenteesEmpListDataRepository.getAbsentDeptUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMAbsenteesEmpListDataRepository.getAbsentDeptDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------RDC office Enrolled--------------------------- + + @GetMapping({"/getRDCAbsentEmpList/{zone}/{tempDate}" }) + public List> 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMAbsenteesEmpListDataRepository.getAbsentRDCUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMAbsenteesEmpListDataRepository.getAbsentRDCUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMAbsenteesEmpListDataRepository.getAbsentRDCDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------LFZ----------------------------------------- + +@GetMapping({ "/getLFZAbsentEmpList/{zone}/{tempDate}" }) +public List> getLFZAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMAbsenteesEmpListDataRepository.getAbsentLFZUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMAbsenteesEmpListDataRepository.getAbsentLFZUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMAbsenteesEmpListDataRepository.getAbsentLFZDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} + + + // ----------------------PRINTING PRESS----------------------------------------- + +@GetMapping({ "/getPPAbsentEmpList/{zone}/{tempDate}" }) +public List> getPPAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMAbsenteesEmpListDataRepository.getAbsentPPUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMAbsenteesEmpListDataRepository.getAbsentPPUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMAbsenteesEmpListDataRepository.getAbsentPPDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} + + // ----------------------NORTH CHENNAI DEPOT----------------------------------------- + +@GetMapping({ "/getNCDAbsentEmpList/{zone}/{tempDate}" }) +public List> getNCDPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMAbsenteesEmpListDataRepository.getAbsentNCDUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMAbsenteesEmpListDataRepository.getAbsentNCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMAbsenteesEmpListDataRepository.getAbsentNCDDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} + + // ----------------------TASK FORCE----------------------------------------- + +@GetMapping({ "/getTFAbsentEmpList/{zone}/{tempDate}" }) +public List> getTFAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMAbsenteesEmpListDataRepository.getAbsentTFUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMAbsenteesEmpListDataRepository.getAbsentTFUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMAbsenteesEmpListDataRepository.getAbsentTFDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} + + // ----------------------TPF----------------------------------------- + +@GetMapping({ "/getTPFAbsentEmpList/{zone}/{tempDate}" }) +public List> getTPFAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMAbsenteesEmpListDataRepository.getAbsentTPFUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMAbsenteesEmpListDataRepository.getAbsentTPFUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMAbsenteesEmpListDataRepository.getAbsentTPFDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} + + // ----------------------CENTRAL CHENNAI DEPOT----------------------------------------- + +@GetMapping({ "/getCCDAbsentEmpList/{zone}/{tempDate}" }) +public List> getCCDAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMAbsenteesEmpListDataRepository.getAbsentCCDUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMAbsenteesEmpListDataRepository.getAbsentCCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMAbsenteesEmpListDataRepository.getAbsentCCDDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} + + // ----------------------PDG----------------------------------------- + +@GetMapping({ "/getPDGAbsentEmpList/{zone}/{tempDate}" }) +public List> getPDGAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMAbsenteesEmpListDataRepository.getAbsentPDGUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMAbsenteesEmpListDataRepository.getAbsentPDGUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMAbsenteesEmpListDataRepository.getAbsentPDGDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} + + // ----------------------SOUTH CHENNAI DEPOT SCD----------------------------------------- + +@GetMapping({ "/getSCDAbsentEmpList/{zone}/{tempDate}" }) +public List> getSCDAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMAbsenteesEmpListDataRepository.getAbsentSCDUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMAbsenteesEmpListDataRepository.getAbsentSCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMAbsenteesEmpListDataRepository.getAbsentSCDDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} + + // ----------------------INSPECTION VEHICLE----------------------------------------- + +@GetMapping({ "/getIVAbsentEmpList/{zone}/{tempDate}" }) +public List> getIVAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMAbsenteesEmpListDataRepository.getAbsentIVUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMAbsenteesEmpListDataRepository.getAbsentIVUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMAbsenteesEmpListDataRepository.getAbsentIVDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} + + // ----------------------KDG----------------------------------------- + +@GetMapping({ "/getKDGAbsentEmpList/{zone}/{tempDate}" }) +public List> getKDGAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMAbsenteesEmpListDataRepository.getAbsentKDGUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMAbsenteesEmpListDataRepository.getAbsentKDGUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMAbsenteesEmpListDataRepository.getAbsentKDGDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMDeptHeadQuaterOfficeController.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMDeptHeadQuaterOfficeController.java new file mode 100644 index 0000000..794e8e8 --- /dev/null +++ b/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>> 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 allHQDepartments; + ArrayList allHQDeptAsperPunched; + ArrayList hqDeptEnrolled; + ArrayList hqDeptPunched; + ArrayList 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> listMap = new ArrayList>(); + for (int i = 0; i myListKey = new ArrayList<>(); + ArrayList 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 map = new LinkedHashMap<>(); + for(int x=0;x EnrolledUserId; + ArrayList EnrolledUserName; + ArrayList EnrolledUserDesignation; + + + // ----------------------Division office Enrolled----------------------------------------- + + @GetMapping({ "/getDivEnrolledEmpList/{div}" }) + public List> getDivEnrolledEmpList(@PathVariable String div) { + + String divValue = div; + + System.out.println(divValue); + + EnrolledUserId = nULMEnrolledEmpListDataRepository.getEnrolledDivUserId(divValue); + EnrolledUserName = nULMEnrolledEmpListDataRepository.getEnrolledDivUserName(divValue); + EnrolledUserDesignation = nULMEnrolledEmpListDataRepository.getEnrolledDivDesignation(divValue); + + System.out.println(EnrolledUserId.size()); + List> listMap = new ArrayList>(); + if (!EnrolledUserId.isEmpty()) { + for (int i = 0; i < EnrolledUserId.size(); ++i) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + 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 map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); ++x) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); ++x2) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + + // ----------------------Unit office Enrolled----------------------------------------- + + @GetMapping({ "/getUnitEnrolledEmpList/{unit}" }) + public List> getUnitEnrolledEmpList(@PathVariable String unit) { + + String unitValue = unit; + + System.out.println(unitValue); + + EnrolledUserId = nULMEnrolledEmpListDataRepository.getEnrolledUnitUserId(unitValue); + EnrolledUserName = nULMEnrolledEmpListDataRepository.getEnrolledUnitUserName(unitValue); + EnrolledUserDesignation = nULMEnrolledEmpListDataRepository.getEnrolledUnitDesignation(unitValue); + System.out.println(EnrolledUserId.size()); + List> listMap = new ArrayList>(); + if (!EnrolledUserId.isEmpty()) { + for (int i = 0; i < EnrolledUserId.size(); ++i) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + 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 map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); ++x) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); ++x2) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------Lorry office Enrolled----------------------------------------- + + @GetMapping({ "/getLorryEnrolledEmpList/{zone}" }) + public List> getLorryEnrolledEmpList(@PathVariable Integer zone) { + + Integer zoneValue = zone; + + if(zoneValue==1 || zoneValue==2 || zoneValue==3) + { + zoneValue = 1; + } + + System.out.println(zoneValue); + + EnrolledUserId = nULMEnrolledEmpListDataRepository.getEnrolledLorryUserId(zoneValue); + EnrolledUserName = nULMEnrolledEmpListDataRepository.getEnrolledLorryUserName(zoneValue); + EnrolledUserDesignation = nULMEnrolledEmpListDataRepository.getEnrolledLorryDesignation(zoneValue); + System.out.println(EnrolledUserId.size()); + List> listMap = new ArrayList>(); + if (!EnrolledUserId.isEmpty()) { + for (int i = 0; i < EnrolledUserId.size(); ++i) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + 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 map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); ++x) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); ++x2) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + + +// // ----------------------zonal office Enrolled----------------------------------------- + + @GetMapping({ "/getZonalEnrolledEmpList/{zone}" }) + public List> getZonalEnrolledEmpList(@PathVariable Integer zone) { + + Integer zoneValue = zone; + + System.out.println(zoneValue); + + EnrolledUserId = nULMEnrolledEmpListDataRepository.getEnrolledZonalUserId(zoneValue); + EnrolledUserName = nULMEnrolledEmpListDataRepository.getEnrolledZonalUserName(zoneValue); + EnrolledUserDesignation = nULMEnrolledEmpListDataRepository.getEnrolledZonalDesignation(zoneValue); + System.out.println(EnrolledUserId.size()); + List> listMap = new ArrayList>(); + if (!EnrolledUserId.isEmpty()) { + for (int i = 0; i < EnrolledUserId.size(); ++i) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + 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 map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); ++x) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); ++x2) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------Department office Enrolled----------------------------------------- + + @GetMapping({ "/getDeptEnrolledEmpList/{dept}" }) + public List> getDeptEnrolledEmpList(@PathVariable String dept) { + +String zoneValue = dept; + + System.out.println(zoneValue); + + EnrolledUserId = nULMEnrolledEmpListDataRepository.getEnrolledDeptUserId(zoneValue); + EnrolledUserName = nULMEnrolledEmpListDataRepository.getEnrolledDeptUserName(zoneValue); + EnrolledUserDesignation = nULMEnrolledEmpListDataRepository.getEnrolledDeptDesignation(zoneValue); + System.out.println(EnrolledUserId.size()); + List> listMap = new ArrayList>(); + if (!EnrolledUserId.isEmpty()) { + for (int i = 0; i < EnrolledUserId.size(); ++i) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + 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 map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); ++x) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); ++x2) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------RDC office Enrolled----------------------------------------- + + @GetMapping({ "/getRDCEnrolledEmpList/{zone}" }) + public List> getRDCEnrolledEmpList(@PathVariable Integer zone) { + + Integer zoneValue = zone; + + System.out.println(zoneValue); + + EnrolledUserId = nULMEnrolledEmpListDataRepository.getEnrolledRDCUserId(zoneValue); + EnrolledUserName = nULMEnrolledEmpListDataRepository.getEnrolledRDCUserName(zoneValue); + EnrolledUserDesignation = nULMEnrolledEmpListDataRepository.getEnrolledRDCDesignation(zoneValue); + System.out.println(EnrolledUserId.size()); + List> listMap = new ArrayList>(); + if (!EnrolledUserId.isEmpty()) { + for (int i = 0; i < EnrolledUserId.size(); ++i) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + 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 map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); ++x) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); ++x2) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------LFZ----------------------------------------- + + @GetMapping({ "/getLFZEnrolledEmpList/{zone}" }) + public List> getLFZEnrolledEmpList(@PathVariable Integer zone) { + + Integer zoneValue = zone; + + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMEnrolledEmpListDataRepository.getEnrolledLFZUserId(zoneValue); + System.out.println(tempPunchedUserId.size()); + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMEnrolledEmpListDataRepository.getEnrolledLFZUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMEnrolledEmpListDataRepository.getEnrolledLFZDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printedd"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------PRINTING PRESS----------------------------------------- + + @GetMapping({ "/getPPEnrolledEmpList/{zone}" }) + public List> getPPEnrolledEmpList(@PathVariable Integer zone) { + + Integer zoneValue = zone; + + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMEnrolledEmpListDataRepository.getEnrolledPPUserId(zoneValue); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMEnrolledEmpListDataRepository.getEnrolledPPUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMEnrolledEmpListDataRepository.getEnrolledPPDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------NORTH CHENNAI DEPOT----------------------------------------- + + @GetMapping({ "/getNCDEnrolledEmpList/{zone}" }) + public List> getNCDEnrolledEmpList(@PathVariable Integer zone) { + + Integer zoneValue = zone; + + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMEnrolledEmpListDataRepository.getEnrolledNCDUserId(zoneValue); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMEnrolledEmpListDataRepository.getEnrolledNCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMEnrolledEmpListDataRepository.getEnrolledNCDDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------TASK FORCE----------------------------------------- + + @GetMapping({ "/getTFEnrolledEmpList/{zone}" }) + public List> getTFEnrolledEmpList(@PathVariable Integer zone) { + + Integer zoneValue = zone; + + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMEnrolledEmpListDataRepository.getEnrolledTFUserId(zoneValue); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMEnrolledEmpListDataRepository.getEnrolledTFUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMEnrolledEmpListDataRepository.getEnrolledTFDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------TPF----------------------------------------- + + @GetMapping({ "/getTPFEnrolledEmpList/{zone}" }) + public List> getTPFEnrolledEmpList(@PathVariable Integer zone) { + + Integer zoneValue = zone; + + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMEnrolledEmpListDataRepository.getEnrolledTPFUserId(zoneValue); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMEnrolledEmpListDataRepository.getEnrolledTPFUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMEnrolledEmpListDataRepository.getEnrolledTPFDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------CENTRAL CHENNAI DEPOT----------------------------------------- + + @GetMapping({ "/getCCDEnrolledEmpList/{zone}" }) + public List> getCCDEnrolledEmpList(@PathVariable Integer zone) { + + Integer zoneValue = zone; + + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMEnrolledEmpListDataRepository.getEnrolledCCDUserId(zoneValue); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMEnrolledEmpListDataRepository.getEnrolledCCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMEnrolledEmpListDataRepository.getEnrolledCCDDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------PDG----------------------------------------- + + @GetMapping({ "/getPDGEnrolledEmpList/{zone}" }) + public List> getPDGEnrolledEmpList(@PathVariable Integer zone) { + + Integer zoneValue = zone; + + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMEnrolledEmpListDataRepository.getEnrolledPDGUserId(zoneValue); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMEnrolledEmpListDataRepository.getEnrolledPDGUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMEnrolledEmpListDataRepository.getEnrolledPDGDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------SOUTH CHENNAI DEPOT SCD----------------------------------------- + + @GetMapping({ "/getSCDEnrolledEmpList/{zone}" }) + public List> getSCDEnrolledEmpList(@PathVariable Integer zone) { + + Integer zoneValue = zone; + + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMEnrolledEmpListDataRepository.getEnrolledSCDUserId(zoneValue); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMEnrolledEmpListDataRepository.getEnrolledSCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMEnrolledEmpListDataRepository.getEnrolledSCDDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------INSPECTION VEHICLE----------------------------------------- + + @GetMapping({ "/getIVEnrolledEmpList/{zone}" }) + public List> getIVEnrolledEmpList(@PathVariable Integer zone) { + + Integer zoneValue = zone; + + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMEnrolledEmpListDataRepository.getEnrolledIVUserId(zoneValue); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMEnrolledEmpListDataRepository.getEnrolledIVUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMEnrolledEmpListDataRepository.getEnrolledIVDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------KDG----------------------------------------- + + @GetMapping({ "/getKDGEnrolledEmpList/{zone}" }) + public List> getKDGEnrolledEmpList(@PathVariable Integer zone) { + + Integer zoneValue = zone; + + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMEnrolledEmpListDataRepository.getEnrolledKDGUserId(zoneValue); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMEnrolledEmpListDataRepository.getEnrolledKDGUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMEnrolledEmpListDataRepository.getEnrolledKDGDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMHeadQuaterTotalEntriesRestController.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMHeadQuaterTotalEntriesRestController.java new file mode 100644 index 0000000..378098c --- /dev/null +++ b/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 arrZoneEnroll; + ArrayList arrZonePunched; + + @GetMapping("/HQTotalEmpCountPresentAbsentPercentage/{tempDate}") + public LinkedHashMap 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 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 getTheEnrolledAndPunchedAbsPer(@RequestParam(value = "date")@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)String date) { +// +// arrEnroll = headQuaterEntriesRepository.getEnrolled(); +// arrPunched = headQuaterEntriesRepository.getPunched(date); +// LinkedHashMap map = new LinkedHashMap<>(); +// +// +// Integer Absent_1 = arrEnroll.get(0) - arrPunched.get(0); +// Integer Absent_2 = arrEnroll.get(1) - arrPunched.get(1); +// Integer Absent_3 = arrEnroll.get(2) - arrPunched.get(2); +// Integer Absent_4 = arrEnroll.get(3) - arrPunched.get(3); +// Integer Absent_5 = arrEnroll.get(4) - arrPunched.get(4); +// Integer Absent_6 = arrEnroll.get(5) - arrPunched.get(5); +// Integer Absent_7 = arrEnroll.get(6) - arrPunched.get(6); +// Integer Absent_8 = arrEnroll.get(7) - arrPunched.get(7); +// Integer Absent_9 = arrEnroll.get(8) - arrPunched.get(8); +// Integer Absent_10 = arrEnroll.get(9) - arrPunched.get(9); +// Integer Absent_11 = arrEnroll.get(10) - arrPunched.get(10); +// Integer Absent_12 = arrEnroll.get(11) - arrPunched.get(11); +// Integer Absent_13 = arrEnroll.get(12) - arrPunched.get(12); +// Integer Absent_14 = arrEnroll.get(13) - arrPunched.get(13); +// Integer Absent_15 = arrEnroll.get(14) - arrPunched.get(14); +// Integer Absent_16 = arrEnroll.get(15) - arrPunched.get(15); +// +// Integer Percentage_1 = ((arrPunched.get(0) *100)/ arrEnroll.get(0)); +// Integer Percentage_2 = ((arrPunched.get(1) *100)/ arrEnroll.get(1)); +// Integer Percentage_3 = ((arrPunched.get(2) *100)/ arrEnroll.get(2)); +// Integer Percentage_4 = ((arrPunched.get(3) *100)/ arrEnroll.get(3)); +// Integer Percentage_5 = ((arrPunched.get(4) *100)/ arrEnroll.get(4)); +// Integer Percentage_6 = ((arrPunched.get(5) *100)/ arrEnroll.get(5)); +// Integer Percentage_7 = ((arrPunched.get(6) *100)/ arrEnroll.get(6)); +// Integer Percentage_8 = ((arrPunched.get(7) *100)/ arrEnroll.get(7)); +// Integer Percentage_9 = ((arrPunched.get(8) *100)/ arrEnroll.get(8)); +// Integer Percentage_10 = ((arrPunched.get(9) *100)/ arrEnroll.get(9)); +// Integer Percentage_11 = ((arrPunched.get(10) *100)/ arrEnroll.get(10)); +// Integer Percentage_12 = ((arrPunched.get(11) *100)/ arrEnroll.get(11)); +// Integer Percentage_13 = ((arrPunched.get(12) *100)/ arrEnroll.get(12)); +// Integer Percentage_14 = ((arrPunched.get(13) *100)/ arrEnroll.get(13)); +// Integer Percentage_15 = ((arrPunched.get(14) *100)/ arrEnroll.get(14)); +// Integer Percentage_16 = ((arrPunched.get(15) *100)/ arrEnroll.get(15)); +// +// +// +// map.put("Zone_1", 1); +// map.put("Zone_1_enrolled", arrEnroll.get(0)); +// map.put("Zone_1_punched", arrPunched.get(0)); +// map.put("Absent_1", Absent_1); +// map.put("Percentage_1", Percentage_1); +// map.put("Zone_2", 2); +// map.put("Zone_2_enrolled", arrEnroll.get(1)); +// map.put("Zone_2_punched", arrPunched.get(1)); +// map.put("Absent_2", Absent_2); +// map.put("Percentage_2", Percentage_2); +// map.put("Zone_3", 3); +// map.put("Zone_3_enrolled", arrEnroll.get(2)); +// map.put("Zone_3_punched", arrPunched.get(2)); +// map.put("Absent_3", Absent_3); +// map.put("Percentage_3", Percentage_3); +// map.put("Zone_4", 4); +// map.put("Zone_4_enrolled", arrEnroll.get(3)); +// map.put("Zone_4_punched", arrPunched.get(0)); +// map.put("Absent_4", Absent_4); +// map.put("Percentage_4", Percentage_4); +// map.put("Zone_5", 5); +// map.put("Zone_5_enrolled", arrEnroll.get(4)); +// map.put("Zone_5_punched", arrPunched.get(4)); +// map.put("Absent_5", Absent_5); +// map.put("Percentage_5", Percentage_5); +// map.put("Zone_6", 6); +// map.put("Zone_6_enrolled", arrEnroll.get(5)); +// map.put("Zone_6_punched", arrPunched.get(5)); +// map.put("Absent_6", Absent_6); +// map.put("Percentage_6", Percentage_6); +// map.put("Zone_7", 7); +// map.put("Zone_7_enrolled", arrEnroll.get(6)); +// map.put("Zone_7_punched", arrPunched.get(6)); +// map.put("Absent_7", Absent_7); +// map.put("Percentage_7", Percentage_7); +// map.put("Zone_8", 8); +// map.put("Zone_8_enrolled", arrEnroll.get(7)); +// map.put("Zone_8_punched", arrPunched.get(7)); +// map.put("Absent_8", Absent_8); +// map.put("Percentage_8", Percentage_8); +// map.put("Zone_9", 9); +// map.put("Zone_9_enrolled", arrEnroll.get(8)); +// map.put("Zone_9_punched", arrPunched.get(8)); +// map.put("Absent_9", Absent_9); +// map.put("Percentage_9", Percentage_9); +// map.put("Zone_10", 10); +// map.put("Zone_10_enrolled", arrEnroll.get(9)); +// map.put("Zone_10_punched", arrPunched.get(9)); +// map.put("Absent_10", Absent_10); +// map.put("Percentage_10", Percentage_10); +// map.put("Zone_11", 11); +// map.put("Zone_11_enrolled", arrEnroll.get(10)); +// map.put("Zone_11_punched", arrPunched.get(10)); +// map.put("Absent_11", Absent_11); +// map.put("Percentage_11", Percentage_11); +// map.put("Zone_12", 12); +// map.put("Zone_12_enrolled", arrEnroll.get(11)); +// map.put("Zone_12_punched", arrPunched.get(11)); +// map.put("Absent_12", Absent_12); +// map.put("Percentage_12", Percentage_12); +// map.put("Zone_13", 13); +// map.put("Zone_13_enrolled", arrEnroll.get(12)); +// map.put("Zone_13_punched", arrPunched.get(12)); +// map.put("Absent_13", Absent_13); +// map.put("Percentage_13", Percentage_13); +// map.put("Zone_14", 14); +// map.put("Zone_14_enrolled", arrEnroll.get(13)); +// map.put("Zone_14_punched", arrPunched.get(13)); +// map.put("Absent_14", Absent_14); +// map.put("Percentage_14", Percentage_14); +// map.put("Zone_15", 15); +// map.put("Zone_15_enrolled", arrEnroll.get(14)); +// map.put("Zone_15_punched", arrPunched.get(14)); +// map.put("Absent_15", Absent_15); +// map.put("Percentage_15", Percentage_15); +// map.put("Zone_16", 16); +// map.put("Zone_16_enrolled", arrEnroll.get(15)); +// map.put("Zone_16_punched", arrPunched.get(15)); +// map.put("Absent_16", Absent_16); +// map.put("Percentage_16", Percentage_16); +// System.out.println("Till 15"); + + +// return map; +// } + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMHeadQuaterZonesEntriesRestController.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMHeadQuaterZonesEntriesRestController.java new file mode 100644 index 0000000..7751376 --- /dev/null +++ b/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 arrZoneEnroll; + ArrayList arrZonePunched; + + @GetMapping("/HQZonesEmpCountPresentAbsentPercentage/{tempDate}") + public LinkedHashMap 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 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 getTheEnrolledAndPunchedAbsPer(@RequestParam(value = "date")@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)String date) { +// +// arrEnroll = headQuaterEntriesRepository.getEnrolled(); +// arrPunched = headQuaterEntriesRepository.getPunched(date); +// LinkedHashMap map = new LinkedHashMap<>(); +// +// +// Integer Absent_1 = arrEnroll.get(0) - arrPunched.get(0); +// Integer Absent_2 = arrEnroll.get(1) - arrPunched.get(1); +// Integer Absent_3 = arrEnroll.get(2) - arrPunched.get(2); +// Integer Absent_4 = arrEnroll.get(3) - arrPunched.get(3); +// Integer Absent_5 = arrEnroll.get(4) - arrPunched.get(4); +// Integer Absent_6 = arrEnroll.get(5) - arrPunched.get(5); +// Integer Absent_7 = arrEnroll.get(6) - arrPunched.get(6); +// Integer Absent_8 = arrEnroll.get(7) - arrPunched.get(7); +// Integer Absent_9 = arrEnroll.get(8) - arrPunched.get(8); +// Integer Absent_10 = arrEnroll.get(9) - arrPunched.get(9); +// Integer Absent_11 = arrEnroll.get(10) - arrPunched.get(10); +// Integer Absent_12 = arrEnroll.get(11) - arrPunched.get(11); +// Integer Absent_13 = arrEnroll.get(12) - arrPunched.get(12); +// Integer Absent_14 = arrEnroll.get(13) - arrPunched.get(13); +// Integer Absent_15 = arrEnroll.get(14) - arrPunched.get(14); +// Integer Absent_16 = arrEnroll.get(15) - arrPunched.get(15); +// +// Integer Percentage_1 = ((arrPunched.get(0) *100)/ arrEnroll.get(0)); +// Integer Percentage_2 = ((arrPunched.get(1) *100)/ arrEnroll.get(1)); +// Integer Percentage_3 = ((arrPunched.get(2) *100)/ arrEnroll.get(2)); +// Integer Percentage_4 = ((arrPunched.get(3) *100)/ arrEnroll.get(3)); +// Integer Percentage_5 = ((arrPunched.get(4) *100)/ arrEnroll.get(4)); +// Integer Percentage_6 = ((arrPunched.get(5) *100)/ arrEnroll.get(5)); +// Integer Percentage_7 = ((arrPunched.get(6) *100)/ arrEnroll.get(6)); +// Integer Percentage_8 = ((arrPunched.get(7) *100)/ arrEnroll.get(7)); +// Integer Percentage_9 = ((arrPunched.get(8) *100)/ arrEnroll.get(8)); +// Integer Percentage_10 = ((arrPunched.get(9) *100)/ arrEnroll.get(9)); +// Integer Percentage_11 = ((arrPunched.get(10) *100)/ arrEnroll.get(10)); +// Integer Percentage_12 = ((arrPunched.get(11) *100)/ arrEnroll.get(11)); +// Integer Percentage_13 = ((arrPunched.get(12) *100)/ arrEnroll.get(12)); +// Integer Percentage_14 = ((arrPunched.get(13) *100)/ arrEnroll.get(13)); +// Integer Percentage_15 = ((arrPunched.get(14) *100)/ arrEnroll.get(14)); +// Integer Percentage_16 = ((arrPunched.get(15) *100)/ arrEnroll.get(15)); +// +// +// +// map.put("Zone_1", 1); +// map.put("Zone_1_enrolled", arrEnroll.get(0)); +// map.put("Zone_1_punched", arrPunched.get(0)); +// map.put("Absent_1", Absent_1); +// map.put("Percentage_1", Percentage_1); +// map.put("Zone_2", 2); +// map.put("Zone_2_enrolled", arrEnroll.get(1)); +// map.put("Zone_2_punched", arrPunched.get(1)); +// map.put("Absent_2", Absent_2); +// map.put("Percentage_2", Percentage_2); +// map.put("Zone_3", 3); +// map.put("Zone_3_enrolled", arrEnroll.get(2)); +// map.put("Zone_3_punched", arrPunched.get(2)); +// map.put("Absent_3", Absent_3); +// map.put("Percentage_3", Percentage_3); +// map.put("Zone_4", 4); +// map.put("Zone_4_enrolled", arrEnroll.get(3)); +// map.put("Zone_4_punched", arrPunched.get(0)); +// map.put("Absent_4", Absent_4); +// map.put("Percentage_4", Percentage_4); +// map.put("Zone_5", 5); +// map.put("Zone_5_enrolled", arrEnroll.get(4)); +// map.put("Zone_5_punched", arrPunched.get(4)); +// map.put("Absent_5", Absent_5); +// map.put("Percentage_5", Percentage_5); +// map.put("Zone_6", 6); +// map.put("Zone_6_enrolled", arrEnroll.get(5)); +// map.put("Zone_6_punched", arrPunched.get(5)); +// map.put("Absent_6", Absent_6); +// map.put("Percentage_6", Percentage_6); +// map.put("Zone_7", 7); +// map.put("Zone_7_enrolled", arrEnroll.get(6)); +// map.put("Zone_7_punched", arrPunched.get(6)); +// map.put("Absent_7", Absent_7); +// map.put("Percentage_7", Percentage_7); +// map.put("Zone_8", 8); +// map.put("Zone_8_enrolled", arrEnroll.get(7)); +// map.put("Zone_8_punched", arrPunched.get(7)); +// map.put("Absent_8", Absent_8); +// map.put("Percentage_8", Percentage_8); +// map.put("Zone_9", 9); +// map.put("Zone_9_enrolled", arrEnroll.get(8)); +// map.put("Zone_9_punched", arrPunched.get(8)); +// map.put("Absent_9", Absent_9); +// map.put("Percentage_9", Percentage_9); +// map.put("Zone_10", 10); +// map.put("Zone_10_enrolled", arrEnroll.get(9)); +// map.put("Zone_10_punched", arrPunched.get(9)); +// map.put("Absent_10", Absent_10); +// map.put("Percentage_10", Percentage_10); +// map.put("Zone_11", 11); +// map.put("Zone_11_enrolled", arrEnroll.get(10)); +// map.put("Zone_11_punched", arrPunched.get(10)); +// map.put("Absent_11", Absent_11); +// map.put("Percentage_11", Percentage_11); +// map.put("Zone_12", 12); +// map.put("Zone_12_enrolled", arrEnroll.get(11)); +// map.put("Zone_12_punched", arrPunched.get(11)); +// map.put("Absent_12", Absent_12); +// map.put("Percentage_12", Percentage_12); +// map.put("Zone_13", 13); +// map.put("Zone_13_enrolled", arrEnroll.get(12)); +// map.put("Zone_13_punched", arrPunched.get(12)); +// map.put("Absent_13", Absent_13); +// map.put("Percentage_13", Percentage_13); +// map.put("Zone_14", 14); +// map.put("Zone_14_enrolled", arrEnroll.get(13)); +// map.put("Zone_14_punched", arrPunched.get(13)); +// map.put("Absent_14", Absent_14); +// map.put("Percentage_14", Percentage_14); +// map.put("Zone_15", 15); +// map.put("Zone_15_enrolled", arrEnroll.get(14)); +// map.put("Zone_15_punched", arrPunched.get(14)); +// map.put("Absent_15", Absent_15); +// map.put("Percentage_15", Percentage_15); +// map.put("Zone_16", 16); +// map.put("Zone_16_enrolled", arrEnroll.get(15)); +// map.put("Zone_16_punched", arrPunched.get(15)); +// map.put("Absent_16", Absent_16); +// map.put("Percentage_16", Percentage_16); +// System.out.println("Till 15"); + + +// return map; +// } + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMOtherZoneOfficesController.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMOtherZoneOfficesController.java new file mode 100644 index 0000000..6d0131d --- /dev/null +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMOtherZoneOfficesController.java @@ -0,0 +1,1072 @@ +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.NULMOtherZoneOfficesRepository; + + +@RestController +@RequestMapping("/gcc.com/NULM") +public class NULMOtherZoneOfficesController { + + @Autowired + private NULMOtherZoneOfficesRepository nULMOtherZoneOfficesRepository; + + @Autowired + public NULMOtherZoneOfficesController(NULMOtherZoneOfficesRepository theNULMOtherZoneOfficesRepository) { + nULMOtherZoneOfficesRepository = theNULMOtherZoneOfficesRepository; + } + + + + @GetMapping("/OtherOfficesEmpCountPresentAbsentPercentage/{zone}/{officeTypes}/{tempDate}") + public ResponseEntity>> getDivEnrollPunchAbsentPercentage(@PathVariable Integer zone, + @PathVariable String officeTypes, @PathVariable String tempDate) + { + System.out.println("Inside OtherOfficesEmpCountPresentAbsentPercentage() method!"); + Integer zoneValue = zone; + String officeType = officeTypes; + + + //LFZ + + + if (officeType.equals("LFZ")) { + System.out.println("for LFZ 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 divEnrolled; + ArrayList divPunched; + + + divEnrolled = nULMOtherZoneOfficesRepository.getLFZEnrolled(zoneValue); + divPunched = nULMOtherZoneOfficesRepository.getLFZPunched(zoneValue, date); + + System.out.println("Enrolled: "+divEnrolled); + System.out.println("Punched: "+divPunched); + + String divAbsent = null; + String divPercentage = null; + Integer j = 0; + + List> listMap = new ArrayList>(); + if(!divEnrolled.isEmpty()) + { + for (int i = 0; i <1; i++) { + + + ArrayList myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("LFZ"); + myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i)); + + if(!divPunched.isEmpty()) + { + myListKey.add("Punched"); myListValue.add(divPunched.get(i)); + 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(); + } + else + { + myListKey.add("Punched"); myListValue.add("0"); + Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt("0"); + Integer xdivPercentage = ((Integer.parseInt("0")) *100)/ Integer.parseInt(divEnrolled.get(i)); + divAbsent = xDivAbsent.toString(); + divPercentage = xdivPercentage.toString(); + } + + myListKey.add("Absent"); myListValue.add(divAbsent); + myListKey.add("Percentage"); myListValue.add(divPercentage); + + Map map = new LinkedHashMap<>(); + + for(int x=0;x myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("LFZ"); + 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 map = new LinkedHashMap<>(); + + for(int x=0;x divEnrolled; + ArrayList divPunched; + + + divEnrolled = nULMOtherZoneOfficesRepository.getPRINTINGPRESSEnrolled(zoneValue); + divPunched = nULMOtherZoneOfficesRepository.getPRINTINGPRESSPunched(zoneValue, date); + + System.out.println("Enrolled: "+divEnrolled); + System.out.println("Punched: "+divPunched); + + String divAbsent = null; + String divPercentage = null; + Integer j = 0; + + List> listMap = new ArrayList>(); + if(!divEnrolled.isEmpty()) + { + for (int i = 0; i <1; i++) { + + + ArrayList myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("Printing Press"); + myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i)); + if(!divPunched.isEmpty()) + { + myListKey.add("Punched"); myListValue.add(divPunched.get(i)); + 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(); + } + else + { + myListKey.add("Punched"); myListValue.add("0"); + Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt("0"); + Integer xdivPercentage = ((Integer.parseInt("0")) *100)/ Integer.parseInt(divEnrolled.get(i)); + divAbsent = xDivAbsent.toString(); + divPercentage = xdivPercentage.toString(); + } + + myListKey.add("Absent"); myListValue.add(divAbsent); + myListKey.add("Percentage"); myListValue.add(divPercentage); + + Map map = new LinkedHashMap<>(); + + for(int x=0;x myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("Printing Press"); + 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 map = new LinkedHashMap<>(); + + for(int x=0;x divEnrolled; + ArrayList divPunched; + + + divEnrolled = nULMOtherZoneOfficesRepository.getNCDEnrolled(zoneValue); + divPunched = nULMOtherZoneOfficesRepository.getNCDPunched(zoneValue, date); + + + System.out.println("Enrolled: "+divEnrolled); + System.out.println("Punched: "+divPunched); + + + String divAbsent = null; + String divPercentage = null; + Integer j = 0; + + List> listMap = new ArrayList>(); + + if(!divEnrolled.isEmpty()) + { + for (int i = 0; i <1; i++) { + + + ArrayList myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("North Chennai Depot"); + myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i)); + if(!divPunched.isEmpty()) + { + myListKey.add("Punched"); myListValue.add(divPunched.get(i)); + 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(); + } + else + { + myListKey.add("Punched"); myListValue.add("0"); + Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt("0"); + Integer xdivPercentage = ((Integer.parseInt("0")) *100)/ Integer.parseInt(divEnrolled.get(i)); + divAbsent = xDivAbsent.toString(); + divPercentage = xdivPercentage.toString(); + } + + myListKey.add("Absent"); myListValue.add(divAbsent); + myListKey.add("Percentage"); myListValue.add(divPercentage); + + Map map = new LinkedHashMap<>(); + + for(int x=0;x myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("North Chennai Depot"); + 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 map = new LinkedHashMap<>(); + + for(int x=0;x divEnrolled; + ArrayList divPunched; + + + divEnrolled = nULMOtherZoneOfficesRepository.getTFEnrolled(zoneValue); + divPunched = nULMOtherZoneOfficesRepository.getTFPunched(zoneValue, date); + + System.out.println("Enrolled: "+divEnrolled); + System.out.println("Punched: "+divPunched); + + String divAbsent = null; + String divPercentage = null; + Integer j = 0; + + List> listMap = new ArrayList>(); + if(!divEnrolled.isEmpty()) + { + for (int i = 0; i <1; i++) { + + + ArrayList myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("Task Force"); + myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i)); + if(!divPunched.isEmpty()) + { + myListKey.add("Punched"); myListValue.add(divPunched.get(i)); + 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(); + } + else + { + myListKey.add("Punched"); myListValue.add("0"); + Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt("0"); + Integer xdivPercentage = ((Integer.parseInt("0")) *100)/ Integer.parseInt(divEnrolled.get(i)); + divAbsent = xDivAbsent.toString(); + divPercentage = xdivPercentage.toString(); + } + + + + + myListKey.add("Absent"); myListValue.add(divAbsent); + myListKey.add("Percentage"); myListValue.add(divPercentage); + + Map map = new LinkedHashMap<>(); + + for(int x=0;x myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("Task Force"); + 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 map = new LinkedHashMap<>(); + + for(int x=0;x divEnrolled; + ArrayList divPunched; + + + divEnrolled = nULMOtherZoneOfficesRepository.getTPFEnrolled(zoneValue); + divPunched = nULMOtherZoneOfficesRepository.getTPFPunched(zoneValue, date); + + System.out.println("Enrolled: "+divEnrolled); + System.out.println("Punched: "+divPunched); + + String divAbsent = null; + String divPercentage = null; + Integer j = 0; + + List> listMap = new ArrayList>(); + if(!divEnrolled.isEmpty()) + { + for (int i = 0; i <1; i++) { + + + ArrayList myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("TPF"); + myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i)); + if(!divPunched.isEmpty()) + { + myListKey.add("Punched"); myListValue.add(divPunched.get(i)); + 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(); + } + else + { + myListKey.add("Punched"); myListValue.add("0"); + Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt("0"); + Integer xdivPercentage = ((Integer.parseInt("0")) *100)/ Integer.parseInt(divEnrolled.get(i)); + divAbsent = xDivAbsent.toString(); + divPercentage = xdivPercentage.toString(); + } + + myListKey.add("Absent"); myListValue.add(divAbsent); + myListKey.add("Percentage"); myListValue.add(divPercentage); + + Map map = new LinkedHashMap<>(); + + for(int x=0;x myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("TPF"); + 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 map = new LinkedHashMap<>(); + + for(int x=0;x divEnrolled; + ArrayList divPunched; + + + divEnrolled = nULMOtherZoneOfficesRepository.getCCDEnrolled(zoneValue); + divPunched = nULMOtherZoneOfficesRepository.getCCDPunched(zoneValue, date); + + System.out.println("Enrolled: "+divEnrolled); + System.out.println("Punched: "+divPunched); + + String divAbsent = null; + String divPercentage = null; + Integer j = 0; + + List> listMap = new ArrayList>(); + if(!divEnrolled.isEmpty()) + { + for (int i = 0; i <1; i++) { + + + ArrayList myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("Central Chennai Depot"); + myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i)); + if(!divPunched.isEmpty()) + { + myListKey.add("Punched"); myListValue.add(divPunched.get(i)); + 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(); + } + else + { + myListKey.add("Punched"); myListValue.add("0"); + Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt("0"); + Integer xdivPercentage = ((Integer.parseInt("0")) *100)/ Integer.parseInt(divEnrolled.get(i)); + divAbsent = xDivAbsent.toString(); + divPercentage = xdivPercentage.toString(); + } + + myListKey.add("Absent"); myListValue.add(divAbsent); + myListKey.add("Percentage"); myListValue.add(divPercentage); + + Map map = new LinkedHashMap<>(); + + for(int x=0;x myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("Central Chennai Depot"); + 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 map = new LinkedHashMap<>(); + + for(int x=0;x divEnrolled; + ArrayList divPunched; + + + divEnrolled = nULMOtherZoneOfficesRepository.getPDGEnrolled(zoneValue); + divPunched = nULMOtherZoneOfficesRepository.getPDGPunched(zoneValue, date); + + System.out.println("Enrolled: "+divEnrolled); + System.out.println("Punched: "+divPunched); + + String divAbsent = null; + String divPercentage = null; + Integer j = 0; + + List> listMap = new ArrayList>(); + if(!divEnrolled.isEmpty()) + { + for (int i = 0; i <1; i++) { + + + ArrayList myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("PDG"); + myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i)); + if(!divPunched.isEmpty()) + { + myListKey.add("Punched"); myListValue.add(divPunched.get(i)); + 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(); + } + else + { + myListKey.add("Punched"); myListValue.add("0"); + Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt("0"); + Integer xdivPercentage = ((Integer.parseInt("0")) *100)/ Integer.parseInt(divEnrolled.get(i)); + divAbsent = xDivAbsent.toString(); + divPercentage = xdivPercentage.toString(); + } + + myListKey.add("Absent"); myListValue.add(divAbsent); + myListKey.add("Percentage"); myListValue.add(divPercentage); + + Map map = new LinkedHashMap<>(); + + for(int x=0;x myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("PDG"); + 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 map = new LinkedHashMap<>(); + + for(int x=0;x divEnrolled; + ArrayList divPunched; + + + divEnrolled = nULMOtherZoneOfficesRepository.getSCDEnrolled(zoneValue); + divPunched = nULMOtherZoneOfficesRepository.getSCDPunched(zoneValue, date); + + System.out.println("Enrolled: "+divEnrolled); + System.out.println("Punched: "+divPunched); + + String divAbsent = null; + String divPercentage = null; + Integer j = 0; + + List> listMap = new ArrayList>(); + + if(!divEnrolled.isEmpty()) + { + for (int i = 0; i <1; i++) { + + + ArrayList myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("South Chennai Depot"); + myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i)); + if(!divPunched.isEmpty()) + { + myListKey.add("Punched"); myListValue.add(divPunched.get(i)); + 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(); + } + else + { + myListKey.add("Punched"); myListValue.add("0"); + Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt("0"); + Integer xdivPercentage = ((Integer.parseInt("0")) *100)/ Integer.parseInt(divEnrolled.get(i)); + divAbsent = xDivAbsent.toString(); + divPercentage = xdivPercentage.toString(); + } + + myListKey.add("Absent"); myListValue.add(divAbsent); + myListKey.add("Percentage"); myListValue.add(divPercentage); + + Map map = new LinkedHashMap<>(); + + for(int x=0;x myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("South Chennai Depot"); + 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 map = new LinkedHashMap<>(); + + for(int x=0;x divEnrolled; + ArrayList divPunched; + + + divEnrolled = nULMOtherZoneOfficesRepository.getINSPECTIONVEHICLEEnrolled(zoneValue); + divPunched = nULMOtherZoneOfficesRepository.getINSPECTIONVEHICLEPunched(zoneValue, date); + + System.out.println("Enrolled: "+divEnrolled); + System.out.println("Punched: "+divPunched); + + String divAbsent = null; + String divPercentage = null; + Integer j = 0; + + List> listMap = new ArrayList>(); + + if(!divEnrolled.isEmpty()) + { + for (int i = 0; i <1; i++) { + + + ArrayList myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("Inspection Vehicle"); + myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i)); + if(!divPunched.isEmpty()) + { + myListKey.add("Punched"); myListValue.add(divPunched.get(i)); + 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(); + } + else + { + myListKey.add("Punched"); myListValue.add("0"); + Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt("0"); + Integer xdivPercentage = ((Integer.parseInt("0")) *100)/ Integer.parseInt(divEnrolled.get(i)); + divAbsent = xDivAbsent.toString(); + divPercentage = xdivPercentage.toString(); + } + + myListKey.add("Absent"); myListValue.add(divAbsent); + myListKey.add("Percentage"); myListValue.add(divPercentage); + + Map map = new LinkedHashMap<>(); + + for(int x=0;x myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("Inspection Vehicle"); + 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 map = new LinkedHashMap<>(); + + for(int x=0;x divEnrolled; + ArrayList divPunched; + + + divEnrolled = nULMOtherZoneOfficesRepository.getKDGEnrolled(zoneValue); + divPunched = nULMOtherZoneOfficesRepository.getKDGPunched(zoneValue, date); + + System.out.println("Enrolled: "+divEnrolled); + System.out.println("Punched: "+divPunched); + + String divAbsent = null; + String divPercentage = null; + Integer j = 0; + + List> listMap = new ArrayList>(); + + if(!divEnrolled.isEmpty()) + { + for (int i = 0; i <1; i++) { + + + ArrayList myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("KDG"); + myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i)); + if(!divPunched.isEmpty()) + { + myListKey.add("Punched"); myListValue.add(divPunched.get(i)); + 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(); + } + else + { + myListKey.add("Punched"); myListValue.add("0"); + Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt("0"); + Integer xdivPercentage = ((Integer.parseInt("0")) *100)/ Integer.parseInt(divEnrolled.get(i)); + divAbsent = xDivAbsent.toString(); + divPercentage = xdivPercentage.toString(); + } + + myListKey.add("Absent"); myListValue.add(divAbsent); + myListKey.add("Percentage"); myListValue.add(divPercentage); + + Map map = new LinkedHashMap<>(); + + for(int x=0;x myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("KDG"); + 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 map = new LinkedHashMap<>(); + + for(int x=0;x> 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + + tempPunchedUserId = nULMPunchedEmpListDataRepository.getPunchedDivUserId(divValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMPunchedEmpListDataRepository.getPunchedDivUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMPunchedEmpListDataRepository.getPunchedDivDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + + if (!PunchedUserId.isEmpty()) { + + for (int i = 0; i < PunchedUserId.size(); i++) { + + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + final Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// ----------------Unit office Enrolled--------------- + + @GetMapping({ "/getUnitPunchedEmpList/{unit}/{tempDate}" }) + public List> 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + + tempPunchedUserId = nULMPunchedEmpListDataRepository.getPunchedUnitUserId(unitValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMPunchedEmpListDataRepository.getPunchedUnitUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMPunchedEmpListDataRepository.getPunchedUnitDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + final Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------Lorry office Enrolled------------------------ + + @GetMapping({ "/getLorryPunchedEmpList/{zone}/{tempDate}" }) + public List> 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + + tempPunchedUserId = nULMPunchedEmpListDataRepository.getPunchedLorryUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMPunchedEmpListDataRepository.getPunchedLorryUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMPunchedEmpListDataRepository.getPunchedLorryDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + final Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------zonal office Enrolled----------------------- + + @GetMapping({ "/getZonalPunchedEmpList/{zone}/{tempDate}" }) + public List> 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + + tempPunchedUserId = nULMPunchedEmpListDataRepository.getPunchedZonalUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMPunchedEmpListDataRepository.getPunchedZonalUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMPunchedEmpListDataRepository.getPunchedZonalDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + final Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------Department office Enrolled--------------------------- + + @GetMapping({ "/getDeptPunchedEmpList/{dept}/{tempDate}" }) + public List> 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + + tempPunchedUserId = nULMPunchedEmpListDataRepository.getPunchedDeptUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMPunchedEmpListDataRepository.getPunchedDeptUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMPunchedEmpListDataRepository.getPunchedDeptDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------RDC office Enrolled--------------------------- + + @GetMapping({ "/getRDCPunchedEmpList/{zone}/{tempDate}" }) + public List> 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMPunchedEmpListDataRepository.getPunchedRDCUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMPunchedEmpListDataRepository.getPunchedRDCUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMPunchedEmpListDataRepository.getPunchedRDCDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------LFZ----------------------------------------- + +@GetMapping({ "/getLFZPunchedEmpList/{zone}/{tempDate}" }) +public List> getLFZPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMPunchedEmpListDataRepository.getPunchedLFZUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMPunchedEmpListDataRepository.getPunchedLFZUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMPunchedEmpListDataRepository.getPunchedLFZDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} + + // ----------------------PRINTING PRESS----------------------------------------- + +@GetMapping({ "/getPPPunchedEmpList/{zone}/{tempDate}" }) +public List> getPPPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMPunchedEmpListDataRepository.getPunchedPPUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMPunchedEmpListDataRepository.getPunchedPPUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMPunchedEmpListDataRepository.getPunchedPPDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} + + // ----------------------NORTH CHENNAI DEPOT----------------------------------------- + +@GetMapping({ "/getNCDPunchedEmpList/{zone}/{tempDate}" }) +public List> getNCDPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMPunchedEmpListDataRepository.getPunchedNCDUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMPunchedEmpListDataRepository.getPunchedNCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMPunchedEmpListDataRepository.getPunchedNCDDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} + + // ----------------------TASK FORCE----------------------------------------- + +@GetMapping({ "/getTFPunchedEmpList/{zone}/{tempDate}" }) +public List> getTFPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMPunchedEmpListDataRepository.getPunchedTFUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMPunchedEmpListDataRepository.getPunchedTFUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMPunchedEmpListDataRepository.getPunchedTFDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} + + // ----------------------TPF----------------------------------------- + +@GetMapping({ "/getTPFPunchedEmpList/{zone}/{tempDate}" }) +public List> getTPFPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMPunchedEmpListDataRepository.getPunchedTPFUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMPunchedEmpListDataRepository.getPunchedTPFUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMPunchedEmpListDataRepository.getPunchedTPFDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} + + // ----------------------CENTRAL CHENNAI DEPOT----------------------------------------- + +@GetMapping({ "/getCCDPunchedEmpList/{zone}/{tempDate}" }) +public List> getCCDPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMPunchedEmpListDataRepository.getPunchedCCDUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMPunchedEmpListDataRepository.getPunchedCCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMPunchedEmpListDataRepository.getPunchedCCDDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} + + // ----------------------PDG----------------------------------------- + +@GetMapping({ "/getPDGPunchedEmpList/{zone}/{tempDate}" }) +public List> getPDGPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMPunchedEmpListDataRepository.getPunchedPDGUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMPunchedEmpListDataRepository.getPunchedPDGUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMPunchedEmpListDataRepository.getPunchedPDGDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} + + // ----------------------SOUTH CHENNAI DEPOT SCD----------------------------------------- + +@GetMapping({ "/getSCDPunchedEmpList/{zone}/{tempDate}" }) +public List> getSCDPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMPunchedEmpListDataRepository.getPunchedSCDUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMPunchedEmpListDataRepository.getPunchedSCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMPunchedEmpListDataRepository.getPunchedSCDDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} + + // ----------------------INSPECTION VEHICLE----------------------------------------- + +@GetMapping({ "/getIVPunchedEmpList/{zone}/{tempDate}" }) +public List> getIVPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMPunchedEmpListDataRepository.getPunchedIVUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMPunchedEmpListDataRepository.getPunchedIVUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMPunchedEmpListDataRepository.getPunchedIVDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} + + // ----------------------KDG----------------------------------------- + +@GetMapping({ "/getKDGPunchedEmpList/{zone}/{tempDate}" }) +public List> getKDGPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = nULMPunchedEmpListDataRepository.getPunchedKDGUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(nULMPunchedEmpListDataRepository.getPunchedKDGUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(nULMPunchedEmpListDataRepository.getPunchedKDGDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + +} +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMRegionalDeputyCommissionerController.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/nulm/NULMRegionalDeputyCommissionerController.java new file mode 100644 index 0000000..f9da126 --- /dev/null +++ b/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 arrRDCEnroll; + ArrayList arrRDCPunched; + ArrayList arrRDCZoneNames; + ArrayList arrRDCZoneNamesAsPerPunched; + + @GetMapping("/RegionalDeputyCommissionerOfficeData/{tempDate}") + public LinkedHashMap 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 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 arrZonalTotalEnroll; + ArrayList arrZonalTotalPunched; + + @GetMapping("/TotalZonalOfficeEmployeeData/{tempDate}") + public LinkedHashMap 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 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>> 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 zoneDivisions; + ArrayList zoneDivisionsOnDate; + ArrayList divEnrolled; + ArrayList divAsPerEnrolled; + ArrayList 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> listMap = new ArrayList>(); + for (int i = 0; i myListKey = new ArrayList<>(); + ArrayList 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 map = new LinkedHashMap<>(); + + for(int x=0;x allUnitsAsPerZone; + ArrayList unitEnrolled; + ArrayList unitAsEnrolled; + ArrayList unitPunched; + ArrayList 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> listMap = new ArrayList>(); + for (int i = 0; i myListKey = new ArrayList<>(); + ArrayList 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 map = new LinkedHashMap<>(); + for(int x=0;x zoneDivisions; + ArrayList zoneDivisionsOnDate; + ArrayList divEnrolled; + ArrayList 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> listMap = new ArrayList>(); + for (int i = 0; i myListKey = new ArrayList<>(); + ArrayList 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 map = new LinkedHashMap<>(); + for(int x=0;x zoneDivisions; + ArrayList zoneDivisionsOnDate; + ArrayList divEnrolled; + ArrayList 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> listMap = new ArrayList>(); + for (int i = 0; i myListKey = new ArrayList<>(); + ArrayList 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 map = new LinkedHashMap<>(); + for(int x=0;x zoneDivisions; + ArrayList zoneDivisionsOnDate; + ArrayList divEnrolled; + ArrayList divAsPerEnrolled; + ArrayList 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> listMap = new ArrayList>(); + for (Integer i = 0; i myListKey = new ArrayList<>(); + ArrayList 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 map = new LinkedHashMap<>(); + for(int x=0;x> getDivAbsentEmpList(@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 tempAbsentUserId = new ArrayList<>(); + ArrayList AbsentUserName = new ArrayList<>(); + ArrayList AbsentUserDesignation = new ArrayList<>(); + + tempAbsentUserId = absenteesEmpListDataRepository.getAbsentDivUserId(divValue, date); + + ArrayList AbsentUserId = new ArrayList(); + 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> listMap = new ArrayList>(); + + if (!AbsentUserId.isEmpty()) { + + for (int i = 0; i < AbsentUserId.size(); i++) { + + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + 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 map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// ----------------Unit office Enrolled--------------- + + @GetMapping({ "/getUnitAbsentEmpList/{unit}/{tempDate}" }) + public List> getUnitAbsentEmpList(@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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + + tempPunchedUserId = absenteesEmpListDataRepository.getAbsentUnitUserId(unitValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(absenteesEmpListDataRepository.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> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + final Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------Lorry office Enrolled------------------------ + + @GetMapping({ "/getLorryAbsentEmpList/{zone}/{tempDate}" }) + public List> getLorryAbsentEmpList(@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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + + tempPunchedUserId = absenteesEmpListDataRepository.getAbsentLorryUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(absenteesEmpListDataRepository.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> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + final Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------zonal office Enrolled----------------------- + + @GetMapping({ "/getZonalAbsentEmpList/{zone}/{tempDate}" }) + public List> getZonalAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + + tempPunchedUserId = absenteesEmpListDataRepository.getAbsentZonalUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(absenteesEmpListDataRepository.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> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + final Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------Department office Enrolled--------------------------- + + @GetMapping({ "/getDeptAbsentEmpList/{dept}/{tempDate}" }) + public List> getDeptAbsentEmpList(@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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + + tempPunchedUserId = absenteesEmpListDataRepository.getAbsentDeptUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(absenteesEmpListDataRepository.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> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------RDC office Enrolled--------------------------- + + @GetMapping({ "/getRDCAbsentEmpList/{zone}/{tempDate}" }) + public List> getRDCAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = absenteesEmpListDataRepository.getAbsentRDCUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(absenteesEmpListDataRepository.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> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------LFZ----------------------------------------- + + @GetMapping({ "/getLFZAbsentEmpList/{zone}/{tempDate}" }) + public List> getLFZAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = absenteesEmpListDataRepository.getAbsentLFZUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(absenteesEmpListDataRepository.getAbsentLFZUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(absenteesEmpListDataRepository.getAbsentLFZDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + + // ----------------------PRINTING PRESS----------------------------------------- + + @GetMapping({ "/getPPAbsentEmpList/{zone}/{tempDate}" }) + public List> getPPAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = absenteesEmpListDataRepository.getAbsentPPUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(absenteesEmpListDataRepository.getAbsentPPUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(absenteesEmpListDataRepository.getAbsentPPDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------NORTH CHENNAI DEPOT----------------------------------------- + + @GetMapping({ "/getNCDAbsentEmpList/{zone}/{tempDate}" }) + public List> getNCDPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = absenteesEmpListDataRepository.getAbsentNCDUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(absenteesEmpListDataRepository.getAbsentNCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(absenteesEmpListDataRepository.getAbsentNCDDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------TASK FORCE----------------------------------------- + + @GetMapping({ "/getTFAbsentEmpList/{zone}/{tempDate}" }) + public List> getTFAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = absenteesEmpListDataRepository.getAbsentTFUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(absenteesEmpListDataRepository.getAbsentTFUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(absenteesEmpListDataRepository.getAbsentTFDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------TPF----------------------------------------- + + @GetMapping({ "/getTPFAbsentEmpList/{zone}/{tempDate}" }) + public List> getTPFAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = absenteesEmpListDataRepository.getAbsentTPFUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(absenteesEmpListDataRepository.getAbsentTPFUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(absenteesEmpListDataRepository.getAbsentTPFDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------CENTRAL CHENNAI DEPOT----------------------------------------- + + @GetMapping({ "/getCCDAbsentEmpList/{zone}/{tempDate}" }) + public List> getCCDAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = absenteesEmpListDataRepository.getAbsentCCDUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(absenteesEmpListDataRepository.getAbsentCCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(absenteesEmpListDataRepository.getAbsentCCDDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------PDG----------------------------------------- + + @GetMapping({ "/getPDGAbsentEmpList/{zone}/{tempDate}" }) + public List> getPDGAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = absenteesEmpListDataRepository.getAbsentPDGUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(absenteesEmpListDataRepository.getAbsentPDGUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(absenteesEmpListDataRepository.getAbsentPDGDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------SOUTH CHENNAI DEPOT SCD----------------------------------------- + + @GetMapping({ "/getSCDAbsentEmpList/{zone}/{tempDate}" }) + public List> getSCDAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = absenteesEmpListDataRepository.getAbsentSCDUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(absenteesEmpListDataRepository.getAbsentSCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(absenteesEmpListDataRepository.getAbsentSCDDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------INSPECTION VEHICLE----------------------------------------- + + @GetMapping({ "/getIVAbsentEmpList/{zone}/{tempDate}" }) + public List> getIVAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = absenteesEmpListDataRepository.getAbsentIVUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(absenteesEmpListDataRepository.getAbsentIVUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(absenteesEmpListDataRepository.getAbsentIVDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------KDG----------------------------------------- + + @GetMapping({ "/getKDGAbsentEmpList/{zone}/{tempDate}" }) + public List> getKDGAbsentEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = absenteesEmpListDataRepository.getAbsentKDGUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(absenteesEmpListDataRepository.getAbsentKDGUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(absenteesEmpListDataRepository.getAbsentKDGDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMDeptHeadQuaterOfficeController.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMDeptHeadQuaterOfficeController.java new file mode 100644 index 0000000..c49d61f --- /dev/null +++ b/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>> 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 allHQDepartments; + ArrayList allHQDepartmentsAsperDate; + ArrayList hqDepartmentsEnrolled; + ArrayList 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> listMap = new ArrayList>(); + for (int i = 0; i myListKey = new ArrayList<>(); + ArrayList 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 map = new LinkedHashMap<>(); + for(int x=0;x EnrolledUserId; + ArrayList EnrolledUserName; + ArrayList EnrolledUserDesignation; + + + // ----------------------Division office Enrolled----------------------------------------- + + @GetMapping({ "/getDivEnrolledEmpList/{div}" }) + public List> 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> listMap = new ArrayList>(); + if (!EnrolledUserId.isEmpty()) { + for (int i = 0; i < EnrolledUserId.size(); ++i) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + 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 map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); ++x) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); ++x2) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + + // ----------------------Unit office Enrolled----------------------------------------- + + @GetMapping({ "/getUnitEnrolledEmpList/{unit}" }) + public List> 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> listMap = new ArrayList>(); + if (!EnrolledUserId.isEmpty()) { + for (int i = 0; i < EnrolledUserId.size(); ++i) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + 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 map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); ++x) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); ++x2) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------Lorry office Enrolled----------------------------------------- + + @GetMapping({ "/getLorryEnrolledEmpList/{zone}" }) + public List> 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> listMap = new ArrayList>(); + if (!EnrolledUserId.isEmpty()) { + for (int i = 0; i < EnrolledUserId.size(); ++i) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + 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 map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); ++x) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); ++x2) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + + +// // ----------------------zonal office Enrolled----------------------------------------- + + @GetMapping({ "/getZonalEnrolledEmpList/{zone}" }) + public List> 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> listMap = new ArrayList>(); + if (!EnrolledUserId.isEmpty()) { + for (int i = 0; i < EnrolledUserId.size(); ++i) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + 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 map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); ++x) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); ++x2) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------Department office Enrolled----------------------------------------- + + @GetMapping({ "/getDeptEnrolledEmpList/{dept}" }) + public List> 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> listMap = new ArrayList>(); + if (!EnrolledUserId.isEmpty()) { + for (int i = 0; i < EnrolledUserId.size(); ++i) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + 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 map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); ++x) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); ++x2) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------RDC office Enrolled----------------------------------------- + + @GetMapping({ "/getRDCEnrolledEmpList/{zone}" }) + public List> 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> listMap = new ArrayList>(); + if (!EnrolledUserId.isEmpty()) { + for (int i = 0; i < EnrolledUserId.size(); ++i) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + 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 map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); ++x) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); ++x2) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------LFZ----------------------------------------- + + @GetMapping({ "/getLFZEnrolledEmpList/{zone}" }) + public List> getLFZEnrolledEmpList(@PathVariable Integer zone) { + + Integer zoneValue = zone; + + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = enrolledEmpListDataRepository.getEnrolledLFZUserId(zoneValue); + System.out.println(tempPunchedUserId.size()); + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(enrolledEmpListDataRepository.getEnrolledLFZUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(enrolledEmpListDataRepository.getEnrolledLFZDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printedd"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------PRINTING PRESS----------------------------------------- + + @GetMapping({ "/getPPEnrolledEmpList/{zone}" }) + public List> getPPEnrolledEmpList(@PathVariable Integer zone) { + + Integer zoneValue = zone; + + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = enrolledEmpListDataRepository.getEnrolledPPUserId(zoneValue); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(enrolledEmpListDataRepository.getEnrolledPPUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(enrolledEmpListDataRepository.getEnrolledPPDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------NORTH CHENNAI DEPOT----------------------------------------- + + @GetMapping({ "/getNCDEnrolledEmpList/{zone}" }) + public List> getNCDEnrolledEmpList(@PathVariable Integer zone) { + + Integer zoneValue = zone; + + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = enrolledEmpListDataRepository.getEnrolledNCDUserId(zoneValue); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(enrolledEmpListDataRepository.getEnrolledNCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(enrolledEmpListDataRepository.getEnrolledNCDDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------TASK FORCE----------------------------------------- + + @GetMapping({ "/getTFEnrolledEmpList/{zone}" }) + public List> getTFEnrolledEmpList(@PathVariable Integer zone) { + + Integer zoneValue = zone; + + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = enrolledEmpListDataRepository.getEnrolledTFUserId(zoneValue); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(enrolledEmpListDataRepository.getEnrolledTFUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(enrolledEmpListDataRepository.getEnrolledTFDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------TPF----------------------------------------- + + @GetMapping({ "/getTPFEnrolledEmpList/{zone}" }) + public List> getTPFEnrolledEmpList(@PathVariable Integer zone) { + + Integer zoneValue = zone; + + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = enrolledEmpListDataRepository.getEnrolledTPFUserId(zoneValue); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(enrolledEmpListDataRepository.getEnrolledTPFUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(enrolledEmpListDataRepository.getEnrolledTPFDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------CENTRAL CHENNAI DEPOT----------------------------------------- + + @GetMapping({ "/getCCDEnrolledEmpList/{zone}" }) + public List> getCCDEnrolledEmpList(@PathVariable Integer zone) { + + Integer zoneValue = zone; + + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = enrolledEmpListDataRepository.getEnrolledCCDUserId(zoneValue); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(enrolledEmpListDataRepository.getEnrolledCCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(enrolledEmpListDataRepository.getEnrolledCCDDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------PDG----------------------------------------- + + @GetMapping({ "/getPDGEnrolledEmpList/{zone}" }) + public List> getPDGEnrolledEmpList(@PathVariable Integer zone) { + + Integer zoneValue = zone; + + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = enrolledEmpListDataRepository.getEnrolledPDGUserId(zoneValue); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(enrolledEmpListDataRepository.getEnrolledPDGUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(enrolledEmpListDataRepository.getEnrolledPDGDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------SOUTH CHENNAI DEPOT SCD----------------------------------------- + + @GetMapping({ "/getSCDEnrolledEmpList/{zone}" }) + public List> getSCDEnrolledEmpList(@PathVariable Integer zone) { + + Integer zoneValue = zone; + + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = enrolledEmpListDataRepository.getEnrolledSCDUserId(zoneValue); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(enrolledEmpListDataRepository.getEnrolledSCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(enrolledEmpListDataRepository.getEnrolledSCDDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------INSPECTION VEHICLE----------------------------------------- + + @GetMapping({ "/getIVEnrolledEmpList/{zone}" }) + public List> getIVEnrolledEmpList(@PathVariable Integer zone) { + + Integer zoneValue = zone; + + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = enrolledEmpListDataRepository.getEnrolledIVUserId(zoneValue); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(enrolledEmpListDataRepository.getEnrolledIVUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(enrolledEmpListDataRepository.getEnrolledIVDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------KDG----------------------------------------- + + @GetMapping({ "/getKDGEnrolledEmpList/{zone}" }) + public List> getKDGEnrolledEmpList(@PathVariable Integer zone) { + + Integer zoneValue = zone; + + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = enrolledEmpListDataRepository.getEnrolledKDGUserId(zoneValue); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(enrolledEmpListDataRepository.getEnrolledKDGUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(enrolledEmpListDataRepository.getEnrolledKDGDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMHeadQuaterTotalEntriesRestController.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMHeadQuaterTotalEntriesRestController.java new file mode 100644 index 0000000..4ec8356 --- /dev/null +++ b/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 arrZoneEnroll; + ArrayList arrZonePunched; + + @GetMapping("/HQTotalEmpCountPresentAbsentPercentage/{tempDate}") + public LinkedHashMap 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 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 getTheEnrolledAndPunchedAbsPer(@RequestParam(value = "date")@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)String date) { +// +// arrEnroll = headQuaterEntriesRepository.getEnrolled(); +// arrPunched = headQuaterEntriesRepository.getPunched(date); +// LinkedHashMap map = new LinkedHashMap<>(); +// +// +// Integer Absent_1 = arrEnroll.get(0) - arrPunched.get(0); +// Integer Absent_2 = arrEnroll.get(1) - arrPunched.get(1); +// Integer Absent_3 = arrEnroll.get(2) - arrPunched.get(2); +// Integer Absent_4 = arrEnroll.get(3) - arrPunched.get(3); +// Integer Absent_5 = arrEnroll.get(4) - arrPunched.get(4); +// Integer Absent_6 = arrEnroll.get(5) - arrPunched.get(5); +// Integer Absent_7 = arrEnroll.get(6) - arrPunched.get(6); +// Integer Absent_8 = arrEnroll.get(7) - arrPunched.get(7); +// Integer Absent_9 = arrEnroll.get(8) - arrPunched.get(8); +// Integer Absent_10 = arrEnroll.get(9) - arrPunched.get(9); +// Integer Absent_11 = arrEnroll.get(10) - arrPunched.get(10); +// Integer Absent_12 = arrEnroll.get(11) - arrPunched.get(11); +// Integer Absent_13 = arrEnroll.get(12) - arrPunched.get(12); +// Integer Absent_14 = arrEnroll.get(13) - arrPunched.get(13); +// Integer Absent_15 = arrEnroll.get(14) - arrPunched.get(14); +// Integer Absent_16 = arrEnroll.get(15) - arrPunched.get(15); +// +// Integer Percentage_1 = ((arrPunched.get(0) *100)/ arrEnroll.get(0)); +// Integer Percentage_2 = ((arrPunched.get(1) *100)/ arrEnroll.get(1)); +// Integer Percentage_3 = ((arrPunched.get(2) *100)/ arrEnroll.get(2)); +// Integer Percentage_4 = ((arrPunched.get(3) *100)/ arrEnroll.get(3)); +// Integer Percentage_5 = ((arrPunched.get(4) *100)/ arrEnroll.get(4)); +// Integer Percentage_6 = ((arrPunched.get(5) *100)/ arrEnroll.get(5)); +// Integer Percentage_7 = ((arrPunched.get(6) *100)/ arrEnroll.get(6)); +// Integer Percentage_8 = ((arrPunched.get(7) *100)/ arrEnroll.get(7)); +// Integer Percentage_9 = ((arrPunched.get(8) *100)/ arrEnroll.get(8)); +// Integer Percentage_10 = ((arrPunched.get(9) *100)/ arrEnroll.get(9)); +// Integer Percentage_11 = ((arrPunched.get(10) *100)/ arrEnroll.get(10)); +// Integer Percentage_12 = ((arrPunched.get(11) *100)/ arrEnroll.get(11)); +// Integer Percentage_13 = ((arrPunched.get(12) *100)/ arrEnroll.get(12)); +// Integer Percentage_14 = ((arrPunched.get(13) *100)/ arrEnroll.get(13)); +// Integer Percentage_15 = ((arrPunched.get(14) *100)/ arrEnroll.get(14)); +// Integer Percentage_16 = ((arrPunched.get(15) *100)/ arrEnroll.get(15)); +// +// +// +// map.put("Zone_1", 1); +// map.put("Zone_1_enrolled", arrEnroll.get(0)); +// map.put("Zone_1_punched", arrPunched.get(0)); +// map.put("Absent_1", Absent_1); +// map.put("Percentage_1", Percentage_1); +// map.put("Zone_2", 2); +// map.put("Zone_2_enrolled", arrEnroll.get(1)); +// map.put("Zone_2_punched", arrPunched.get(1)); +// map.put("Absent_2", Absent_2); +// map.put("Percentage_2", Percentage_2); +// map.put("Zone_3", 3); +// map.put("Zone_3_enrolled", arrEnroll.get(2)); +// map.put("Zone_3_punched", arrPunched.get(2)); +// map.put("Absent_3", Absent_3); +// map.put("Percentage_3", Percentage_3); +// map.put("Zone_4", 4); +// map.put("Zone_4_enrolled", arrEnroll.get(3)); +// map.put("Zone_4_punched", arrPunched.get(0)); +// map.put("Absent_4", Absent_4); +// map.put("Percentage_4", Percentage_4); +// map.put("Zone_5", 5); +// map.put("Zone_5_enrolled", arrEnroll.get(4)); +// map.put("Zone_5_punched", arrPunched.get(4)); +// map.put("Absent_5", Absent_5); +// map.put("Percentage_5", Percentage_5); +// map.put("Zone_6", 6); +// map.put("Zone_6_enrolled", arrEnroll.get(5)); +// map.put("Zone_6_punched", arrPunched.get(5)); +// map.put("Absent_6", Absent_6); +// map.put("Percentage_6", Percentage_6); +// map.put("Zone_7", 7); +// map.put("Zone_7_enrolled", arrEnroll.get(6)); +// map.put("Zone_7_punched", arrPunched.get(6)); +// map.put("Absent_7", Absent_7); +// map.put("Percentage_7", Percentage_7); +// map.put("Zone_8", 8); +// map.put("Zone_8_enrolled", arrEnroll.get(7)); +// map.put("Zone_8_punched", arrPunched.get(7)); +// map.put("Absent_8", Absent_8); +// map.put("Percentage_8", Percentage_8); +// map.put("Zone_9", 9); +// map.put("Zone_9_enrolled", arrEnroll.get(8)); +// map.put("Zone_9_punched", arrPunched.get(8)); +// map.put("Absent_9", Absent_9); +// map.put("Percentage_9", Percentage_9); +// map.put("Zone_10", 10); +// map.put("Zone_10_enrolled", arrEnroll.get(9)); +// map.put("Zone_10_punched", arrPunched.get(9)); +// map.put("Absent_10", Absent_10); +// map.put("Percentage_10", Percentage_10); +// map.put("Zone_11", 11); +// map.put("Zone_11_enrolled", arrEnroll.get(10)); +// map.put("Zone_11_punched", arrPunched.get(10)); +// map.put("Absent_11", Absent_11); +// map.put("Percentage_11", Percentage_11); +// map.put("Zone_12", 12); +// map.put("Zone_12_enrolled", arrEnroll.get(11)); +// map.put("Zone_12_punched", arrPunched.get(11)); +// map.put("Absent_12", Absent_12); +// map.put("Percentage_12", Percentage_12); +// map.put("Zone_13", 13); +// map.put("Zone_13_enrolled", arrEnroll.get(12)); +// map.put("Zone_13_punched", arrPunched.get(12)); +// map.put("Absent_13", Absent_13); +// map.put("Percentage_13", Percentage_13); +// map.put("Zone_14", 14); +// map.put("Zone_14_enrolled", arrEnroll.get(13)); +// map.put("Zone_14_punched", arrPunched.get(13)); +// map.put("Absent_14", Absent_14); +// map.put("Percentage_14", Percentage_14); +// map.put("Zone_15", 15); +// map.put("Zone_15_enrolled", arrEnroll.get(14)); +// map.put("Zone_15_punched", arrPunched.get(14)); +// map.put("Absent_15", Absent_15); +// map.put("Percentage_15", Percentage_15); +// map.put("Zone_16", 16); +// map.put("Zone_16_enrolled", arrEnroll.get(15)); +// map.put("Zone_16_punched", arrPunched.get(15)); +// map.put("Absent_16", Absent_16); +// map.put("Percentage_16", Percentage_16); +// System.out.println("Till 15"); + + +// return map; +// } + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMHeadQuaterZonesEntriesRestController.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMHeadQuaterZonesEntriesRestController.java new file mode 100644 index 0000000..e772fff --- /dev/null +++ b/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 arrZoneEnroll; + ArrayList arrZonePunched; + + @GetMapping("/HQZonesEmpCountPresentAbsentPercentage/{tempDate}") + public LinkedHashMap 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 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 getTheEnrolledAndPunchedAbsPer(@RequestParam(value = "date")@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)String date) { +// +// arrEnroll = headQuaterEntriesRepository.getEnrolled(); +// arrPunched = headQuaterEntriesRepository.getPunched(date); +// LinkedHashMap map = new LinkedHashMap<>(); +// +// +// Integer Absent_1 = arrEnroll.get(0) - arrPunched.get(0); +// Integer Absent_2 = arrEnroll.get(1) - arrPunched.get(1); +// Integer Absent_3 = arrEnroll.get(2) - arrPunched.get(2); +// Integer Absent_4 = arrEnroll.get(3) - arrPunched.get(3); +// Integer Absent_5 = arrEnroll.get(4) - arrPunched.get(4); +// Integer Absent_6 = arrEnroll.get(5) - arrPunched.get(5); +// Integer Absent_7 = arrEnroll.get(6) - arrPunched.get(6); +// Integer Absent_8 = arrEnroll.get(7) - arrPunched.get(7); +// Integer Absent_9 = arrEnroll.get(8) - arrPunched.get(8); +// Integer Absent_10 = arrEnroll.get(9) - arrPunched.get(9); +// Integer Absent_11 = arrEnroll.get(10) - arrPunched.get(10); +// Integer Absent_12 = arrEnroll.get(11) - arrPunched.get(11); +// Integer Absent_13 = arrEnroll.get(12) - arrPunched.get(12); +// Integer Absent_14 = arrEnroll.get(13) - arrPunched.get(13); +// Integer Absent_15 = arrEnroll.get(14) - arrPunched.get(14); +// Integer Absent_16 = arrEnroll.get(15) - arrPunched.get(15); +// +// Integer Percentage_1 = ((arrPunched.get(0) *100)/ arrEnroll.get(0)); +// Integer Percentage_2 = ((arrPunched.get(1) *100)/ arrEnroll.get(1)); +// Integer Percentage_3 = ((arrPunched.get(2) *100)/ arrEnroll.get(2)); +// Integer Percentage_4 = ((arrPunched.get(3) *100)/ arrEnroll.get(3)); +// Integer Percentage_5 = ((arrPunched.get(4) *100)/ arrEnroll.get(4)); +// Integer Percentage_6 = ((arrPunched.get(5) *100)/ arrEnroll.get(5)); +// Integer Percentage_7 = ((arrPunched.get(6) *100)/ arrEnroll.get(6)); +// Integer Percentage_8 = ((arrPunched.get(7) *100)/ arrEnroll.get(7)); +// Integer Percentage_9 = ((arrPunched.get(8) *100)/ arrEnroll.get(8)); +// Integer Percentage_10 = ((arrPunched.get(9) *100)/ arrEnroll.get(9)); +// Integer Percentage_11 = ((arrPunched.get(10) *100)/ arrEnroll.get(10)); +// Integer Percentage_12 = ((arrPunched.get(11) *100)/ arrEnroll.get(11)); +// Integer Percentage_13 = ((arrPunched.get(12) *100)/ arrEnroll.get(12)); +// Integer Percentage_14 = ((arrPunched.get(13) *100)/ arrEnroll.get(13)); +// Integer Percentage_15 = ((arrPunched.get(14) *100)/ arrEnroll.get(14)); +// Integer Percentage_16 = ((arrPunched.get(15) *100)/ arrEnroll.get(15)); +// +// +// +// map.put("Zone_1", 1); +// map.put("Zone_1_enrolled", arrEnroll.get(0)); +// map.put("Zone_1_punched", arrPunched.get(0)); +// map.put("Absent_1", Absent_1); +// map.put("Percentage_1", Percentage_1); +// map.put("Zone_2", 2); +// map.put("Zone_2_enrolled", arrEnroll.get(1)); +// map.put("Zone_2_punched", arrPunched.get(1)); +// map.put("Absent_2", Absent_2); +// map.put("Percentage_2", Percentage_2); +// map.put("Zone_3", 3); +// map.put("Zone_3_enrolled", arrEnroll.get(2)); +// map.put("Zone_3_punched", arrPunched.get(2)); +// map.put("Absent_3", Absent_3); +// map.put("Percentage_3", Percentage_3); +// map.put("Zone_4", 4); +// map.put("Zone_4_enrolled", arrEnroll.get(3)); +// map.put("Zone_4_punched", arrPunched.get(0)); +// map.put("Absent_4", Absent_4); +// map.put("Percentage_4", Percentage_4); +// map.put("Zone_5", 5); +// map.put("Zone_5_enrolled", arrEnroll.get(4)); +// map.put("Zone_5_punched", arrPunched.get(4)); +// map.put("Absent_5", Absent_5); +// map.put("Percentage_5", Percentage_5); +// map.put("Zone_6", 6); +// map.put("Zone_6_enrolled", arrEnroll.get(5)); +// map.put("Zone_6_punched", arrPunched.get(5)); +// map.put("Absent_6", Absent_6); +// map.put("Percentage_6", Percentage_6); +// map.put("Zone_7", 7); +// map.put("Zone_7_enrolled", arrEnroll.get(6)); +// map.put("Zone_7_punched", arrPunched.get(6)); +// map.put("Absent_7", Absent_7); +// map.put("Percentage_7", Percentage_7); +// map.put("Zone_8", 8); +// map.put("Zone_8_enrolled", arrEnroll.get(7)); +// map.put("Zone_8_punched", arrPunched.get(7)); +// map.put("Absent_8", Absent_8); +// map.put("Percentage_8", Percentage_8); +// map.put("Zone_9", 9); +// map.put("Zone_9_enrolled", arrEnroll.get(8)); +// map.put("Zone_9_punched", arrPunched.get(8)); +// map.put("Absent_9", Absent_9); +// map.put("Percentage_9", Percentage_9); +// map.put("Zone_10", 10); +// map.put("Zone_10_enrolled", arrEnroll.get(9)); +// map.put("Zone_10_punched", arrPunched.get(9)); +// map.put("Absent_10", Absent_10); +// map.put("Percentage_10", Percentage_10); +// map.put("Zone_11", 11); +// map.put("Zone_11_enrolled", arrEnroll.get(10)); +// map.put("Zone_11_punched", arrPunched.get(10)); +// map.put("Absent_11", Absent_11); +// map.put("Percentage_11", Percentage_11); +// map.put("Zone_12", 12); +// map.put("Zone_12_enrolled", arrEnroll.get(11)); +// map.put("Zone_12_punched", arrPunched.get(11)); +// map.put("Absent_12", Absent_12); +// map.put("Percentage_12", Percentage_12); +// map.put("Zone_13", 13); +// map.put("Zone_13_enrolled", arrEnroll.get(12)); +// map.put("Zone_13_punched", arrPunched.get(12)); +// map.put("Absent_13", Absent_13); +// map.put("Percentage_13", Percentage_13); +// map.put("Zone_14", 14); +// map.put("Zone_14_enrolled", arrEnroll.get(13)); +// map.put("Zone_14_punched", arrPunched.get(13)); +// map.put("Absent_14", Absent_14); +// map.put("Percentage_14", Percentage_14); +// map.put("Zone_15", 15); +// map.put("Zone_15_enrolled", arrEnroll.get(14)); +// map.put("Zone_15_punched", arrPunched.get(14)); +// map.put("Absent_15", Absent_15); +// map.put("Percentage_15", Percentage_15); +// map.put("Zone_16", 16); +// map.put("Zone_16_enrolled", arrEnroll.get(15)); +// map.put("Zone_16_punched", arrPunched.get(15)); +// map.put("Absent_16", Absent_16); +// map.put("Percentage_16", Percentage_16); +// System.out.println("Till 15"); + + +// return map; +// } + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMOtherZoneOfficesController.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMOtherZoneOfficesController.java new file mode 100644 index 0000000..7ccb50b --- /dev/null +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMOtherZoneOfficesController.java @@ -0,0 +1,1070 @@ +package com.gcc.biometric.api.GccBioMetricApi.controller.perm; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import com.gcc.biometric.api.GccBioMetricApi.repo.OtherZoneOfficesRepository; + +@RestController +@RequestMapping("/gcc.com/PERM") +public class PERMOtherZoneOfficesController { + + @Autowired + private OtherZoneOfficesRepository otherZoneOfficesRepository; + + @Autowired + public PERMOtherZoneOfficesController(OtherZoneOfficesRepository theOtherZoneOfficesRepository) { + otherZoneOfficesRepository = theOtherZoneOfficesRepository; + } + + @GetMapping("/OtherOfficesEmpCountPresentAbsentPercentage/{zone}/{officeTypes}/{tempDate}") + public ResponseEntity>> getDivEnrollPunchAbsentPercentage(@PathVariable Integer zone, + @PathVariable String officeTypes, @PathVariable String tempDate) + { + System.out.println("Inside OtherOfficesEmpCountPresentAbsentPercentage() method!"); + Integer zoneValue = zone; + String officeType = officeTypes; + + + //LFZ + + + if (officeType.equals("LFZ")) { + System.out.println("for LFZ 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 divEnrolled; + ArrayList divPunched; + + + divEnrolled = otherZoneOfficesRepository.getLFZEnrolled(zoneValue); + divPunched = otherZoneOfficesRepository.getLFZPunched(zoneValue, date); + + System.out.println("Enrolled: "+divEnrolled); + System.out.println("Punched: "+divPunched); + + String divAbsent = null; + String divPercentage = null; + Integer j = 0; + + List> listMap = new ArrayList>(); + if(!divEnrolled.isEmpty()) + { + for (int i = 0; i <1; i++) { + + + ArrayList myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("LFZ"); + myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i)); + + if(!divPunched.isEmpty()) + { + myListKey.add("Punched"); myListValue.add(divPunched.get(i)); + 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(); + } + else + { + myListKey.add("Punched"); myListValue.add("0"); + Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt("0"); + Integer xdivPercentage = ((Integer.parseInt("0")) *100)/ Integer.parseInt(divEnrolled.get(i)); + divAbsent = xDivAbsent.toString(); + divPercentage = xdivPercentage.toString(); + } + + myListKey.add("Absent"); myListValue.add(divAbsent); + myListKey.add("Percentage"); myListValue.add(divPercentage); + + Map map = new LinkedHashMap<>(); + + for(int x=0;x myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("LFZ"); + 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 map = new LinkedHashMap<>(); + + for(int x=0;x divEnrolled; + ArrayList divPunched; + + + divEnrolled = otherZoneOfficesRepository.getPRINTINGPRESSEnrolled(zoneValue); + divPunched = otherZoneOfficesRepository.getPRINTINGPRESSPunched(zoneValue, date); + + System.out.println("Enrolled: "+divEnrolled); + System.out.println("Punched: "+divPunched); + + String divAbsent = null; + String divPercentage = null; + Integer j = 0; + + List> listMap = new ArrayList>(); + if(!divEnrolled.isEmpty()) + { + for (int i = 0; i <1; i++) { + + + ArrayList myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("Printing Press"); + myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i)); + if(!divPunched.isEmpty()) + { + myListKey.add("Punched"); myListValue.add(divPunched.get(i)); + 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(); + } + else + { + myListKey.add("Punched"); myListValue.add("0"); + Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt("0"); + Integer xdivPercentage = ((Integer.parseInt("0")) *100)/ Integer.parseInt(divEnrolled.get(i)); + divAbsent = xDivAbsent.toString(); + divPercentage = xdivPercentage.toString(); + } + + myListKey.add("Absent"); myListValue.add(divAbsent); + myListKey.add("Percentage"); myListValue.add(divPercentage); + + Map map = new LinkedHashMap<>(); + + for(int x=0;x myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("Printing Press"); + 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 map = new LinkedHashMap<>(); + + for(int x=0;x divEnrolled; + ArrayList divPunched; + + + divEnrolled = otherZoneOfficesRepository.getNCDEnrolled(zoneValue); + divPunched = otherZoneOfficesRepository.getNCDPunched(zoneValue, date); + + + System.out.println("Enrolled: "+divEnrolled); + System.out.println("Punched: "+divPunched); + + + String divAbsent = null; + String divPercentage = null; + Integer j = 0; + + List> listMap = new ArrayList>(); + + if(!divEnrolled.isEmpty()) + { + for (int i = 0; i <1; i++) { + + + ArrayList myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("North Chennai Depot"); + myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i)); + if(!divPunched.isEmpty()) + { + myListKey.add("Punched"); myListValue.add(divPunched.get(i)); + 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(); + } + else + { + myListKey.add("Punched"); myListValue.add("0"); + Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt("0"); + Integer xdivPercentage = ((Integer.parseInt("0")) *100)/ Integer.parseInt(divEnrolled.get(i)); + divAbsent = xDivAbsent.toString(); + divPercentage = xdivPercentage.toString(); + } + + myListKey.add("Absent"); myListValue.add(divAbsent); + myListKey.add("Percentage"); myListValue.add(divPercentage); + + Map map = new LinkedHashMap<>(); + + for(int x=0;x myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("North Chennai Depot"); + 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 map = new LinkedHashMap<>(); + + for(int x=0;x divEnrolled; + ArrayList divPunched; + + + divEnrolled = otherZoneOfficesRepository.getTFEnrolled(zoneValue); + divPunched = otherZoneOfficesRepository.getTFPunched(zoneValue, date); + + System.out.println("Enrolled: "+divEnrolled); + System.out.println("Punched: "+divPunched); + + String divAbsent = null; + String divPercentage = null; + Integer j = 0; + + List> listMap = new ArrayList>(); + if(!divEnrolled.isEmpty()) + { + for (int i = 0; i <1; i++) { + + + ArrayList myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("Task Force"); + myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i)); + if(!divPunched.isEmpty()) + { + myListKey.add("Punched"); myListValue.add(divPunched.get(i)); + 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(); + } + else + { + myListKey.add("Punched"); myListValue.add("0"); + Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt("0"); + Integer xdivPercentage = ((Integer.parseInt("0")) *100)/ Integer.parseInt(divEnrolled.get(i)); + divAbsent = xDivAbsent.toString(); + divPercentage = xdivPercentage.toString(); + } + + + + + myListKey.add("Absent"); myListValue.add(divAbsent); + myListKey.add("Percentage"); myListValue.add(divPercentage); + + Map map = new LinkedHashMap<>(); + + for(int x=0;x myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("Task Force"); + 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 map = new LinkedHashMap<>(); + + for(int x=0;x divEnrolled; + ArrayList divPunched; + + + divEnrolled = otherZoneOfficesRepository.getTPFEnrolled(zoneValue); + divPunched = otherZoneOfficesRepository.getTPFPunched(zoneValue, date); + + System.out.println("Enrolled: "+divEnrolled); + System.out.println("Punched: "+divPunched); + + String divAbsent = null; + String divPercentage = null; + Integer j = 0; + + List> listMap = new ArrayList>(); + if(!divEnrolled.isEmpty()) + { + for (int i = 0; i <1; i++) { + + + ArrayList myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("TPF"); + myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i)); + if(!divPunched.isEmpty()) + { + myListKey.add("Punched"); myListValue.add(divPunched.get(i)); + 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(); + } + else + { + myListKey.add("Punched"); myListValue.add("0"); + Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt("0"); + Integer xdivPercentage = ((Integer.parseInt("0")) *100)/ Integer.parseInt(divEnrolled.get(i)); + divAbsent = xDivAbsent.toString(); + divPercentage = xdivPercentage.toString(); + } + + myListKey.add("Absent"); myListValue.add(divAbsent); + myListKey.add("Percentage"); myListValue.add(divPercentage); + + Map map = new LinkedHashMap<>(); + + for(int x=0;x myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("TPF"); + 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 map = new LinkedHashMap<>(); + + for(int x=0;x divEnrolled; + ArrayList divPunched; + + + divEnrolled = otherZoneOfficesRepository.getCCDEnrolled(zoneValue); + divPunched = otherZoneOfficesRepository.getCCDPunched(zoneValue, date); + + System.out.println("Enrolled: "+divEnrolled); + System.out.println("Punched: "+divPunched); + + String divAbsent = null; + String divPercentage = null; + Integer j = 0; + + List> listMap = new ArrayList>(); + if(!divEnrolled.isEmpty()) + { + for (int i = 0; i <1; i++) { + + + ArrayList myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("Central Chennai Depot"); + myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i)); + if(!divPunched.isEmpty()) + { + myListKey.add("Punched"); myListValue.add(divPunched.get(i)); + 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(); + } + else + { + myListKey.add("Punched"); myListValue.add("0"); + Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt("0"); + Integer xdivPercentage = ((Integer.parseInt("0")) *100)/ Integer.parseInt(divEnrolled.get(i)); + divAbsent = xDivAbsent.toString(); + divPercentage = xdivPercentage.toString(); + } + + myListKey.add("Absent"); myListValue.add(divAbsent); + myListKey.add("Percentage"); myListValue.add(divPercentage); + + Map map = new LinkedHashMap<>(); + + for(int x=0;x myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("CENTRAL CHENNAI DEPOT"); + 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 map = new LinkedHashMap<>(); + + for(int x=0;x divEnrolled; + ArrayList divPunched; + + + divEnrolled = otherZoneOfficesRepository.getPDGEnrolled(zoneValue); + divPunched = otherZoneOfficesRepository.getPDGPunched(zoneValue, date); + + System.out.println("Enrolled: "+divEnrolled); + System.out.println("Punched: "+divPunched); + + String divAbsent = null; + String divPercentage = null; + Integer j = 0; + + List> listMap = new ArrayList>(); + if(!divEnrolled.isEmpty()) + { + for (int i = 0; i <1; i++) { + + + ArrayList myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("PDG"); + myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i)); + if(!divPunched.isEmpty()) + { + myListKey.add("Punched"); myListValue.add(divPunched.get(i)); + 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(); + } + else + { + myListKey.add("Punched"); myListValue.add("0"); + Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt("0"); + Integer xdivPercentage = ((Integer.parseInt("0")) *100)/ Integer.parseInt(divEnrolled.get(i)); + divAbsent = xDivAbsent.toString(); + divPercentage = xdivPercentage.toString(); + } + + myListKey.add("Absent"); myListValue.add(divAbsent); + myListKey.add("Percentage"); myListValue.add(divPercentage); + + Map map = new LinkedHashMap<>(); + + for(int x=0;x myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("PDG"); + 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 map = new LinkedHashMap<>(); + + for(int x=0;x divEnrolled; + ArrayList divPunched; + + + divEnrolled = otherZoneOfficesRepository.getSCDEnrolled(zoneValue); + divPunched = otherZoneOfficesRepository.getSCDPunched(zoneValue, date); + + System.out.println("Enrolled: "+divEnrolled); + System.out.println("Punched: "+divPunched); + + String divAbsent = null; + String divPercentage = null; + Integer j = 0; + + List> listMap = new ArrayList>(); + + if(!divEnrolled.isEmpty()) + { + for (int i = 0; i <1; i++) { + + + ArrayList myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("South Chennai Depot"); + myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i)); + if(!divPunched.isEmpty()) + { + myListKey.add("Punched"); myListValue.add(divPunched.get(i)); + 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(); + } + else + { + myListKey.add("Punched"); myListValue.add("0"); + Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt("0"); + Integer xdivPercentage = ((Integer.parseInt("0")) *100)/ Integer.parseInt(divEnrolled.get(i)); + divAbsent = xDivAbsent.toString(); + divPercentage = xdivPercentage.toString(); + } + + myListKey.add("Absent"); myListValue.add(divAbsent); + myListKey.add("Percentage"); myListValue.add(divPercentage); + + Map map = new LinkedHashMap<>(); + + for(int x=0;x myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("South Chennai Depot"); + 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 map = new LinkedHashMap<>(); + + for(int x=0;x divEnrolled; + ArrayList divPunched; + + + divEnrolled = otherZoneOfficesRepository.getINSPECTIONVEHICLEEnrolled(zoneValue); + divPunched = otherZoneOfficesRepository.getINSPECTIONVEHICLEPunched(zoneValue, date); + + System.out.println("Enrolled: "+divEnrolled); + System.out.println("Punched: "+divPunched); + + String divAbsent = null; + String divPercentage = null; + Integer j = 0; + + List> listMap = new ArrayList>(); + + if(!divEnrolled.isEmpty()) + { + for (int i = 0; i <1; i++) { + + + ArrayList myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("INSPECTION VEHICLE"); + myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i)); + if(!divPunched.isEmpty()) + { + myListKey.add("Punched"); myListValue.add(divPunched.get(i)); + 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(); + } + else + { + myListKey.add("Punched"); myListValue.add("0"); + Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt("0"); + Integer xdivPercentage = ((Integer.parseInt("0")) *100)/ Integer.parseInt(divEnrolled.get(i)); + divAbsent = xDivAbsent.toString(); + divPercentage = xdivPercentage.toString(); + } + + myListKey.add("Absent"); myListValue.add(divAbsent); + myListKey.add("Percentage"); myListValue.add(divPercentage); + + Map map = new LinkedHashMap<>(); + + for(int x=0;x myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("INSPECTION VEHICLE"); + 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 map = new LinkedHashMap<>(); + + for(int x=0;x divEnrolled; + ArrayList divPunched; + + + divEnrolled = otherZoneOfficesRepository.getKDGEnrolled(zoneValue); + divPunched = otherZoneOfficesRepository.getKDGPunched(zoneValue, date); + + System.out.println("Enrolled: "+divEnrolled); + System.out.println("Punched: "+divPunched); + + String divAbsent = null; + String divPercentage = null; + Integer j = 0; + + List> listMap = new ArrayList>(); + + if(!divEnrolled.isEmpty()) + { + for (int i = 0; i <1; i++) { + + + ArrayList myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("KDG"); + myListKey.add("Enrolled"); myListValue.add(divEnrolled.get(i)); + if(!divPunched.isEmpty()) + { + myListKey.add("Punched"); myListValue.add(divPunched.get(i)); + 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(); + } + else + { + myListKey.add("Punched"); myListValue.add("0"); + Integer xDivAbsent = Integer.parseInt(divEnrolled.get(i)) - Integer.parseInt("0"); + Integer xdivPercentage = ((Integer.parseInt("0")) *100)/ Integer.parseInt(divEnrolled.get(i)); + divAbsent = xDivAbsent.toString(); + divPercentage = xdivPercentage.toString(); + } + + myListKey.add("Absent"); myListValue.add(divAbsent); + myListKey.add("Percentage"); myListValue.add(divPercentage); + + Map map = new LinkedHashMap<>(); + + for(int x=0;x myListKey = new ArrayList<>(); + ArrayList myListValue = new ArrayList<>(); + myListKey.add("Office"); myListValue.add("KDG"); + 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 map = new LinkedHashMap<>(); + + for(int x=0;x> 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + + tempPunchedUserId = punchedEmpListDataRepository.getPunchedDivUserId(divValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(punchedEmpListDataRepository.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> listMap = new ArrayList>(); + + if (!PunchedUserId.isEmpty()) { + + for (int i = 0; i < PunchedUserId.size(); i++) { + + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + final Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// ----------------Unit office Enrolled--------------- + + @GetMapping({ "/getUnitPunchedEmpList/{unit}/{tempDate}" }) + public List> 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + + tempPunchedUserId = punchedEmpListDataRepository.getPunchedUnitUserId(unitValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(punchedEmpListDataRepository.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> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + final Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------Lorry office Enrolled------------------------ + + @GetMapping({ "/getLorryPunchedEmpList/{zone}/{tempDate}" }) + public List> 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + + tempPunchedUserId = punchedEmpListDataRepository.getPunchedLorryUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(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> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + final Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------zonal office Enrolled----------------------- + + @GetMapping({ "/getZonalPunchedEmpList/{zone}/{tempDate}" }) + public List> 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + + tempPunchedUserId = punchedEmpListDataRepository.getPunchedZonalUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(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> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + final ArrayList myListKey = new ArrayList(); + final ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + final Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + System.out.println("Printed"); + return listMap; + } + final ArrayList myListKey2 = new ArrayList(); + final ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + final Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------Department office Enrolled--------------------------- + + @GetMapping({ "/getDeptPunchedEmpList/{dept}/{tempDate}" }) + public List> 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + + tempPunchedUserId = punchedEmpListDataRepository.getPunchedDeptUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(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> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + } + +// // ----------------------RDC office Enrolled--------------------------- + + @GetMapping({ "/getRDCPunchedEmpList/{zone}/{tempDate}" }) + public List> 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 tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = punchedEmpListDataRepository.getPunchedRDCUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(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> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------LFZ----------------------------------------- + + @GetMapping({ "/getLFZPunchedEmpList/{zone}/{tempDate}" }) + public List> getLFZPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = punchedEmpListDataRepository.getPunchedLFZUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(punchedEmpListDataRepository.getPunchedLFZUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(punchedEmpListDataRepository.getPunchedLFZDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------PRINTING PRESS----------------------------------------- + + @GetMapping({ "/getPPPunchedEmpList/{zone}/{tempDate}" }) + public List> getPPPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = punchedEmpListDataRepository.getPunchedPPUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(punchedEmpListDataRepository.getPunchedPPUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(punchedEmpListDataRepository.getPunchedPPDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------NORTH CHENNAI DEPOT----------------------------------------- + + @GetMapping({ "/getNCDPunchedEmpList/{zone}/{tempDate}" }) + public List> getNCDPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = punchedEmpListDataRepository.getPunchedNCDUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(punchedEmpListDataRepository.getPunchedNCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(punchedEmpListDataRepository.getPunchedNCDDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------TASK FORCE----------------------------------------- + + @GetMapping({ "/getTFPunchedEmpList/{zone}/{tempDate}" }) + public List> getTFPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = punchedEmpListDataRepository.getPunchedTFUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(punchedEmpListDataRepository.getPunchedTFUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(punchedEmpListDataRepository.getPunchedTFDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------TPF----------------------------------------- + + @GetMapping({ "/getTPFPunchedEmpList/{zone}/{tempDate}" }) + public List> getTPFPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = punchedEmpListDataRepository.getPunchedTPFUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(punchedEmpListDataRepository.getPunchedTPFUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(punchedEmpListDataRepository.getPunchedTPFDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------CENTRAL CHENNAI DEPOT----------------------------------------- + + @GetMapping({ "/getCCDPunchedEmpList/{zone}/{tempDate}" }) + public List> getCCDPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = punchedEmpListDataRepository.getPunchedCCDUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(punchedEmpListDataRepository.getPunchedCCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(punchedEmpListDataRepository.getPunchedCCDDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------PDG----------------------------------------- + + @GetMapping({ "/getPDGPunchedEmpList/{zone}/{tempDate}" }) + public List> getPDGPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = punchedEmpListDataRepository.getPunchedPDGUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(punchedEmpListDataRepository.getPunchedPDGUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(punchedEmpListDataRepository.getPunchedPDGDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------SOUTH CHENNAI DEPOT SCD----------------------------------------- + + @GetMapping({ "/getSCDPunchedEmpList/{zone}/{tempDate}" }) + public List> getSCDPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = punchedEmpListDataRepository.getPunchedSCDUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(punchedEmpListDataRepository.getPunchedSCDUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(punchedEmpListDataRepository.getPunchedSCDDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------INSPECTION VEHICLE----------------------------------------- + + @GetMapping({ "/getIVPunchedEmpList/{zone}/{tempDate}" }) + public List> getIVPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = punchedEmpListDataRepository.getPunchedIVUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(punchedEmpListDataRepository.getPunchedIVUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(punchedEmpListDataRepository.getPunchedIVDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + + // ----------------------KDG----------------------------------------- + + @GetMapping({ "/getKDGPunchedEmpList/{zone}/{tempDate}" }) + public List> getKDGPunchedEmpList(@PathVariable Integer zone, + @PathVariable final String tempDate) { + + Integer zoneValue = zone; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy").parse(tempDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + System.out.println(date); + System.out.println(zoneValue); + + ArrayList tempPunchedUserId = new ArrayList<>(); + ArrayList PunchedUserName = new ArrayList<>(); + ArrayList PunchedUserDesignation = new ArrayList<>(); + tempPunchedUserId = punchedEmpListDataRepository.getPunchedKDGUserId(zoneValue, date); + + ArrayList PunchedUserId = new ArrayList(); + for (int i = 0; i < tempPunchedUserId.size(); i++) { + PunchedUserId.add(tempPunchedUserId.get(i).trim()); + } + + System.out.println(PunchedUserId.size()); + + for (int i = 0; i < PunchedUserId.size(); i++) { + PunchedUserName.add(punchedEmpListDataRepository.getPunchedKDGUserName(PunchedUserId.get(i)).trim()); + PunchedUserDesignation + .add(punchedEmpListDataRepository.getPunchedKDGDesignation(PunchedUserId.get(i)).trim()); + } + +// System.out.println(PunchedUserName); + System.out.println(PunchedUserName.size()); +// System.out.println(PunchedUserDesignation); + System.out.println(PunchedUserDesignation.size()); + + List> listMap = new ArrayList>(); + if (!tempPunchedUserId.isEmpty()) { + for (int i = 0; i < tempPunchedUserId.size(); i++) { + ArrayList myListKey = new ArrayList(); + ArrayList myListValue = new ArrayList(); + myListKey.add("UserId"); + myListValue.add(PunchedUserId.get(i)); + myListKey.add("UserName"); + myListValue.add(PunchedUserName.get(i).trim()); + myListKey.add("Designation"); + myListValue.add(PunchedUserDesignation.get(i).trim()); + Map map = new LinkedHashMap(); + for (int x = 0; x < myListKey.size(); x++) { + map.put(myListKey.get(x), myListValue.get(x)); + } + listMap.add(map); + } + + System.out.println("Printed"); + return listMap; + } + ArrayList myListKey2 = new ArrayList(); + ArrayList myListValue2 = new ArrayList(); + myListKey2.add("UserId"); + myListValue2.add("0"); + myListKey2.add("UserName"); + myListValue2.add("0"); + myListKey2.add("Designation"); + myListValue2.add("0"); + Map map2 = new LinkedHashMap(); + for (int x2 = 0; x2 < myListKey2.size(); x2++) { + map2.put(myListKey2.get(x2), myListValue2.get(x2)); + } + listMap.add(map2); + System.out.println("Printed"); + return listMap; + + } + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMRegionalDeputyCommissionerController.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/controller/perm/PERMRegionalDeputyCommissionerController.java new file mode 100644 index 0000000..a5689ce --- /dev/null +++ b/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 arrRDCEnroll; + ArrayList arrRDCPunched; + ArrayList arrRDCZoneNames; + + @GetMapping("/RegionalDeputyCommissionerOfficeData/{tempDate}") + public LinkedHashMap 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 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 arrZonalTotalEnroll; + ArrayList arrZonalTotalPunched; + + @GetMapping("/TotalZonalOfficeEmployeeData/{tempDate}") + public LinkedHashMap 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 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>> 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 zoneDivisions; + ArrayList zoneDivisionsOnDate; + ArrayList divEnrolled; + ArrayList divPunched; + ArrayList 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> listMap = new ArrayList>(); + for (int i = 0; i myListKey = new ArrayList<>(); + ArrayList 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 map = new LinkedHashMap<>(); + + for(int x=0;x allUnitsAsPerZone; + ArrayList unitEnrolled; + ArrayList unitAsEnrolled; + ArrayList unitPunched; + ArrayList 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> listMap = new ArrayList>(); + for (int i = 0; i myListKey = new ArrayList<>(); + ArrayList 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 map = new LinkedHashMap<>(); + for(int x=0;x zoneDivisions; + ArrayList zoneDivisionsOnDate; + ArrayList divEnrolled; + ArrayList 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> listMap = new ArrayList>(); + for (int i = 0; i myListKey = new ArrayList<>(); + ArrayList 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 map = new LinkedHashMap<>(); + for(int x=0;x zoneDivisions; + ArrayList zoneDivisionsOnDate; + ArrayList divEnrolled; + ArrayList 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> listMap = new ArrayList>(); + for (int i = 0; i myListKey = new ArrayList<>(); + ArrayList 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 map = new LinkedHashMap<>(); + for(int x=0;x zoneDivisions; + ArrayList zoneDivisionsOnDate; + ArrayList divEnrolled; + ArrayList 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> listMap = new ArrayList>(); + for (Integer i = 0; i myListKey = new ArrayList<>(); + ArrayList 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 map = new LinkedHashMap<>(); + for(int x=0;x findAll(); +// +// public Customer findById(int theId); +// +// public void save(Customer theCustomer); +// +// public void deleteById(int thId); +// +// +//} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/CustomerDAOImpl.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/CustomerDAOImpl.java new file mode 100644 index 0000000..cc132e9 --- /dev/null +++ b/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 findAll() { +// +// // get the current hibernate session +// Session currentSession = entityManager.unwrap(Session.class); +// System.out.println("Session Created"); +// // create a query +// Query theQuery = currentSession.createQuery("from Customer", Customer.class); +// System.out.println("Reading Query"); +// // execute query and get result +// List 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 theQuery = currentSession.createQuery("delete from Customer where id="+theId); +// //theQuery.setParameter("customerId", theId); +// theQuery.executeUpdate(); +// +// } +// +//} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/CustomerDAOJpaImpl.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/CustomerDAOJpaImpl.java new file mode 100644 index 0000000..726c168 --- /dev/null +++ b/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 findAll() { +// // create query +// Query theQuery = entityManager.createQuery("from Customer"); +// // execute query and get the results +// List 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 +// +// } +// +// +//} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/DeviceStatusDAO.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/DeviceStatusDAO.java new file mode 100644 index 0000000..40acaeb --- /dev/null +++ b/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 getAllDevices(); +// +//} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/DeviceStatusDAOImpl.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/DeviceStatusDAOImpl.java new file mode 100644 index 0000000..3f32901 --- /dev/null +++ b/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 getAllDevices() { +// // get the current hibernate session +// Session currentSession = entityManager.unwrap(Session.class); +// System.out.println("Session Created"); +// // create a query +// Query theQuery = currentSession.createQuery("from DeviceStatus", DeviceStatus.class); +// System.out.println("Reading Query"); +// // execute query and get result +// List deviceStatus = theQuery.getResultList(); +// // return the result +// System.out.println("Returning query"); +// return deviceStatus; +// } +// +//} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/EmployeeDAO.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/EmployeeDAO.java new file mode 100644 index 0000000..802477d --- /dev/null +++ b/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 getAllEmployee(); +// +// public Employee findEmpBySnn(String snn); +// +//} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/EmployeeDAOImpl.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/EmployeeDAOImpl.java new file mode 100644 index 0000000..01ce789 --- /dev/null +++ b/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 getAllEmployee() { +// // get the current hibernate session +// Session currentSession = entityManager.unwrap(Session.class); +// System.out.println("Session Created"); +// // create a query +// Query theQuery = currentSession.createQuery("from Employee", Employee.class); +// System.out.println("Reading Query"); +// // execute query and get result +// List 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; +// +// } +// +// +//} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/MachineRawPunchDAO.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/MachineRawPunchDAO.java new file mode 100644 index 0000000..273a803 --- /dev/null +++ b/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 getAllRawPunch(); +// +//} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/MachineRawPunchDAOImpl.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/MachineRawPunchDAOImpl.java new file mode 100644 index 0000000..12bd7cb --- /dev/null +++ b/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 getAllRawPunch() { +// // get the current hibernate session +// Session currentSession = entityManager.unwrap(Session.class); +// System.out.println("Session Created"); +// // create a query +// Query theQuery = currentSession.createQuery("from MachineRawPunch", MachineRawPunch.class); +// System.out.println("Reading Query"); +// // execute query and get result +// List machineRawPunch = theQuery.getResultList(); +// // return the result +// System.out.println("Returning query"); +// return machineRawPunch; +// } +// +//} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/RealTimeUserInfoDAO.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/RealTimeUserInfoDAO.java new file mode 100644 index 0000000..7b08e34 --- /dev/null +++ b/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 getAllUserInfo(); +// +//} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/RealTimeUserInfoDAOImpl.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/dao/RealTimeUserInfoDAOImpl.java new file mode 100644 index 0000000..9cb50ea --- /dev/null +++ b/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 getAllUserInfo() { +// +// // get the current hibernate session +// Session currentSession = entityManager.unwrap(Session.class); +// System.out.println("Session Created"); +// // create a query +// Query theQuery = currentSession.createQuery("from RealTimeUserInfo", RealTimeUserInfo.class); +// System.out.println("Reading Query"); +// // execute query and get result +// List realTimeUserInfo = theQuery.getResultList(); +// // return the result +// System.out.println("Returning query"); +// return realTimeUserInfo; +// +// } +// +//// @Override +//// public List getAllUserInfo() { +//// // get the current hibernate session +//// Session currentSession = entityManager.unwrap(Session.class); +//// System.out.println("Session Created"); +//// // create a query +//// Query theQuery = currentSession.createQuery("from RealTimeUserInfo", RealTimeUserInfo.class); +//// System.out.println("Reading Query"); +//// // execute query and get result +//// List employees = theQuery.getResultList(); +//// // return the result +//// System.out.println("Returning query"); +//// return employees; +//// } +// +//} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/entity/Customer.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/entity/Customer.java new file mode 100644 index 0000000..612e0a9 --- /dev/null +++ b/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 +// + "]"; +// } +// +// +// +// +//} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/entity/DeviceStatus.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/entity/DeviceStatus.java new file mode 100644 index 0000000..f56ab63 --- /dev/null +++ b/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 + "]"; + } + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/entity/Employee.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/entity/Employee.java new file mode 100644 index 0000000..e51bef6 --- /dev/null +++ b/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 + "]"; + } + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/entity/HeadQuaterEntries.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/entity/HeadQuaterEntries.java new file mode 100644 index 0000000..4a4645e --- /dev/null +++ b/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 + "]"; + } + + + + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/entity/MachineRawPunchh.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/entity/MachineRawPunchh.java new file mode 100644 index 0000000..c99552c --- /dev/null +++ b/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 + "]"; + } + + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/entity/RealTimeUserInfo.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/entity/RealTimeUserInfo.java new file mode 100644 index 0000000..73d8ed6 --- /dev/null +++ b/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 + "]"; + } + + + + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/entity/ZoneDivMaster.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/entity/ZoneDivMaster.java new file mode 100644 index 0000000..ab31bf9 --- /dev/null +++ b/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 zones =new HashMap<>(Map.of(1,"zone_1")); +// zones.put(2,""); + + + } + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/exception/CustomizedResponseEntityExceptionHandler.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/exception/CustomizedResponseEntityExceptionHandler.java new file mode 100644 index 0000000..b11396a --- /dev/null +++ b/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 handleAllException(Exception ex, WebRequest request) + throws Exception { + + ExceptionResponse errorDetails = new ExceptionResponse(LocalDateTime.now(), ex.getMessage(), + request.getDescription(false)); + + return new ResponseEntity(errorDetails, HttpStatus.INTERNAL_SERVER_ERROR); + } + + // Only for UserNotFound + // In above method we replaced Response entity to ErrorDetail to remove + // warning +// @ExceptionHandler(UserNotFoundException.class) +// public final ResponseEntity 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); +// } + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/exception/ExceptionResponse.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/exception/ExceptionResponse.java new file mode 100644 index 0000000..78f507c --- /dev/null +++ b/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; + } +} \ No newline at end of file diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/AbsenteesEmpListDataRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/AbsenteesEmpListDataRepository.java new file mode 100644 index 0000000..d6a2597 --- /dev/null +++ b/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 { + +// ----------------------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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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); + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/CustomerRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/CustomerRepository.java new file mode 100644 index 0000000..4389ac8 --- /dev/null +++ b/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 { +// +// +// +//} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/DeptHeadQuaterOfficeRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/DeptHeadQuaterOfficeRepository.java new file mode 100644 index 0000000..1fccf5c --- /dev/null +++ b/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 { + + +// # # # # # # # # # # # # # # # # 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 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 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 getHQDepartmentOfficesAsPerDate(Date date); + + + @Query(value="select distinct c.devname from ZoneDivMaster c where c.division like '%HQ%'") + public ArrayList getAllHQDepartmentOffices(); + +// # # # # # # # # # # # # # # # # Department Office # # # # # # # # # # # # # # # # # # # + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/DeviceStatusRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/DeviceStatusRepository.java new file mode 100644 index 0000000..b0e3a23 --- /dev/null +++ b/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 { + + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/EmployeeRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/EmployeeRepository.java new file mode 100644 index 0000000..e754ab0 --- /dev/null +++ b/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 { + + + + @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 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 getEmpCountPresentAbsent(); + +} + + + + + + + + + + + diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/EnrolledEmpListDataRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/EnrolledEmpListDataRepository.java new file mode 100644 index 0000000..e3bde66 --- /dev/null +++ b/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 { + +// ----------------------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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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); + + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/HeadQuaterTotalEntriesRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/HeadQuaterTotalEntriesRepository.java new file mode 100644 index 0000000..570e400 --- /dev/null +++ b/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 { + + + @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 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 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(); +// + + + + + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/HeadQuaterZonesEntriesRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/HeadQuaterZonesEntriesRepository.java new file mode 100644 index 0000000..f79b298 --- /dev/null +++ b/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 { + + + @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 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 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(); +// + + + + + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/MachineRawPunchRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/MachineRawPunchRepository.java new file mode 100644 index 0000000..284167f --- /dev/null +++ b/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 { + + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/OtherZoneOfficesRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/OtherZoneOfficesRepository.java new file mode 100644 index 0000000..15d450c --- /dev/null +++ b/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 { + + +// # # # # # # # # # # # # # # # # 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 getKDGPunched(Integer zoneValue, Date date); + + +// # # # # # # # # # # # # # # # # KDG # # # # # # # # # # # # # # # # # # # + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/PunchedEmpListDataRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/PunchedEmpListDataRepository.java new file mode 100644 index 0000000..dfb345f --- /dev/null +++ b/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 { + +// ----------------------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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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); + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/RealTimeUserInfoRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/RealTimeUserInfoRepository.java new file mode 100644 index 0000000..7e9def6 --- /dev/null +++ b/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 { + + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/RegionalDeputyCommissionerRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/RegionalDeputyCommissionerRepository.java new file mode 100644 index 0000000..5c0b2ad --- /dev/null +++ b/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 { + + + + @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 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 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 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(); +// + + + + + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/ZonalOfficeTotalDataRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/ZonalOfficeTotalDataRepository.java new file mode 100644 index 0000000..847f3f3 --- /dev/null +++ b/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 { + + + @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 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 getZonalOfficeTotalPunched(Date date); + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/ZoneDivisionOfficeRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/ZoneDivisionOfficeRepository.java new file mode 100644 index 0000000..9ae1b8c --- /dev/null +++ b/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 { + + +// # # # # # # # # # # # # # # # # 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 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 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 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 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 getDivisionOfficeZoneDivAsPerDate(Integer zoneValue, Date date); + + + @Query(value="select division from ZoneDivMaster c where c.zone= :zoneValue and c.devname like '%DIV%'") + public ArrayList 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 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 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 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 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 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 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 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 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 getAllUnitOfficeAsPerZoneAsPerPunched(Integer zoneValue, Date date); + + + @Query(value="select division from ZoneDivMaster c where c.zone=:zoneValue and c.division like '%UNIT%'") + public ArrayList 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 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 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 getZonalOfficeZoneDivAsPerDate(Integer zoneValue, Date date); + + + @Query(value="select devname from ZoneDivMaster c where c.zone= :zoneValue and c.division like '%ZONAL%'") + public ArrayList 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 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 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 getAllZonalOfficesZoneAsPerDate(Date date); + + + @Query(value="select devname from ZoneDivMaster c where c.division like '%ZONAL%'") + public ArrayList 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 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 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 getLorryStationZoneDivAsPerDate(Integer zoneValue, Date date); + + + @Query(value="select division from ZoneDivMaster c where c.zone= :zoneValue and c.devname like '%LORRY%'") + public ArrayList getLorryStationZoneDivisions(Integer zoneValue); + +// # # # # # # # # # # # # # # # # Lorry Station # # # # # # # # # # # # # # # # # # # +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRAbsenteesEmpListDataRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRAbsenteesEmpListDataRepository.java new file mode 100644 index 0000000..7e00c55 --- /dev/null +++ b/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 { + +// ----------------------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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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); + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRDeptHeadQuaterOfficeRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRDeptHeadQuaterOfficeRepository.java new file mode 100644 index 0000000..e888cc7 --- /dev/null +++ b/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 { + + +// # # # # # # # # # # # # # # # # 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 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 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 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 getHQDepartmentOfficesAsPerDate(Date date); + + + @Query(value="select distinct c.devname from ZoneDivMaster c where c.division like '%HQ%'") + public ArrayList getAllHQDepartmentOffices(); + +// # # # # # # # # # # # # # # # # Department Office # # # # # # # # # # # # # # # # # # # + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMREnrolledEmpListDataRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMREnrolledEmpListDataRepository.java new file mode 100644 index 0000000..8f684de --- /dev/null +++ b/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 { + +// ----------------------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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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); + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRHeadQuaterTotalEntriesRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRHeadQuaterTotalEntriesRepository.java new file mode 100644 index 0000000..1c35238 --- /dev/null +++ b/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 { + + + @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 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 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(); +// + + + + + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRHeadQuaterZonesEntriesRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRHeadQuaterZonesEntriesRepository.java new file mode 100644 index 0000000..aa96e19 --- /dev/null +++ b/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 { + + + @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 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 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 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 getZonesAsPerPunched(Date date); + + + + + + + + + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMROtherZoneOfficesRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMROtherZoneOfficesRepository.java new file mode 100644 index 0000000..b525c26 --- /dev/null +++ b/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 { + + +// # # # # # # # # # # # # # # # # 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 getKDGPunched(Integer zoneValue, Date date); + + +// # # # # # # # # # # # # # # # # KDG # # # # # # # # # # # # # # # # # # # + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRPunchedEmpListDataRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRPunchedEmpListDataRepository.java new file mode 100644 index 0000000..5cae4ce --- /dev/null +++ b/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 { + +// ----------------------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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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); + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRRegionalDeputyCommissionerRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRRegionalDeputyCommissionerRepository.java new file mode 100644 index 0000000..e3441f8 --- /dev/null +++ b/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 { + + + + @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 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 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 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 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 getRDCZoneNames(); + + + + + + + + + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRZonalOfficeTotalDataRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRZonalOfficeTotalDataRepository.java new file mode 100644 index 0000000..9a922c3 --- /dev/null +++ b/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 { + + + @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 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 getZonalOfficeTotalPunched(Date date); + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRZoneDivisionOfficeRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nmr/NMRZoneDivisionOfficeRepository.java new file mode 100644 index 0000000..26cfa6f --- /dev/null +++ b/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 { + + +// # # # # # # # # # # # # # # # # 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 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 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 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 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 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 getDivisionOfficeZoneDivAsPerDate(Integer zoneValue, Date date); + + + @Query(value="select division from ZoneDivMaster c where c.zone= :zoneValue and c.devname like '%DIV%'") + public ArrayList 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 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 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 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 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 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 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 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 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 getAllUnitOfficeAsPerZoneAsPerPunched(Integer zoneValue, Date date); + + + @Query(value="select division from ZoneDivMaster c where c.zone=:zoneValue and c.division like '%UNIT%'") + public ArrayList 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 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 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 getZonalOfficeZoneDivAsPerDate(Integer zoneValue, Date date); + + + @Query(value="select devname from ZoneDivMaster c where c.zone= :zoneValue and c.division like '%ZONAL%'") + public ArrayList 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 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 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 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 getAllZonalOfficesZoneAsPerDate(Date date); + + + @Query(value="select devname from ZoneDivMaster c where c.division like '%ZONAL%'") + public ArrayList 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 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 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 getLorryStationZoneDivAsPerDate(Integer zoneValue, Date date); + + + @Query(value="select division from ZoneDivMaster c where c.zone= :zoneValue and c.devname like '%LORRY%'") + public ArrayList getLorryStationZoneDivisions(Integer zoneValue); + +// # # # # # # # # # # # # # # # # Lorry Station # # # # # # # # # # # # # # # # # # # +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMAbsenteesEmpListDataRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMAbsenteesEmpListDataRepository.java new file mode 100644 index 0000000..9b6a126 --- /dev/null +++ b/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 { + +// ----------------------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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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); + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMDeptHeadQuaterOfficeRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMDeptHeadQuaterOfficeRepository.java new file mode 100644 index 0000000..f84acd4 --- /dev/null +++ b/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 { + + +// # # # # # # # # # # # # # # # # 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 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 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 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 getHQDepartmentOfficesAsPerDate(Date date); + + + @Query(value="select distinct c.devname from ZoneDivMaster c where c.division like '%HQ%'") + public ArrayList getAllHQDepartmentOffices(); + +// # # # # # # # # # # # # # # # # Department Office # # # # # # # # # # # # # # # # # # # + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMEnrolledEmpListDataRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMEnrolledEmpListDataRepository.java new file mode 100644 index 0000000..70178ff --- /dev/null +++ b/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 { + +// ----------------------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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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); + + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMHeadQuaterTotalEntriesRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMHeadQuaterTotalEntriesRepository.java new file mode 100644 index 0000000..817b0f6 --- /dev/null +++ b/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 { + + + @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 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 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(); +// + + + + + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMHeadQuaterZonesEntriesRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMHeadQuaterZonesEntriesRepository.java new file mode 100644 index 0000000..b5dd744 --- /dev/null +++ b/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 { + + + @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 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 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(); +// + + + + + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMOtherZoneOfficesRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMOtherZoneOfficesRepository.java new file mode 100644 index 0000000..364ee3a --- /dev/null +++ b/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 { + + +// # # # # # # # # # # # # # # # # 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 getKDGPunched(Integer zoneValue, Date date); + + +// # # # # # # # # # # # # # # # # KDG # # # # # # # # # # # # # # # # # # # + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMPunchedEmpListDataRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMPunchedEmpListDataRepository.java new file mode 100644 index 0000000..aec07da --- /dev/null +++ b/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 { + +// ----------------------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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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); + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMRegionalDeputyCommissionerRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMRegionalDeputyCommissionerRepository.java new file mode 100644 index 0000000..8b4e765 --- /dev/null +++ b/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 { + + + + @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 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 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 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 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(); +// + + + + + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMZonalOfficeTotalDataRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMZonalOfficeTotalDataRepository.java new file mode 100644 index 0000000..b9321f6 --- /dev/null +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMZonalOfficeTotalDataRepository.java @@ -0,0 +1,36 @@ +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 NULMZonalOfficeTotalDataRepository extends JpaRepository { + + + @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 '%1100%' \r\n" + + "and c.payCode=a.userId\r\n" + + "and d.division like '%ZONAL%'\r\n" + + "and d.devname=b.deviceName") + public ArrayList 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 '%1100%'\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 getZonalOfficeTotalPunched(Date date); + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMZoneDivisionOfficeRepository.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMZoneDivisionOfficeRepository.java new file mode 100644 index 0000000..6c772d3 --- /dev/null +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/repo/nulm/NULMZoneDivisionOfficeRepository.java @@ -0,0 +1,372 @@ +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 NULMZoneDivisionOfficeRepository extends JpaRepository { + + +// # # # # # # # # # # # # # # # # 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 '%1100%' " + + "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 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 '%1100%'" + + "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 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 '%1100%'" + + "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 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 '%1100%'" + + "and cast(a.officePunch as date) = :date\r\n" + + "group by c.division\r\n" + +"order by c.division + 0 asc") + public ArrayList 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 '%1100%'" + + "and cast(a.officePunch as date) = :date\r\n" + + "group by c.division\r\n" + +"order by c.division asc") + public ArrayList 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 '%1100%'" + + "and cast(a.officePunch as date) = :date\r\n" + + "group by c.division\r\n" + +"order by c.division asc") + public ArrayList getDivisionOfficeZoneDivAsPerDate(Integer zoneValue, Date date); + + + @Query(value="select division from ZoneDivMaster c where c.zone= :zoneValue and c.devname like '%DIV%'") + public ArrayList 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 '%1100%' \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 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 '%1100%' \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 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 '%1100%' \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 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 '%1100%' \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 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 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 '%1100%'" + + "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 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 '%1100%'" + + "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 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 '%1100%'" + + "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 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 '%1100%'" + + "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 getAllUnitOfficeAsPerZoneAsPerPunched(Integer zoneValue, Date date); + + + @Query(value="select division from ZoneDivMaster c where c.zone=:zoneValue and c.division like '%UNIT%'") + public ArrayList 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 '%1100%'" + + "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 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 '%1100%'" + + "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 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 '%1100%'" + + "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 getZonalOfficeZoneDivAsPerDate(Integer zoneValue, Date date); + + + @Query(value="select devname from ZoneDivMaster c where c.zone= :zoneValue and c.division like '%ZONAL%'") + public ArrayList 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 '%1100%' " + + "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 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 '%1100%' " + + "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 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 '%1100%'" + + "and cast(a.officePunch as date) =:date\r\n" + + "group by c.zone,c.division\r\n" + + "order by c.zone") + public ArrayList 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 '%1100%'" + + "and cast(a.officePunch as date) =:date\r\n" + + "group by c.devname\r\n" + + "order by c.devname") + public ArrayList getAllZonalOfficesZoneAsPerDate(Date date); + + + @Query(value="select devname from ZoneDivMaster c where c.division like '%ZONAL%'") + public ArrayList 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 '%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" + + "group by d.division\r\n" + + "order by d.division asc") + public ArrayList 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 '%1100%'" + + "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 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 '%1100%'" + + "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 getLorryStationZoneDivAsPerDate(Integer zoneValue, Date date); + + + @Query(value="select division from ZoneDivMaster c where c.zone= :zoneValue and c.devname like '%LORRY%'") + public ArrayList getLorryStationZoneDivisions(Integer zoneValue); + +// # # # # # # # # # # # # # # # # Lorry Station # # # # # # # # # # # # # # # # # # # +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/CustomerService.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/CustomerService.java new file mode 100644 index 0000000..c7b896b --- /dev/null +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/CustomerService.java @@ -0,0 +1,17 @@ +//package com.gcc.biometric.api.GccBioMetricApi.service; +// +//import java.util.List; +// +//import com.gcc.biometric.api.GccBioMetricApi.entity.Customer; +// +//public interface CustomerService { +// +// public List findAll(); +// +// public Customer findById(String theId); +// +// public void save(Customer theCustomer); +// +// public void deleteById(String thId); +// +//} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/CustomerServiceImpl.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/CustomerServiceImpl.java new file mode 100644 index 0000000..c2b2be2 --- /dev/null +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/CustomerServiceImpl.java @@ -0,0 +1,71 @@ +//package com.gcc.biometric.api.GccBioMetricApi.service; +// +//import java.util.List; +//import java.util.Optional; +// +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.stereotype.Service; +//import org.springframework.transaction.annotation.Transactional; +//import com.gcc.biometric.api.GccBioMetricApi.entity.Customer; +//import com.gcc.biometric.api.GccBioMetricApi.repo.CustomerRepository; +// +// +//@Service +//public class CustomerServiceImpl implements CustomerService { +// +// +// //for constructor Injection +// private CustomerRepository customerRepository; +// +// +// //Constructor Injection +// @Autowired +// public CustomerServiceImpl(CustomerRepository theCustomerRepository) +// { +// customerRepository = theCustomerRepository; +// } +// +// @Transactional +// @Override +// public List findAll() { +// +// return customerRepository.findAll(); +// } +// +// @Transactional +// @Override +// public Customer findById(String theId) { +// +// Optional result = customerRepository.findById(theId); +// +// Customer theEmployee = null; +// if(result.isPresent()) +// { +// theEmployee = result.get(); +// } +// else +// { +// throw new RuntimeException("Customer not found with payCode: "+theId); +// } +// +// return theEmployee; +// } +// +// @Transactional +// @Override +// public void save(Customer theCustomer) { +// +// System.out.println("Calling save method"); +// customerRepository.save(theCustomer); +// +// } +// +// @Transactional +// @Override +// public void deleteById(String thId) { +// System.out.println("Called deletemethod from service"); +// customerRepository.deleteById(thId); +// +// } +// +//} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/DeviceStatusService.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/DeviceStatusService.java new file mode 100644 index 0000000..c2a1ed7 --- /dev/null +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/DeviceStatusService.java @@ -0,0 +1,19 @@ +package com.gcc.biometric.api.GccBioMetricApi.service; + +import java.util.ArrayList; +import java.util.List; +import com.gcc.biometric.api.GccBioMetricApi.entity.DeviceStatus; + +public interface DeviceStatusService { + + public List findAll(); + + public DeviceStatus findById(String theId); + + public void save(DeviceStatus theCustomer); + + public void deleteById(String thId); + + public ArrayList zones(); + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/DeviceStatusServiceImpl.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/DeviceStatusServiceImpl.java new file mode 100644 index 0000000..9c278a9 --- /dev/null +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/DeviceStatusServiceImpl.java @@ -0,0 +1,76 @@ +package com.gcc.biometric.api.GccBioMetricApi.service; + +import java.util.ArrayList; +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Service; +import com.gcc.biometric.api.GccBioMetricApi.entity.DeviceStatus; +import com.gcc.biometric.api.GccBioMetricApi.repo.DeviceStatusRepository; + + + +@Service +public class DeviceStatusServiceImpl implements DeviceStatusService { + + //for constructor Injection + private DeviceStatusRepository deviceStatusRepository; + + + //Constructor Injection + @Autowired + public DeviceStatusServiceImpl(DeviceStatusRepository theDeviceStatusDAO) + { + deviceStatusRepository = theDeviceStatusDAO; + } + + + @Override + public List findAll() { + // TODO Auto-generated method stub + return deviceStatusRepository.findAll(); + } + + + @Override + public DeviceStatus findById(String deviceId) { + // TODO Auto-generated method stub +// Optional result = DeviceStatusRepository.findById(deviceId); +// +// DeviceStatus theDeviceStatus = null; +// if(result.isPresent()) +// { +// theDeviceStatus = result.get(); +// } +// else +// { +// throw new RuntimeException("Customer not found with payCode: "+deviceId); +// } + + return null; + } + + + @Override + public void save(DeviceStatus theCustomer) { + // TODO Auto-generated method stub + + } + + + @Override + public void deleteById(String thId) { + // TODO Auto-generated method stub + + } + + + @Override + @Query(value="select ") + public ArrayList zones() { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/EmployeeService.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/EmployeeService.java new file mode 100644 index 0000000..ee9b1eb --- /dev/null +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/EmployeeService.java @@ -0,0 +1,29 @@ +package com.gcc.biometric.api.GccBioMetricApi.service; + + +import java.util.List; + +import com.gcc.biometric.api.GccBioMetricApi.entity.Employee; + + +public interface EmployeeService { + + public List findAll(); + + public Employee findById(String payCode); + + public void save(Employee theEmployee); + + public void deleteById(String payCode); + + + + + + +//////////////////////////////////////Doing it using JPA @Query Annotation//////////////////////////////////////// + + public List getEmpCountPerZone(); + + public List getEmpCountPresentAbsent(); +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/EmployeeServiceImpl.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/EmployeeServiceImpl.java new file mode 100644 index 0000000..925c5df --- /dev/null +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/EmployeeServiceImpl.java @@ -0,0 +1,75 @@ +package com.gcc.biometric.api.GccBioMetricApi.service; + +import java.util.List; +import java.util.Optional; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.gcc.biometric.api.GccBioMetricApi.entity.Employee; +import com.gcc.biometric.api.GccBioMetricApi.repo.EmployeeRepository; + +@Service +public class EmployeeServiceImpl implements EmployeeService { + + // for constructor Injection + + @Autowired + private EmployeeRepository employeeRepository; + + // Constructor Injection + @Autowired + public EmployeeServiceImpl(EmployeeRepository theEmployeeRepository) { + employeeRepository = theEmployeeRepository; + } + + @Override + public List findAll() { + return employeeRepository.findAll(); + + } + + @Override + public Employee findById(String payCode) { + + Optional result = employeeRepository.findById(payCode); + + Employee theEmployee = null; + if (result.isPresent()) { + theEmployee = result.get(); + } else { + throw new RuntimeException("Customer not found with payCode: " + payCode); + } + + return theEmployee; + + } + + @Override + public void save(Employee theEmployee) { + // TODO Auto-generated method stub + + } + + @Override + public void deleteById(String payCode) { + // TODO Auto-generated method stub + + } + + +//////////////////////////////////////Doing it using JPA @Query Annotation//////////////////////////////////////// + + @Override + public List getEmpCountPerZone() { + + return employeeRepository.getEmpCountPerZone(); + } + + @Override + public List getEmpCountPresentAbsent() + { + return employeeRepository.getEmpCountPresentAbsent(); + } + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/HeadQuaterEntriesService.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/HeadQuaterEntriesService.java new file mode 100644 index 0000000..9135288 --- /dev/null +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/HeadQuaterEntriesService.java @@ -0,0 +1,10 @@ +//package com.gcc.biometric.api.GccBioMetricApi.service; +// +// +//public interface HeadQuaterEntriesService { +// +// public String getZone_1(); +// public String getEnroll_1(); +// public String getPunched_1(); +// +//} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/HeadQuaterEntriesServiceImpl.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/HeadQuaterEntriesServiceImpl.java new file mode 100644 index 0000000..8dcae45 --- /dev/null +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/HeadQuaterEntriesServiceImpl.java @@ -0,0 +1,44 @@ +//package com.gcc.biometric.api.GccBioMetricApi.service; +// +// +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.stereotype.Service; +//import com.gcc.biometric.api.GccBioMetricApi.repo.HeadQuaterEntriesRepository; +// +//@Service +//public class HeadQuaterEntriesServiceImpl implements HeadQuaterEntriesService { +// +// // for constructor Injection +// +// @Autowired +// private HeadQuaterEntriesRepository headQuaterEntriesRepository; +// +// // Constructor Injection +// @Autowired +// public HeadQuaterEntriesServiceImpl(HeadQuaterEntriesRepository theHeadQuaterEntriesRepository) { +// headQuaterEntriesRepository = theHeadQuaterEntriesRepository; +// } +// +// @Override +// public String getZone_1() { +// // TODO Auto-generated method stub +// return null; +// } +// +// @Override +// public String getEnroll_1() { +// // TODO Auto-generated method stub +// return headQuaterEntriesRepository.getEnroll_1(); +// } +// +// @Override +// public String getPunched_1() { +// // TODO Auto-generated method stub +// return headQuaterEntriesRepository.getPunched_1(); +// } +// +// +// +// +// +//} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/MachineRawPunchService.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/MachineRawPunchService.java new file mode 100644 index 0000000..497775e --- /dev/null +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/MachineRawPunchService.java @@ -0,0 +1,17 @@ +package com.gcc.biometric.api.GccBioMetricApi.service; + +import java.util.List; + +import com.gcc.biometric.api.GccBioMetricApi.entity.MachineRawPunchh; + +public interface MachineRawPunchService { + + public List findAll(); + + public MachineRawPunchh findById(String cardNo); + + public void save(MachineRawPunchh theEmployee); + + public void deleteById(String cardNo); + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/MachineRawPunchServiceImpl.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/MachineRawPunchServiceImpl.java new file mode 100644 index 0000000..3565172 --- /dev/null +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/MachineRawPunchServiceImpl.java @@ -0,0 +1,57 @@ +package com.gcc.biometric.api.GccBioMetricApi.service; + +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.gcc.biometric.api.GccBioMetricApi.entity.MachineRawPunchh; +import com.gcc.biometric.api.GccBioMetricApi.repo.MachineRawPunchRepository; + + + +@Service +public class MachineRawPunchServiceImpl implements MachineRawPunchService { + + //for constructor Injection + private MachineRawPunchRepository machineRawPunchRepository; + + + //Constructor Injection + @Autowired + public MachineRawPunchServiceImpl(MachineRawPunchRepository theMachineRawPunchRepository) + { + machineRawPunchRepository = theMachineRawPunchRepository; + } + + + @Override + public List findAll() { + // TODO Auto-generated method stub + return machineRawPunchRepository.findAll(); + } + + + @Override + public MachineRawPunchh findById(String cardNo) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public void save(MachineRawPunchh theEmployee) { + // TODO Auto-generated method stub + + } + + + @Override + public void deleteById(String cardNo) { + // TODO Auto-generated method stub + + } + + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/RealTimeUserInfoService.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/RealTimeUserInfoService.java new file mode 100644 index 0000000..9f0747b --- /dev/null +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/RealTimeUserInfoService.java @@ -0,0 +1,17 @@ +package com.gcc.biometric.api.GccBioMetricApi.service; + +import java.util.List; + +import com.gcc.biometric.api.GccBioMetricApi.entity.RealTimeUserInfo; + +public interface RealTimeUserInfoService { + + public List findAll(); + + public RealTimeUserInfo findById(String userId); + + public void save(RealTimeUserInfo theRealTimeUserInfo); + + public void deleteById(String userId); + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/RealTimeUserInfoServiceImpl.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/RealTimeUserInfoServiceImpl.java new file mode 100644 index 0000000..564974e --- /dev/null +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/RealTimeUserInfoServiceImpl.java @@ -0,0 +1,56 @@ +package com.gcc.biometric.api.GccBioMetricApi.service; + +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.gcc.biometric.api.GccBioMetricApi.entity.RealTimeUserInfo; +import com.gcc.biometric.api.GccBioMetricApi.repo.RealTimeUserInfoRepository; + + + +@Service +public class RealTimeUserInfoServiceImpl implements RealTimeUserInfoService { + + //for constructor Injection + @Autowired + private RealTimeUserInfoRepository realTimeUserInfoRepository; + + + //Constructor Injection + @Autowired + public RealTimeUserInfoServiceImpl(RealTimeUserInfoRepository theRealTimeUserInfoRepository) + { + realTimeUserInfoRepository = theRealTimeUserInfoRepository; + } + + + @Override + public List findAll() { + // TODO Auto-generated method stub + return realTimeUserInfoRepository.findAll(); + } + + + @Override + public RealTimeUserInfo findById(String userId) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public void save(RealTimeUserInfo theRealTimeUserInfo) { + // TODO Auto-generated method stub + + } + + + @Override + public void deleteById(String userId) { + // TODO Auto-generated method stub + + } + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/ZoneDivMasterService.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/ZoneDivMasterService.java new file mode 100644 index 0000000..dddf580 --- /dev/null +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/ZoneDivMasterService.java @@ -0,0 +1,12 @@ +package com.gcc.biometric.api.GccBioMetricApi.service; + +import java.util.HashSet; + +import com.gcc.biometric.api.GccBioMetricApi.entity.ZoneDivMaster; + +public interface ZoneDivMasterService { + + + public HashSet getZoneList(); + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/ZoneDivMasterServiceImpl.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/ZoneDivMasterServiceImpl.java new file mode 100644 index 0000000..4df16b1 --- /dev/null +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/service/ZoneDivMasterServiceImpl.java @@ -0,0 +1,40 @@ +package com.gcc.biometric.api.GccBioMetricApi.service; + +import java.util.HashSet; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.gcc.biometric.api.GccBioMetricApi.entity.ZoneDivMaster; +import com.gcc.biometric.api.GccBioMetricApi.repo.ZoneDivisionOfficeRepository; + + +@Service +public class ZoneDivMasterServiceImpl implements ZoneDivMasterService { + + + //for constructor Injection + @Autowired + private ZoneDivisionOfficeRepository zoneDivMasterRepository; + + + //Constructor Injection + @Autowired + public ZoneDivMasterServiceImpl(ZoneDivisionOfficeRepository theZoneDivMasterRepository) + { + zoneDivMasterRepository = theZoneDivMasterRepository; + } + + @Override + public HashSet getZoneList() { + + //HashSet tempList = zoneDivMasterRepository.getZoneList(); + + return null; + + } + + + +} diff --git a/src/main/java/com/gcc/biometric/api/GccBioMetricApi/swagger/SwaggerConfig.java b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/swagger/SwaggerConfig.java new file mode 100644 index 0000000..2eeac80 --- /dev/null +++ b/src/main/java/com/gcc/biometric/api/GccBioMetricApi/swagger/SwaggerConfig.java @@ -0,0 +1,31 @@ +//package com.gcc.biometric.api.GccBioMetricApi.swagger; +// +//import org.springframework.context.annotation.Bean; +//import org.springframework.stereotype.Component; +// +//import springfox.documentation.builders.ApiInfoBuilder; +//import springfox.documentation.service.ApiInfo; +//import springfox.documentation.spi.DocumentationType; +//import springfox.documentation.spring.web.plugins.Docket; +//import springfox.documentation.swagger2.annotations.EnableSwagger2; +// +//@Component +//@EnableSwagger2 +//public class SwaggerConfig { +// +// @Bean +// public Docket getDocket() +// { +// return new Docket(DocumentationType.SWAGGER_2) +// .groupName("public=apis") +// .apiInfo(getApiInfo()) +// .select().build(); +// } +// +// public ApiInfo getApiInfo() { +// +// return new ApiInfoBuilder().title("Gcc Attendence Api") +// .description("API created by SS").version("1.0").build(); +// } +// +//} diff --git a/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/src/main/resources/META-INF/additional-spring-configuration-metadata.json new file mode 100644 index 0000000..989a42f --- /dev/null +++ b/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -0,0 +1,5 @@ +{"properties": [{ + "name": "spring.jpa.hibernate.dialect", + "type": "java.lang.String", + "description": "A description for 'spring.jpa.hibernate.dialect'" +}]} \ No newline at end of file diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties new file mode 100644 index 0000000..b826454 --- /dev/null +++ b/src/main/resources/application.properties @@ -0,0 +1,70 @@ +#Production + +spring.datasource.url=jdbc:sqlserver://10.6.1.165:1433;databaseName=iASweb;encrypt=true;trustServerCertificate=true; + +spring.datasource.username=sa + +spring.datasource.password=sss + +spring.datasource.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver + +spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.SQLServer2012Dialect + +server.port=8090 + +#server.address=117.232.67.158 + +#server.address=10.6.10.193 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#spring.jpa.show-sql=true +#spring.jpa.hibernate.ddl-auto=none +#server.port=8099 +#server.address=10.6.10.193 + + + +#spring.datasource.url=jdbc:sqlserver://SACHINSAVITA\\SQLEXPRESS:1433;encrypt=false;databaseName=iASweb +#spring.datasource.username=MicroSystem +#spring.datasource.password=micro@123 +#spring.datasource.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver +#server.port=8090 +#server.address=localhost +#server.address=10.6.10.193 +#server.address=10.6.1.165 +#DESKTOP-IR2M3UU\SQLEXPRESS \ No newline at end of file diff --git a/src/test/java/com/gcc/biometric/api/GccBioMetricApi/GccAttendanceApplicationTests.java b/src/test/java/com/gcc/biometric/api/GccBioMetricApi/GccAttendanceApplicationTests.java new file mode 100644 index 0000000..5222745 --- /dev/null +++ b/src/test/java/com/gcc/biometric/api/GccBioMetricApi/GccAttendanceApplicationTests.java @@ -0,0 +1,13 @@ +package com.gcc.biometric.api.GccBioMetricApi; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class GccAttendanceApplicationTests { + + @Test + void contextLoads() { + } + +}