Browse Source

first commit

master
unknown 3 years ago
commit
fdd09e636c
  1. 33
      .gitignore
  2. 10
      Query-license expiry.txt
  3. 316
      mvnw
  4. 188
      mvnw.cmd
  5. 82
      pom.xml
  6. 13
      src/main/java/com/gcc/pets/Pets/Registration/PetsRegistrationApplication.java
  7. 57
      src/main/java/com/gcc/pets/Pets/Registration/component/UserSessionInterceptor.java
  8. 19
      src/main/java/com/gcc/pets/Pets/Registration/configuration/WebConfig.java
  9. 603
      src/main/java/com/gcc/pets/Pets/Registration/controller/APIController.java
  10. 233
      src/main/java/com/gcc/pets/Pets/Registration/controller/AdminAPIController.java
  11. 372
      src/main/java/com/gcc/pets/Pets/Registration/controller/AdminController.java
  12. 57
      src/main/java/com/gcc/pets/Pets/Registration/controller/MainController.java
  13. 212
      src/main/java/com/gcc/pets/Pets/Registration/controller/OfficerController.java
  14. 132
      src/main/java/com/gcc/pets/Pets/Registration/controller/PetController.java
  15. 110
      src/main/java/com/gcc/pets/Pets/Registration/controller/PetOwnerController.java
  16. 272
      src/main/java/com/gcc/pets/Pets/Registration/controller/SuperAdminController.java
  17. 192
      src/main/java/com/gcc/pets/Pets/Registration/customQuery/PetdetailsCustomQuery.java
  18. 4
      src/main/java/com/gcc/pets/Pets/Registration/customQuery/PetdetailsQuery.java
  19. 53
      src/main/java/com/gcc/pets/Pets/Registration/dto/DogAndCatCountInZone.java
  20. 18
      src/main/java/com/gcc/pets/Pets/Registration/dto/PetSelectedInfo.java
  21. 74
      src/main/java/com/gcc/pets/Pets/Registration/dto/PetShortInfo.java
  22. 65
      src/main/java/com/gcc/pets/Pets/Registration/dto/PetStatusDateDto.java
  23. 131
      src/main/java/com/gcc/pets/Pets/Registration/dto/Petdetaildto.java
  24. 30
      src/main/java/com/gcc/pets/Pets/Registration/exception/ErrorResponse.java
  25. 36
      src/main/java/com/gcc/pets/Pets/Registration/exception/GlobalExceptionHandler.java
  26. 0
      src/main/java/com/gcc/pets/Pets/Registration/login/CheckUserSession.java
  27. 48
      src/main/java/com/gcc/pets/Pets/Registration/login/LoginController.java
  28. 26
      src/main/java/com/gcc/pets/Pets/Registration/login/UserService.java
  29. 75
      src/main/java/com/gcc/pets/Pets/Registration/login/UserSession.java
  30. 36
      src/main/java/com/gcc/pets/Pets/Registration/model/Admin.java
  31. 40
      src/main/java/com/gcc/pets/Pets/Registration/model/Breed.java
  32. 52
      src/main/java/com/gcc/pets/Pets/Registration/model/LoginDetail.java
  33. 59
      src/main/java/com/gcc/pets/Pets/Registration/model/OldPetLicense.java
  34. 289
      src/main/java/com/gcc/pets/Pets/Registration/model/OldPetdetails.java
  35. 50
      src/main/java/com/gcc/pets/Pets/Registration/model/Orderslogs.java
  36. 80
      src/main/java/com/gcc/pets/Pets/Registration/model/Payment.java
  37. 61
      src/main/java/com/gcc/pets/Pets/Registration/model/PetLicense.java
  38. 164
      src/main/java/com/gcc/pets/Pets/Registration/model/PetOwner.java
  39. 291
      src/main/java/com/gcc/pets/Pets/Registration/model/Petdetails.java
  40. 66
      src/main/java/com/gcc/pets/Pets/Registration/model/SMSsender.java
  41. 55
      src/main/java/com/gcc/pets/Pets/Registration/model/Signature.java
  42. 72
      src/main/java/com/gcc/pets/Pets/Registration/model/VeterinaryOfficers.java
  43. 47
      src/main/java/com/gcc/pets/Pets/Registration/others/AppConfig.java
  44. 11
      src/main/java/com/gcc/pets/Pets/Registration/repo/AdminRepository.java
  45. 16
      src/main/java/com/gcc/pets/Pets/Registration/repo/BreedRepository.java
  46. 24
      src/main/java/com/gcc/pets/Pets/Registration/repo/Logindetail.java
  47. 8
      src/main/java/com/gcc/pets/Pets/Registration/repo/OldPetLicenseRepository.java
  48. 8
      src/main/java/com/gcc/pets/Pets/Registration/repo/OldPetdetailsRepository.java
  49. 9
      src/main/java/com/gcc/pets/Pets/Registration/repo/OrderslogsRepository.java
  50. 16
      src/main/java/com/gcc/pets/Pets/Registration/repo/PaymentRepository.java
  51. 26
      src/main/java/com/gcc/pets/Pets/Registration/repo/PetLicenseRepository.java
  52. 27
      src/main/java/com/gcc/pets/Pets/Registration/repo/PetOwnerRepository.java
  53. 156
      src/main/java/com/gcc/pets/Pets/Registration/repo/PetdetailsRepository.java
  54. 9
      src/main/java/com/gcc/pets/Pets/Registration/repo/SMSsenderRepository.java
  55. 7
      src/main/java/com/gcc/pets/Pets/Registration/repo/SignatureRepository.java
  56. 19
      src/main/java/com/gcc/pets/Pets/Registration/repo/VeterinaryOfficersRepository.java
  57. 15
      src/main/java/com/gcc/pets/Pets/Registration/service/OfficerService.java
  58. 53
      src/main/java/com/gcc/pets/Pets/Registration/service/OfficerServiceImpl.java
  59. 12
      src/main/java/com/gcc/pets/Pets/Registration/service/PetLicenseService.java
  60. 110
      src/main/java/com/gcc/pets/Pets/Registration/service/PetLicenseServiceImpl.java
  61. 19
      src/main/java/com/gcc/pets/Pets/Registration/service/PetOwnerService.java
  62. 142
      src/main/java/com/gcc/pets/Pets/Registration/service/PetOwnerServiceImpl.java
  63. 49
      src/main/java/com/gcc/pets/Pets/Registration/service/PetdetailsService.java
  64. 393
      src/main/java/com/gcc/pets/Pets/Registration/service/PetdetailsServiceImpl.java
  65. 53
      src/main/resources/application.properties
  66. 65
      src/main/resources/static/assets/_js/main/app.js
  67. 1110
      src/main/resources/static/assets/_js/main/modules/helpers.js
  68. 802
      src/main/resources/static/assets/_js/main/modules/template.js
  69. 179
      src/main/resources/static/assets/_js/pages/be_comp_calendar.js
  70. 143
      src/main/resources/static/assets/_js/pages/be_comp_charts.js
  71. 156
      src/main/resources/static/assets/_js/pages/be_comp_chat.js
  72. 106
      src/main/resources/static/assets/_js/pages/be_comp_dialogs.js
  73. 88
      src/main/resources/static/assets/_js/pages/be_comp_image_cropper.js
  74. 154
      src/main/resources/static/assets/_js/pages/be_comp_maps_vector.js
  75. 47
      src/main/resources/static/assets/_js/pages/be_comp_nestable.js
  76. 41
      src/main/resources/static/assets/_js/pages/be_comp_onboarding.js
  77. 50
      src/main/resources/static/assets/_js/pages/be_comp_rating.js
  78. 124
      src/main/resources/static/assets/_js/pages/be_forms_validation.js
  79. 89
      src/main/resources/static/assets/_js/pages/be_pages_dashboard.js
  80. 225
      src/main/resources/static/assets/_js/pages/be_pages_dashboard_v1.js
  81. 104
      src/main/resources/static/assets/_js/pages/be_pages_ecom_dashboard.js
  82. 271
      src/main/resources/static/assets/_js/pages/be_pages_projects_tasks.js
  83. 101
      src/main/resources/static/assets/_js/pages/be_tables_datatables.js
  84. 45
      src/main/resources/static/assets/_js/pages/be_ui_animations.js
  85. 2184
      src/main/resources/static/assets/_js/pages/be_ui_icons.js
  86. 41
      src/main/resources/static/assets/_js/pages/be_ui_progress.js
  87. 73
      src/main/resources/static/assets/_js/pages/db_analytics.js
  88. 144
      src/main/resources/static/assets/_js/pages/db_corporate_slim.js
  89. 93
      src/main/resources/static/assets/_js/pages/db_crypto.js
  90. 42
      src/main/resources/static/assets/_js/pages/op_auth_lock.js
  91. 42
      src/main/resources/static/assets/_js/pages/op_auth_reminder.js
  92. 51
      src/main/resources/static/assets/_js/pages/op_auth_signin.js
  93. 69
      src/main/resources/static/assets/_js/pages/op_auth_signup.js
  94. 34
      src/main/resources/static/assets/_js/pages/op_coming_soon.js
  95. 78
      src/main/resources/static/assets/_js/pages/op_installation.js
  96. 149
      src/main/resources/static/assets/_scss/bootstrap/_accordion.scss
  97. 71
      src/main/resources/static/assets/_scss/bootstrap/_alert.scss
  98. 38
      src/main/resources/static/assets/_scss/bootstrap/_badge.scss
  99. 40
      src/main/resources/static/assets/_scss/bootstrap/_breadcrumb.scss
  100. 142
      src/main/resources/static/assets/_scss/bootstrap/_button-group.scss

33
.gitignore

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

10
Query-license expiry.txt

@ -0,0 +1,10 @@
DELIMITER //
CREATE EVENT EXPIRY
ON SCHEDULE EVERY 1 DAY
DO BEGIN
UPDATE petdetails
SET `status` = 4
WHERE uniqueid IN (SELECT uniqueid FROM pet_license WHERE (`date` + INTERVAL 1 YEAR) < NOW());
END//
DELIMITER ;

316
mvnw

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

188
mvnw.cmd

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

82
pom.xml

@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.0.4</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.gcc.pets</groupId>
<artifactId>Pets-Registration</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>Pets-Registration</name>
<description>GREATER CHENNAI CORPORATION - Pets Registration</description>
<properties>
<java.version>17</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.razorpay</groupId>
<artifactId>razorpay-java</artifactId>
<version>1.4.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.10.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

13
src/main/java/com/gcc/pets/Pets/Registration/PetsRegistrationApplication.java

@ -0,0 +1,13 @@
package com.gcc.pets.Pets.Registration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class PetsRegistrationApplication {
public static void main(String[] args) {
SpringApplication.run(PetsRegistrationApplication.class, args);
}
}

57
src/main/java/com/gcc/pets/Pets/Registration/component/UserSessionInterceptor.java

@ -0,0 +1,57 @@
package com.gcc.pets.Pets.Registration.component;
import com.gcc.pets.Pets.Registration.login.UserSession;
import com.gcc.pets.Pets.Registration.others.AppConfig;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;
import java.util.Arrays;
import java.util.List;
@Component
public class UserSessionInterceptor implements HandlerInterceptor {
@Autowired
private UserSession userSession;
@Autowired
private AppConfig appConfig;
private static final List<String> EXCLUDED_URLS = Arrays.asList("/login", "/", "/api");
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
// Get the current request URL
String requestUrl = request.getRequestURI();
// Exclude static resources from the check
if (requestUrl.startsWith("/assets/") || requestUrl.startsWith("/css/") || requestUrl.startsWith("/js/") || requestUrl.startsWith("/images/") || requestUrl.startsWith("/api/")) {
return true; // Allow the request to proceed without checking the login status
}
// Exclude the login page from the check
// Exclude specific URLs from the check
if (EXCLUDED_URLS.contains(requestUrl)) {
return true; // Allow the request to proceed without checking the login status
}
// Check if the user is logged in
// If logged in, add the userSession to the model
// Return true to allow the request to proceed
//if (isLoggedIn()) {
if(userSession.getUserId() != null && userSession.getUserType() != null) {
request.setAttribute("userSession", userSession);
} else {
request.setAttribute("title", "Login");
request.setAttribute("baseURL", appConfig.getBaseUrl());
response.sendRedirect("/login");
return false; // Stop further processing of the request
}
return true; // Allow the request to proceed
}
private boolean isLoggedIn() {
// Implement your login check logic here
// For example, check if the userSession contains the necessary information
return userSession.getUserId() != null && userSession.getUserType() != null;
}
}

19
src/main/java/com/gcc/pets/Pets/Registration/configuration/WebConfig.java

@ -0,0 +1,19 @@
package com.gcc.pets.Pets.Registration.configuration;
import com.gcc.pets.Pets.Registration.component.UserSessionInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class WebConfig implements WebMvcConfigurer {
@Autowired
private UserSessionInterceptor userSessionInterceptor;
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(userSessionInterceptor);
}
}

603
src/main/java/com/gcc/pets/Pets/Registration/controller/APIController.java

@ -0,0 +1,603 @@
package com.gcc.pets.Pets.Registration.controller;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import com.gcc.pets.Pets.Registration.dto.PetSelectedInfo;
import com.gcc.pets.Pets.Registration.model.*;
import com.gcc.pets.Pets.Registration.repo.*;
import jakarta.servlet.ServletOutputStream;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.multipart.MultipartFile;
import com.gcc.pets.Pets.Registration.login.UserSession;
import com.gcc.pets.Pets.Registration.others.AppConfig;
import com.gcc.pets.Pets.Registration.service.PetLicenseServiceImpl;
import com.gcc.pets.Pets.Registration.service.PetOwnerServiceImpl;
import com.gcc.pets.Pets.Registration.service.PetdetailsServiceImpl;
import com.google.gson.Gson;
import com.razorpay.Order;
import com.razorpay.RazorpayClient;
import com.razorpay.RazorpayException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpSession;
@RequestMapping("/api")
@RestController
public class APIController {
@Autowired
private AppConfig appConfig;
@Autowired
private UserSession userSession;
@Autowired
private PetOwnerServiceImpl ownser;
@Autowired
private Logindetail loginrepo;
@Autowired
private OrderslogsRepository orderslogrepo;
@Autowired
private PaymentRepository payrepo;
@Autowired
private PetdetailsServiceImpl petser;
@Autowired
private PetLicenseServiceImpl licser;
@Autowired
private BreedRepository breedrepo;
@Autowired
private VeterinaryOfficersRepository offrepo;
@Autowired
private PetdetailsRepository petrepoo;
@Autowired
private SMSsenderRepository smsrepo;
@GetMapping(value = "/sendOTP")
public String sendOtp(HttpServletRequest request, @RequestParam String mobileNo,@RequestParam String purpose) {
String MobileNo=mobileNo;
System.out.print("\n MobileNo---:"+mobileNo);
Random rand = new Random();
int otp = rand.nextInt(90000) + 10000;
System.out.print("\n otp---:"+otp);
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("dd-MMM-yyyy%20HH:mm");
LocalDateTime now = LocalDateTime.now();
System.out.println(dtf.format(now));
String generatedToken = "Welcome to GCC "+otp+" is your OTP for gcc QR System";
// String key="qxg4mklD";
String key="pfTEYN6H";
String urlString= appConfig.getGetOtpUrl()+"from=GCCCRP&key="+key+"&sender=GCCCRP&to="+MobileNo+"&body="+generatedToken+"&entityid=1401572690000011081&templateid=1407168250479102852";
// String urlString=appConfig.getGetOtpUrl()+"user=GCCtrans&authkey=92kOC1RBGBIws&sender=GCCCRP&mobile="+MobileNo+"&text="+generatedToken+"&rpt=1&summary=1&output=json&entityid=1401572690000011081&templateid=1407168250479102852";
System.out.print("\n urlString---: "+urlString);
String bodyMessage = "";
try {
RestTemplate restTemplate = new RestTemplate();
String Response = restTemplate.getForObject(urlString, String.class);
bodyMessage=Response;
System.out.println("\n bodyMessage"+bodyMessage);
SMSsender sms = new SMSsender();
sms.setPhone(Long.parseLong(mobileNo));
sms.setCdate(new Date());
sms.setBodyMsg(bodyMessage);
sms.setPurpose(purpose);
smsrepo.save(sms);
System.out.println("OTP sent successfully!");
} catch (Exception e) {
System.out.print("ERROR---: "+e);
bodyMessage = "Error";
}
HttpSession session = request.getSession();
session.setAttribute("otp", otp);
return bodyMessage;
}
@GetMapping(value = "/verifyOTP")
public String verifyOtp(HttpServletRequest request, @RequestParam String otp) {
HttpSession session = request.getSession();
try {
Integer session_otp = (Integer) session.getAttribute("otp");
System.out.println("session_otp---:" + session_otp);
Integer entered_otp = Integer.parseInt(otp);
if (session_otp != null && session_otp.equals(entered_otp)) {
System.out.println("Entered OTP Correct");
session.setAttribute("verifiedotp", "success");
return "Success";
} else {
System.out.println("Incorrect OTP. Please enter correct OTPs.");
session.setAttribute("verifiedotp", "error");
return "Error";
}
} catch (NumberFormatException e) {
System.out.println("Invalid OTP format: " + otp);
return "Error";
} catch (Exception e) {
System.out.println("Error verifying OTP: " + e.getMessage());
return "Error";
}
}
@GetMapping("/savePIN")
public String submitedform(HttpServletRequest request,
@RequestParam String title,@RequestParam String fname,
@RequestParam String doornumber,@RequestParam String street,
@RequestParam String area,@RequestParam String city,@RequestParam String pincode,
@RequestParam String zone,@RequestParam String ward,
@RequestParam String phone,@RequestParam String email,
@RequestParam String pin
) {
System.out.println("save pin"+pin);
if(pincode.isEmpty() && !pin.isEmpty()) {
//System.out.println("forgrt ");
LoginDetail mod= loginrepo.checkUserbyMobile(Long.parseLong(phone));
if(mod!=null) {
mod.setId(mod.getId());
mod.setMobileno(Long.parseLong(phone));
mod.setPin(pin);
mod.setUsertype(mod.getUsertype());
loginrepo.save(mod);
return "Success";
}
else {
return "Error";
}
}
HttpSession session = request.getSession();
PetOwner pet = new PetOwner();
pet.setTitle(title);
pet.setFname(fname);
pet.setDoornumber(doornumber);
pet.setStreet(street);
pet.setArea(area);
pet.setCity(city);
pet.setPincode(pincode);
pet.setZone(zone);
pet.setWard(ward);
pet.setPhone(phone);
pet.setEmail(email);
String s = ownser.save(pet);
if(s.equals("success")) {
LoginDetail login = new LoginDetail();
login.setMobileno(Long.parseLong(phone));
login.setPin(pin);
login.setUsertype("user");
login.setZone(zone);
loginrepo.save(login);
return "Success";
}
return s;
}
@GetMapping(value = "/login")
public String login(HttpServletRequest request, @RequestParam String uname, @RequestParam String upass){
// System.out.println(uname+"......");
LoginDetail petown =loginrepo.checkUser(Long.parseLong(uname), upass);
if(petown!=null) {
userSession.setUserId(petown.getId());
userSession.setMobNo(petown.getMobileno());
userSession.setUserType(petown.getUsertype());
userSession.setZone(petown.getZone());
return petown.getUsertype();
}
else {
return "Error";
}
}
@PostMapping("/create_order")
@ResponseBody
public String createOrder(@RequestBody Map<String,Object> data) throws RazorpayException {
int pet_id= (int) data.get("id");
double amount=Double.parseDouble("50");
var client= new RazorpayClient("rzp_live_ySI5Ns54Y7qOcJ","Nwf1TjhUtaskof8vePkRR8Sb");
// var client= new RazorpayClient("rzp_test_g9lA3ldDgapZQq","cj4pS2qEMuJcVsLAz2hHqNnl");
JSONObject options = new JSONObject();
options.put("amount", amount*100);
options.put("currency", "INR");
// options.put("receipt","HRC"+"/"+user_id+"/"+inv);
Order od=client.orders.create( options);
Orderslogs or = new Orderslogs();
or.setOrder_id(od.get("id"));
or.setOrderInfo(od.toString());
or.setUniqueid(pet_id);
orderslogrepo.save(or);
System.out.println(od);
return od.toString();
}
@PostMapping("/Confirm")
public ResponseEntity<?> updateOrder(@RequestBody Map<String,Object> data){
int user_id=(int) data.get("id");
String pay_id= data.get("payment_id").toString();
String order_id=data.get("order_id").toString();
String status=data.get("status").toString();
int uniqueid = (int)data.get("id");
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss");
LocalDateTime now = LocalDateTime.now();
System.out.println(data);
long mobno=userSession.getMobNo();
Payment pay = new Payment();
pay.setMobno(mobno);
pay.setUniqueid(uniqueid);
pay.setPaymentId(pay_id);
pay.setAmount(50);
pay.setPaymentStatus(status);
pay.setPaymentdate(dtf.format(now));
pay.setOrder_id(order_id);
payrepo.save(pay);
licser.savePetLicense(uniqueid, mobno);
// System.out.println(pay_id+""+status);
return ResponseEntity.ok(Map.of("msg","updated"));
}
@GetMapping(value = "/accept")
public String acceptPetById(HttpServletRequest request, @RequestParam String id,@RequestParam String mobileNo) {
// System.out.println("accept");
String s =petser.updateAcceptStatus(Integer.parseInt(id), 1,null,null);
if(s.equals("ok")) {
// PetSelectedInfo pet = petrepo.getpetetailsbyUniqueid(Integer.parseInt(id));
String generatedToken = "Your Application for Pet license has been accepted. Follow this link towards payment of license fee of Rs.50/- By GCC";
// String key="qxg4mklD";
// String key="pfTEYN6H";
String key="mRSm0zym";
// long MobileNo = pet.getMobilenum();
// String urlString=appConfig.getGetOtpUrl()+"user=GCCtrans&authkey=92kOC1RBGBIws&sender=GCCCRP&mobile="+MobileNo+"&text="+generatedToken+"&rpt=1&summary=1&output=json&entityid=1401572690000011081&templateid=1407168423376962032";
String urlString=appConfig.getGetOtpUrl()+"from=GCCCRP&key="+key+"&sender=GCCCRP&to="+mobileNo+"&body="+generatedToken+"&entityid=1401572690000011081&templateid=1407168423376962032";
System.out.print("\n urlString---: "+urlString);
String bodyMessage = "";
try {
RestTemplate restTemplate = new RestTemplate();
String Response = restTemplate.getForObject(urlString, String.class);
bodyMessage=Response;
SMSsender sms = new SMSsender();
sms.setPhone(Long.parseLong(mobileNo));
sms.setCdate(new Date());
sms.setBodyMsg(bodyMessage);
sms.setPurpose("Pet Accepted");
smsrepo.save(sms);
System.out.println("\n bodyMessage"+bodyMessage);
} catch (Exception e) {
// e.printStackTrace();
System.out.print("ERROR---: "+e);
bodyMessage = "Error";
}
}
// petser.updateAcceptStatus(Integer.parseInt(id), 1);
String bodyMessage="success";
return bodyMessage;
}
@GetMapping(value = "/reject")
public String rejectPetById(HttpServletRequest request, @RequestParam String id, @RequestParam String reason,@RequestParam String mobileNo) {
String s =petser.updateRejectStatus(3,reason,Integer.parseInt(id),null,null);
if(s.equals("ok")) {
// Petdetails pet = petser.getpetetailsbyUniqueid(Integer.parseInt(id));
String generatedToken = "Your Application for Pet license is rejected due to irrelevant/ insufficient Pet/Owner detail(s). By GCC";
// String key ="qxg4mklD" ;
String key="mRSm0zym";
// long MobileNo = pet.getMobilenum();
// String urlString=appConfig.getGetOtpUrl()+"user=GCCtrans&authkey=92kOC1RBGBIws&sender=GCCCRP&mobile="+MobileNo+"&text="+generatedToken+"&rpt=1&summary=1&output=json&entityid=1401572690000011081&templateid=1407168423383126580";
String urlString=appConfig.getGetOtpUrl()+"from=GCCCRP&key="+key+"&sender=GCCCRP&to="+mobileNo+"&body="+generatedToken+"&entityid=1401572690000011081&templateid=1407168423383126580";
// System.out.print("\n urlString---: "+urlString);
String bodyMessage = "";
try {
RestTemplate restTemplate = new RestTemplate();
String Response = restTemplate.getForObject(urlString, String.class);
bodyMessage=Response;
SMSsender sms = new SMSsender();
sms.setPhone(Long.parseLong(mobileNo));
sms.setCdate(new Date());
sms.setBodyMsg(bodyMessage);
sms.setPurpose("Pet Rejected");
smsrepo.save(sms);
// System.out.println(bodyMessage);
} catch (Exception e) {
// e.printStackTrace();
System.out.print("ERROR---: "+e);
bodyMessage = "Error";
}
}
// petser.updateRejectStatus(3,reason,Integer.parseInt(id));
return "success";
}
@GetMapping(value = "/getpetOwner")
public ResponseEntity<?> getPetOwnerByNo(HttpServletRequest request, @RequestParam String mobilenum) {
PetOwner own =ownser.getByMobNo(Long.parseLong(mobilenum));
return ResponseEntity.ok(own);
}
@GetMapping(value = "/getpetInfo")
public ResponseEntity<?> getPetInfoByPetId(HttpServletRequest request, @RequestParam String petid) {
Petdetails pet =petser.getpetetailsbyUniqueid(Integer.parseInt(petid));
return ResponseEntity.ok(pet);
}
@GetMapping(value = "/getlicenseinfo")
public ResponseEntity<?> getlicenseinfo(HttpServletRequest request, @RequestParam String mobilenum,
@RequestParam String uniqueid) {
PetLicense own=licser.getbymobnoanduniqueId(Long.parseLong(mobilenum), Integer.parseInt(uniqueid));
return ResponseEntity.ok(own);
}
@GetMapping(value = "/getlicensebylicno")
public ResponseEntity<?> getlicensebyno(HttpServletRequest request, @RequestParam String licno) {
PetLicense own=licser.getByLicenseNo(licno);
return ResponseEntity.ok(own);
}
@GetMapping(value = "/getbreed")
public ResponseEntity<?> getBreed(HttpServletRequest request, @RequestParam String type) {
if(Integer.parseInt(type)==0){
List<Breed> breed = breedrepo.findAll();
return ResponseEntity.ok(breed);
}
List<Breed> breed = breedrepo.getbreedbyType(Integer.parseInt(type));
return ResponseEntity.ok(breed);
}
@RequestMapping(value="/updatePetInfo",method=RequestMethod.POST)
public String editPetInfo(HttpServletRequest request,
@RequestParam("petid") String petid,
@RequestParam String petname,
@RequestParam String species,
@RequestParam String breed,
@RequestParam String gender,
@RequestParam String age,
@RequestParam String arvdate,
@RequestParam String dewormdate,
@RequestParam String othervac,
@RequestParam String prelicno,
@RequestParam String vetdrname,
@RequestParam String tnvncno,
@RequestParam(required=false) MultipartFile applicantimg,
@RequestParam(required=false) MultipartFile addressproimg,
@RequestParam(required=false) MultipartFile petimg,
@RequestParam(required=false) MultipartFile rabvacimg
) {
Petdetails pet = new Petdetails();
pet.setUniqueid(Integer.parseInt(petid));
pet.setPetname(petname);
pet.setSpecies(species);
pet.setBreed(breed);
pet.setGender(gender);
pet.setDewormdate(dewormdate);
pet.setVeterinaryConsultant(vetdrname);
pet.setTNVCNo(tnvncno);
pet.setAge(age);
pet.setPrevioslicenseNo(prelicno);
pet.setArvdate(arvdate);
pet.setOthervac(othervac);
petser.updatedetail(pet, applicantimg, addressproimg, petimg, rabvacimg);
return "Success";
}
@GetMapping(value = "/checkMobileExits")
public String checkMobileExits(HttpServletRequest request, @RequestParam String phone) {
//System.out.println("correction in pin"+phone);
LoginDetail mod= loginrepo.checkUserbyMobile(Long.parseLong(phone));
//System.out.println(mod);
if(mod!=null){
return "success";
}
else {
return "error";
}
}
@GetMapping(value = "/getpetimg")
public ResponseEntity<?> getPetImg(HttpServletRequest request, @RequestParam String mobno,@RequestParam String uniqueid) {
List<?> pet = petrepoo.getPetImage(uniqueid);
return ResponseEntity.ok(pet.get(0));
}
@GetMapping(value = "/getapplicantimg")
public ResponseEntity<?> getapplicantImg(HttpServletRequest request, @RequestParam String mobno,@RequestParam String uniqueid) {
System.out.println("Applicant Image Call"+mobno+"Id;"+uniqueid);
List<?> pet = petrepoo.getApplicantImage(uniqueid);
return ResponseEntity.ok(pet.get(0));
}
@GetMapping(value = "/getvacimg")
public ResponseEntity<?> getvacImg(HttpServletRequest request, @RequestParam String mobno,@RequestParam String uniqueid) {
System.out.println("Rabies Image Call"+mobno+"Id;"+uniqueid);
List<?> pet = petrepoo.getRabiesCertiImage(uniqueid);
return ResponseEntity.ok(pet.get(0));
}
@GetMapping(value = "/getaddproofimg")
public ResponseEntity<?> getaddproofImg(HttpServletRequest request, @RequestParam String mobno,@RequestParam String uniqueid) {
System.out.println("Address Image Call"+mobno+"Id;"+uniqueid);
List<?> pet= petrepoo.getAddressProofImage(uniqueid);
return ResponseEntity.ok(pet.get(0));
}
@GetMapping(value = "/getbydate")
public ResponseEntity<?> getbydate(HttpServletRequest request, @RequestParam String fromdate,@RequestParam String todate) {
userSession.setFromdate(fromdate);
userSession.setTodate(todate);
if(fromdate==""){
System.out.println("reset Call:");
userSession.setFromdate(null);
userSession.setTodate(null);
}
else{
System.out.println("Update Call:");
}
return ResponseEntity.ok("ok");
}
@GetMapping(value = "/resetdate")
public String resetdate() {
userSession.setFromdate(null);
userSession.setTodate(null);
return "ok";
}
@GetMapping("/updatePetOwnerProfile")
public String updateOwnerform(HttpServletRequest request,
@RequestParam String title,@RequestParam String fname,
@RequestParam String doornumber,@RequestParam String street,
@RequestParam String area,@RequestParam String pincode,
@RequestParam String zone,@RequestParam String ward,
@RequestParam String email,@RequestParam String phone
) {
PetOwner pet = new PetOwner();
pet.setTitle(title);
pet.setFname(fname);
pet.setDoornumber(doornumber);
pet.setStreet(street);
pet.setArea(area);
pet.setPincode(pincode);
pet.setZone(zone);
pet.setWard(ward);
pet.setPhone(userSession.getMobNo()+"");
pet.setEmail(email);
String s =ownser.update(pet,Long.parseLong(phone));
if(s.equals("success")){
userSession.setZone(zone);
}
return s;
}
@GetMapping("/updateOfficerProfile")
public String updateOwnerform(HttpServletRequest request,
@RequestParam String name,
@RequestParam String tnvncno,
@RequestParam String email,
@RequestParam String mobno,
@RequestParam String password
) {
// System.out.println(name + ">" + password.isBlank() + ">" + mobno+">");
if (!mobno.isBlank()) {
VeterinaryOfficers vet = offrepo.getOfficerbyMobileNo(userSession.getMobNo());
if (vet != null) {
VeterinaryOfficers vetoff = new VeterinaryOfficers();
vetoff.setId(vet.getId());
vetoff.setName(name);
vetoff.setMobno(vet.getMobno());
vetoff.setUserName(vet.getUserName());
vetoff.setZone(vet.getZone());
vetoff.setEmail(email);
vetoff.setTnvncno(tnvncno);
if (!password.isBlank()) {
vetoff.setPassword(password);
LoginDetail log = loginrepo.checkUserbyMobile(userSession.getMobNo());
if (log != null) {
log.setPin(password);
loginrepo.save(log);
}else{
return "Error";
}
offrepo.save(vetoff);
return "success";
} else {
vetoff.setPassword(vet.getPassword());
offrepo.save(vetoff);
return "success";
}
}
}
return "Error";
}
@RequestMapping(value="/renewalPetInfo",method=RequestMethod.POST)
public String renewalPetInfo(HttpServletRequest request,
@RequestParam("petid") String petid,
@RequestParam String petname,
@RequestParam String species,
@RequestParam String breed,
@RequestParam String gender,
@RequestParam String arvdate,
@RequestParam String dewormdate,
@RequestParam String othervac,
@RequestParam String prelicno,
@RequestParam String vetdrname,
@RequestParam String age,
@RequestParam String tnvncno,
@RequestParam(required=false) MultipartFile applicantimg,
@RequestParam(required=false) MultipartFile addressproimg,
@RequestParam(required=false) MultipartFile petimg,
@RequestParam(required=false) MultipartFile rabvacimg
) {
Petdetails pet = new Petdetails();
pet.setUniqueid(Integer.parseInt(petid));
pet.setPetname(petname);
pet.setSpecies(species);
pet.setBreed(breed);
pet.setGender(gender);
pet.setDewormdate(dewormdate);
pet.setVeterinaryConsultant(vetdrname);
pet.setTNVCNo(tnvncno);
pet.setPrevioslicenseNo(prelicno);
pet.setArvdate(arvdate);
pet.setOthervac(othervac);
pet.setAge(age);
pet.setStatus(0);
// Fetch the previous pet details
// Petdetails previousPet = petser.getPetDetails(petid);
// Set the previous prelicno value
// pet.setPrevioslicenseNo(previousPet.getPrevioslicenseNo());
petser.renewaldetail(pet, applicantimg, addressproimg, petimg, rabvacimg);
return "Success";
}
}

233
src/main/java/com/gcc/pets/Pets/Registration/controller/AdminAPIController.java

@ -0,0 +1,233 @@
package com.gcc.pets.Pets.Registration.controller;
import com.gcc.pets.Pets.Registration.customQuery.PetdetailsCustomQuery;
import com.gcc.pets.Pets.Registration.dto.DogAndCatCountInZone;
import com.gcc.pets.Pets.Registration.dto.PetSelectedInfo;
import com.gcc.pets.Pets.Registration.dto.PetStatusDateDto;
import com.gcc.pets.Pets.Registration.login.UserSession;
import com.gcc.pets.Pets.Registration.model.*;
import com.gcc.pets.Pets.Registration.others.AppConfig;
import com.gcc.pets.Pets.Registration.repo.*;
import com.gcc.pets.Pets.Registration.service.PetOwnerServiceImpl;
import com.gcc.pets.Pets.Registration.service.PetdetailsServiceImpl;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.swing.*;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.time.temporal.ChronoUnit;
import java.time.Duration;
@RequestMapping("/admin/api")
@RestController
public class AdminAPIController {
@Autowired
private SignatureRepository signrepo;
@Autowired
private BreedRepository breedrepo;
@Autowired
private PetdetailsRepository petrepo;
@Autowired
private UserSession userSession;
@Autowired
private PetdetailsServiceImpl petser;
@Autowired
private AppConfig appConfig;
@Autowired
private PaymentRepository payrepo;
@Autowired
private PetLicenseRepository licrepo;
@Autowired
private PetdetailsCustomQuery petdetailsCustomQuery;
// @Autowired
// private DogAndCatCountInZone countInZone;
@Autowired
private PetOwnerServiceImpl ownser;
@GetMapping("/dashboard")
public ResponseEntity<?> viewdashboard(HttpServletRequest request,
@RequestParam String zone) {
HashMap<Integer, Long> dogcount = petser.getCountOfPetBySpeciesAndStatus("Dog",checkNull(zone));
HashMap<Integer, Long> catcount =petser.getCountOfPetBySpeciesAndStatus("Cat",checkNull(zone));
long usercount = ownser.getUserCountByZone(zone);
DogAndCatCountInZone countInZone = new DogAndCatCountInZone();
countInZone.setCat(catcount);
countInZone.setDog(dogcount);
countInZone.setUserCount(usercount);
// System.out.println(dogcount);
// System.out.println(catcount);
return ResponseEntity.ok(countInZone);
}
@RequestMapping(value="/signChange",method= RequestMethod.POST)
public ResponseEntity<?> getPetInfoByPetId(HttpServletRequest request,
@RequestParam(required=false) MultipartFile sign1,
@RequestParam(required=false) MultipartFile sign2,
@RequestParam(required=false) MultipartFile sign3) {
Optional<Signature> signature = signrepo.findById(1);
if(signature.isEmpty()){
Signature s = new Signature();
try {
if(sign1!=null&&!sign1.isEmpty()) {
s.setSign1(Base64.getEncoder().encodeToString(sign1.getBytes()));
}
if(sign2!=null) {
s.setSign2(Base64.getEncoder().encodeToString(sign2.getBytes()));
}
if(sign3!=null) {
s.setSign3(Base64.getEncoder().encodeToString(sign3.getBytes()));
}
signrepo.save(s);
}catch (IOException e) {
e.printStackTrace();
}
}
else{
try {
if(sign1!=null&&!sign1.isEmpty()) {
signature.get().setSign1(Base64.getEncoder().encodeToString(sign1.getBytes()));
}
if(sign2!=null) {
signature.get().setSign2(Base64.getEncoder().encodeToString(sign2.getBytes()));
}
if(sign3!=null) {
signature.get().setSign3(Base64.getEncoder().encodeToString(sign3.getBytes()));
}
signrepo.save(signature.get());
}catch (IOException e) {
e.printStackTrace();
}
}
return ResponseEntity.ok("ok");
}
@GetMapping(value = "/getSignature")
public ResponseEntity<?> getBreed(HttpServletRequest request) {
Optional<Signature> sign =signrepo.findById(1);
if(!sign.isEmpty())
return ResponseEntity.ok(sign.get());
else
return ResponseEntity.ok(null);
}
@GetMapping("/updateBreed")
public String updateBreedList(HttpServletRequest request,
@RequestParam String breedtype,
@RequestParam String breedname){
Breed b = new Breed();
b.setType(Integer.parseInt(breedtype));
b.setBreed(breedname);
breedrepo.save(b);
return "success";
}
@GetMapping("/deleteBreed")
public String DeleteBreed(HttpServletRequest request,
@RequestParam String id){
breedrepo.deleteById(Integer.parseInt(id));
return "success";
}
public String checkNull(String x){
if(x.isBlank()||x.length()==0){
return null;
}
return x;
}
// @GetMapping("/licenserequestreport")
// public List<Petdetails> viewRequest(HttpServletRequest request,
// @RequestParam String zone,
// @RequestParam String specie,
// @RequestParam String bree
// ) {
// List<Petdetails> list = petrepo.filterPetdetails(0,checkNull(zone),checkNull(specie),checkNull(bree));
// return list;
// }
//
//
// @GetMapping("/acceptedreport")
// public List<Petdetails> viewAccepted(HttpServletRequest request,
// @RequestParam String zone,
// @RequestParam String specie,
// @RequestParam String bree
// ) {
// //System.out.println(zone+">s "+specie+" "+bree);
// List<Petdetails> list = petrepo.filterPetdetails(1,checkNull(zone),checkNull(specie),checkNull(bree));;
// return list;
// }
//
//
// @GetMapping("/rejectedreport")
// public List<Petdetails> viewRejected(HttpServletRequest request,
// @RequestParam String zone,
// @RequestParam String specie,
// @RequestParam String bree
// ) {
// //System.out.println(zone+" >s"+specie+" "+bree);
// List<Petdetails> list = petrepo.filterPetdetails(3,checkNull(zone),checkNull(specie),checkNull(bree));
// return list;
//
// }
//
//
// @GetMapping("/paymentreport")
// public List<Payment> viewPayment(HttpServletRequest request,
// @RequestParam String zone,
// @RequestParam String specie,
// @RequestParam String bree
// ) {
// List<Payment> pay = payrepo.findAll();
// return pay;
// }
//
// @GetMapping("/Licensereport")
// public List<PetLicense> viewLicense(HttpServletRequest request,
// @RequestParam String zone,
// @RequestParam String specie,
// @RequestParam String bree
// ) {
// List<PetLicense> lic = licrepo.findAll();
// return lic;
// }
//
// @GetMapping("/testFilterReport")
// public List<Petdetails> Test(HttpServletRequest request,
// @RequestParam String zone,
// @RequestParam String specie,
// @RequestParam String bree
// ) {
// String fromdate="2023-06-22 ";
// String todate="2023-07-10 ";
// List<Petdetails> lic = petrepo.filterPetdetailsbydate(0,"1",null,null,fromdate,todate);
// return lic;
// }
}

372
src/main/java/com/gcc/pets/Pets/Registration/controller/AdminController.java

@ -0,0 +1,372 @@
package com.gcc.pets.Pets.Registration.controller;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import ch.qos.logback.core.CoreConstants;
import com.gcc.pets.Pets.Registration.customQuery.PetdetailsCustomQuery;
import com.gcc.pets.Pets.Registration.dto.DogAndCatCountInZone;
import com.gcc.pets.Pets.Registration.dto.Petdetaildto;
import com.gcc.pets.Pets.Registration.model.*;
import com.gcc.pets.Pets.Registration.repo.*;
import com.gcc.pets.Pets.Registration.service.PetOwnerServiceImpl;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import com.gcc.pets.Pets.Registration.login.UserSession;
import com.gcc.pets.Pets.Registration.others.AppConfig;
import com.gcc.pets.Pets.Registration.service.PetdetailsServiceImpl;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.client.RestTemplate;
@RequestMapping("/admin")
@Controller
public class AdminController {
@Autowired
private UserSession userSession;
@Autowired
private PetdetailsRepository petrepo;
@Autowired
private VeterinaryOfficersRepository offrepo;
@Autowired
private PetOwnerServiceImpl ownser;
@Autowired
private AppConfig appConfig;
@Autowired
private PaymentRepository payrepo;
@Autowired
private PetLicenseRepository licrepo;
@Autowired
private PetdetailsRepository petdetailsrep;
@Autowired
private BreedRepository breedrepo;
@Autowired
private PetdetailsServiceImpl petser;
@Autowired
private PetOwnerRepository ownrepo;
@Autowired
private OldPetLicenseRepository oldlicrepo;
@Autowired
private PetdetailsCustomQuery petquery;
// private DogAndCatCountInZone DogAndCatCountDto;
/*
* 0-Inprogess
* 1-payment
* 2-download
* 3-rejected
* 4-expired
* */
@GetMapping("/signin")
public String viewlogin(Model model) {
// System.out.println("officer login");
model.addAttribute("title","Login");
model.addAttribute("baseURL", appConfig.getBaseUrl());
String msg="Login to Your Account";
model.addAttribute("errortxt",msg);
model.addAttribute("newpetowner",new PetOwner());
return "officers/signin";
}
@GetMapping("/licenserequest")
public String viewRequest(Model model) {
model.addAttribute("title", "License Request");
model.addAttribute("baseURL", appConfig.getBaseUrl());
if(userSession.getTodate()!=null && userSession.getFromdate()!=null) {
try {
model.addAttribute("fromdate", userSession.getFromdate());
model.addAttribute("todate", userSession.getTodate());
// List<Petdetails> pet=petser.getPetByRegiserdate(userSession.getFromdate(),userSession.getTodate(),0);
// System.out.println(userSession.getFromdate()+">>> "+userSession.getTodate());
List<Petdetaildto> pet= petquery.filterPetinfo(0,0,null,null,null,userSession.getFromdate(),userSession.getTodate(),0);
// System.out.println(pet.size()+".....lic");
model.addAttribute("petlist",pet);
} catch (Exception e) {
// List<Petdetails> list = petser.getbystatus(0);
List<Petdetaildto> list= petquery.filterPetinfo(0,0,null,null,null,null,null,0);
model.addAttribute("petlist", list);
return "admin/pet-license-request";
}
}else {
// List<Petdetails> list = petser.getbystatus(0);
List<Petdetaildto> list= petquery.filterPetinfo(0,0,null,null,null,null,null,0);
model.addAttribute("petlist", list);
}
return "admin/pet-license-request";
}
@GetMapping("/home")
public String viewOfficerHome(Model model) {
return "redirect:/admin/dashboard";
}
@GetMapping("/dashboard")
public String viewdashboard(Model model) {
model.addAttribute("title", "Dashboard");
model.addAttribute("baseURL", appConfig.getBaseUrl());
HashMap<Integer, Long> dogcount = petser.getCountOfPetBySpeciesAndStatus("Dog",null);
HashMap<Integer, Long> catcount =petser.getCountOfPetBySpeciesAndStatus("Cat",null);
long oldliccount = oldlicrepo.count();
long usercount = ownser.getUserCount();
model.addAttribute("UserCount",usercount);
model.addAttribute("dogTotalCount",dogcount.get(200));
model.addAttribute("catTotalCount",catcount.get(200));
model.addAttribute("totalpet",dogcount.get(2)+catcount.get(2));
model.addAttribute("totalInprogcount", dogcount.get(0)+catcount.get(0));
model.addAttribute("totalPayProgCount",dogcount.get(1)+catcount.get(1));
model.addAttribute("totallicCount",dogcount.get(2)+catcount.get(2)+oldliccount);
model.addAttribute("totalRejCount",dogcount.get(3)+catcount.get(3));
model.addAttribute("totalExpCount",dogcount.get(4)+catcount.get(4));
model.addAttribute("totalRegPets",dogcount.get(200)+catcount.get(200));
model.addAttribute("dogInProgCount",dogcount.get(0));
model.addAttribute("dogPayProgCount",dogcount.get(1));
model.addAttribute("doglicCount",dogcount.get(2));
model.addAttribute("dogRejCount",dogcount.get(3));
model.addAttribute("dogExpCount",dogcount.get(4));
model.addAttribute("catInprogCount",catcount.get(0));
model.addAttribute("catPayprogCount",catcount.get(1));
model.addAttribute("catlicCount",catcount.get(2));
model.addAttribute("catRejCount",catcount.get(3));
model.addAttribute("catExpCount",catcount.get(4));
model.addAttribute("explicCount",dogcount.get(4)+catcount.get(4));
DogAndCatCountInZone DogAndCatCountDto = new DogAndCatCountInZone();
DogAndCatCountDto.setDog(dogcount);
DogAndCatCountDto.setCat(catcount);
model.addAttribute("totalcatsanddog",DogAndCatCountDto);
return "admin/pet-dashboard";
}
@GetMapping("/acceptedlist")
public String acceptedPets(Model model) {
model.addAttribute("title", "Accepted List");
model.addAttribute("baseURL", appConfig.getBaseUrl());
// List<Petdetails> list= petser.getbystatus(1);
if(userSession.getTodate()!=null && userSession.getFromdate()!=null) {
model.addAttribute("fromdate", userSession.getFromdate());
model.addAttribute("todate", userSession.getTodate());
// List<Petdetails> pet=petser.getPetByUpdateddate(userSession.getFromdate(),userSession.getTodate(),1);
//System.out.println(pet.size()+"....acc.lic");
List<Petdetaildto> pet= petquery.filterPetinfo(0,1,null,null,null,userSession.getFromdate(),userSession.getTodate(),1);
model.addAttribute("petlist",pet);
}else {
// List<Petdetails> list = petser.getbystatus(1);
List<Petdetaildto> list= petquery.filterPetinfo(0,1,null,null,null,null,null,1);
model.addAttribute("petlist", list);
}
return "admin/pet-license-accept";
}
@GetMapping("/licenseIssued")
public String licenseissued(Model model) {
model.addAttribute("title", "License Issued");
model.addAttribute("baseURL", appConfig.getBaseUrl());
//System.out.println(userSession.getFromdate()+"..>.." + userSession.getTodate());
if(userSession.getFromdate() != null && userSession.getTodate() != null && userSession.getFromdate() != "null" && userSession.getTodate() != "null"){
model.addAttribute("fromdate",userSession.getFromdate());
model.addAttribute("todate",userSession.getTodate());
List<Petdetaildto> list= petquery.filterPetinfo(0,2,null,null,null,userSession.getFromdate(),userSession.getTodate(),1);
model.addAttribute("petlist",list);
}else{
List<Petdetaildto> list= petquery.filterPetinfo(0,2,null,null,null,null,null,1);
model.addAttribute("petlist",list);
}
return "admin/pet-license-issued";
}
@GetMapping("/rejectedlist")
public String rejectedPets(Model model) {
model.addAttribute("title", "Rejected List");
model.addAttribute("baseURL", appConfig.getBaseUrl());
if(userSession.getTodate()!=null && userSession.getFromdate()!=null) {
model.addAttribute("fromdate", userSession.getFromdate());
model.addAttribute("todate", userSession.getTodate());
List<Petdetaildto> pet= petquery.filterPetinfo(0,3,null,null,null,userSession.getFromdate(),userSession.getTodate(),1);
model.addAttribute("petlist",pet);
}else {
List<Petdetaildto> list= petquery.filterPetinfo(0,3,null,null,null,null,null,1);
model.addAttribute("petlist", list);
}
return "admin/pet-license-reject";
}
@GetMapping("/MyProfile")
public String viewOfficerProfile(Model model) {
model.addAttribute("title", "My Profile");
model.addAttribute("baseURL", appConfig.getBaseUrl());
VeterinaryOfficers own= offrepo.getOfficerbyMobileNo(userSession.getMobNo());
model.addAttribute("user",own);
List<Breed> breed =breedrepo.findAll();
model.addAttribute("breed",breed);
return "admin/officer-profile";
}
@GetMapping("/report")
public String viewreport(Model model) {
model.addAttribute("title", "Pet Report");
model.addAttribute("baseURL", appConfig.getBaseUrl());
// model.addAttribute("petlist",list);
return "admin/admin-report";
}
@GetMapping("/paymentinfo")
public String viewpaymentInfo(Model model) {
model.addAttribute("title", "Pet Payment Info");
model.addAttribute("baseURL", appConfig.getBaseUrl());
if(userSession.getTodate()!=null && userSession.getFromdate()!=null){
model.addAttribute("fromdate",userSession.getFromdate());
model.addAttribute("todate",userSession.getTodate());
try {
List<Payment> pay = payrepo.getPaymentbydate(userSession.getFromdate()+" %", userSession.getTodate()+" %");
//System.out.println(pay.size()+".....pay");
model.addAttribute("paymentlist", pay);
}catch (Exception e){
List<Payment> pay=payrepo.findAll();
model.addAttribute("paymentlist",pay);
e.printStackTrace();
}
}else{
List<Payment> pay=payrepo.findAll();
model.addAttribute("paymentlist",pay);
}
return "admin/paymentInfo";
}
public String checkNull(String x){
if(x.isBlank()||x.length()==0){
return null;
}
return x;
}
@PostMapping("/getReport")
public String GetReport(Model model,
@RequestParam String FromDate,
@RequestParam String ToDate,
@RequestParam String request,
@RequestParam String zone,
@RequestParam String specie,
@RequestParam String bree
){
model.addAttribute("title", "Admin Report");
model.addAttribute("baseURL", appConfig.getBaseUrl());
// System.out.println("Im here to have success"+request+""+FromDate+","+ToDate);
if(Integer.parseInt(request)==0){
List<Petdetaildto> list;
if(checkNull(FromDate)!=null && checkNull(ToDate)!=null ){
list = petquery.filterPetinfo(0,0, checkNull(specie), checkNull(bree),checkNull(zone),FromDate.trim(),ToDate.trim(),0);
}else {
list = petquery.filterPetinfo(0,0, checkNull(specie), checkNull(bree),checkNull(zone),null,null,0); }
model.addAttribute("petlist", list);
}
else if(Integer.parseInt(request)==1){
List<Petdetaildto> list;
if(checkNull(FromDate)!=null && checkNull(ToDate)!=null ){
list = petquery.filterPetinfo(0,11, checkNull(specie), checkNull(bree),checkNull(zone),FromDate.trim(),ToDate.trim(),1);
}else {
list = petquery.filterPetinfo(0,11, checkNull(specie), checkNull(bree),checkNull(zone),null,null,1);
}
model.addAttribute("petlist", list);
}
else if(Integer.parseInt(request)==2){
// List<Petdetails> list = petrepo.filterPetdetails(0,checkNull(zone),checkNull(specie),checkNull(bree));
List<PetLicense> lic;
if(checkNull(FromDate)!=null && checkNull(ToDate)!=null ){
lic=licrepo.getLincenseByDate(FromDate,ToDate);
}else{
lic = licrepo.findAll();
}
model.addAttribute("license", lic);
}
else if(Integer.parseInt(request)==3){
List<Petdetaildto> list;
if(checkNull(FromDate)!=null && checkNull(ToDate)!=null ){
list = petquery.filterPetinfo(0,3, checkNull(specie), checkNull(bree),checkNull(zone),FromDate.trim(),ToDate.trim(),1);
}else {
list = petquery.filterPetinfo(0,3, checkNull(specie), checkNull(bree),checkNull(zone),null,null,1);
}
model.addAttribute("petlist", list);
}
else if(Integer.parseInt(request)==5){
List<Payment> pay;
if(checkNull(FromDate)!=null && checkNull(ToDate)!=null ){
pay=payrepo.getPaymentbydate(FromDate,ToDate);
}else {
pay = payrepo.findAll();
}
model.addAttribute("payment", pay);
}
else if(Integer.parseInt(request)==6){
List<Breed> breed;
int t=0;
if(checkNull(specie)==null){
breed = breedrepo.findAll();
}else{
if(specie.equals("Dog")){
t=1;
}else if(specie.equals("Cat")){
t=2;
}
breed = breedrepo.getbreedbyType(t);
}
model.addAttribute("breed", breed);
}
else if(Integer.parseInt(request)==7){
List<PetOwner> own = ownser.getAllPetAndOwnerDet(zone,FromDate,ToDate);
model.addAttribute("owner", own);
}
model.addAttribute("fromdate",FromDate);
model.addAttribute("todate",ToDate);
model.addAttribute("request",request);
model.addAttribute("zone",zone);
model.addAttribute("specie",specie);
model.addAttribute("bree",bree);
return "admin/admin-report";
}
}

57
src/main/java/com/gcc/pets/Pets/Registration/controller/MainController.java

@ -0,0 +1,57 @@
package com.gcc.pets.Pets.Registration.controller;
import com.gcc.pets.Pets.Registration.login.UserSession;
import com.gcc.pets.Pets.Registration.model.PetOwner;
import com.gcc.pets.Pets.Registration.model.Petdetails;
import com.gcc.pets.Pets.Registration.others.AppConfig;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
@Controller
public class MainController {
@Autowired
private AppConfig appConfig;
@Autowired
private UserSession userSession;
@GetMapping("/")
public String loadHome(Model model) {
return "redirect:/login";
}
@GetMapping("/login")
public String viewlogin(Model model) {
model.addAttribute("title","Login");
model.addAttribute("baseURL", appConfig.getBaseUrl());
String msg="Login to Your Account";
model.addAttribute("errortxt",msg);
model.addAttribute("newpetowner",new PetOwner());
return "login";
}
@GetMapping("/logout")
public String logout(Model model) {
// Clear all login session (Check API Controller /gcc-login)
userSession.setUserId(null);
userSession.setMobNo(0);
userSession.setUserType(null);
userSession.setFromdate(null);
userSession.setTodate(null);
return "redirect:/login";
}
}

212
src/main/java/com/gcc/pets/Pets/Registration/controller/OfficerController.java

@ -0,0 +1,212 @@
package com.gcc.pets.Pets.Registration.controller;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import com.gcc.pets.Pets.Registration.customQuery.PetdetailsCustomQuery;
import com.gcc.pets.Pets.Registration.dto.Petdetaildto;
import com.gcc.pets.Pets.Registration.service.PetOwnerServiceImpl;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import com.gcc.pets.Pets.Registration.login.UserSession;
import com.gcc.pets.Pets.Registration.model.PetOwner;
import com.gcc.pets.Pets.Registration.model.Petdetails;
import com.gcc.pets.Pets.Registration.model.VeterinaryOfficers;
import com.gcc.pets.Pets.Registration.others.AppConfig;
import com.gcc.pets.Pets.Registration.repo.PetdetailsRepository;
import com.gcc.pets.Pets.Registration.repo.VeterinaryOfficersRepository;
import com.gcc.pets.Pets.Registration.service.PetdetailsServiceImpl;
import org.springframework.web.bind.annotation.RequestParam;
@RequestMapping("/officers")
@Controller
public class OfficerController {
@Autowired
private UserSession userSession;
@Autowired
private VeterinaryOfficersRepository offrepo;
@Autowired
private AppConfig appConfig;
@Autowired
private PetdetailsRepository petdetailsrep;
@Autowired
private PetdetailsServiceImpl petser;
@Autowired
private PetOwnerServiceImpl ownser;
@Autowired
private PetdetailsCustomQuery petquery;
/*
* 0-Inprogess
* 1-payment
* 2-download
* 3-rejected
* 4-expired
* */
@GetMapping("/signin")
public String viewlogin(Model model) {
// System.out.println("officer login");
model.addAttribute("title","Login");
model.addAttribute("baseURL", appConfig.getBaseUrl());
String msg="Login to Your Account";
model.addAttribute("errortxt",msg);
model.addAttribute("newpetowner",new PetOwner());
return "officers/signin";
}
@GetMapping("/licenserequest")
public String viewRequest(Model model) {
model.addAttribute("title", "License Request");
model.addAttribute("baseURL", appConfig.getBaseUrl());
if(userSession.getTodate()!=null && userSession.getFromdate()!=null) {
try {
model.addAttribute("fromdate", userSession.getFromdate());
model.addAttribute("todate", userSession.getTodate());
// List<Petdetails> pet=petser.getPetByRegiserdateAndZone(userSession.getFromdate(),userSession.getTodate(),0,userSession.getZone());
// System.out.println(pet.size()+".....lic");
List<Petdetaildto> pet= petquery.filterPetinfo(0,0,null,null,userSession.getZone(),userSession.getFromdate(),userSession.getTodate(),0);
model.addAttribute("petlist",pet);
} catch (Exception e) {
List<Petdetaildto> list= petquery.filterPetinfo(0,0,null,null,userSession.getZone(),null,null,0);
model.addAttribute("petlist", list);
return "admin/pet-license-request";
}
}else {
// List<Petdetails> list= petser.getbystatus(0);
//filterPetinfo();
List<Petdetaildto> list= petquery.filterPetinfo(0,0,null,null,userSession.getZone(),null,null,0);
model.addAttribute("petlist", list);
}
return "officers/pet-license-request";
}
@GetMapping("/home")
public String viewOfficerHome(Model model) {
return "redirect:/officers/dashboard";
}
@GetMapping("/dashboard")
public String viewdashboard(Model model) {
model.addAttribute("title", "Dashboard");
model.addAttribute("baseURL", appConfig.getBaseUrl());
HashMap<Integer, Long> dogcount1 = petser.getCountOfPetBySpeciesAndStatus("Dog",userSession.getZone());
HashMap<Integer, Long> catcount1 =petser.getCountOfPetBySpeciesAndStatus("Cat",userSession.getZone());
long usercount = ownser.getUserCountByZone(userSession.getZone());
model.addAttribute("UserCount",usercount);
model.addAttribute("dogTotalCount",dogcount1.get(200));
model.addAttribute("catTotalCount",catcount1.get(200));
model.addAttribute("totalpet",dogcount1.get(200)+catcount1.get(200));
model.addAttribute("totalInprogcount", dogcount1.get(0)+catcount1.get(0));
model.addAttribute("totalPayProgCount",dogcount1.get(1)+catcount1.get(1));
model.addAttribute("totallicCount",dogcount1.get(2)+catcount1.get(2));
model.addAttribute("totalRejCount",dogcount1.get(3)+catcount1.get(3));
model.addAttribute("totalExpCount",dogcount1.get(4)+catcount1.get(4));
model.addAttribute("dogInProgCount",dogcount1.get(0));
model.addAttribute("dogPayProgCount",dogcount1.get(1));
model.addAttribute("doglicCount",dogcount1.get(2));
model.addAttribute("dogRejCount",dogcount1.get(3));
model.addAttribute("dogExpCount",dogcount1.get(4));
model.addAttribute("catInprogCount",catcount1.get(0));
model.addAttribute("catPayprogCount",catcount1.get(1));
model.addAttribute("catlicCount",catcount1.get(2));
model.addAttribute("catRejCount",catcount1.get(3));
model.addAttribute("catExpCount",catcount1.get(4));
model.addAttribute("explicCount",dogcount1.get(4)+catcount1.get(4));
return "officers/pet-dashboard";
}
@GetMapping("/acceptedlist")
public String acceptedPets(Model model) {
model.addAttribute("title", "Accepted List");
model.addAttribute("baseURL", appConfig.getBaseUrl());
if(userSession.getTodate()!=null && userSession.getFromdate()!=null) {
model.addAttribute("fromdate", userSession.getFromdate());
model.addAttribute("todate", userSession.getTodate());
List<Petdetaildto> pet= petquery.filterPetinfo(0,1,null,null,userSession.getZone(),userSession.getFromdate(),userSession.getTodate(),1);
model.addAttribute("petlist",pet);
}else {
List<Petdetaildto> pet= petquery.filterPetinfo(0,1,null,null,userSession.getZone(),null,null,1);
model.addAttribute("petlist",pet);
}
return "officers/pet-license-accept";
}
@GetMapping("/licenseIssued")
public String licenseissued(Model model) {
model.addAttribute("title", "License Issued");
model.addAttribute("baseURL", appConfig.getBaseUrl());
// List<Petdetails> list= petser.getbystatus(2);
if(userSession.getTodate()!=null && userSession.getFromdate()!=null) {
model.addAttribute("fromdate", userSession.getFromdate());
model.addAttribute("todate", userSession.getTodate());
List<Petdetaildto> pet= petquery.filterPetinfo(0,2,null,null,userSession.getZone(),userSession.getFromdate(),userSession.getTodate(),1);
model.addAttribute("petlist",pet);
}else {
List<Petdetaildto> pet= petquery.filterPetinfo(0,2,null,null,userSession.getZone(),null,null,1);
model.addAttribute("petlist",pet);
}
return "officers/pet-license-issued";
}
@GetMapping("/rejectedlist")
public String rejectedPets(Model model) {
model.addAttribute("title", "Rejected List");
model.addAttribute("baseURL", appConfig.getBaseUrl());
// List<Petdetails> list= petser.getbystatus(3);
if(userSession.getTodate()!=null && userSession.getFromdate()!=null) {
model.addAttribute("fromdate", userSession.getFromdate());
model.addAttribute("todate", userSession.getTodate());
List<Petdetaildto> pet= petquery.filterPetinfo(0,3,null,null,userSession.getZone(),userSession.getFromdate(),userSession.getTodate(),1);
model.addAttribute("petlist",pet);
}else {
List<Petdetaildto> pet= petquery.filterPetinfo(0,3,null,null,userSession.getZone(),null,null,1);
model.addAttribute("petlist",pet);
}
return "officers/pet-license-reject";
}
@GetMapping("/MyProfile")
public String viewOfficerProfile(Model model) {
model.addAttribute("title", "My Profile");
model.addAttribute("baseURL", appConfig.getBaseUrl());
VeterinaryOfficers own= offrepo.getOfficerbyMobileNo(userSession.getMobNo());
model.addAttribute("user",own);
return "officers/officer-profile";
}
@GetMapping("/getlicense")
public String viewLicenseToOfficer(Model model) {
model.addAttribute("title", "Get Pet License");
model.addAttribute("baseURL", appConfig.getBaseUrl());
return "officers/officer-getlicense";
}
}

132
src/main/java/com/gcc/pets/Pets/Registration/controller/PetController.java

@ -0,0 +1,132 @@
package com.gcc.pets.Pets.Registration.controller;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Optional;
import com.gcc.pets.Pets.Registration.model.Signature;
import com.gcc.pets.Pets.Registration.repo.SignatureRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import com.gcc.pets.Pets.Registration.login.UserSession;
import com.gcc.pets.Pets.Registration.model.PetLicense;
import com.gcc.pets.Pets.Registration.model.PetOwner;
import com.gcc.pets.Pets.Registration.model.Petdetails;
import com.gcc.pets.Pets.Registration.service.PetLicenseServiceImpl;
import com.gcc.pets.Pets.Registration.service.PetOwnerServiceImpl;
import com.gcc.pets.Pets.Registration.service.PetdetailsServiceImpl;
@RequestMapping("/owners")
@Controller
public class PetController {
@Autowired
private PetdetailsServiceImpl petser;
@Autowired
private UserSession userSession;
@Autowired
private PetLicenseServiceImpl licser;
@Autowired
private PetOwnerServiceImpl petownser;
@Autowired
private SignatureRepository signrepo;
@PostMapping("/petformsubmit")
public String submitedform(
@RequestParam(value = "appphoto") MultipartFile applicantphoto ,
@RequestParam(value = "addproof") MultipartFile addressproof ,
@RequestParam(value = "petimg") MultipartFile petphoto ,
@RequestParam(value = "rabiesvac") MultipartFile rabiesvacCerti ,
@RequestParam(value = "Months") int month ,
@ModelAttribute Petdetails petform,
Model model) {
//System.out.println(petform.getBreed()+"breed register");
petform.setMobilenum(userSession.getMobNo());
petform.setStatus(0);
String a =petform.getAge()+"."+month;
petform.setAge(a);
petform.setZone(userSession.getZone());
petser.savedetail(petform, applicantphoto, addressproof, petphoto, rabiesvacCerti);
return "redirect:/owners/pet-registration-status";
}
@GetMapping("/getlicense/{id}")
public String viewLicense(Model model,@PathVariable("id") int id) {
model.addAttribute("title","license");
// model.addAttribute("baseURL",appConfig.getBaseUrl());
long mobno = userSession.getMobNo();
int uniqueid = id;
PetLicense lic =licser.getbymobnoanduniqueId(mobno, uniqueid);
PetOwner own =petownser.getByMobNo(mobno);
Petdetails pet =petser.getpetetailsbymobnoByuniqueid(mobno, uniqueid);
model.addAttribute("lic",lic);
model.addAttribute("own",own);
model.addAttribute("pet",pet);
SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy");
Calendar c = Calendar.getInstance();
c.setTime(lic.getDate());
String issuedate=dateFormat.format(c.getTime());
model.addAttribute("issue",issuedate);
c.add(Calendar.YEAR, 1);
c.add(Calendar.DATE, -1);
String dateInString=dateFormat.format(c.getTime());
model.addAttribute("valid",dateInString);
Optional<Signature> sign = signrepo.findById(1);
if(!sign.isEmpty()){
model.addAttribute("sign1",sign.get().getSign1());
model.addAttribute("sign2",sign.get().getSign2());
model.addAttribute("sign3",sign.get().getSign3());
}
Date date1;
return "owners/petlicense";
}
@GetMapping("/getlicensebymobo/{id}/{mobno}")
public String viewLicensebymobno(Model model,@PathVariable("id") int id,@PathVariable("mobno") long mobileNo) {
model.addAttribute("title","license");
// model.addAttribute("baseURL",appConfig.getBaseUrl());
long mobno = mobileNo;
int uniqueid = id;
PetLicense lic =licser.getbymobnoanduniqueId(mobno, uniqueid);
PetOwner own =petownser.getByMobNo(mobno);
Petdetails pet =petser.getpetetailsbymobnoByuniqueid(mobno, uniqueid);
model.addAttribute("lic",lic);
model.addAttribute("own",own);
model.addAttribute("pet",pet);
SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy");
Calendar c = Calendar.getInstance();
c.setTime(lic.getDate());
String issuedate=dateFormat.format(c.getTime());
model.addAttribute("issue",issuedate);
c.add(Calendar.YEAR, 1);
c.add(Calendar.DATE, -1);
String dateInString=dateFormat.format(c.getTime());
model.addAttribute("valid",dateInString);
Optional<Signature> sign = signrepo.findById(1);
if(!sign.isEmpty()){
model.addAttribute("sign1",sign.get().getSign1());
model.addAttribute("sign2",sign.get().getSign2());
model.addAttribute("sign3",sign.get().getSign3());
}
Date date1;
return "owners/petlicense";
}
}

110
src/main/java/com/gcc/pets/Pets/Registration/controller/PetOwnerController.java

@ -0,0 +1,110 @@
package com.gcc.pets.Pets.Registration.controller;
import com.gcc.pets.Pets.Registration.dto.PetSelectedInfo;
import com.gcc.pets.Pets.Registration.login.UserSession;
import com.gcc.pets.Pets.Registration.model.PetOwner;
import com.gcc.pets.Pets.Registration.model.Petdetails;
import com.gcc.pets.Pets.Registration.others.AppConfig;
import com.gcc.pets.Pets.Registration.service.PetOwnerServiceImpl;
import com.gcc.pets.Pets.Registration.service.PetdetailsServiceImpl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@RequestMapping("/owners")
@Controller
public class PetOwnerController {
@Autowired
private AppConfig appConfig;
@Autowired
private UserSession userSession;
@Autowired
private PetdetailsServiceImpl petser;
@Autowired
private PetOwnerServiceImpl petownser;
/*
* 0-Inprogess
* 1-payment
* 2-download
* 3-rejected
* 4-expired
* */
@GetMapping("/home")
public String viewDashboard(Model model) {
model.addAttribute("title", "form");
model.addAttribute("baseURL", appConfig.getBaseUrl());
List<PetSelectedInfo> list =petser.getpetetailsbymobno(userSession.getMobNo());
model.addAttribute("petlist",list);
return "owners/home";
}
@GetMapping("/pet-registration")
public String viewForm(Model model) {
model.addAttribute("title","newregistration");
model.addAttribute("baseURL", appConfig.getBaseUrl());
model.addAttribute("petform",new Petdetails());
// System.out.println(userSession.getUserId());
return "owners/pet-registration";
}
@GetMapping("/pet-registration-status")
public String viewStatus(Model model) {
model.addAttribute("title", "Status");
model.addAttribute("baseURL" , appConfig.getBaseUrl());
//System.out.println(userSession.getUserId());
List<Petdetails> list =petser.getpetetailsbymobnoAndStatus(userSession.getMobNo(),0);
model.addAttribute("petlist",list);
return "owners/pet-registration-status";
}
@GetMapping("/pet-list")
public String viewList(Model model) {
return "redirect:/owners/home";
}
@GetMapping("/license-list")
public String viewLicense(Model model) {
model.addAttribute("title","license");
model.addAttribute("baseURL",appConfig.getBaseUrl());
// System.out.println(userSession.getUserId());
List<Petdetails> list =petser.getpetetailsbymobnoAndStatus(userSession.getMobNo(),2);
model.addAttribute("petlist",list);
return "owners/pet-license-list";
}
@GetMapping("/expired-license-list")
public String viewExpired(Model model) {
model.addAttribute("title", "expired");
model.addAttribute("baseURL", appConfig.getBaseUrl());
//System.out.println(userSession.getUserId());
List<Petdetails> list =petser.getpetetailsbymobnoAndStatus(userSession.getMobNo(),4);
model.addAttribute("petlist",list);
return "owners/expired-pet-license-list";
}
@GetMapping("/payment")
public String viewPending(Model model) {
model.addAttribute("title", "Pending");
model.addAttribute("baseURL", appConfig.getBaseUrl());
//System.out.println(userSession.getUserId());
List<Petdetails> list =petser.getpetetailsbymobnoAndStatus(userSession.getMobNo(),1);
model.addAttribute("petlist",list);
return "owners/payment-pending-list";
}
@GetMapping("/MyProfile")
public String viewmyprofile(Model model) {
model.addAttribute("title", "My Profile");
model.addAttribute("baseURL", appConfig.getBaseUrl());
PetOwner own =petownser.getByMobNo(userSession.getMobNo());
model.addAttribute("user",own);
return "owners/myprofile";
}
}

272
src/main/java/com/gcc/pets/Pets/Registration/controller/SuperAdminController.java

@ -0,0 +1,272 @@
package com.gcc.pets.Pets.Registration.controller;
import ch.qos.logback.core.CoreConstants;
import com.gcc.pets.Pets.Registration.customQuery.PetdetailsCustomQuery;
import com.gcc.pets.Pets.Registration.dto.DogAndCatCountInZone;
import com.gcc.pets.Pets.Registration.dto.Petdetaildto;
import com.gcc.pets.Pets.Registration.model.*;
import com.gcc.pets.Pets.Registration.others.AppConfig;
import com.gcc.pets.Pets.Registration.repo.*;
import com.gcc.pets.Pets.Registration.service.PetOwnerServiceImpl;
import com.gcc.pets.Pets.Registration.service.PetdetailsServiceImpl;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@RequestMapping("/api/admin")
@RestController
public class SuperAdminController {
@Autowired
private AppConfig appConfig;
@Autowired
private PaymentRepository payrepo;
@Autowired
private PetdetailsRepository petrepoo;
@Autowired
private PetdetailsCustomQuery petquery;
@Autowired
private SMSsenderRepository smsrepo;
@Autowired
private PetdetailsServiceImpl petser;
@Autowired
private PetLicenseRepository licrepo;
@Autowired
private BreedRepository breedrepo;
@Autowired
private PetOwnerServiceImpl ownser;
@Autowired
private OldPetLicenseRepository oldlicrepo;
@GetMapping(value = "/accept")
public String acceptPetById(HttpServletRequest request, @RequestParam String id, @RequestParam String mobileNo,@RequestParam String userType,@RequestParam String zone) {
String s =petser.updateAcceptStatus(Integer.parseInt(id), 1,userType,zone);
if(s.equals("ok")) {
String generatedToken = "Your Application for Pet license has been accepted. Follow this link towards payment of license fee of Rs.50/- By GCC";
// String key="qxg4mklD";
String key="mRSm0zym";
String urlString=appConfig.getGetOtpUrl()+"from=GCCCRP&key="+key+"&sender=GCCCRP&to="+mobileNo+"&body="+generatedToken+"&entityid=1401572690000011081&templateid=1407168423376962032";
System.out.print("\n urlString---: "+urlString);
String bodyMessage = "";
try {
RestTemplate restTemplate = new RestTemplate();
String Response = restTemplate.getForObject(urlString, String.class);
bodyMessage=Response;
SMSsender sms = new SMSsender();
sms.setPhone(Long.parseLong(mobileNo));
sms.setCdate(new Date());
sms.setBodyMsg(bodyMessage);
sms.setPurpose("Pet Accepted");
smsrepo.save(sms);
System.out.println("\n bodyMessage"+bodyMessage);
} catch (Exception e) {
// e.printStackTrace();
System.out.print("ERROR---: "+e);
bodyMessage = "Error";
}
}
// petser.updateAcceptStatus(Integer.parseInt(id), 1);
String bodyMessage="success";
return bodyMessage;
}
@GetMapping(value = "/reject")
public String rejectPetById(HttpServletRequest request, @RequestParam String id, @RequestParam String reason,@RequestParam String mobileNo,@RequestParam String userType ,@RequestParam String zone) {
String s =petser.updateRejectStatus(3,reason,Integer.parseInt(id),userType,zone);
if(s.equals("ok")) {
String generatedToken = "Your Application for Pet license is rejected due to irrelevant/ insufficient Pet/Owner detail(s). By GCC";
// String key="qxg4mklD";
String key="mRSm0zym";
String urlString=appConfig.getGetOtpUrl()+"from=GCCCRP&key="+key+"&sender=GCCCRP&to="+mobileNo+"&body="+generatedToken+"&entityid=1401572690000011081&templateid=1407168423383126580";
String bodyMessage = "";
try {
RestTemplate restTemplate = new RestTemplate();
String Response = restTemplate.getForObject(urlString, String.class);
bodyMessage=Response;
SMSsender sms = new SMSsender();
sms.setPhone(Long.parseLong(mobileNo));
sms.setCdate(new Date());
sms.setBodyMsg(bodyMessage);
sms.setPurpose("Pet Rejected");
smsrepo.save(sms);
// System.out.println(bodyMessage);
} catch (Exception e) {
// e.printStackTrace();
System.out.print("ERROR---: "+e);
bodyMessage = "Error";
}
}
// petser.updateRejectStatus(3,reason,Integer.parseInt(id));
return "success";
}
@GetMapping("/licenserequest")
public ResponseEntity<?> viewRequest( @RequestParam String zone, @RequestParam String fromDate, @RequestParam String toDate) {
List<Petdetaildto> pet= petquery.filterPetinfo(0,0,null,null,zone,fromDate,toDate,0);
return ResponseEntity.ok(pet);
}
@GetMapping("/dashboard")
public ResponseEntity<?> viewdashboard( @RequestParam String zone) {
HashMap<Integer, Long> dogcount = petser.getCountOfPetBySpeciesAndStatus("Dog",checkNull(zone));
HashMap<Integer, Long> catcount =petser.getCountOfPetBySpeciesAndStatus("Cat",checkNull(zone));
long oldliccount = oldlicrepo.count();
long usercount;
if(!zone.isBlank()){
usercount = ownser.getUserCountByZone(zone);
}else {
usercount = ownser.getUserCount();
}
DogAndCatCountInZone dash = new DogAndCatCountInZone();
dash.setUserCount(usercount);
dash.setDog(dogcount);
dash.setCat(catcount);
dash.setLicCount(oldliccount+dogcount.get(2)+catcount.get(2));
return ResponseEntity.ok(dash);
}
@GetMapping("/acceptedlist")
public ResponseEntity<?> acceptedPets( @RequestParam String zone, @RequestParam String fromDate, @RequestParam String toDate) {
List<Petdetaildto> pet= petquery.filterPetinfo(0,1,null,null,checkNull(zone),fromDate,toDate,1);
return ResponseEntity.ok(pet);
}
@GetMapping("/licenseIssued")
public ResponseEntity<?> licenseIssued( @RequestParam String zone, @RequestParam String fromDate, @RequestParam String toDate) {
List<Petdetaildto> pet= petquery.filterPetinfo(0,2,null,null,checkNull(zone),fromDate,toDate,1);
return ResponseEntity.ok(pet);
}
@GetMapping("/rejectedlist")
public ResponseEntity<?> RejectedPets( @RequestParam String zone, @RequestParam String fromDate, @RequestParam String toDate) {
List<Petdetaildto> pet= petquery.filterPetinfo(0,3,null,null,checkNull(zone),fromDate,toDate,1);
return ResponseEntity.ok(pet);
}
@GetMapping("/paymentinfo")
public ResponseEntity<?> viewpaymentInfo( @RequestParam String fromDate, @RequestParam String toDate) {
List<Payment> pay;
if(checkNull(fromDate)!=null && checkNull(toDate)!=null){
try {
pay = payrepo.getPaymentbydate(fromDate+" %", toDate+" %");
}catch (Exception e){
pay=payrepo.findAll();
e.printStackTrace();
}
}else{
pay=payrepo.findAll();
}
return ResponseEntity.ok(pay);
}
public String checkNull(String x){
if(x.isBlank()||x.length()==0){
return null;
}
return x;
}
@GetMapping("/getReport")
public ResponseEntity<?> GetReport(Model model,
@RequestParam String FromDate,
@RequestParam String ToDate,
@RequestParam String request,
@RequestParam String zone,
@RequestParam String specie,
@RequestParam String bree
){
if(Integer.parseInt(request)==0){
List<Petdetaildto> list;
if(checkNull(FromDate)!=null && checkNull(ToDate)!=null ){
list = petquery.filterPetinfo(0,0, checkNull(specie), checkNull(bree),checkNull(zone),FromDate.trim(),ToDate.trim(),0);
}else {
list = petquery.filterPetinfo(0,0, checkNull(specie), checkNull(bree),checkNull(zone),null,null,0);
}
return ResponseEntity.ok(list);
}
else if(Integer.parseInt(request)==1){
List<Petdetaildto> list;
if(checkNull(FromDate)!=null && checkNull(ToDate)!=null ){
list = petquery.filterPetinfo(0,11, checkNull(specie), checkNull(bree),checkNull(zone),FromDate.trim(),ToDate.trim(),1);
}else {
list = petquery.filterPetinfo(0,11, checkNull(specie), checkNull(bree),checkNull(zone),null,null,1);
}
return ResponseEntity.ok(list);
}
else if(Integer.parseInt(request)==2){
// List<Petdetails> list = petrepo.filterPetdetails(0,checkNull(zone),checkNull(specie),checkNull(bree));
List<PetLicense> lic;
if(checkNull(FromDate)!=null && checkNull(ToDate)!=null ){
lic=licrepo.getLincenseByDate(FromDate,ToDate);
}else{
lic = licrepo.findAll();
}
return ResponseEntity.ok(lic);
}
else if(Integer.parseInt(request)==3){
List<Petdetaildto> list;
if(checkNull(FromDate)!=null && checkNull(ToDate)!=null ){
list = petquery.filterPetinfo(0,3, checkNull(specie), checkNull(bree),checkNull(zone),FromDate.trim(),ToDate.trim(),1);
}else {
list = petquery.filterPetinfo(0,3, checkNull(specie), checkNull(bree),checkNull(zone),null,null,1);
}
return ResponseEntity.ok(list);
}
else if(Integer.parseInt(request)==5){
List<Payment> pay;
if(checkNull(FromDate)!=null && checkNull(ToDate)!=null ){
pay=payrepo.getPaymentbydate(FromDate,ToDate);
}else {
pay = payrepo.findAll();
}
return ResponseEntity.ok(pay);
}
else if(Integer.parseInt(request)==6){
List<Breed> breed;
int t=0;
if(checkNull(specie)==null){
breed = breedrepo.findAll();
}else{
if(specie.equals("Dog")){
t=1;
}else if(specie.equals("Cat")){
t=2;
}
breed = breedrepo.getbreedbyType(t);
}
return ResponseEntity.ok(breed);
}
else if(Integer.parseInt(request)==7){
List<PetOwner> own = ownser.getAllPetAndOwnerDet(zone,FromDate,ToDate);
return ResponseEntity.ok(own);
}
return ResponseEntity.ok("please contact admin");
}
}

192
src/main/java/com/gcc/pets/Pets/Registration/customQuery/PetdetailsCustomQuery.java

@ -0,0 +1,192 @@
package com.gcc.pets.Pets.Registration.customQuery;
import com.gcc.pets.Pets.Registration.dto.PetShortInfo;
import com.gcc.pets.Pets.Registration.dto.PetStatusDateDto;
import com.gcc.pets.Pets.Registration.dto.Petdetaildto;
import com.gcc.pets.Pets.Registration.model.PetOwner;
import com.gcc.pets.Pets.Registration.model.Petdetails;
import org.springframework.stereotype.Component;
import jakarta.persistence.EntityManager;
import jakarta.persistence.PersistenceContext;
import jakarta.persistence.criteria.CriteriaBuilder;
import jakarta.persistence.criteria.CriteriaQuery;
import jakarta.persistence.criteria.Predicate;
import jakarta.persistence.criteria.Root;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Component
public class PetdetailsCustomQuery {
@PersistenceContext
private EntityManager entityManager;
public List<PetShortInfo> findByPetinfoToReport(long mobno,String species,String breed,String zone,String fromdate,String todate,int req) {
// System.out.println(species);
CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
CriteriaQuery<PetShortInfo> criteriaQuery = criteriaBuilder.createQuery(PetShortInfo.class);
Root<Petdetails> root = criteriaQuery.from(Petdetails.class);
long mobnoo = mobno;
String spec = species;
String bre = breed;
String zon = zone;
String fromdat = fromdate;
String todat =todate;
/* Adding search criteria's for query using CriteriaBuilder */
List<Predicate> searchCriterias = new ArrayList<>();
if(mobnoo!=0){
searchCriterias.add(criteriaBuilder.equal(root.get("mobilenum"), mobnoo));
}
if (spec != null && !spec.isEmpty()) {
searchCriterias.add(criteriaBuilder.equal(root.get("species"), spec));
}
if (bre != null && !bre.isEmpty()) {
searchCriterias.add(criteriaBuilder.equal(root.get("breed"), bre));
}
if (zon != null && !zon.isEmpty()) {
searchCriterias.add(criteriaBuilder.equal(root.get("zone"), zon));
}
if (req==0 && fromdat != null && !fromdat.isEmpty() && todat !=null && !todat.isEmpty()) {
searchCriterias.add(criteriaBuilder.between(root.get("registerdate"),fromdat,todat));
}
if (req==1 && fromdat != null && !fromdat.isEmpty() && todat !=null && !todat.isEmpty()) {
searchCriterias.add(criteriaBuilder.between(root.get("statusdate"),fromdat,todat));
}
criteriaQuery.multiselect(
// root.get("uniqueid"),
root.get("mobilenum"),
// root.get("species"),
// root.get("breed"),
root.get("status")
// root.get("zone")
).where(criteriaBuilder.and(searchCriterias.toArray(new Predicate[0])));
return entityManager.createQuery(criteriaQuery).getResultList();
}
public List<Petdetaildto> filterPetinfo(long mobno,int status, String species, String breed, String zone, String fromdate, String todate, int req) {
// System.out.println(species);
CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
CriteriaQuery<Petdetaildto> criteriaQuery = criteriaBuilder.createQuery(Petdetaildto.class);
Root<Petdetails> root = criteriaQuery.from(Petdetails.class);
/* Adding search criteria's for query using CriteriaBuilder */
List<Predicate> searchCriterias = new ArrayList<>();
if(mobno!=0){
searchCriterias.add(criteriaBuilder.equal(root.get("mobilenum"), mobno));
}
if(status>=0 && status<7){
searchCriterias.add(criteriaBuilder.equal(root.get("status"), status));
}
if(status==11){
List<Predicate> st = new ArrayList<>();
st.add(criteriaBuilder.equal(root.get("status"), 1));
st.add(criteriaBuilder.equal(root.get("status"), 2));
searchCriterias.add(criteriaBuilder.or(st.toArray(new Predicate[0])));
}
if (species != null && !species.isEmpty()) {
searchCriterias.add(criteriaBuilder.equal(root.get("species"), species));
}
if (breed != null && !breed.isEmpty()) {
searchCriterias.add(criteriaBuilder.equal(root.get("breed"), breed));
}
if (zone != null && !zone.isEmpty()) {
searchCriterias.add(criteriaBuilder.equal(root.get("zone"), zone));
}
if (req==0 && fromdate != null && !fromdate.isEmpty() && todate !=null && !todate.isEmpty()) {
searchCriterias.add(criteriaBuilder.between(root.get("registerdate"),fromdate,todate));
}
if (req==1 && fromdate != null && !fromdate.isEmpty() && todate !=null && !todate.isEmpty()) {
searchCriterias.add(criteriaBuilder.between(root.get("statusdate"),fromdate,todate));
}
criteriaQuery.multiselect(
root.get("uniqueid"),
root.get("mobilenum"),
root.get("petname"),
root.get("species"),
root.get("breed"),
root.get("gender"),
root.get("registerdate"),
root.get("status"),
root.get("rejectreason"),
root.get("zone"),
root.get("statusdate"),
root.get("updatedby")
).where(criteriaBuilder.and(searchCriterias.toArray(new Predicate[0])));
return entityManager.createQuery(criteriaQuery).getResultList();
}
public List<PetOwner> findByUserInfo( String zone, String fromdate, String todate) {
CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
CriteriaQuery<PetOwner> criteriaQuery = criteriaBuilder.createQuery(PetOwner.class);
Root<PetOwner> root = criteriaQuery.from(PetOwner.class);
// String mobnoo = mobno;
String zon = zone;
String fromdat = fromdate;
String todat =todate;
/* Adding search criteria's for query using CriteriaBuilder */
List<Predicate> searchCriterias = new ArrayList<>();
// if(mobnoo != null && !mobnoo.isEmpty()){
// searchCriterias.add(criteriaBuilder.equal(root.get("phone"), mobnoo));
// }
if (zon != null && !zon.isEmpty()) {
searchCriterias.add(criteriaBuilder.equal(root.get("zone"), zon));
}
if (fromdat != null && !fromdat.isEmpty() && todat !=null && !todat.isEmpty()) {
searchCriterias.add(criteriaBuilder.between(root.get("cdate"),fromdat,todat));
}
criteriaQuery.where(criteriaBuilder.and(searchCriterias.toArray(new Predicate[0])));
return entityManager.createQuery(criteriaQuery).getResultList();
}
public List<PetStatusDateDto> AddStatusDateTemp(){
CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
CriteriaQuery<PetStatusDateDto> criteriaQuery = criteriaBuilder.createQuery(PetStatusDateDto.class);
Root<Petdetails> root = criteriaQuery.from(Petdetails.class);
/* Adding search criteria's for query using CriteriaBuilder */
List<Predicate> st = new ArrayList<>();
st.add(criteriaBuilder.notEqual(root.get("status"), 0));
//
criteriaQuery.multiselect(
root.get("uniqueid"),
root.get("mobilenum"),
root.get("petname"),
root.get("registerdate"),
root.get("status")
).where(criteriaBuilder.and(st.toArray(new Predicate[0])));
return entityManager.createQuery(criteriaQuery).getResultList();
}
}

4
src/main/java/com/gcc/pets/Pets/Registration/customQuery/PetdetailsQuery.java

@ -0,0 +1,4 @@
package com.gcc.pets.Pets.Registration.customQuery;
public interface PetdetailsQuery {
}

53
src/main/java/com/gcc/pets/Pets/Registration/dto/DogAndCatCountInZone.java

@ -0,0 +1,53 @@
package com.gcc.pets.Pets.Registration.dto;
import java.util.HashMap;
import org.springframework.stereotype.Component;
@Component
public class DogAndCatCountInZone {
HashMap<Integer, Long> dog;
HashMap<Integer, Long> cat;
long userCount;
long licCount;
public DogAndCatCountInZone(){
super();
}
public DogAndCatCountInZone(HashMap<Integer, Long> dog, HashMap<Integer, Long> cat, long userCount) {
this.dog = dog;
this.cat = cat;
this.userCount = userCount;
}
public long getUserCount() {
return userCount;
}
public void setUserCount(long userCount) {
this.userCount = userCount;
}
public HashMap<Integer, Long> getDog() {
return dog;
}
public void setDog(HashMap<Integer, Long> dog) {
this.dog = dog;
}
public HashMap<Integer, Long> getCat() {
return cat;
}
public void setCat(HashMap<Integer, Long> cat) {
this.cat = cat;
}
public long getLicCount() {
return licCount;
}
public void setLicCount(long licCount) {
this.licCount = licCount;
}
}

18
src/main/java/com/gcc/pets/Pets/Registration/dto/PetSelectedInfo.java

@ -0,0 +1,18 @@
package com.gcc.pets.Pets.Registration.dto;
import java.util.Date;
public interface PetSelectedInfo{
int getUniqueid() ;
public long getMobilenum();
public String getPetname() ;
public String getSpecies() ;
public String getBreed() ;
public String getRegisterdate();
public Integer getStatus() ;
public String getRejectreason() ;
public String getZone() ;
public Date getStatusdate() ;
public String getUpdatedby() ;
public String getGender();
}

74
src/main/java/com/gcc/pets/Pets/Registration/dto/PetShortInfo.java

@ -0,0 +1,74 @@
package com.gcc.pets.Pets.Registration.dto;
public class PetShortInfo {
private int uniqueid;
private long mobilenum;
private String species;
private String breed;
private Integer status;
private String zone;
public PetShortInfo(long mobilenum,Integer status){
this.mobilenum = mobilenum;
this.status = status;
}
public PetShortInfo(int uniqueid, long mobilenum, String species, String breed, Integer status, String zone) {
this.uniqueid = uniqueid;
this.mobilenum = mobilenum;
this.species = species;
this.breed = breed;
this.status = status;
this.zone = zone;
}
public PetShortInfo(){
super();
}
public int getUniqueid() {
return uniqueid;
}
public void setUniqueid(int uniqueid) {
this.uniqueid = uniqueid;
}
public long getMobilenum() {
return mobilenum;
}
public void setMobilenum(long mobilenum) {
this.mobilenum = mobilenum;
}
public String getSpecies() {
return species;
}
public void setSpecies(String species) {
this.species = species;
}
public String getBreed() {
return breed;
}
public void setBreed(String breed) {
this.breed = breed;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getZone() {
return zone;
}
public void setZone(String zone) {
this.zone = zone;
}
}

65
src/main/java/com/gcc/pets/Pets/Registration/dto/PetStatusDateDto.java

@ -0,0 +1,65 @@
package com.gcc.pets.Pets.Registration.dto;
import java.util.Date;
public class PetStatusDateDto {
private int uniqueid;
private long mobilenum;
private String petname;
private String registerdate;
private Integer status;
public PetStatusDateDto(){
}
public PetStatusDateDto(int uniqueid, long mobilenum, String petname, String registerdate, Integer status) {
this.uniqueid = uniqueid;
this.mobilenum = mobilenum;
this.petname = petname;
this.registerdate = registerdate;
this.status = status;
}
public int getUniqueid() {
return uniqueid;
}
public void setUniqueid(int uniqueid) {
this.uniqueid = uniqueid;
}
public long getMobilenum() {
return mobilenum;
}
public void setMobilenum(long mobilenum) {
this.mobilenum = mobilenum;
}
public String getPetname() {
return petname;
}
public void setPetname(String petname) {
this.petname = petname;
}
public String getRegisterdate() {
return registerdate;
}
public void setRegisterdate(String registerdate) {
this.registerdate = registerdate;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
}

131
src/main/java/com/gcc/pets/Pets/Registration/dto/Petdetaildto.java

@ -0,0 +1,131 @@
package com.gcc.pets.Pets.Registration.dto;
import java.util.Date;
public class Petdetaildto {
private int uniqueid;
private long mobilenum;
private String petname;
private String species;
private String breed;
private String gender;
private String registerdate;
private Integer status;
private String rejectreason;
private String zone;
private Date statusdate;
private String updatedby;
public Petdetaildto(){
super();
}
public Petdetaildto(int uniqueid, long mobilenum, String petname, String species, String breed,String gender, String registerdate, Integer status, String rejectreason, String zone, Date statusdate, String updatedby) {
this.uniqueid = uniqueid;
this.mobilenum = mobilenum;
this.petname = petname;
this.species = species;
this.breed = breed;
this.gender=gender;
this.registerdate = registerdate;
this.status = status;
this.rejectreason = rejectreason;
this.zone = zone;
this.statusdate = statusdate;
this.updatedby = updatedby;
}
public int getUniqueid() {
return uniqueid;
}
public void setUniqueid(int uniqueid) {
this.uniqueid = uniqueid;
}
public long getMobilenum() {
return mobilenum;
}
public void setMobilenum(long mobilenum) {
this.mobilenum = mobilenum;
}
public String getPetname() {
return petname;
}
public void setPetname(String petname) {
this.petname = petname;
}
public String getSpecies() {
return species;
}
public void setSpecies(String species) {
this.species = species;
}
public String getBreed() {
return breed;
}
public void setBreed(String breed) {
this.breed = breed;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public String getRegisterdate() {
return registerdate;
}
public void setRegisterdate(String registerdate) {
this.registerdate = registerdate;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getRejectreason() {
return rejectreason;
}
public void setRejectreason(String rejectreason) {
this.rejectreason = rejectreason;
}
public String getZone() {
return zone;
}
public void setZone(String zone) {
this.zone = zone;
}
public Date getStatusdate() {
return statusdate;
}
public void setStatusdate(Date statusdate) {
this.statusdate = statusdate;
}
public String getUpdatedby() {
return updatedby;
}
public void setUpdatedby(String updatedby) {
this.updatedby = updatedby;
}
}

30
src/main/java/com/gcc/pets/Pets/Registration/exception/ErrorResponse.java

@ -0,0 +1,30 @@
package com.gcc.pets.Pets.Registration.exception;
public class ErrorResponse {
private int statusCode;
private String message;
// Constructor, getters, and setters
public ErrorResponse(int statusCode, String message) {
this.statusCode = statusCode;
this.message = message;
}
public int getStatusCode() {
return statusCode;
}
public void setStatusCode(int statusCode) {
this.statusCode = statusCode;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}

36
src/main/java/com/gcc/pets/Pets/Registration/exception/GlobalExceptionHandler.java

@ -0,0 +1,36 @@
package com.gcc.pets.Pets.Registration.exception;
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.servlet.NoHandlerFoundException;
@ControllerAdvice
public class GlobalExceptionHandler {
@ExceptionHandler(NoHandlerFoundException.class)
public ResponseEntity<String> handlePageNotFoundException(NoHandlerFoundException ex) {
// Log the exception
ex.printStackTrace();
// Get the requested URL from the exception
String requestedUrl = ex.getRequestURL();
// Create an error message with the requested URL
String errorMessage = "Page not found: " + requestedUrl;
// Return a ResponseEntity with a 404 Not Found status code and error message
return ResponseEntity.status(HttpStatus.NOT_FOUND).body(errorMessage);
}
@ExceptionHandler(Exception.class)
public ResponseEntity<ErrorResponse> handleException(Exception ex) {
// Log the exception
ex.printStackTrace();
// Create an error response object
ErrorResponse errorResponse = new ErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR.value(), "An error occurred: " + ex.getMessage());
// Return a ResponseEntity with an appropriate HTTP status code and error response object
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(errorResponse);
}
}

0
src/main/java/com/gcc/pets/Pets/Registration/login/CheckUserSession.java

48
src/main/java/com/gcc/pets/Pets/Registration/login/LoginController.java

@ -0,0 +1,48 @@
package com.gcc.pets.Pets.Registration.login;
import org.springframework.stereotype.Controller;
@Controller
public class LoginController {
/*
@Autowired
private UserService userService;
@Autowired
private UserSession userSession;
@GetMapping("/login")
public String loginForm(Model model) {
model.addAttribute("user", new User());
return "login";
}
@PostMapping("/login")
public String loginSubmit(@ModelAttribute User user, Model model) {
Long userId = userService.authenticateUser(user.getUsername(), user.getPassword());
if (userId != null) {
userSession.setUserId(userId);
return "redirect:/home";
} else {
model.addAttribute("error", "Incorrect username or password");
return "login";
}
}
@GetMapping("/home")
public String home(Model model) {
Long userId = userSession.getUserId();
if (userId == null) {
return "redirect:/login";
}
Optional<User> optionalUser = userRepository.findById(userId);
if (optionalUser.isPresent()) {
User user = optionalUser.get();
model.addAttribute("username", user.getUsername());
return "home";
} else {
return "redirect:/login";
}
}
*/
}

26
src/main/java/com/gcc/pets/Pets/Registration/login/UserService.java

@ -0,0 +1,26 @@
package com.gcc.pets.Pets.Registration.login;
import org.springframework.stereotype.Service;
@Service
public class UserService {
/*
@Autowired
private UserRepository userRepository;
public void registerUser(User user) {
userRepository.save(user);
}
public Long authenticateUser(String username, String password) {
Optional<User> optionalUser = userRepository.findByUsername(username);
if (optionalUser.isPresent()) {
User user = optionalUser.get();
if (password.equals(user.getPassword())) {
return user.getId();
}
}
return null;
}
*/
}

75
src/main/java/com/gcc/pets/Pets/Registration/login/UserSession.java

@ -0,0 +1,75 @@
package com.gcc.pets.Pets.Registration.login;
import org.springframework.context.annotation.Scope;
import org.springframework.context.annotation.ScopedProxyMode;
import org.springframework.stereotype.Component;
import org.springframework.web.context.WebApplicationContext;
@Component
@Scope(value = WebApplicationContext.SCOPE_SESSION, proxyMode = ScopedProxyMode.TARGET_CLASS)
public class UserSession {
private Integer userId;
private long mobNo;
private String userType;
private String dispayName;
private String zone;
private String fromdate;
private String todate;
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public String getUserType() {
return userType;
}
public void setUserType(String userType) {
this.userType = userType;
}
public String getDispayName() {
return dispayName;
}
public void setDispayName(String dispayName) {
this.dispayName = dispayName;
}
public long getMobNo() {
return mobNo;
}
public void setMobNo(long mobNo) {
this.mobNo = mobNo;
}
public String getZone() {
return zone;
}
public void setZone(String zone) {
this.zone = zone;
}
public String getFromdate() {
return fromdate;
}
public void setFromdate(String fromdate) {
this.fromdate = fromdate;
}
public String getTodate() {
return todate;
}
public void setTodate(String todate) {
this.todate = todate;
}
}

36
src/main/java/com/gcc/pets/Pets/Registration/model/Admin.java

@ -0,0 +1,36 @@
package com.gcc.pets.Pets.Registration.model;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
import jakarta.persistence.Lob;
//@Entity
//public class Admin {
//
// @Id
// @GeneratedValue
// private int id;
//
// @Lob
// @Column(columnDefinition = "MEDIUMBLOB")
// private String OfficerSign;
//
// public int getId() {
// return id;
// }
//
// public void setId(int id) {
// this.id = id;
// }
//
// public String getOfficerSign() {
// return OfficerSign;
// }
//
// public void setOfficerSign(String officerSign) {
// OfficerSign = officerSign;
// }
//
//}

40
src/main/java/com/gcc/pets/Pets/Registration/model/Breed.java

@ -0,0 +1,40 @@
package com.gcc.pets.Pets.Registration.model;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
@Entity
public class Breed {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
private int type;
// 1-dog
// 2-cat
private String breed;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public String getBreed() {
return breed;
}
public void setBreed(String breed) {
this.breed = breed;
}
}

52
src/main/java/com/gcc/pets/Pets/Registration/model/LoginDetail.java

@ -0,0 +1,52 @@
package com.gcc.pets.Pets.Registration.model;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
@Entity
public class LoginDetail {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
private long mobileno;
private String pin;
private String usertype;
private String zone;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public long getMobileno() {
return mobileno;
}
public void setMobileno(long mobileno) {
this.mobileno = mobileno;
}
public String getPin() {
return pin;
}
public void setPin(String pin) {
this.pin = pin;
}
public String getUsertype() {
return usertype;
}
public void setUsertype(String usertype) {
this.usertype = usertype;
}
public String getZone() {
return zone;
}
public void setZone(String zone) {
this.zone = zone;
}
}

59
src/main/java/com/gcc/pets/Pets/Registration/model/OldPetLicense.java

@ -0,0 +1,59 @@
package com.gcc.pets.Pets.Registration.model;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import java.util.Date;
@Entity
public class OldPetLicense {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
private int uniqueid;
private long phone;
private String licenseNo;
private Date date;
private String validity;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getUniqueid() {
return uniqueid;
}
public void setUniqueid(int uniqueid) {
this.uniqueid = uniqueid;
}
public long getPhone() {
return phone;
}
public void setPhone(long phone) {
this.phone = phone;
}
public String getLicenseNo() {
return licenseNo;
}
public void setLicenseNo(String licenseNo) {
this.licenseNo = licenseNo;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
public String getValidity() {
return validity;
}
public void setValidity(String validity) {
this.validity = validity;
}
}

289
src/main/java/com/gcc/pets/Pets/Registration/model/OldPetdetails.java

@ -0,0 +1,289 @@
package com.gcc.pets.Pets.Registration.model;
import jakarta.persistence.*;
import java.util.Date;
@Entity
public class OldPetdetails {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int uniqueid;
private long mobilenum;
private String petname;
private String species;
private String identificationmark;
private String breed;
private String petcolor;
private String gender;
private String age;
private String sterilized;
private String stray;
private String vaccinated;
private String arvdate;
private String dewormdate;
private String othervac;
private String previoslicenseNo;
private String VeterinaryConsultant;
private String TNVCNo;
@Column(name = "registerdate", columnDefinition = "DATETIME NULL DEFAULT CURRENT_TIMESTAMP")
private String registerdate;
private Integer status;
private String rejectreason;
private String zone;
private Date statusdate;
private String updatedby;
@Lob
@Column(columnDefinition = "MEDIUMBLOB")
private String applicantphoto;
@Lob
@Column(columnDefinition = "MEDIUMBLOB")
private String petphoto;
@Lob
@Column(columnDefinition = "MEDIUMBLOB")
private String addressproof;
@Lob
@Column(columnDefinition = "MEDIUMBLOB")
private String rabiesvacCerti;
public int getUniqueid() {
return uniqueid;
}
public void setUniqueid(int uniqueid) {
this.uniqueid = uniqueid;
}
public long getMobilenum() {
return mobilenum;
}
public void setMobilenum(long mobilenum) {
this.mobilenum = mobilenum;
}
public String getPetname() {
return petname;
}
public void setPetname(String petname) {
this.petname = petname;
}
public String getSpecies() {
return species;
}
public void setSpecies(String species) {
this.species = species;
}
public String getIdentificationmark() {
return identificationmark;
}
public void setIdentificationmark(String identificationmark) {
this.identificationmark = identificationmark;
}
public String getBreed() {
return breed;
}
public void setBreed(String breed) {
this.breed = breed;
}
public String getPetcolor() {
return petcolor;
}
public void setPetcolor(String petcolor) {
this.petcolor = petcolor;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public String getAge() {
return age;
}
public void setAge(String age) {
this.age = age;
}
public String getSterilized() {
return sterilized;
}
public void setSterilized(String sterilized) {
this.sterilized = sterilized;
}
public String getStray() {
return stray;
}
public void setStray(String stray) {
this.stray = stray;
}
public String getVaccinated() {
return vaccinated;
}
public void setVaccinated(String vaccinated) {
this.vaccinated = vaccinated;
}
public String getArvdate() {
return arvdate;
}
public void setArvdate(String arvdate) {
this.arvdate = arvdate;
}
public String getDewormdate() {
return dewormdate;
}
public void setDewormdate(String dewormdate) {
this.dewormdate = dewormdate;
}
public String getOthervac() {
return othervac;
}
public void setOthervac(String othervac) {
this.othervac = othervac;
}
public String getPrevioslicenseNo() {
return previoslicenseNo;
}
public void setPrevioslicenseNo(String previoslicenseNo) {
this.previoslicenseNo = previoslicenseNo;
}
public String getVeterinaryConsultant() {
return VeterinaryConsultant;
}
public void setVeterinaryConsultant(String veterinaryConsultant) {
VeterinaryConsultant = veterinaryConsultant;
}
public String getTNVCNo() {
return TNVCNo;
}
public void setTNVCNo(String tNVCNo) {
TNVCNo = tNVCNo;
}
public String getRegisterdate() {
return registerdate;
}
public void setRegisterdate(String registerdate) {
this.registerdate = registerdate;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getRejectreason() {
return rejectreason;
}
public void setRejectreason(String rejectreason) {
this.rejectreason = rejectreason;
}
public String getZone() {
return zone;
}
public void setZone(String zone) {
this.zone = zone;
}
public String getApplicantphoto() {
return applicantphoto;
}
public void setApplicantphoto(String applicantphoto) {
this.applicantphoto = applicantphoto;
}
public String getPetphoto() {
return petphoto;
}
public void setPetphoto(String petphoto) {
this.petphoto = petphoto;
}
public String getAddressproof() {
return addressproof;
}
public void setAddressproof(String addressproof) {
this.addressproof = addressproof;
}
public String getRabiesvacCerti() {
return rabiesvacCerti;
}
public void setRabiesvacCerti(String rabiesvacCerti) {
this.rabiesvacCerti = rabiesvacCerti;
}
public Date getStatusdate() {
return statusdate;
}
public void setStatusdate(Date statusdate) {
this.statusdate = statusdate;
}
public String getUpdatedby() {
return updatedby;
}
public void setUpdatedby(String updatedby) {
this.updatedby = updatedby;
}
}

50
src/main/java/com/gcc/pets/Pets/Registration/model/Orderslogs.java

@ -0,0 +1,50 @@
package com.gcc.pets.Pets.Registration.model;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
@Entity
public class Orderslogs {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
private String order_id;
private String orderInfo;
private int uniqueid;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getOrder_id() {
return order_id;
}
public void setOrder_id(String order_id) {
this.order_id = order_id;
}
public String getOrderInfo() {
return orderInfo;
}
public void setOrderInfo(String orderInfo) {
this.orderInfo = orderInfo;
}
public int getUniqueid() {
return uniqueid;
}
public void setUniqueid(int uniqueid) {
this.uniqueid = uniqueid;
}
}

80
src/main/java/com/gcc/pets/Pets/Registration/model/Payment.java

@ -0,0 +1,80 @@
package com.gcc.pets.Pets.Registration.model;
import jakarta.persistence.Id;
import jakarta.persistence.Column;
import java.util.Date;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
@Entity
public class Payment {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
@Column(name = "paymentdate",nullable = false, columnDefinition = "DATETIME DEFAULT CURRENT_TIMESTAMP")
private String paymentdate;
private String paymentId;
private long mobno;
private int uniqueid;
private float amount;
private String paymentStatus;
private String order_id;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getPaymentdate() {
return paymentdate;
}
public void setPaymentdate(String paymentdate) {
this.paymentdate = paymentdate;
}
public String getPaymentId() {
return paymentId;
}
public void setPaymentId(String paymentId) {
this.paymentId = paymentId;
}
public long getMobno() {
return mobno;
}
public void setMobno(long mobno) {
this.mobno = mobno;
}
public int getUniqueid() {
return uniqueid;
}
public void setUniqueid(int uniqueid) {
this.uniqueid = uniqueid;
}
public float getAmount() {
return amount;
}
public void setAmount(float amount) {
this.amount = amount;
}
public String getPaymentStatus() {
return paymentStatus;
}
public void setPaymentStatus(String paymentStatus) {
this.paymentStatus = paymentStatus;
}
public String getOrder_id() {
return order_id;
}
public void setOrder_id(String order_id) {
this.order_id = order_id;
}
}

61
src/main/java/com/gcc/pets/Pets/Registration/model/PetLicense.java

@ -0,0 +1,61 @@
package com.gcc.pets.Pets.Registration.model;
import java.util.Date;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
@Entity
public class PetLicense {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
private int uniqueid;
private long phone;
private String licenseNo;
private Date date;
private String validity;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getUniqueid() {
return uniqueid;
}
public void setUniqueid(int uniqueid) {
this.uniqueid = uniqueid;
}
public long getPhone() {
return phone;
}
public void setPhone(long phone) {
this.phone = phone;
}
public String getLicenseNo() {
return licenseNo;
}
public void setLicenseNo(String licenseNo) {
this.licenseNo = licenseNo;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
public String getValidity() {
return validity;
}
public void setValidity(String validity) {
this.validity = validity;
}
}

164
src/main/java/com/gcc/pets/Pets/Registration/model/PetOwner.java

@ -0,0 +1,164 @@
package com.gcc.pets.Pets.Registration.model;
import jakarta.persistence.*;
import java.util.Date;
@Entity
public class PetOwner {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
private String title;
private String fname;
private String doornumber;
private String street;
private String area;
private String city;
private String pincode;
private String zone;
private String ward;
private String phone;
private String email;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getFname() {
return fname;
}
public void setFname(String fname) {
this.fname = fname;
}
public String getDoornumber() {
return doornumber;
}
public void setDoornumber(String doornumber) {
this.doornumber = doornumber;
}
public String getStreet() {
return street;
}
public void setStreet(String street) {
this.street = street;
}
public String getArea() {
return area;
}
public void setArea(String area) {
this.area = area;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getPincode() {
return pincode;
}
public void setPincode(String pincode) {
this.pincode = pincode;
}
public String getZone() {
return zone;
}
public void setZone(String zone) {
this.zone = zone;
}
public String getWard() {
return ward;
}
public void setWard(String ward) {
this.ward = ward;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
//@Transient
// @Column( columnDefinition = "DATETIME NULL DEFAULT CURRENT_TIMESTAMP")
private Date cdate= new Date();
@Transient
private long licInProg;
@Transient
private long licPayment;
@Transient
private long licCount;
@Transient
private long licRej;
@Transient
private long expLicCount;
public long getLicInProg() {
return licInProg;
}
public void setLicInProg(long licInProg) {
this.licInProg = licInProg;
}
public long getLicPayment() {
return licPayment;
}
public void setLicPayment(long licPayment) {
this.licPayment = licPayment;
}
public long getLicCount() {
return licCount;
}
public void setLicCount(long licCount) {
this.licCount = licCount;
}
public long getLicRej() {
return licRej;
}
public void setLicRej(long licRej) {
this.licRej = licRej;
}
public long getExpLicCount() {
return expLicCount;
}
public void setExpLicCount(long expLicCount) {
this.expLicCount = expLicCount;
}
public Date getCdate() {
return cdate;
}
public void setCdate(Date cdate) {
this.cdate = cdate;
}
}

291
src/main/java/com/gcc/pets/Pets/Registration/model/Petdetails.java

@ -0,0 +1,291 @@
package com.gcc.pets.Pets.Registration.model;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Lob;
import java.util.Date;
@Entity
public class Petdetails {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int uniqueid;
private long mobilenum;
private String petname;
private String species;
private String identificationmark;
private String breed;
private String petcolor;
private String gender;
private String age;
private String sterilized;
private String stray;
private String vaccinated;
private String arvdate;
private String dewormdate;
private String othervac;
private String previoslicenseNo;
private String VeterinaryConsultant;
private String TNVCNo;
@Column(name = "registerdate", columnDefinition = "DATETIME NULL DEFAULT CURRENT_TIMESTAMP")
private String registerdate;
private Integer status;
private String rejectreason;
private String zone;
private Date statusdate;
private String updatedby;
@Lob
@Column(columnDefinition = "MEDIUMBLOB")
private String applicantphoto;
@Lob
@Column(columnDefinition = "MEDIUMBLOB")
private String petphoto;
@Lob
@Column(columnDefinition = "MEDIUMBLOB")
private String addressproof;
@Lob
@Column(columnDefinition = "MEDIUMBLOB")
private String rabiesvacCerti;
public int getUniqueid() {
return uniqueid;
}
public void setUniqueid(int uniqueid) {
this.uniqueid = uniqueid;
}
public long getMobilenum() {
return mobilenum;
}
public void setMobilenum(long mobilenum) {
this.mobilenum = mobilenum;
}
public String getPetname() {
return petname;
}
public void setPetname(String petname) {
this.petname = petname;
}
public String getSpecies() {
return species;
}
public void setSpecies(String species) {
this.species = species;
}
public String getIdentificationmark() {
return identificationmark;
}
public void setIdentificationmark(String identificationmark) {
this.identificationmark = identificationmark;
}
public String getBreed() {
return breed;
}
public void setBreed(String breed) {
this.breed = breed;
}
public String getPetcolor() {
return petcolor;
}
public void setPetcolor(String petcolor) {
this.petcolor = petcolor;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public String getAge() {
return age;
}
public void setAge(String age) {
this.age = age;
}
public String getSterilized() {
return sterilized;
}
public void setSterilized(String sterilized) {
this.sterilized = sterilized;
}
public String getStray() {
return stray;
}
public void setStray(String stray) {
this.stray = stray;
}
public String getVaccinated() {
return vaccinated;
}
public void setVaccinated(String vaccinated) {
this.vaccinated = vaccinated;
}
public String getArvdate() {
return arvdate;
}
public void setArvdate(String arvdate) {
this.arvdate = arvdate;
}
public String getDewormdate() {
return dewormdate;
}
public void setDewormdate(String dewormdate) {
this.dewormdate = dewormdate;
}
public String getOthervac() {
return othervac;
}
public void setOthervac(String othervac) {
this.othervac = othervac;
}
public String getPrevioslicenseNo() {
return previoslicenseNo;
}
public void setPrevioslicenseNo(String previoslicenseNo) {
this.previoslicenseNo = previoslicenseNo;
}
public String getVeterinaryConsultant() {
return VeterinaryConsultant;
}
public void setVeterinaryConsultant(String veterinaryConsultant) {
VeterinaryConsultant = veterinaryConsultant;
}
public String getTNVCNo() {
return TNVCNo;
}
public void setTNVCNo(String tNVCNo) {
TNVCNo = tNVCNo;
}
public String getRegisterdate() {
return registerdate;
}
public void setRegisterdate(String registerdate) {
this.registerdate = registerdate;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getRejectreason() {
return rejectreason;
}
public void setRejectreason(String rejectreason) {
this.rejectreason = rejectreason;
}
public String getZone() {
return zone;
}
public void setZone(String zone) {
this.zone = zone;
}
public String getApplicantphoto() {
return applicantphoto;
}
public void setApplicantphoto(String applicantphoto) {
this.applicantphoto = applicantphoto;
}
public String getPetphoto() {
return petphoto;
}
public void setPetphoto(String petphoto) {
this.petphoto = petphoto;
}
public String getAddressproof() {
return addressproof;
}
public void setAddressproof(String addressproof) {
this.addressproof = addressproof;
}
public String getRabiesvacCerti() {
return rabiesvacCerti;
}
public void setRabiesvacCerti(String rabiesvacCerti) {
this.rabiesvacCerti = rabiesvacCerti;
}
public Date getStatusdate() {
return statusdate;
}
public void setStatusdate(Date statusdate) {
this.statusdate = statusdate;
}
public String getUpdatedby() {
return updatedby;
}
public void setUpdatedby(String updatedby) {
this.updatedby = updatedby;
}
}

66
src/main/java/com/gcc/pets/Pets/Registration/model/SMSsender.java

@ -0,0 +1,66 @@
package com.gcc.pets.Pets.Registration.model;
import jakarta.annotation.Nonnull;
import jakarta.persistence.*;
import java.util.Date;
@Entity
public class SMSsender {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
@Column(name = "phone",nullable = false)
private Long phone;
@Column(name = "purpose",nullable = false)
private String purpose;
@Column(name = "bodyMsg",nullable = false)
private String bodyMsg;
@Column(name = "cdate",nullable = false, columnDefinition = "DATETIME DEFAULT CURRENT_TIMESTAMP")
private Date cdate;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public Long getPhone() {
return phone;
}
public void setPhone(Long phone) {
this.phone = phone;
}
public String getPurpose() {
return purpose;
}
public void setPurpose(String purpose) {
this.purpose = purpose;
}
public String getBodyMsg() {
return bodyMsg;
}
public void setBodyMsg(String bodyMsg) {
this.bodyMsg = bodyMsg;
}
public Date getCdate() {
return cdate;
}
public void setCdate(Date cdate) {
this.cdate = cdate;
}
}

55
src/main/java/com/gcc/pets/Pets/Registration/model/Signature.java

@ -0,0 +1,55 @@
package com.gcc.pets.Pets.Registration.model;
import jakarta.persistence.*;
@Entity
public class Signature {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
@Lob
@Column(columnDefinition = "MEDIUMBLOB")
private String sign1;
@Lob
@Column(columnDefinition = "MEDIUMBLOB")
private String sign2;
@Lob
@Column(columnDefinition = "MEDIUMBLOB")
private String sign3;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getSign1() {
return sign1;
}
public void setSign1(String sign1) {
this.sign1 = sign1;
}
public String getSign2() {
return sign2;
}
public void setSign2(String sign2) {
this.sign2 = sign2;
}
public String getSign3() {
return sign3;
}
public void setSign3(String sign3) {
this.sign3 = sign3;
}
}

72
src/main/java/com/gcc/pets/Pets/Registration/model/VeterinaryOfficers.java

@ -0,0 +1,72 @@
package com.gcc.pets.Pets.Registration.model;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
@Entity
public class VeterinaryOfficers {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
private String name;
private String userName;
private String password;
private long mobno;
private String email;
private String zone;
private String tnvncno;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public long getMobno() {
return mobno;
}
public void setMobno(long mobno) {
this.mobno = mobno;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getZone() {
return zone;
}
public void setZone(String zone) {
this.zone = zone;
}
public String getTnvncno() {
return tnvncno;
}
public void setTnvncno(String tnvncno) {
this.tnvncno = tnvncno;
}
}

47
src/main/java/com/gcc/pets/Pets/Registration/others/AppConfig.java

@ -0,0 +1,47 @@
package com.gcc.pets.Pets.Registration.others;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
@Component
@ConfigurationProperties(prefix = "app")
public class AppConfig {
private String title;
private String baseUrl;
private String getOtpUrl;
private String erpUrl;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getBaseUrl() {
return baseUrl;
}
public void setBaseUrl(String baseUrl) {
this.baseUrl = baseUrl;
}
public String getGetOtpUrl() {
return getOtpUrl;
}
public void setGetOtpUrl(String getOtpUrl) {
this.getOtpUrl = getOtpUrl;
}
public String getErpUrl() {
return erpUrl;
}
public void setErpUrl(String erpUrl) {
this.erpUrl = erpUrl;
}
}

11
src/main/java/com/gcc/pets/Pets/Registration/repo/AdminRepository.java

@ -0,0 +1,11 @@
package com.gcc.pets.Pets.Registration.repo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
//import com.gcc.pets.Pets.Registration.model.Admin;
//@Repository
//public interface AdminRepository extends JpaRepository<Admin,Integer> {
//
//}

16
src/main/java/com/gcc/pets/Pets/Registration/repo/BreedRepository.java

@ -0,0 +1,16 @@
package com.gcc.pets.Pets.Registration.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.pets.Pets.Registration.model.Breed;
@Repository
public interface BreedRepository extends JpaRepository<Breed,Integer> {
@Query(value = "SELECT a FROM Breed a WHERE a.type=?1")
List<Breed> getbreedbyType(int type);
}

24
src/main/java/com/gcc/pets/Pets/Registration/repo/Logindetail.java

@ -0,0 +1,24 @@
package com.gcc.pets.Pets.Registration.repo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import com.gcc.pets.Pets.Registration.model.LoginDetail;
import org.springframework.transaction.annotation.Transactional;
@Repository
public interface Logindetail extends JpaRepository<LoginDetail,Integer> {
@Query(value = "SELECT a FROM LoginDetail a WHERE a.mobileno=?1 and a.pin=?2")
LoginDetail checkUser(long mobileno,String pin);
@Query(value = "SELECT a FROM LoginDetail a WHERE a.mobileno=?1")
LoginDetail checkUserbyMobile(long mobileno);
@Transactional
@Modifying
@Query(value="UPDATE login_detail SET zone = :zone WHERE mobileno = :mobileno",nativeQuery = true)
void updateZoneInLogin(String zone,long mobileno);
}

8
src/main/java/com/gcc/pets/Pets/Registration/repo/OldPetLicenseRepository.java

@ -0,0 +1,8 @@
package com.gcc.pets.Pets.Registration.repo;
import com.gcc.pets.Pets.Registration.model.OldPetLicense;
import org.springframework.data.jpa.repository.JpaRepository;
public interface OldPetLicenseRepository extends JpaRepository<OldPetLicense,Integer> {
}

8
src/main/java/com/gcc/pets/Pets/Registration/repo/OldPetdetailsRepository.java

@ -0,0 +1,8 @@
package com.gcc.pets.Pets.Registration.repo;
import com.gcc.pets.Pets.Registration.model.OldPetdetails;
import org.springframework.data.jpa.repository.JpaRepository;
public interface OldPetdetailsRepository extends JpaRepository<OldPetdetails,Integer> {
}

9
src/main/java/com/gcc/pets/Pets/Registration/repo/OrderslogsRepository.java

@ -0,0 +1,9 @@
package com.gcc.pets.Pets.Registration.repo;
import com.gcc.pets.Pets.Registration.model.Orderslogs;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface OrderslogsRepository extends JpaRepository<Orderslogs,Integer> {
}

16
src/main/java/com/gcc/pets/Pets/Registration/repo/PaymentRepository.java

@ -0,0 +1,16 @@
package com.gcc.pets.Pets.Registration.repo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import com.gcc.pets.Pets.Registration.model.Payment;
import java.util.List;
@Repository
public interface PaymentRepository extends JpaRepository<Payment,Integer> {
@Query(value = "SELECT * FROM payment WHERE paymentdate BETWEEN :fromdate AND DATE_ADD(:todate, INTERVAL 1 DAY)",nativeQuery=true)
List<Payment> getPaymentbydate(String fromdate, String todate);
}

26
src/main/java/com/gcc/pets/Pets/Registration/repo/PetLicenseRepository.java

@ -0,0 +1,26 @@
package com.gcc.pets.Pets.Registration.repo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import com.gcc.pets.Pets.Registration.model.PetLicense;
import java.util.List;
import java.util.Optional;
@Repository
public interface PetLicenseRepository extends JpaRepository<PetLicense,Integer>{
@Query(value = "SELECT a FROM PetLicense a WHERE a.phone=?1 and a.uniqueid=?2")
PetLicense getLincenseByMobNoAndUniqueid(long phone,int uniqueid);
@Query(value = "SELECT a FROM PetLicense a WHERE a.licenseNo=?1")
PetLicense getLincenseByNo(String licenseNo);
@Query(value = "SELECT * FROM pet_license WHERE `date` BETWEEN :fromdate AND DATE_ADD(:todate, INTERVAL 1 DAY)",nativeQuery=true)
List<PetLicense> getLincenseByDate(String fromdate,String todate);
@Query(value = "SELECT a FROM PetLicense a WHERE a.phone=?1 and a.uniqueid=?2")
Optional<PetLicense> checkLincenseExistsByMobNoAndUniqueid(long phone, int uniqueid);
}

27
src/main/java/com/gcc/pets/Pets/Registration/repo/PetOwnerRepository.java

@ -0,0 +1,27 @@
package com.gcc.pets.Pets.Registration.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.pets.Pets.Registration.model.PetOwner;
@Repository
public interface PetOwnerRepository extends JpaRepository<PetOwner,Integer> {
@Query(value = "SELECT a FROM PetOwner a WHERE a.phone=?1")
PetOwner getPetOwnersbymobno(String phone);
@Query(value = "SELECT count(id) FROM pet_owner",nativeQuery=true)
Long getCountOfUser();
@Query(value = "SELECT * FROM pet_owner WHERE (zone = :zone OR :zone IS NULL) AND ((cdate between :fromdate AND DATE_ADD(:todate, INTERVAL 1 DAY)) OR (cdate IS NULL))",nativeQuery=true)
List<PetOwner> getPetOwnersbymobno(String zone,String fromdate,String todate);
@Query(value = "SELECT * FROM pet_owner WHERE (zone = :zone OR :zone IS NULL)",nativeQuery=true)
List<PetOwner> getPetOwnersbyZone(String zone);
@Query(value = "SELECT count(id) FROM pet_owner WHERE zone=:zone",nativeQuery=true)
long getCountOfUserByZone(String zone);
}

156
src/main/java/com/gcc/pets/Pets/Registration/repo/PetdetailsRepository.java

@ -0,0 +1,156 @@
package com.gcc.pets.Pets.Registration.repo;
import java.util.Date;
import java.util.List;
import com.gcc.pets.Pets.Registration.dto.PetSelectedInfo;
import com.gcc.pets.Pets.Registration.dto.PetStatusDateDto;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import com.gcc.pets.Pets.Registration.model.Petdetails;
@Repository
public interface PetdetailsRepository extends JpaRepository<Petdetails,Integer> {
@Query(value = "SELECT uniqueid,mobilenum,petname,species,breed,gender,registerdate,`status`,rejectreason,zone,statusdate,updatedby FROM petdetails", nativeQuery = true)
List<PetSelectedInfo> findAllPetSelectedInfo();
@Query(value ="SELECT petphoto FROM petdetails where uniqueid=:uniqueid",nativeQuery = true)
List<?> getPetImage(String uniqueid);
@Query(value ="SELECT applicantphoto FROM petdetails where uniqueid=:uniqueid",nativeQuery = true)
List<?> getApplicantImage(String uniqueid);
@Query(value ="SELECT rabiesvac_certi FROM petdetails where uniqueid=:uniqueid",nativeQuery = true)
List<?> getRabiesCertiImage(String uniqueid);
@Query(value ="SELECT addressproof FROM petdetails where uniqueid=:uniqueid",nativeQuery = true)
List<?> getAddressProofImage(String uniqueid);
@Transactional
@Modifying
@Query("update Petdetails u set u.status = ?1 where u.mobilenum = ?2 and u.uniqueid = ?3")
void updatePetStatus(Integer status,long mobilenum,int uniqueid);
@Transactional
@Modifying
@Query("update Petdetails u set u.status = ?1 where u.uniqueid = ?2")
void updateStatus(Integer status,int uniqueid);
@Transactional
@Modifying
@Query("update Petdetails u set u.status = ?1 ,u.statusdate=?2 ,u.updatedby=?3 where u.uniqueid = ?4")
void updateAcceptStatus(Integer status, Date statusdate, String updatedby, int uniqueid);
@Transactional
@Modifying
@Query("update Petdetails u set u.status = ?1,u.rejectreason =?2,u.statusdate=?3 ,u.updatedby=?4 where u.uniqueid = ?5")
void updateRejectStatus(Integer status,String rejectreason,Date statusdate, String updatedby,int uniqueid);
@Transactional
@Modifying
@Query("update Petdetails u set u.updatedby = ?1 where u.zone = ?2 And `status`!=0")
void AddUpdatedBy(String updatedby,String zone);
@Transactional
@Modifying
@Query(value = "update petdetails set statusdate = :statusdate where uniqueid = :uniqueid And `status`!=0",nativeQuery = true)
public void AddStatusDate(String statusdate,int uniqueid);
@Query(value = "SELECT uniqueid,mobilenum,petname,species,breed,gender,registerdate,`status`,rejectreason,zone,statusdate,updatedby FROM petdetails where mobilenum=:mobilenum", nativeQuery = true)
List<PetSelectedInfo> findByPhone(String mobilenum);
@Query(value = "SELECT uniqueid,mobilenum,petname,species,breed,gender,registerdate,`status`,rejectreason,zone,statusdate,updatedby FROM petdetails where species=:species and zone=:zone", nativeQuery = true)
List<PetSelectedInfo> findBySpeciesAndZoneShortInfo(String species,String zone);
@Query(value = "SELECT uniqueid,mobilenum,petname,species,breed,gender,registerdate,`status`,rejectreason,zone,statusdate,updatedby FROM petdetails where species=:species", nativeQuery = true)
List<PetSelectedInfo> findBySpeciesShortInfo(String species);
@Query(value = "SELECT a FROM Petdetails a WHERE a.zone=?1 and a.status = ?2")
List<Petdetails> getPetsbyzoneandStatus(String zone,Integer status);
//removing shortly
@Query(value = "SELECT a FROM Petdetails a WHERE a.mobilenum=?1 and a.status = ?2")
List<Petdetails> getPetsbymobnoAndStatus(long mobno,Integer status);
//
@Query(value = "SELECT a FROM Petdetails a WHERE a.mobilenum=?1 and a.uniqueid=?2")
Petdetails getPetsByMobNoAndUniqueid(long mobilenum,int uniqueid);
//REMOVING QUERY
@Query(value = "SELECT a FROM Petdetails a WHERE a.uniqueid=?1")
Petdetails getPetsByUniqueid(int uniqueid);
@Query(value = "SELECT a FROM Petdetails a WHERE a.status=?1")
List<Petdetails> getPetsbystatus(Integer status);
@Query(value = "SELECT count(uniqueid) FROM petdetails Where species=:pettype AND zone=:zone AND (`status`=0 OR `status`=1 OR `status`=2)",nativeQuery=true)
Long getCountOfPetByZoneAndPetType(String pettype,String zone);
@Query(value = "SELECT count(uniqueid) FROM petdetails Where zone=:zone",nativeQuery=true)
Long getCountOfPetByZone(String zone);
@Query(value = "SELECT count(uniqueid) FROM petdetails Where status=:status AND zone=:zone",nativeQuery=true)
Long getCountOfPetByZoneAndStatus(Integer status,String zone);
@Query(value = "SELECT count(uniqueid) FROM petdetails Where species=:species",nativeQuery=true)
Long getCountOfPetByType(String species);
@Query(value = "SELECT count(uniqueid) FROM petdetails Where status=:status",nativeQuery=true)
Long getCountOfPetByStatus(Integer status);
@Query(value = "SELECT * FROM petdetails WHERE statusdate BETWEEN :fromdate AND DATE_ADD(:todate, INTERVAL 1 DAY) AND `status`=:status",nativeQuery=true)
List<Petdetails> getPetsbyupdatedbydate(String fromdate,String todate,Integer status);
@Query(value = "SELECT * FROM petdetails WHERE statusdate BETWEEN :fromdate AND DATE_ADD(:todate, INTERVAL 1 DAY) AND `status`=:status AND `zone`=:zone",nativeQuery=true)
List<Petdetails> getPetsByUpdatedDateAndZone(String fromdate,String todate,Integer status,String zone);
@Query(value = "SELECT * FROM petdetails WHERE registerdate BETWEEN :fromdate AND :todate AND `status`=:status",nativeQuery=true)
List<Petdetails> getPetByRegiserdate(String fromdate,String todate,Integer status);
@Query(value = "SELECT * FROM petdetails WHERE registerdate BETWEEN :fromdate AND :todate AND `status`=:status AND `zone`=:zone",nativeQuery=true)
List<Petdetails> getPetByRegiserdateAndZone(String fromdate,String todate,Integer status,String zone);
// @Query(value = "SELECT * FROM petdetails WHERE `status`=:status AND (zone = :zone OR :zone IS NULL) AND (species = :species OR :species IS NULL) AND (breed = :breed OR :breed IS NULL)",nativeQuery=true)
// List<Petdetails> filterPetdetails(Integer status,String zone,String species,String breed );
// @Query(value="SELECT * FROM petdetails WHERE `status`=:status AND (zone = :zone OR :zone IS NULL) AND (species = :species OR :species IS NULL) AND (breed = :breed OR :breed IS NULL) and ((registerdate between :fromdate AND :todate) OR (registerdate IS NULL))",nativeQuery=true)
// List<Petdetails> filterPetdetailsbydate(Integer status,String zone,String species,String breed,String fromdate,String todate );
// @Query(value="SELECT * FROM petdetails WHERE `status`=:status AND (zone = :zone OR :zone IS NULL) AND (species = :species OR :species IS NULL) AND (breed = :breed OR :breed IS NULL) and ((statusdate between :fromdate AND :todate) OR (statusdate IS NULL))",nativeQuery=true)
// List<Petdetails> filterPetdetailsbyStatusDate(Integer status,String zone,String species,String breed,String fromdate,String todate );
@Query(value = "SELECT count(uniqueid) FROM petdetails Where mobilenum=:mobilenum AND `status`=:status",nativeQuery=true)
Long getCountOfPetByPhoneAndStatus(long mobilenum,Integer status);
@Query(value = "SELECT count(uniqueid) FROM petdetails Where species=:species AND (`status`=0 OR `status`=1 OR `status`=2)",nativeQuery=true)
Long getCountOfPetBySpeciesAndStatus(String species);
// @Query(value = "SELECT * FROM petdetails WHERE (`status`=1 OR `status`=2) AND (zone = :zone OR :zone IS NULL) AND (species = :species OR :species IS NULL) AND (breed = :breed OR :breed IS NULL)",nativeQuery=true)
// List<Petdetails> filterAcceptedPetdetails(String zone,String species,String breed );
// @Query(value="SELECT * FROM petdetails WHERE (`status`=1 OR `status`=2) AND (zone = :zone OR :zone IS NULL) AND (species = :species OR :species IS NULL) AND (breed = :breed OR :breed IS NULL) and ((statusdate between :fromdate AND :todate) OR (statusdate IS NULL))",nativeQuery=true)
// List<Petdetails> filterAcceptedPetdetailsbydate(String zone,String species,String breed,String fromdate,String todate );
// @Query(value = "SELECT * FROM petdetails where mobilenum=:phone",nativeQuery=true)
// List<Petdetails> findByPhone(String phone);
// @Query(value = "SELECT * FROM petdetails Where species=:species AND (zone = :zone OR :zone IS NULL)",nativeQuery=true)
// List<Petdetails> findBySpeciesAndZone(String species, String zone);
// @Query(value="SELECT * FROM petdetails WHERE `status`!=0",nativeQuery=true)
// List<Petdetails> findAllData();
// @Query(value="SELECT uniqueid,mobilenum,petname,registerdate,`status` FROM petdetails WHERE `status`!=0 ",nativeQuery=true)
// List<PetStatusDateDto> findAllDataRequiredFiled();
}
//year/zone/serial no

9
src/main/java/com/gcc/pets/Pets/Registration/repo/SMSsenderRepository.java

@ -0,0 +1,9 @@
package com.gcc.pets.Pets.Registration.repo;
import com.gcc.pets.Pets.Registration.model.SMSsender;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface SMSsenderRepository extends JpaRepository<SMSsender,Integer> {
}

7
src/main/java/com/gcc/pets/Pets/Registration/repo/SignatureRepository.java

@ -0,0 +1,7 @@
package com.gcc.pets.Pets.Registration.repo;
import com.gcc.pets.Pets.Registration.model.Signature;
import org.springframework.data.jpa.repository.JpaRepository;
public interface SignatureRepository extends JpaRepository<Signature,Integer> {
}

19
src/main/java/com/gcc/pets/Pets/Registration/repo/VeterinaryOfficersRepository.java

@ -0,0 +1,19 @@
package com.gcc.pets.Pets.Registration.repo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import com.gcc.pets.Pets.Registration.model.VeterinaryOfficers;
@Repository
public interface VeterinaryOfficersRepository extends JpaRepository<VeterinaryOfficers,Integer> {
@Query(value = "SELECT a FROM VeterinaryOfficers a WHERE a.userName=?1 and a.password=?2")
VeterinaryOfficers checkUser(String userName,String password);
@Query(value = "SELECT a FROM VeterinaryOfficers a WHERE a.mobno=?1")
VeterinaryOfficers getOfficerbyMobileNo(long mobno);
}

15
src/main/java/com/gcc/pets/Pets/Registration/service/OfficerService.java

@ -0,0 +1,15 @@
package com.gcc.pets.Pets.Registration.service;
import java.util.List;
import com.gcc.pets.Pets.Registration.model.PetLicense;
import com.gcc.pets.Pets.Registration.model.Petdetails;
public interface OfficerService {
List<Petdetails> getAllPets();
List<Petdetails> getByStatus(Integer status);
List<PetLicense> getAllLicense();
List<PetLicense> getLicenseByDate(String date);
public void updatestatusPetdetail(long mobno,int uniqueid);
}

53
src/main/java/com/gcc/pets/Pets/Registration/service/OfficerServiceImpl.java

@ -0,0 +1,53 @@
package com.gcc.pets.Pets.Registration.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gcc.pets.Pets.Registration.model.PetLicense;
import com.gcc.pets.Pets.Registration.model.Petdetails;
@Service
public class OfficerServiceImpl implements OfficerService {
@Autowired
private PetOwnerServiceImpl ownser;
@Autowired
private PetLicenseServiceImpl licser;
@Autowired
private PetdetailsServiceImpl petser;
@Override
public List<Petdetails> getAllPets() {
// TODO Auto-generated method stub
return null;
}
@Override
public List<Petdetails> getByStatus(Integer status) {
// TODO Auto-generated method stub
return null;
}
@Override
public List<PetLicense> getAllLicense() {
// TODO Auto-generated method stub
return null;
}
@Override
public List<PetLicense> getLicenseByDate(String date) {
// TODO Auto-generated method stub
return null;
}
@Override
public void updatestatusPetdetail(long mobno, int uniqueid) {
// TODO Auto-generated method stub
}
}

12
src/main/java/com/gcc/pets/Pets/Registration/service/PetLicenseService.java

@ -0,0 +1,12 @@
package com.gcc.pets.Pets.Registration.service;
import java.util.List;
import com.gcc.pets.Pets.Registration.model.PetLicense;
public interface PetLicenseService {
List<PetLicense> getAllLicense();
PetLicense getbymobnoanduniqueId(long mobno,int uniqueid);
String savePetLicense(int uniqueid,long mobno);
PetLicense getByLicenseNo(String licenseNo);
}

110
src/main/java/com/gcc/pets/Pets/Registration/service/PetLicenseServiceImpl.java

@ -0,0 +1,110 @@
package com.gcc.pets.Pets.Registration.service;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import com.gcc.pets.Pets.Registration.model.OldPetLicense;
import com.gcc.pets.Pets.Registration.repo.OldPetLicenseRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gcc.pets.Pets.Registration.model.PetLicense;
import com.gcc.pets.Pets.Registration.model.PetOwner;
import com.gcc.pets.Pets.Registration.model.Petdetails;
import com.gcc.pets.Pets.Registration.repo.PetLicenseRepository;
@Service
public class PetLicenseServiceImpl implements PetLicenseService{
@Autowired
PetLicenseRepository licenserepo;
@Autowired
PetdetailsServiceImpl petser;
@Autowired
PetOwnerServiceImpl ownser;
@Autowired
private OldPetLicenseRepository oldlicenserepo;
PetLicenseServiceImpl(PetLicenseRepository licenserepo){
this.licenserepo=licenserepo;
}
@Override
public List<PetLicense> getAllLicense() {
// TODO Auto-generated method stub
return licenserepo.findAll();
}
@Override
public PetLicense getbymobnoanduniqueId(long mobno, int uniqueid) {
// TODO Auto-generated method stub
return licenserepo.getLincenseByMobNoAndUniqueid(mobno, uniqueid);
}
@Override
public String savePetLicense(int uniqueid,long mobno) {
// TODO Auto-generated method stub
Date date = new Date();
PetOwner own =ownser.getByMobNo(mobno);
PetLicense lic = new PetLicense();
int year =LocalDate.now().getYear();
int z =Integer.parseInt(own.getZone());
lic.setLicenseNo(year+"/"+String.format("%02d",z)+"/"+String.format("%05d", uniqueid));
lic.setPhone(mobno);
lic.setUniqueid(uniqueid);
lic.setDate(date);
SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy");
Calendar c = Calendar.getInstance();
c.setTime(date);
String issuedate=dateFormat.format(c.getTime());
c.add(Calendar.YEAR, 1);
c.add(Calendar.DATE, -1);
String dateInString=dateFormat.format(c.getTime());
lic.setValidity(dateInString);
Optional<PetLicense> exists= licenserepo.checkLincenseExistsByMobNoAndUniqueid(mobno, uniqueid);
if(exists.isPresent()) {
addOldPetLic(exists.get());
PetLicense renewal=exists.get();
renewal.setDate(date);
renewal.setValidity(dateInString);
//System.out.println(renewal.getLicenseNo()+"..<><id>.."+renewal.getId()+"phone> "+renewal.getPhone()+">unique id:"+renewal.getUniqueid());
licenserepo.save(renewal);
petser.updatePetStatus(mobno, uniqueid, 2);
}else {
licenserepo.save(lic);
petser.updatePetStatus(mobno, uniqueid, 2);
}
return "done";
}
@Override
public PetLicense getByLicenseNo(String licenseNo) {
// TODO Auto-generated method stub
return licenserepo.getLincenseByNo(licenseNo);
}
private void addOldPetLic(PetLicense petlic){
OldPetLicense op = new OldPetLicense();
op.setDate(petlic.getDate());
op.setLicenseNo(petlic.getLicenseNo());
op.setValidity(petlic.getValidity());
op.setUniqueid(petlic.getUniqueid());
op.setPhone(petlic.getPhone());
oldlicenserepo.save(op);
}
}

19
src/main/java/com/gcc/pets/Pets/Registration/service/PetOwnerService.java

@ -0,0 +1,19 @@
package com.gcc.pets.Pets.Registration.service;
import java.util.List;
import com.gcc.pets.Pets.Registration.model.PetOwner;
public interface PetOwnerService {
public List<PetOwner> getAllPetOwnersDetails();
public String save(PetOwner pt);
public String update(PetOwner pt,long mobno);
public PetOwner getByMobNo(long mobno);
public String getByforgetPin(long mobno);
public long getUserCount();
public List<PetOwner> getAllPetAndOwnerDet(String zone,String fromdate,String todate);
public long getUserCountByZone(String zone);
}

142
src/main/java/com/gcc/pets/Pets/Registration/service/PetOwnerServiceImpl.java

@ -0,0 +1,142 @@
package com.gcc.pets.Pets.Registration.service;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.gcc.pets.Pets.Registration.customQuery.PetdetailsCustomQuery;
import com.gcc.pets.Pets.Registration.dto.PetSelectedInfo;
import com.gcc.pets.Pets.Registration.dto.PetShortInfo;
import com.gcc.pets.Pets.Registration.model.Petdetails;
import com.gcc.pets.Pets.Registration.model.SMSsender;
import com.gcc.pets.Pets.Registration.repo.Logindetail;
import com.gcc.pets.Pets.Registration.repo.PetdetailsRepository;
import com.gcc.pets.Pets.Registration.repo.SMSsenderRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gcc.pets.Pets.Registration.model.PetOwner;
import com.gcc.pets.Pets.Registration.repo.PetOwnerRepository;
@Service
public class PetOwnerServiceImpl implements PetOwnerService {
@Autowired
SMSsenderRepository smsrepo;
@Autowired
PetOwnerRepository petownrepo;
@Autowired
private PetdetailsRepository petrepo;
@Autowired
private Logindetail loginrepo;
@Autowired
private PetdetailsCustomQuery petquery;
PetOwnerServiceImpl(PetOwnerRepository petownrepo){
this.petownrepo=petownrepo;
}
@Override
public List<PetOwner> getAllPetOwnersDetails() {
// TODO Auto-generated method stub
return petownrepo.findAll();
}
@Override
public String save(PetOwner pt) {
// TODO Auto-generated method stub
PetOwner exits = getByMobNo(Long.parseLong(pt.getPhone()));
//System.out.println(exits);
if(exits==null) {
//System.out.println(".....");
petownrepo.save(pt);
return "success" ;
}
return "Error";
}
@Override
public String update(PetOwner pt, long mobno) {
// TODO Auto-generated method stub
PetOwner own =petownrepo.getPetOwnersbymobno(mobno+"");
if(own!=null){
pt.setId(own.getId());
pt.setCity(own.getCity());
petownrepo.save(pt);
loginrepo.updateZoneInLogin(pt.getZone(),mobno);
return "success";
}
return "Error";
}
@Override
public PetOwner getByMobNo(long mobno) {
// TODO Auto-generated method stub
return petownrepo.getPetOwnersbymobno(mobno+"");
}
@Override
public String getByforgetPin(long mobno) {
// TODO Auto-generated method stub
return null;
}
@Override
public long getUserCount() {
return petownrepo.getCountOfUser();
}
public String checkNull(String x){
if(x.isBlank()||x.length()==0){
return null;
}
return x;
}
@Override
public List<PetOwner> getAllPetAndOwnerDet(String zone,String fromdate,String todate) {
List<PetOwner> ownersList =petquery.findByUserInfo(zone,fromdate,todate);
if(!ownersList.isEmpty()) {
ownersList.stream().forEach(owner-> {
List<PetShortInfo> pet=petquery.findByPetinfoToReport(Long.parseLong(owner.getPhone()),null,null,null,null,null,100);
if(pet.isEmpty()) {
owner.setLicInProg(0);
owner.setLicPayment(0);
owner.setLicCount(0);
owner.setLicRej(0);
owner.setExpLicCount(0);
}else {
Map<Integer, Long> countMap = pet.stream()
.collect(Collectors.groupingBy(i ->i.getStatus(), Collectors.counting()));
owner.setLicInProg(countMap.getOrDefault(0, 0L));
owner.setLicPayment(countMap.getOrDefault(1, 0L));
owner.setLicCount(countMap.getOrDefault(2, 0L));
owner.setLicRej(countMap.getOrDefault(3, 0L));
owner.setExpLicCount(countMap.getOrDefault(4, 0L));
//System.out.println(owner.getPhone()+" "+owner.getFname()+inProgress+": "+
// accepted+": "+licenseIssued+": "+rejected+": "+expired);
}
});
return ownersList;
}
return null;
}
@Override
public long getUserCountByZone(String zone) {
return petownrepo.getCountOfUserByZone(zone);
}
}

49
src/main/java/com/gcc/pets/Pets/Registration/service/PetdetailsService.java

@ -0,0 +1,49 @@
package com.gcc.pets.Pets.Registration.service;
import java.util.HashMap;
import java.util.List;
import com.gcc.pets.Pets.Registration.dto.PetSelectedInfo;
import com.gcc.pets.Pets.Registration.model.Petdetails;
import org.springframework.web.multipart.MultipartFile;
public interface PetdetailsService {
public List<Petdetails> getAllPetdetail();
public Petdetails savedetail(Petdetails petdet,MultipartFile applicantphoto,MultipartFile addresssproof,MultipartFile petphoto,MultipartFile rabiesvavcerti);
public List<PetSelectedInfo> getpetetailsbymobno(long mobilenum);
public List<Petdetails> getpetetailsbymobnoAndStatus(long mobilenum,Integer Status);
public String updatedetail(Petdetails petdet,MultipartFile applicantphoto,MultipartFile addresssproof,MultipartFile petphoto,MultipartFile rabiesvavcerti);
public Petdetails getpetetailsbymobnoByuniqueid(long mobilenum,int uniqueid);
public Petdetails getpetetailsbyUniqueid(int uniqueid);
public String updateStatus(long mobilenum,int uniqueid,int status,String rejectreason);
public String updatePetStatus(long mobilenum,int uniqueid,int status);
public String updateAcceptStatus(int uniqueid,int status,String userType,String zone);
public String updateRejectStatus(int status,String reason,int uniqueid,String userType,String zone);
public List<Petdetails> getbystatus(Integer status);
public List<Petdetails> getbyzoneandStatus(String zone,Integer status);
public Long getcountbyZoneAndType(String zone,String pettype);
public Long getcountbyZoneAndstatus(String zone,Integer status);
public Long getcountbyZone(String zone);
public Long getCountOfPetByStatus(Integer status);
public Long getCountOfPetByType(String species);
public Long getCountOfPetBySpeciesAndStatus(String species);
public List<Petdetails> getPetByUpdateddate(String fromdate, String todate,Integer status);
public List<Petdetails> getPetsByUpdatedDateAndZone(String fromdate, String todate,Integer status,String zone);
public List<Petdetails> getPetByRegiserdate(String fromdate, String todate,Integer status);
public List<Petdetails> getPetByRegiserdateAndZone(String fromdate, String todate,Integer status,String zone);
public String renewaldetail(Petdetails petdet,MultipartFile applicantphoto,MultipartFile addresssproof,MultipartFile petphoto,MultipartFile rabiesvavcerti);
public HashMap<Integer, Long> getCountOfPetBySpeciesAndStatus(String species, String zone);
}

393
src/main/java/com/gcc/pets/Pets/Registration/service/PetdetailsServiceImpl.java

@ -0,0 +1,393 @@
package com.gcc.pets.Pets.Registration.service;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
import com.gcc.pets.Pets.Registration.customQuery.PetdetailsCustomQuery;
import com.gcc.pets.Pets.Registration.dto.PetSelectedInfo;
import com.gcc.pets.Pets.Registration.dto.PetShortInfo;
import com.gcc.pets.Pets.Registration.login.UserSession;
import com.gcc.pets.Pets.Registration.model.OldPetdetails;
import com.gcc.pets.Pets.Registration.repo.OldPetdetailsRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile;
import com.gcc.pets.Pets.Registration.model.Petdetails;
import com.gcc.pets.Pets.Registration.repo.PetdetailsRepository;
@Service
public class PetdetailsServiceImpl implements PetdetailsService {
@Autowired
PetdetailsRepository petrepo;
@Autowired
private UserSession userSession;
@Autowired
private OldPetdetailsRepository oldpetrepo;
@Autowired
private PetdetailsCustomQuery petquery;
PetdetailsServiceImpl(PetdetailsRepository petrepo){
this.petrepo=petrepo;
}
@Override
public List<Petdetails> getAllPetdetail() {
return petrepo.findAll();
}
@Override
public Petdetails savedetail(Petdetails petdet, MultipartFile applicantphoto, MultipartFile addresssproof,
MultipartFile petphoto, MultipartFile rabiesvavcerti) {
// TODO Auto-generated method stub
String fileName = StringUtils.cleanPath(applicantphoto.getOriginalFilename());
try {
petdet.setApplicantphoto(Base64.getEncoder().encodeToString(applicantphoto.getBytes()));
petdet.setAddressproof(Base64.getEncoder().encodeToString(addresssproof.getBytes()));
petdet.setPetphoto(Base64.getEncoder().encodeToString(petphoto.getBytes()));
petdet.setRabiesvacCerti(Base64.getEncoder().encodeToString(rabiesvavcerti.getBytes()));
// String pattern = "dd-MM-yyyy";
String pattern = "yyyy-MM-dd";
String dateInString =new SimpleDateFormat(pattern).format(new Date());
petdet.setRegisterdate(dateInString);
} catch (IOException e) {
e.printStackTrace();
}
return petrepo.save(petdet);
// return null;
}
@Override
public List<PetSelectedInfo> getpetetailsbymobno(long mobilenum) {
return petrepo.findByPhone(mobilenum+"");
}
@Override
public Petdetails getpetetailsbymobnoByuniqueid(long mobilenum, int uniqueid) {
return petrepo.getPetsByMobNoAndUniqueid(mobilenum, uniqueid);
}
@Override
public Petdetails getpetetailsbyUniqueid(int uniqueid) {
return petrepo.getPetsByUniqueid(uniqueid);
}
@Override
public String updateStatus(long mobilenum, int uniqueid, int status, String rejectreason) {
return null;
}
@Override
public String updatePetStatus(long mobilenum, int uniqueid, int status) {
petrepo.updatePetStatus(status, mobilenum, uniqueid);
return "" ;
}
@Override
public List<Petdetails> getbystatus(Integer status) {
// TODO Auto-generated method stub
return petrepo.getPetsbystatus(status);
}
@Override
public String updateAcceptStatus(int uniqueid, int status,String userType,String zone) {
// TODO Auto-generated method stub
String s="";
if(userType==null) {
s = userSession.getUserType() + "(Zone:" + userSession.getZone() + ")";
}else{
s = userType+"(Zone:"+zone+")";
}
Date d = new Date();
petrepo.updateAcceptStatus(status,d,s, uniqueid);
return "ok";
}
@Override
public String updateRejectStatus(int status, String reason, int uniqueid,String userType,String zone) {
// TODO Auto-generated method stub
// String s =userSession.getUserType()+" "+userSession.getZone();
String s="";
if(userType==null) {
s = userSession.getUserType() + "(Zone:" + userSession.getZone() + ")";
}else{
s = userType+"(Zone:"+zone+")";
}
Date d = new Date();
petrepo.updateRejectStatus(3, reason,d,s, uniqueid);
return "ok";
}
@Override
public List<Petdetails> getpetetailsbymobnoAndStatus(long mobilenum, Integer Status) {
// TODO Auto-generated method stub
return petrepo.getPetsbymobnoAndStatus(mobilenum, Status);
}
@Override
public List<Petdetails> getbyzoneandStatus(String zone, Integer status) {
// TODO Auto-generated method stub
return petrepo.getPetsbyzoneandStatus(zone, status);
}
@Override
public Long getcountbyZoneAndType(String zone, String pettype) {
// TODO Auto-generated method stub
return petrepo.getCountOfPetByZoneAndPetType(pettype, zone);
}
@Override
public Long getcountbyZoneAndstatus(String zone, Integer status) {
// TODO Auto-generated method stub
return petrepo.getCountOfPetByZoneAndStatus(status,zone);
}
@Override
public Long getcountbyZone(String zone) {
// TODO Auto-generated method stub
return petrepo.getCountOfPetByZone(zone);
}
@Override
public String updatedetail(Petdetails petdet, MultipartFile applicantphoto, MultipartFile addresssproof,
MultipartFile petphoto, MultipartFile rabiesvavcerti) {
// TODO Auto-generated method stub
//System.out.println("3"+petphoto+"....");
Petdetails pet= petrepo.getPetsByUniqueid(petdet.getUniqueid());
// System.out.println(pet);
if(pet!=null) {
System.out.println(".....>>.........");
if(!petdet.getPetname().isEmpty())
pet.setPetname(petdet.getPetname());
if(!petdet.getSpecies().isEmpty())
pet.setSpecies(petdet.getSpecies());
if(!petdet.getBreed().isEmpty())
pet.setBreed(petdet.getBreed());
if(!petdet.getDewormdate().isEmpty())
pet.setDewormdate(petdet.getDewormdate());
if(!petdet.getVeterinaryConsultant().isEmpty())
pet.setVeterinaryConsultant(petdet.getVeterinaryConsultant());
if(!petdet.getPrevioslicenseNo().isEmpty())
pet.setPrevioslicenseNo(petdet.getPrevioslicenseNo());
if(!petdet.getArvdate().isEmpty())
pet.setArvdate(petdet.getArvdate());
if(!petdet.getTNVCNo().isBlank())
pet.setTNVCNo(petdet.getTNVCNo());
if(!petdet.getOthervac().isEmpty())
pet.setOthervac(petdet.getOthervac());
if(!petdet.getGender().isEmpty())
pet.setGender(petdet.getGender());
pet.setAge(petdet.getAge());
try {
if(applicantphoto!=null&&!applicantphoto.isEmpty()) {
pet.setApplicantphoto(Base64.getEncoder().encodeToString(applicantphoto.getBytes()));
}
if(addresssproof!=null) {
pet.setAddressproof(Base64.getEncoder().encodeToString(addresssproof.getBytes()));
}
if(petphoto!=null) {
pet.setPetphoto(Base64.getEncoder().encodeToString(petphoto.getBytes()));
}
if(rabiesvavcerti!=null) {
pet.setRabiesvacCerti(Base64.getEncoder().encodeToString(rabiesvavcerti.getBytes()));
}
}catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
petrepo.save(pet);
return "success";
}
return "success";
}
@Override
public Long getCountOfPetByStatus(Integer status) {
// TODO Auto-generated method stub
return petrepo.getCountOfPetByStatus(status);
}
@Override
public Long getCountOfPetByType(String species) {
// TODO Auto-generated method stub
return petrepo.getCountOfPetByType(species);
}
@Override
public Long getCountOfPetBySpeciesAndStatus(String species) {
return petrepo.getCountOfPetBySpeciesAndStatus(species);
}
@Override
public List<Petdetails> getPetByUpdateddate(String fromdate, String todate, Integer status) {
fromdate=fromdate+" %";
todate=todate+" %";
List<Petdetails> pet= petrepo.getPetsbyupdatedbydate(fromdate,todate,status);
return pet;
}
@Override
public List<Petdetails> getPetsByUpdatedDateAndZone(String fromdate, String todate, Integer status, String zone) {
fromdate=fromdate+" %";
todate=todate+" %";
List<Petdetails> pet= petrepo.getPetsByUpdatedDateAndZone(fromdate,todate,status,zone);
return pet;
}
@Override
public List<Petdetails> getPetByRegiserdate(String fromdate, String todate, Integer status) {
return petrepo.getPetByRegiserdate(fromdate,todate,status);
}
@Override
public List<Petdetails> getPetByRegiserdateAndZone(String fromdate, String todate, Integer status, String zone) {
return petrepo.getPetByRegiserdateAndZone(fromdate,todate,status,zone);
}
@Override
public String renewaldetail(Petdetails petdet, MultipartFile applicantphoto, MultipartFile addresssproof,
MultipartFile petphoto, MultipartFile rabiesvavcerti) {
// TODO Auto-generated method stub
//System.out.println("3"+petphoto+"....");
Petdetails pet= petrepo.getPetsByUniqueid(petdet.getUniqueid());
//System.out.println(pet);
if(pet!=null) {
System.out.println(".....renewal>>.........");
oldPetdetails(pet);
if(!petdet.getPetname().isEmpty())
pet.setPetname(petdet.getPetname());
if(!petdet.getSpecies().isEmpty())
pet.setSpecies(petdet.getSpecies());
if(!petdet.getBreed().isEmpty())
pet.setBreed(petdet.getBreed());
if(!petdet.getDewormdate().isEmpty())
pet.setDewormdate(petdet.getDewormdate());
if(!petdet.getVeterinaryConsultant().isEmpty())
pet.setVeterinaryConsultant(petdet.getVeterinaryConsultant());
if(!petdet.getPrevioslicenseNo().isEmpty())
pet.setPrevioslicenseNo(petdet.getPrevioslicenseNo());
if(!petdet.getArvdate().isEmpty())
pet.setArvdate(petdet.getArvdate());
if(!petdet.getTNVCNo().isBlank())
pet.setTNVCNo(petdet.getTNVCNo());
if(!petdet.getOthervac().isEmpty())
pet.setOthervac(petdet.getOthervac());
if(!petdet.getGender().isEmpty())
pet.setGender(petdet.getGender());
if(pet.getStatus().equals(4))
pet.setStatus(0);
pet.setAge(petdet.getAge());
try {
if(applicantphoto!=null&&!applicantphoto.isEmpty()) {
pet.setApplicantphoto(Base64.getEncoder().encodeToString(applicantphoto.getBytes()));
}
if(addresssproof!=null) {
pet.setAddressproof(Base64.getEncoder().encodeToString(addresssproof.getBytes()));
}
if(petphoto!=null) {
pet.setPetphoto(Base64.getEncoder().encodeToString(petphoto.getBytes()));
}
if(rabiesvavcerti!=null) {
pet.setRabiesvacCerti(Base64.getEncoder().encodeToString(rabiesvavcerti.getBytes()));
}
}catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
petrepo.save(pet);
return "success";
}
return "success";
}
private void oldPetdetails(Petdetails pet){
OldPetdetails op = new OldPetdetails();
op.setAddressproof(pet.getAddressproof());
op.setAge(pet.getAge());
op.setApplicantphoto(pet.getApplicantphoto());
op.setIdentificationmark(pet.getIdentificationmark());
op.setMobilenum(pet.getMobilenum());
op.setPetcolor(pet.getPetcolor());
op.setArvdate(pet.getArvdate());
op.setBreed(pet.getBreed());
op.setSpecies(pet.getSpecies());
op.setDewormdate(pet.getDewormdate());
op.setGender(pet.getGender());
op.setOthervac(pet.getOthervac());
op.setPetphoto(pet.getPetphoto());
op.setPrevioslicenseNo(pet.getPrevioslicenseNo());
op.setRabiesvacCerti(pet.getRabiesvacCerti());
op.setPetname(pet.getPetname()+"("+pet.getUniqueid()+")");
op.setSterilized(pet.getSterilized());
op.setStray(pet.getStray());
op.setRejectreason(pet.getRejectreason());
op.setSterilized(pet.getSterilized());
op.setStatus(pet.getStatus());
op.setZone(pet.getZone());
op.setUpdatedby(pet.getUpdatedby());
op.setTNVCNo(pet.getTNVCNo());
op.setVaccinated(pet.getVaccinated());
op.setVeterinaryConsultant(pet.getVeterinaryConsultant());
op.setStatusdate(pet.getStatusdate());
oldpetrepo.save(op);
}
//This Method is used to get Dashboard details
@Override
public HashMap<Integer, Long> getCountOfPetBySpeciesAndStatus(String species, String zone) {
HashMap<Integer, Long> petStatus=new HashMap<>();
List<PetShortInfo> findBySpeciesAndZone;
findBySpeciesAndZone = petquery.findByPetinfoToReport(0,species,null, zone,null,null,100);
Map<Integer, Long> countStatus = findBySpeciesAndZone.stream().collect(Collectors.groupingBy(i ->i.getStatus(),Collectors.counting()));
Long inProgress = countStatus.getOrDefault(0, 0L);
Long accepted = countStatus.getOrDefault(1, 0L);
Long licenseIssued = countStatus.getOrDefault(2, 0L);
Long rejected = countStatus.getOrDefault(3, 0L);
Long expired = countStatus.getOrDefault(4, 0L);
petStatus.put(0,inProgress);
petStatus.put(1, accepted);
petStatus.put(2, licenseIssued);
petStatus.put(3, rejected);
petStatus.put(4, expired);
petStatus.put(200, inProgress+accepted+licenseIssued+rejected+expired);
return petStatus;
}
//This Method is used to get Admin Report Detail
// List filterPetdetailsbyStatusDate(){
//
// }
}

53
src/main/resources/application.properties

@ -0,0 +1,53 @@
#Database connection properties
#spring.datasource.url=jdbc:mysql://localhost:3306/gcc_pets?useSSL=false&useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
#spring.datasource.url=jdbc:mysql://localhost:3306/gcc_pets
spring.datasource.url=jdbc:mysql://localhost:3306/gcc_pets
spring.datasource.username=root
spring.datasource.password=gccroot
#spring.datasource.password=root
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
#server.port=8070
server.port=8061
#app.baseUrl=http://localhost:8061
app.baseUrl=http://117.232.67.158:8061
#app.baseUrl=http://gccservices.chennaicorporation.gov.in:8061
#app.getOtpUrl=http://api.onex-ultimo.in/api/pushsms?
#app.getOtpUrl=https://api.onex-aura.com/api/sms?
app.getOtpUrl=https://tmegov.onex-aura.com/api/sms?
app.erpUrl=https://erp.chennaicorporation.gov.in/pgr/external/mobileservice?
app.title=GREATER CHENNAI CORPORATION - Pet Registration
app.ptaxid=null
app.ptaxRegMobile=null
app.pusertype=nulls
#// Session Config
# Connection pool properties
spring.datasource.hikari.maximum-pool-size=5
spring.datasource.hikari.minimum-idle=2
spring.datasource.hikari.idle-timeout=30000
spring.datasource.hikari.connection-timeout=5000
# JPA properties
spring.jpa.hibernate.ddl-auto=update
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect
spring.jpa.properties.hibernate.jdbc.batch_size=50
spring.jpa.properties.hibernate.jdbc.fetch_size=1000
spring.jpa.properties.hibernate.jdbc.batch_versioned_data=true
spring.jpa.properties.hibernate.jdbc.batch_orders_inserts=true
logging.level.org.hibernate.SQL=debug
logging.level.org.hibernate.orm.jdbc.bind=trace
logging.level.org.hibernate.type.descriptor.sql=trace
#server.error.include-stacktrace= on_param
#Auto Resert On file changes
spring.devtools.restart.enabled=true

65
src/main/resources/static/assets/_js/main/app.js

@ -0,0 +1,65 @@
/*
* Document : app.js
* Author : pixelcave
* Description: Main entry point
*
*/
// Import required modules
import Template from './modules/template';
// App extends Template
export default class App extends Template {
/*
* Auto called when creating a new instance
*
*/
constructor() {
super();
}
/*
* Here you can override or extend any function you want from Template class
* if you would like to change/extend/remove the default functionality.
*
* This way it will be easier for you to update the module files if a new update
* is released since all your changes will be in here overriding the original ones.
*
* Let's have a look at the _uiInit() function, the one that runs the first time
* we create an instance of Template class or App class which extends it. This function
* inits all vital functionality but you can change it to fit your own needs.
*
*/
/*
* EXAMPLE #1 - Removing default functionality by making it empty
*
*/
// _uiInit() {}
/*
* EXAMPLE #2 - Extending default functionality with additional code
*
*/
// _uiInit() {
// // Call original function
// super._uiInit();
//
// // Your extra JS code afterwards
// }
/*
* EXAMPLE #3 - Replacing default functionality by writing your own code
*
*/
// _uiInit() {
// // Your own JS code without ever calling the original function's code
// }
}
// Create a new instance of App
window.Dashmix = new App();

1110
src/main/resources/static/assets/_js/main/modules/helpers.js
File diff suppressed because it is too large
View File

802
src/main/resources/static/assets/_js/main/modules/template.js

@ -0,0 +1,802 @@
/*
* Document : template.js
* Author : pixelcave
* Description: UI Framework custom functionality
*
*/
// Imports
import * as bootstrap from 'bootstrap';
import SimpleBar from 'simplebar';
import Helpers from './helpers';
// Assignments
window.bootstrap = bootstrap;
window.SimpleBar = SimpleBar;
// Template
export default class Template {
/*
* Auto called when creating a new instance
*
*/
constructor() {
this.onLoad(() => this._uiInit());
}
/*
* Init all vital functionality
*
*/
_uiInit() {
// Layout variables
this._lHtml = document.documentElement;
this._lBody = document.body;
this._lpageLoader = document.getElementById('page-loader');
this._lPage = document.getElementById('page-container');
this._lSidebar = document.getElementById('sidebar');
this._lSidebarScrollCon = this._lSidebar && this._lSidebar.querySelector('.js-sidebar-scroll');
this._lSideOverlay = document.getElementById('side-overlay');
this._lResize = false;
this._lHeader = document.getElementById('page-header');
this._lHeaderSearch = document.getElementById('page-header-search');
this._lHeaderSearchInput = document.getElementById('page-header-search-input');
this._lHeaderLoader = document.getElementById('page-header-loader');
this._lMain = document.getElementById('main-container');
this._lFooter = document.getElementById('page-footer');
// Helper variables
this._lSidebarScroll = false;
this._lSideOverlayScroll = false;
// Base UI Init
this._uiHandleTheme();
this._uiHandleDarkMode();
this._uiHandleSidebars();
this._uiHandleHeader();
this._uiHandleNav();
// API Init
this._uiApiLayout();
this._uiApiBlocks();
// Init the following helpers by default
this.helpers([
'bs-tooltip',
'bs-popover',
'dm-toggle-class',
'dm-year-copy',
'dm-ripple',
]);
// Page Loader (hide it)
this._uiHandlePageLoader();
}
/*
* Handles sidebar and side overlay scrolling functionality/styles
*
*/
_uiHandleSidebars(mode = 'init') {
let self = this;
if (self._lSidebar || self._lSideOverlay) {
if (mode === 'init') {
// Add 'side-trans-enabled' class to #page-container (enables sidebar and side overlay transition on open/close)
// Fixes IE10, IE11 and Edge bug in which animation was executed on each page load
self._lPage.classList.add('side-trans-enabled');
// Remove side transitions on window resizing
window.addEventListener('resize', () => {
clearTimeout(self._lResize);
self._lPage.classList.remove('side-trans-enabled');
self._lResize = setTimeout(() => { self._lPage.classList.add('side-trans-enabled'); }, 500);
});
// Init custom scrolling
this._uiHandleSidebars('custom-scroll');
} else if (mode = 'custom-scroll') {
// If .side-scroll is added to #page-container, enable custom scrolling
if (self._lPage.classList.contains('side-scroll')) {
// Init custom scrolling on Sidebar
if ((self._lSidebar) && !self._lSidebarScroll) {
self._lSidebarScroll = new SimpleBar(self._lSidebarScrollCon);
}
// Init custom scrolling on Side Overlay
if ((self._lSideOverlay) && !self._lSideOverlayScroll) {
self._lSideOverlayScroll = new SimpleBar(self._lSideOverlay);
}
}
}
}
}
/*
* Handles header related classes
*
*/
_uiHandleHeader() {
let self = this;
// If the header is fixed and has the glass style, add the related class on scrolling to add a background color to the header
if (self._lPage.classList.contains('page-header-glass') && self._lPage.classList.contains('page-header-fixed')) {
window.addEventListener('scroll', e => {
if (window.scrollY > 60) {
self._lPage.classList.add('page-header-scroll');
} else {
self._lPage.classList.remove('page-header-scroll');
}
});
window.dispatchEvent(new CustomEvent('scroll'));
}
}
/*
* Toggle Submenu functionality
*
*/
_uiHandleNav() {
let links = document.querySelectorAll('[data-toggle="submenu"]');
// When a submenu link is clicked
if (links) {
links.forEach(link => {
link.addEventListener('click', e => {
e.preventDefault();
// Get main navigation
let mainNav = link.closest('.nav-main');
// Check if we are in horizontal navigation, large screen and hover is enabled
if (
!(
(window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth) > 991
&& mainNav.classList.contains('nav-main-horizontal')
&& mainNav.classList.contains('nav-main-hover')
)
) {
// Get link's parent
let parentLi = link.closest('li');
if (parentLi.classList.contains('open')) {
// If submenu is open, close it..
parentLi.classList.remove('open');
link.setAttribute('aria-expanded', 'false');
} else {
// .. else if submenu is closed, close all other (same level) submenus first before open it
Array.from(link.closest('ul').children).forEach(el => {
el.classList.remove('open');
});
parentLi.classList.add('open');
link.setAttribute('aria-expanded', 'true');
}
}
return false;
});
});
}
}
/*
* Page loading screen functionality
*
*/
_uiHandlePageLoader(mode = 'hide', colorClass) {
if (mode === 'show') {
if (this._lpageLoader) {
if (colorClass) {
this._lpageLoader.className = '';
this._lpageLoader.classList.add(colorClass);
}
this._lpageLoader.classList.add('show');
} else {
let pageLoader = document.createElement('div');
pageLoader.id = 'page-loader';
if (colorClass) {
pageLoader.classList.add(colorClass);
}
pageLoader.classList.add('show');
this._lPage.insertBefore(pageLoader, this._lPage.firstChild);
this._lpageLoader = document.getElementById('page-loader');
}
} else if (mode === 'hide') {
if (this._lpageLoader) {
this._lpageLoader.classList.remove('show');
}
}
}
/*
* Saves/Retrieves Dark Mode preference to local storage
*
*/
_uiHandleDarkMode(mode = 'init') {
let self = this;
// If dark mode is not enabled by default remember default sidebar
// and header style to return to after any possible dark mode disabling
if (mode === 'init' && !self._lPage.classList.contains('dark-mode')) {
if (self._lPage.classList.contains('sidebar-dark')) {
localStorage.setItem('dashmixDefaultsSidebarDark', true);
} else {
localStorage.removeItem('dashmixDefaultsSidebarDark');
}
if (self._lPage.classList.contains('page-header-dark')) {
localStorage.setItem('dashmixDefaultsPageHeaderDark', true);
} else {
localStorage.removeItem('dashmixDefaultsPageHeaderDark');
}
}
// If remember-theme class is added in #page-container
if (self._lPage.classList.contains('remember-theme')) {
let darkMode = localStorage.getItem('dashmixDarkMode') || false;
if (mode === 'init') {
if (darkMode) {
self._lPage.classList.add('sidebar-dark');
self._lPage.classList.add('page-header-dark');
self._lPage.classList.add('dark-mode');
} else if (mode === 'init') {
self._lPage.classList.remove('dark-mode');
}
} else if (mode === 'on') {
localStorage.setItem('dashmixDarkMode', true);
} else if (mode === 'off') {
localStorage.removeItem('dashmixDarkMode');
}
} else if (mode === 'init') {
localStorage.removeItem('dashmixDarkMode');
}
}
/*
* Set active color theme functionality
*
*/
_uiHandleTheme() {
let self = this;
let themeEl = document.getElementById('css-theme');
let rememberTheme = this._lPage.classList.contains('remember-theme') ? true : false;
// If remember theme is enabled
if (rememberTheme) {
let themeName = localStorage.getItem('dashmixThemeName') || false;
// Update color theme
if (themeName) {
self._uiUpdateTheme(themeEl, themeName);
}
// Update theme element
themeEl = document.getElementById('css-theme');
} else {
localStorage.removeItem('dashmixThemeName');
}
// Set the active color theme link as active
document.querySelectorAll('[data-toggle="theme"][data-theme="' + (themeEl ? themeEl.getAttribute('href') : 'default') + '"]').forEach(link => {
link.classList.add('active');
});
// When a color theme link is clicked
document.querySelectorAll('[data-toggle="theme"]').forEach(el => {
el.addEventListener('click', e => {
e.preventDefault();
// Get element's data
let themeName = el.dataset.theme;
// Set this color theme link as active
document.querySelectorAll('[data-toggle="theme"]').forEach(link => {
link.classList.remove('active');
});
document.querySelector('[data-toggle="theme"][data-theme="' + themeName + '"]').classList.add('active');
// Update color theme
self._uiUpdateTheme(themeEl, themeName);
// Update theme element
themeEl = document.getElementById('css-theme');
// If remember theme is enabled, save the new active color theme
if (rememberTheme) {
localStorage.setItem('dashmixThemeName', themeName);
}
});
});
}
/*
* Updates the color theme
*
*/
_uiUpdateTheme(themeEl, themeName) {
if (themeName === 'default') {
if (themeEl) {
themeEl.parentNode.removeChild(themeEl);
}
} else {
if (themeEl) {
themeEl.setAttribute('href', themeName);
} else {
let themeLink = document.createElement('link');
themeLink.id = 'css-theme';
themeLink.setAttribute('rel', 'stylesheet');
themeLink.setAttribute('href', themeName);
document.getElementById('css-main').insertAdjacentElement('afterend', themeLink);
}
}
}
/*
* Layout API
*
*/
_uiApiLayout(mode = 'init') {
let self = this;
// API with object literals
let layoutAPI = {
init: () => {
let buttons = document.querySelectorAll('[data-toggle="layout"]');
// Call layout API on button click
if (buttons) {
buttons.forEach(btn => {
btn.addEventListener('click', e => {
self._uiApiLayout(btn.dataset.action);
});
})
}
// Prepend Page Overlay div if enabled (used when Side Overlay opens)
if (self._lPage.classList.contains('enable-page-overlay')) {
let pageOverlay = document.createElement('div');
pageOverlay.id = 'page-overlay';
self._lPage.insertBefore(pageOverlay, self._lPage.firstChild);
document.getElementById('page-overlay').addEventListener('click', e => {
self._uiApiLayout('side_overlay_close');
});
}
},
sidebar_pos_toggle: () => {
self._lPage.classList.toggle('sidebar-r');
},
sidebar_pos_left: () => {
self._lPage.classList.remove('sidebar-r');
},
sidebar_pos_right: () => {
self._lPage.classList.add('sidebar-r');
},
sidebar_toggle: () => {
if (window.innerWidth > 991) {
self._lPage.classList.toggle('sidebar-o');
} else {
self._lPage.classList.toggle('sidebar-o-xs');
}
},
sidebar_open: () => {
if (window.innerWidth > 991) {
self._lPage.classList.add('sidebar-o');
} else {
self._lPage.classList.add('sidebar-o-xs');
}
},
sidebar_close: () => {
if (window.innerWidth > 991) {
self._lPage.classList.remove('sidebar-o');
} else {
self._lPage.classList.remove('sidebar-o-xs');
}
},
sidebar_mini_toggle: () => {
if (window.innerWidth > 991) {
self._lPage.classList.toggle('sidebar-mini');
}
},
sidebar_mini_on: () => {
if (window.innerWidth > 991) {
self._lPage.classList.add('sidebar-mini');
}
},
sidebar_mini_off: () => {
if (window.innerWidth > 991) {
self._lPage.classList.remove('sidebar-mini');
}
},
sidebar_style_toggle: () => {
if (self._lPage.classList.contains('sidebar-dark')) {
self._uiApiLayout('sidebar_style_light');
} else {
self._uiApiLayout('sidebar_style_dark');
}
},
sidebar_style_dark: () => {
self._lPage.classList.add('sidebar-dark');
localStorage.setItem('dashmixDefaultsSidebarDark', true);
},
sidebar_style_light: () => {
self._lPage.classList.remove('sidebar-dark');
self._lPage.classList.remove('dark-mode');
localStorage.removeItem('dashmixDefaultsSidebarDark');
},
side_overlay_toggle: () => {
if (self._lPage.classList.contains('side-overlay-o')) {
self._uiApiLayout('side_overlay_close');
} else {
self._uiApiLayout('side_overlay_open');
}
},
side_overlay_open: () => {
// When ESCAPE key is hit close the side overlay
document.addEventListener('keydown', e => {
if (e.key === 'Esc' || e.key === 'Escape') {
self._uiApiLayout('side_overlay_close');
}
});
self._lPage.classList.add('side-overlay-o');
},
side_overlay_close: () => {
self._lPage.classList.remove('side-overlay-o');
},
side_overlay_mode_hover_toggle: () => {
self._lPage.classList.toggle('side-overlay-hover');
},
side_overlay_mode_hover_on: () => {
self._lPage.classList.add('side-overlay-hover');
},
side_overlay_mode_hover_off: () => {
self._lPage.classList.remove('side-overlay-hover');
},
header_glass_toggle: () => {
self._lPage.classList.toggle('page-header-glass');
self._uiHandleHeader();
},
header_glass_on: () => {
self._lPage.classList.add('page-header-glass');
self._uiHandleHeader();
},
header_glass_off: () => {
self._lPage.classList.remove('page-header-glass');
self._uiHandleHeader();
},
header_mode_toggle: () => {
self._lPage.classList.toggle('page-header-fixed');
},
header_mode_static: () => {
self._lPage.classList.remove('page-header-fixed');
},
header_mode_fixed: () => {
self._lPage.classList.add('page-header-fixed');
},
header_style_toggle: () => {
if (self._lPage.classList.contains('page-header-dark')) {
self._uiApiLayout('header_style_light');
} else {
self._uiApiLayout('header_style_dark');
}
},
header_style_dark: () => {
self._lPage.classList.add('page-header-dark');
localStorage.setItem('dashmixDefaultsPageHeaderDark', true);
},
header_style_light: () => {
self._lPage.classList.remove('page-header-dark');
self._lPage.classList.remove('dark-mode');
localStorage.removeItem('dashmixDefaultsPageHeaderDark');
},
header_search_on: () => {
self._lHeaderSearch.classList.add('show');
self._lHeaderSearchInput.focus();
// When ESCAPE key is hit close the search section
document.addEventListener('keydown', e => {
if (e.key === 'Esc' || e.key === 'Escape') {
self._uiApiLayout('header_search_off');
}
});
},
header_search_off: () => {
self._lHeaderSearch.classList.remove('show');
self._lHeaderSearchInput.blur();
},
header_loader_on: () => {
self._lHeaderLoader.classList.add('show');
},
header_loader_off: () => {
self._lHeaderLoader.classList.remove('show');
},
dark_mode_toggle: () => {
if (self._lPage.classList.contains('dark-mode')) {
self._uiApiLayout('dark_mode_off');
} else {
self._uiApiLayout('dark_mode_on');
}
},
dark_mode_on: () => {
self._lPage.classList.add('sidebar-dark');
self._lPage.classList.add('page-header-dark');
self._lPage.classList.add('dark-mode');
this._uiHandleDarkMode('on');
},
dark_mode_off: () => {
if (!localStorage.getItem('dashmixDefaultsSidebarDark')) {
self._lPage.classList.remove('sidebar-dark');
}
if (!localStorage.getItem('dashmixDefaultsPageHeaderDark')) {
self._lPage.classList.remove('page-header-dark');
}
self._lPage.classList.remove('dark-mode');
this._uiHandleDarkMode('off');
},
content_layout_toggle: () => {
if (self._lPage.classList.contains('main-content-boxed')) {
self._uiApiLayout('content_layout_narrow');
} else if (self._lPage.classList.contains('main-content-narrow')) {
self._uiApiLayout('content_layout_full_width');
} else {
self._uiApiLayout('content_layout_boxed');
}
},
content_layout_boxed: () => {
self._lPage.classList.remove('main-content-narrow');
self._lPage.classList.add('main-content-boxed');
},
content_layout_narrow: () => {
self._lPage.classList.remove('main-content-boxed');
self._lPage.classList.add('main-content-narrow');
},
content_layout_full_width: () => {
self._lPage.classList.remove('main-content-boxed');
self._lPage.classList.remove('main-content-narrow');
}
};
// Call layout API
if (layoutAPI[mode]) {
layoutAPI[mode]();
}
}
/*
* Blocks API
*
*/
_uiApiBlocks(mode = 'init', block = false) {
let self = this;
// Helper variables
let elBlock, btnFullscreen, btnContentToggle;
// Set default icons for fullscreen and content toggle buttons
let iconBase = 'si';
let iconFullscreen = 'si-size-fullscreen';
let iconFullscreenActive = 'si-size-actual';
let iconContent = 'si-arrow-up';
let iconContentActive = 'si-arrow-down';
// API with object literals
let blockAPI = {
init: () => {
// Auto add the default toggle icons to fullscreen and content toggle buttons
document.querySelectorAll('[data-toggle="block-option"][data-action="fullscreen_toggle"]').forEach(btn => {
btn.innerHTML = '<i class="' + iconBase + ' ' + (btn.closest('.block').classList.contains('block-mode-fullscreen') ? iconFullscreenActive : iconFullscreen) + '"></i>';
});
document.querySelectorAll('[data-toggle="block-option"][data-action="content_toggle"]').forEach(btn => {
btn.innerHTML = '<i class="' + iconBase + ' ' + (btn.closest('.block').classList.contains('block-mode-hidden') ? iconContentActive : iconContent) + '"></i>';
});
// Call blocks API on option button click
document.querySelectorAll('[data-toggle="block-option"]').forEach(btn => {
btn.addEventListener('click', e => {
this._uiApiBlocks(btn.dataset.action, btn.closest('.block'));
});
});
},
fullscreen_toggle: () => {
elBlock.classList.remove('block-mode-pinned');
elBlock.classList.toggle('block-mode-fullscreen');
// Update block option icon
if (btnFullscreen) {
if (elBlock.classList.contains('block-mode-fullscreen')) {
btnFullscreen && btnFullscreen.querySelector('i').classList.replace(iconFullscreen, iconFullscreenActive);
} else {
btnFullscreen && btnFullscreen.querySelector('i').classList.replace(iconFullscreenActive, iconFullscreen);
}
}
},
fullscreen_on: () => {
elBlock.classList.remove('block-mode-pinned')
elBlock.classList.add('block-mode-fullscreen');
// Update block option icon
btnFullscreen && btnFullscreen.querySelector('i').classList.replace(iconFullscreen, iconFullscreenActive);
},
fullscreen_off: () => {
elBlock.classList.remove('block-mode-fullscreen');
// Update block option icon
btnFullscreen && btnFullscreen.querySelector('i').classList.replace(iconFullscreenActive, iconFullscreen);
},
content_toggle: () => {
elBlock.classList.toggle('block-mode-hidden');
// Update block option icon
if (btnContentToggle) {
if (elBlock.classList.contains('block-mode-hidden')) {
btnContentToggle.querySelector('i').classList.replace(iconContent, iconContentActive);
} else {
btnContentToggle.querySelector('i').classList.replace(iconContentActive, iconContent);
}
}
},
content_hide: () => {
elBlock.classList.add('block-mode-hidden');
// Update block option icon
btnContentToggle && btnContentToggle.querySelector('i').classList.replace(iconContent, iconContentActive);
},
content_show: () => {
elBlock.classList.remove('block-mode-hidden');
// Update block option icon
btnContentToggle && btnContentToggle.querySelector('i').classList.replace(iconContentActive, iconContent);
},
state_toggle: () => {
elBlock.classList.toggle('block-mode-loading');
// Return block to normal state if the demostration mode is on in the refresh option button - data-action-mode="demo"
if (elBlock.querySelector('[data-toggle="block-option"][data-action="state_toggle"][data-action-mode="demo"]')) {
setTimeout(() => {
elBlock.classList.remove('block-mode-loading');
}, 2000);
}
},
state_loading: () => {
elBlock.classList.add('block-mode-loading');
},
state_normal: () => {
elBlock.classList.remove('block-mode-loading');
},
pinned_toggle: () => {
elBlock.classList.remove('block-mode-fullscreen');
elBlock.classList.toggle('block-mode-pinned');
},
pinned_on: () => {
elBlock.classList.remove('block-mode-fullscreen');
elBlock.classList.add('block-mode-pinned');
},
pinned_off: () => {
elBlock.classList.remove('block-mode-pinned');
},
close: () => {
elBlock.classList.add('d-none');
},
open: () => {
elBlock.classList.remove('d-none');
}
};
if (mode === 'init') {
// Call Block API
blockAPI[mode]();
} else {
// Get block element
elBlock = (block instanceof Element) ? block : document.querySelector(`${block}`);
// If element exists, procceed with block functionality
if (elBlock) {
// Get block option buttons if exist (need them to update their icons)
btnFullscreen = elBlock.querySelector('[data-toggle="block-option"][data-action="fullscreen_toggle"]');
btnContentToggle = elBlock.querySelector('[data-toggle="block-option"][data-action="content_toggle"]');
// Call Block API
if (blockAPI[mode]) {
blockAPI[mode]();
}
}
}
}
/*
********************************************************************************************
*
* Helpers
*
*********************************************************************************************
*/
/*
* On DOM content loaded
*
*/
onLoad(fn) {
if (document.readyState != 'loading') {
fn();
} else {
document.addEventListener('DOMContentLoaded', fn);
}
}
/*
********************************************************************************************
*
* Create aliases for easier/quicker access to vital methods
*
*********************************************************************************************
*/
/*
* Init base functionality
*
*/
init() {
this._uiInit();
}
/*
* Layout API
*
*/
layout(mode) {
this._uiApiLayout(mode);
}
/*
* Blocks API
*
*/
block(mode, block) {
this._uiApiBlocks(mode, block);
}
/*
* Handle Page Loader
*
*/
loader(mode, colorClass) {
this._uiHandlePageLoader(mode, colorClass);
}
/*
* Run Helpers
*
*/
helpers(helpers, options = {}) {
Helpers.run(helpers, options);
}
/*
* Run Helpers on DOM content loaded
*
*/
helpersOnLoad(helpers, options = {}) {
this.onLoad(() => Helpers.run(helpers, options));
}
}

179
src/main/resources/static/assets/_js/pages/be_comp_calendar.js

@ -0,0 +1,179 @@
/*
* Document : be_comp_calendar.js
* Author : pixelcave
* Description: Custom JS code used in Calendar Page
*/
// Full Calendar, for more examples you can check out http://fullcalendar.io/
class pageCompCalendar {
/*
* Add event to the events list
*
*/
static addEvent() {
let eventInput = document.querySelector('.js-add-event');
let eventInputVal = '';
// When the add event form is submitted
document.querySelector('.js-form-add-event').addEventListener('submit', e => {
e.preventDefault();
// Get input value
eventInputVal = eventInput.value;
// Check if the user entered something
if (eventInputVal) {
let eventList = document.getElementById('js-events');
let newEvent = document.createElement('li');
let newEventDiv = document.createElement('div');
// Prepare new event div
newEventDiv.classList.add('js-event');
newEventDiv.classList.add('p-2');
newEventDiv.classList.add('fs-sm');
newEventDiv.classList.add('fw-medium');
newEventDiv.classList.add('rounded');
newEventDiv.classList.add('bg-info-light');
newEventDiv.classList.add('text-info');
newEventDiv.textContent = eventInputVal;
// Prepare new event li
newEvent.appendChild(newEventDiv);
// Add it to the events list
eventList.insertBefore(newEvent, eventList.firstChild);
// Clear input field
eventInput.value = '';
}
});
}
/*
* Init drag and drop event functionality
*
*/
static initEvents() {
new FullCalendar.Draggable(document.getElementById('js-events'), {
itemSelector: '.js-event',
eventData: function (eventEl) {
return {
title: eventEl.textContent,
backgroundColor: getComputedStyle(eventEl).color,
borderColor: getComputedStyle(eventEl).color
};
}
});
}
/*
* Init calendar demo functionality
*
*/
static initCalendar() {
let date = new Date();
let d = date.getDate();
let m = date.getMonth();
let y = date.getFullYear();
let calendar = new FullCalendar.Calendar(document.getElementById('js-calendar'), {
themeSystem: 'standard',
firstDay: 1,
editable: true,
droppable: true,
headerToolbar: {
left: 'title',
right: 'prev,next today dayGridMonth,timeGridWeek,timeGridDay,listWeek'
},
drop: function (info) {
info.draggedEl.parentNode.remove();
},
events: [
{
title: 'Gaming Day',
start: new Date(y, m, 1),
allDay: true
},
{
title: 'Skype Meeting',
start: new Date(y, m, 3)
},
{
title: 'Project X',
start: new Date(y, m, 9),
end: new Date(y, m, 12),
allDay: true,
color: '#e04f1a'
},
{
title: 'Work',
start: new Date(y, m, 17),
end: new Date(y, m, 19),
allDay: true,
color: '#82b54b'
},
{
id: 999,
title: 'Hiking (repeated)',
start: new Date(y, m, d - 1, 15, 0)
},
{
id: 999,
title: 'Hiking (repeated)',
start: new Date(y, m, d + 3, 15, 0)
},
{
title: 'Landing Template',
start: new Date(y, m, d - 3),
end: new Date(y, m, d - 3),
allDay: true,
color: '#ffb119'
},
{
title: 'Lunch',
start: new Date(y, m, d + 7, 15, 0),
color: '#82b54b'
},
{
title: 'Coding',
start: new Date(y, m, d, 8, 0),
end: new Date(y, m, d, 14, 0),
},
{
title: 'Trip',
start: new Date(y, m, 25),
end: new Date(y, m, 27),
allDay: true,
color: '#ffb119'
},
{
title: 'Reading',
start: new Date(y, m, d + 8, 20, 0),
end: new Date(y, m, d + 8, 22, 0)
},
{
title: 'Follow us on Twitter',
start: new Date(y, m, 22),
allDay: true,
url: 'http://twitter.com/pixelcave',
color: '#3c90df'
}
]
});
calendar.render();
}
/*
* Init functionality
*
*/
static init() {
this.addEvent();
this.initEvents();
this.initCalendar();
}
}
// Initialize when page loads
Dashmix.onLoad(() => pageCompCalendar.init());

143
src/main/resources/static/assets/_js/pages/be_comp_charts.js

@ -0,0 +1,143 @@
/*
* Document : be_comp_charts.js
* Author : pixelcave
* Description: Custom JS code used in Charts Page
*/
// Chart.js Charts, for more examples you can check out http://www.chartjs.org/docs
class pageCompCharts {
/*
* Init Charts
*
*/
static initChartsChartJS() {
// Set Global Chart.js configuration
Chart.defaults.color = '#818d96';
Chart.defaults.scale.grid.color = "rgba(0,0,0,.04)";
Chart.defaults.scale.grid.zeroLineColor = "rgba(0,0,0,.1)";
Chart.defaults.scale.beginAtZero = true;
Chart.defaults.elements.line.borderWidth = 2;
Chart.defaults.elements.point.radius = 5;
Chart.defaults.elements.point.hoverRadius = 7;
Chart.defaults.plugins.tooltip.radius = 3;
Chart.defaults.plugins.legend.labels.boxWidth = 12;
// Get Chart Containers
let chartLinesCon = document.getElementById('js-chartjs-lines');
let chartBarsCon = document.getElementById('js-chartjs-bars');
let chartRadarCon = document.getElementById('js-chartjs-radar');
let chartPolarCon = document.getElementById('js-chartjs-polar');
let chartPieCon = document.getElementById('js-chartjs-pie');
let chartDonutCon = document.getElementById('js-chartjs-donut');
// Set Chart and Chart Data variables
let chartLines, chartBars, chartRadar, chartPolar, chartPie, chartDonut;
let chartLinesBarsRadarData, chartPolarPieDonutData;
// Lines/Bar/Radar Chart Data
chartLinesBarsRadarData = {
labels: ['MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT', 'SUN'],
datasets: [
{
label: 'This Week',
fill: true,
backgroundColor: 'rgba(6, 101, 208, .75)',
borderColor: 'rgba(6, 101, 208, 1)',
pointBackgroundColor: 'rgba(6, 101, 208, 1)',
pointBorderColor: '#fff',
pointHoverBackgroundColor: '#fff',
pointHoverBorderColor: 'rgba(6, 101, 208, 1)',
data: [34, 42, 62, 78, 39, 83, 98]
},
{
label: 'Last Week',
fill: true,
backgroundColor: 'rgba(108, 117, 125, .25)',
borderColor: 'rgba(108, 117, 125, .75)',
pointBackgroundColor: 'rgba(108, 117, 125, 1)',
pointBorderColor: '#fff',
pointHoverBackgroundColor: '#fff',
pointHoverBorderColor: 'rgba(108, 117, 125, 1)',
data: [130, 95, 125, 160, 187, 110, 143]
}
]
};
// Polar/Pie/Donut Data
chartPolarPieDonutData = {
labels: [
'Earnings',
'Sales',
'Tickets'
],
datasets: [{
data: [
65,
15,
20
],
backgroundColor: [
'rgba(141, 196, 81, 1)',
'rgba(255, 177, 25, 1)',
'rgba(224, 79, 26, 1)'
],
hoverBackgroundColor: [
'rgba(141, 196, 81, .5)',
'rgba(255, 177, 25, .5)',
'rgba(224, 79, 26, .5)'
]
}]
};
// Init Charts
if (chartLinesCon !== null) {
chartLines = new Chart(chartLinesCon, {type: 'line', data: chartLinesBarsRadarData, options: { responsive: true, maintainAspectRatio: false, tension: .4 }});
}
if (chartBarsCon !== null) {
chartBars = new Chart(chartBarsCon, {type: 'bar', data: chartLinesBarsRadarData, options: { responsive: true, maintainAspectRatio: false }});
}
if (chartRadarCon !== null) {
chartRadar = new Chart(chartRadarCon, {type: 'radar', data: chartLinesBarsRadarData, options: { responsive: true, maintainAspectRatio: false }});
}
if (chartPolarCon !== null) {
chartPolar = new Chart(chartPolarCon, {type: 'polarArea', data: chartPolarPieDonutData, options: { responsive: true, maintainAspectRatio: false }});
}
if (chartPieCon !== null) {
chartPie = new Chart(chartPieCon, {type: 'pie', data: chartPolarPieDonutData, options: { responsive: true, maintainAspectRatio: false }});
}
if (chartDonutCon !== null) {
chartDonut = new Chart(chartDonutCon, {type: 'doughnut', data: chartPolarPieDonutData, options: { responsive: true, maintainAspectRatio: false }});
}
}
/*
* Randomize Easy Pie Chart values
*
*/
static initRandomEasyPieChart() {
document.querySelectorAll('.js-pie-randomize').forEach(btn => {
btn.addEventListener('click', e => {
btn.closest('.block').querySelectorAll('.pie-chart').forEach(chart => {
jQuery(chart).data('easyPieChart').update(Math.floor((Math.random() * 100) + 1));
});
});
});
}
/*
* Init functionality
*
*/
static init() {
this.initChartsChartJS();
this.initRandomEasyPieChart();
}
}
// Initialize when page loads
Dashmix.onLoad(() => pageCompCharts.init());

156
src/main/resources/static/assets/_js/pages/be_comp_chat.js

@ -0,0 +1,156 @@
/*
* Document : be_comp_chat.js
* Author : pixelcave
* Description: Custom JS code used in Chat Page
*/
// Message Classes
let classesMsgBase = ['fs-sm', 'd-inline-block', 'fw-medium', 'animated', 'fadeIn', 'bg-body-light', 'border-3', 'px-3', 'py-2', 'mb-2', 'shadow-sm', 'mw-100'],
classesMsgSelf = ['border-end', 'border-primary', 'rounded-start', 'text-start'],
classesMsgOther = ['border-start', 'border-dark', 'rounded-end'],
classesMsgHeader = ['fs-sm', 'text-muted', 'animated', 'fadeIn', 'my-2'];
class pageCompChat {
/*
* Init chat
*
*/
static initChat() {
let self = this;
// Set variables
let chatForms = document.querySelectorAll('.js-chat-form form');
// Init form submission
chatForms.forEach(form => {
form.addEventListener('submit', e => {
// Stop form submission
e.preventDefault();
// Get chat input
let chatInput = e.currentTarget.querySelector('.js-chat-input');
// Add message
self.chatAddMessage(parseInt(chatInput.dataset.targetChatId), chatInput.value, 'self', chatInput);
});
});
}
/*
* Add a header message to a chat window
*
*/
static chatAddHeader(chatId, chatMsg, chatMsgLevel) {
// Get chat messages window
let chatWindow = document.querySelector('.js-chat-messages[data-chat-id="' + chatId + '"]');
// If header and chat window exists
if (chatMsg && chatWindow !== null) {
// Create new message elements and add the correct classes
let newChatMsgCon = document.createElement('div');
let newChatMsg = document.createElement('div');
classesMsgHeader.forEach(cls => {
newChatMsg.classList.add(cls);
});
if (chatMsgLevel === 'self') {
newChatMsg.classList.add('text-end');
newChatMsgCon.classList.add('ms-4');
} else {
newChatMsgCon.classList.add('me-4');
}
// Set text message
newChatMsg.innerText = chatMsg;
// Append message to chat window
newChatMsgCon.appendChild(newChatMsg);
chatWindow.appendChild(newChatMsgCon);
// Scroll the message list to the bottom
chatWindow.scrollTop = chatWindow.scrollHeight;
}
}
/*
* Add a message to a chat window
*
*/
static chatAddMessage(chatId, chatMsg, chatMsgLevel, chatInput) {
// Get chat messages window
let chatWindow = document.querySelector('.js-chat-messages[data-chat-id="' + chatId + '"]');
// If message and chat window exists
if (chatMsg && chatWindow !== null) {
// Create new message elements and add the correct classes
let newChatMsgCon = document.createElement('div');
let newChatMsg = document.createElement('div');
classesMsgBase.forEach(cls => {
newChatMsg.classList.add(cls);
});
if (chatMsgLevel === 'self') {
newChatMsgCon.classList.add('text-end');
newChatMsgCon.classList.add('ms-4');
classesMsgSelf.forEach(cls => {
newChatMsg.classList.add(cls);
});
} else {
newChatMsgCon.classList.add('me-4');
classesMsgOther.forEach(cls => {
newChatMsg.classList.add(cls);
});
}
// Set text message
newChatMsg.innerText = chatMsg;
// Append message to chat window
newChatMsgCon.appendChild(newChatMsg);
chatWindow.appendChild(newChatMsgCon);
// Scroll the message list to the bottom
chatWindow.scrollTop = chatWindow.scrollHeight;
// If input is set, reset it
if (chatInput !== null) {
chatInput.value = '';
}
}
}
/*
* Init functionality
*
*/
static init() {
this.initChat();
}
/*
* Add header
*
*/
static addHeader(chatId, chatMsg, chatMsgLevel = '') {
this.chatAddHeader(chatId, chatMsg, chatMsgLevel);
}
/*
* Add message
*
*/
static addMessage(chatId, chatMsg, chatMsgLevel = '') {
this.chatAddMessage(chatId, chatMsg, chatMsgLevel, null);
}
}
// Initialize when page loads
Dashmix.onLoad(() => {
pageCompChat.init();
window.Chat = pageCompChat;
});

106
src/main/resources/static/assets/_js/pages/be_comp_dialogs.js

@ -0,0 +1,106 @@
/*
* Document : be_comp_dialogs.js
* Author : pixelcave
* Description: Custom JS code used in Dialogs Page
*/
// SweetAlert2, for more examples you can check out https://github.com/sweetalert2/sweetalert2
class pageDialogs {
/*
* SweetAlert2 demo functionality
*
*/
static sweetAlert2() {
// Set default properties
let toast = Swal.mixin({
buttonsStyling: false,
target: '#page-container',
customClass: {
confirmButton: 'btn btn-success m-1',
cancelButton: 'btn btn-danger m-1',
input: 'form-control'
}
});
// Init a simple dialog on button click
document.querySelector('.js-swal-simple').addEventListener('click', e => {
toast.fire('Hi, this is just a simple message!');
});
// Init an success dialog on button click
document.querySelector('.js-swal-success').addEventListener('click', e => {
toast.fire('Success', 'Everything was updated perfectly!', 'success');
});
// Init an info dialog on button click
document.querySelector('.js-swal-info').addEventListener('click', e => {
toast.fire('Info', 'Just an informational message!', 'info');
});
// Init an warning dialog on button click
document.querySelector('.js-swal-warning').addEventListener('click', e => {
toast.fire('Warning', 'Something needs your attention!', 'warning');
});
// Init an error dialog on button click
document.querySelector('.js-swal-error').addEventListener('click', e => {
toast.fire('Oops...', 'Something went wrong!', 'error');
});
// Init an question dialog on button click
document.querySelector('.js-swal-question').addEventListener('click', e => {
toast.fire('Question', 'Are you sure about that?', 'question');
});
// Init an example confirm dialog on button click
document.querySelector('.js-swal-confirm').addEventListener('click', e => {
toast.fire({
title: 'Are you sure?',
text: 'You will not be able to recover this imaginary file!',
icon: 'warning',
showCancelButton: true,
customClass: {
confirmButton: 'btn btn-danger m-1',
cancelButton: 'btn btn-secondary m-1'
},
confirmButtonText: 'Yes, delete it!',
html: false,
preConfirm: e => {
return new Promise(resolve => {
setTimeout(() => {
resolve();
}, 50);
});
}
}).then(result => {
if (result.value) {
toast.fire('Deleted!', 'Your imaginary file has been deleted.', 'success');
// result.dismiss can be 'overlay', 'cancel', 'close', 'esc', 'timer'
} else if (result.dismiss === 'cancel') {
toast.fire('Cancelled', 'Your imaginary file is safe :)', 'error');
}
});
});
// Init an example confirm alert on button click
document.querySelector('.js-swal-custom-position').addEventListener('click', e => {
toast.fire({
position: 'top-end',
title: 'Perfect!',
text: 'Nice Position!',
icon: 'success'
});
});
}
/*
* Init functionality
*
*/
static init() {
this.sweetAlert2();
}
}
// Initialize when page loads
Dashmix.onLoad(() => pageDialogs.init());

88
src/main/resources/static/assets/_js/pages/be_comp_image_cropper.js

@ -0,0 +1,88 @@
/*
* Document : be_comp_image_cropper.js
* Author : pixelcave
* Description: Custom JS code used in Image Cropper Page
*/
// Image Cropper, for more examples you can check out https://fengyuanchen.github.io/cropperjs/
class pageCompImageCropper {
/*
* Init image cropper demo functionality
*
*/
static initImageCropper() {
// Get Image Container
let image = document.getElementById('js-img-cropper');
// Set Options
Cropper.setDefaults({
aspectRatio: 4 / 3,
preview: '.js-img-cropper-preview'
});
// Init Image Cropper
let cropper = new Cropper(image, {
crop: function (e) {
// e.detail contains all data required to crop the image server side
// You will have to send it to your custom server side script and crop the image there
// Since this event is fired each time you set the crop section, you could also use getData()
// method on demand. Please check out https://fengyuanchen.github.io/cropperjs/ for more info
// console.log(e.detail);
}
});
// Mini Cropper API
document.querySelectorAll('[data-toggle="cropper"]').forEach(btn => {
btn.addEventListener('click', e => {
let method = btn.dataset.method || false;
let option = btn.dataset.option || false;
// Method selection with object literals
let cropperAPI = {
zoom: () => {
cropper.zoom(option);
},
setDragMode: () => {
cropper.setDragMode(option);
},
rotate: () => {
cropper.rotate(option);
},
scaleX: () => {
cropper.scaleX(option);
btn.dataset.option = -(option);
},
scaleY: () => {
cropper.scaleY(option);
btn.dataset.option = -(option);
},
setAspectRatio: () => {
cropper.setAspectRatio(option);
},
crop: () => {
cropper.crop();
},
clear: () => {
cropper.clear();
}
};
// If method exists, execute it
if (cropperAPI[method]) {
cropperAPI[method]();
}
});
});
}
/*
* Init functionality
*
*/
static init() {
this.initImageCropper();
}
}
// Initialize when page loads
Dashmix.onLoad(() => pageCompImageCropper.init());

154
src/main/resources/static/assets/_js/pages/be_comp_maps_vector.js

@ -0,0 +1,154 @@
/*
* Document : be_comp_maps_vector.js
* Author : pixelcave
* Description: Custom JS code used in Vector Maps Page
*/
// Set default options for all maps
let mapOptions = {
map: '',
backgroundColor: '#ffffff',
regionStyle: {
initial: {
fill: '#1F75D5',
'fill-opacity': 1,
stroke: 'none',
'stroke-width': 0,
'stroke-opacity': 1
},
hover: {
'fill-opacity': .8,
cursor: 'pointer'
}
}
};
// jVectorMap, for more examples you can check out http://jvectormap.com/documentation/
class pageCompMapsVector {
/*
* Init World Map
*
*/
static initMapWorld() {
// Set Active Map
mapOptions['map'] = 'world_mill_en';
// Init Map
jQuery('.js-vector-map-world').vectorMap(mapOptions);
}
/*
* Init Europe Map
*
*/
static initMapEurope() {
// Set Active Map
mapOptions['map'] = 'europe_mill_en';
// Init Map
jQuery('.js-vector-map-europe').vectorMap(mapOptions);
}
/*
* Init USA Map
*
*/
static initMapUsa() {
// Set Active Map
mapOptions['map'] = 'us_aea_en';
// Init Map
jQuery('.js-vector-map-usa').vectorMap(mapOptions);
}
/*
* Init India Map
*
*/
static initMapIndia() {
// Set Active Map
mapOptions['map'] = 'in_mill_en';
// Init Map
jQuery('.js-vector-map-india').vectorMap(mapOptions);
}
/*
* Init China Map
*
*/
static initMapChina() {
// Set Active Map
mapOptions['map'] = 'cn_mill_en';
// Init Map
jQuery('.js-vector-map-china').vectorMap(mapOptions);
}
/*
* Init Australia Map
*
*/
static initMapAustralia() {
// Set Active Map
mapOptions['map'] = 'au_mill_en';
// Init Map
jQuery('.js-vector-map-australia').vectorMap(mapOptions);
}
/*
* Init South Africa Map
*
*/
static initMapSouthAfrica() {
// Set Active Map
mapOptions['map'] = 'za_mill_en';
// Init Map
jQuery('.js-vector-map-south-africa').vectorMap(mapOptions);
}
/*
* Init France Map
*
*/
static initMapFrance() {
// Set Active Map
mapOptions['map'] = 'fr_mill_en';
// Init Map
jQuery('.js-vector-map-france').vectorMap(mapOptions);
}
/*
* Init Germany Map
*
*/
static initMapGermany() {
// Set Active Map
mapOptions['map'] = 'de_mill_en';
// Init Map
jQuery('.js-vector-map-germany').vectorMap(mapOptions);
}
/*
* Init functionality
*
*/
static init() {
this.initMapWorld();
this.initMapEurope();
this.initMapUsa();
this.initMapIndia();
this.initMapChina();
this.initMapAustralia();
this.initMapSouthAfrica();
this.initMapFrance();
this.initMapGermany();
}
}
// Initialize when page loads
Dashmix.onLoad(() => pageCompMapsVector.init());

47
src/main/resources/static/assets/_js/pages/be_comp_nestable.js

@ -0,0 +1,47 @@
/*
* Document : be_comp_nestable.js
* Author : pixelcave
* Description: Custom JS code used in Nestable Page
*/
// Nestable2, for more examples you can check out https://github.com/RamonSmit/Nestable2
class pageCompNestable {
/*
* Nestable2 demo functionality
*
*/
static nestable2() {
// Init Connected Lists
jQuery('.js-nestable-connected-simple').
add('.js-nestable-connected-icons').
add('.js-nestable-connected-treeview').nestable({
group: 0
});
// Init Simple List
jQuery('.js-nestable-simple').nestable({
group: 1
});
// Init Icons List
jQuery('.js-nestable-icons').nestable({
group: 2
});
// Init Tree View List
jQuery('.js-nestable-treeview').nestable({
group: 3
});
}
/*
* Init functionality
*
*/
static init() {
this.nestable2();
}
}
// Initialize when page loads
Dashmix.onLoad(() => pageCompNestable.init());

41
src/main/resources/static/assets/_js/pages/be_comp_onboarding.js

@ -0,0 +1,41 @@
/*
* Document : be_comp_onboarding.js
* Author : pixelcave
* Description: Custom JS code used in Onboarding Page
*/
// Onboarding Modal using Bootstrap Modal and Slick slider
class pageCompOnboarding {
/*
* Init example onboarding modal functionality
*
*/
static initOnboardingModal() {
// Get onboarding modal
let modalEl = document.getElementById('modal-onboarding');
let modal = new bootstrap.Modal(modalEl);
// Show Onboarding Modal by default
modal.show();
// Re-init Slick Slider every time the modal is shown
modalEl.addEventListener('shown.bs.modal', e => {
// Remove enabled class added by the helper to prevent re-init
document.querySelector('#modal-onboarding .js-slider').classList.remove('js-slider-enabled');
// Re-init Slick Slider
Dashmix.helpers('jq-slick');
});
}
/*
* Init functionality
*
*/
static init() {
this.initOnboardingModal();
}
}
// Initialize when page loads
Dashmix.onLoad(() => pageCompOnboarding.init());

50
src/main/resources/static/assets/_js/pages/be_comp_rating.js

@ -0,0 +1,50 @@
/*
* Document : be_comp_rating.js
* Author : pixelcave
* Description: Custom JS code used in Rating Page
*/
// jQuery Raty, for more examples you can check out https://github.com/wbotelhos/raty
class pageCompRating {
/*
* Init demo rating functionality
*
*/
static initRating() {
// Init Raty on .js-rating class
jQuery('.js-rating').each((index, element) => {
let el = jQuery(element);
el.raty({
score: el.data('score') || 0,
number: el.data('number') || 5,
cancel: el.data('cancel') || false,
target: el.data('target') || false,
targetScore: el.data('target-score') || false,
precision: el.data('precision') || false,
cancelOff: el.data('cancel-off') || 'fa fa-fw fa-times-circle text-danger',
cancelOn: el.data('cancel-on') || 'fa fa-fw fa-times-circle',
starHalf: el.data('star-half') || 'fa fa-fw fa-star-half text-warning',
starOff: el.data('star-off') || 'fa fa-fw fa-star text-muted',
starOn: el.data('star-on') || 'fa fa-fw fa-star text-warning',
starType: 'i',
hints: ['Just Bad!', 'Almost There!', 'It’s ok!', 'That’s nice!', 'Incredible!'],
click: function (score, evt) {
// Here you could add your logic on rating click
// console.log('ID: ' + this.id + "\nscore: " + score + "\nevent: " + evt);
}
});
});
}
/*
* Init functionality
*
*/
static init() {
this.initRating();
}
}
// Initialize when page loads
Dashmix.onLoad(() => pageCompRating.init());

124
src/main/resources/static/assets/_js/pages/be_forms_validation.js

@ -0,0 +1,124 @@
/*
* Document : be_forms_validation.js
* Author : pixelcave
* Description: Custom JS code used in Forms Validation Page
*/
// Form Validation, for more examples you can check out https://github.com/jzaefferer/jquery-validation
class pageFormsValidation {
/*
* Init Validation functionality
*
*/
static initValidation() {
// Load default options for jQuery Validation plugin
Dashmix.helpers('jq-validation');
// Init Form Validation
jQuery('.js-validation').validate({
ignore: [],
rules: {
'val-username': {
required: true,
minlength: 3
},
'val-email': {
required: true,
emailWithDot: true
},
'val-password': {
required: true,
minlength: 5
},
'val-confirm-password': {
required: true,
equalTo: '#val-password'
},
'val-suggestions': {
required: true,
minlength: 5
},
'val-skill': {
required: true
},
'val-currency': {
required: true,
currency: ['$', true]
},
'val-website': {
required: true,
url: true
},
'val-phoneus': {
required: true,
phoneUS: true
},
'val-digits': {
required: true,
digits: true
},
'val-number': {
required: true,
number: true
},
'val-range': {
required: true,
range: [1, 5]
},
'val-terms': {
required: true
},
'val-select2': {
required: true
},
'val-select2-multiple': {
required: true,
minlength: 2
}
},
messages: {
'val-username': {
required: 'Please enter a username',
minlength: 'Your username must consist of at least 3 characters'
},
'val-email': 'Please enter a valid email address',
'val-password': {
required: 'Please provide a password',
minlength: 'Your password must be at least 5 characters long'
},
'val-confirm-password': {
required: 'Please provide a password',
minlength: 'Your password must be at least 5 characters long',
equalTo: 'Please enter the same password as above'
},
'val-select2': 'Please select a value!',
'val-select2-multiple': 'Please select at least 2 values!',
'val-suggestions': 'What can we do to become better?',
'val-skill': 'Please select a skill!',
'val-currency': 'Please enter a price!',
'val-website': 'Please enter your website!',
'val-phoneus': 'Please enter a US phone!',
'val-digits': 'Please enter only digits!',
'val-number': 'Please enter a number!',
'val-range': 'Please enter a number between 1 and 5!',
'val-terms': 'You must agree to the service terms!'
}
});
// Init Validation on Select2 change
jQuery('.js-select2').on('change', e => {
jQuery(e.currentTarget).valid();
});
}
/*
* Init functionality
*
*/
static init() {
this.initValidation();
}
}
// Initialize when page loads
Dashmix.onLoad(() => pageFormsValidation.init());

89
src/main/resources/static/assets/_js/pages/be_pages_dashboard.js

@ -0,0 +1,89 @@
/*
* Document : be_pages_dashboard.js
* Author : pixelcave
* Description: Custom JS code used in Default Dashboard Page
*/
// Chart.js Charts, for more examples you can check out http://www.chartjs.org/docs
class pageDashboard {
/*
* Init Charts
*
*/
static initChartsBars() {
// Set Global Chart.js configuration
Chart.defaults.color = '#818d96';
Chart.defaults.scale.grid.color = 'transparent';
Chart.defaults.scale.grid.zeroLineColor = 'transparent';
Chart.defaults.scale.beginAtZero = true;
Chart.defaults.elements.line.borderWidth = 1;
Chart.defaults.plugins.legend.labels.boxWidth = 12;
// Get Chart Containers
let chartBarsCon = document.getElementById('js-chartjs-analytics-bars');
// Set Chart and Chart Data variables
let chartBars, chartLinesBarsData;
// Bars Chart Data
chartLinesBarsData = {
labels: ['MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT', 'SUN'],
datasets: [
{
label: 'This Week',
fill: true,
backgroundColor: 'rgba(6, 101, 208, .6)',
borderColor: 'transparent',
pointBackgroundColor: 'rgba(6, 101, 208, 1)',
pointBorderColor: '#fff',
pointHoverBackgroundColor: '#fff',
pointHoverBorderColor: 'rgba(6, 101, 208, 1)',
data: [73, 68, 69, 53, 60, 72, 82]
},
{
label: 'Last Week',
fill: true,
backgroundColor: 'rgba(6, 101, 208, .2)',
borderColor: 'transparent',
pointBackgroundColor: 'rgba(6, 101, 208, .2)',
pointBorderColor: '#fff',
pointHoverBackgroundColor: '#fff',
pointHoverBorderColor: 'rgba(6, 101, 208, .2)',
data: [62, 32, 59, 55, 52, 56, 73]
}
]
};
// Init Chart
if (chartBarsCon !== null) {
chartBars = new Chart(chartBarsCon, {
type: 'bar',
data: chartLinesBarsData,
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
tooltip: {
callbacks: {
label: function (context) {
return context.dataset.label + ': ' + context.parsed.y + ' Customers';
}
}
}
}
}
});
}
}
/*
* Init functionality
*
*/
static init() {
this.initChartsBars();
}
}
// Initialize when page loads
Dashmix.onLoad(() => pageDashboard.init());

225
src/main/resources/static/assets/_js/pages/be_pages_dashboard_v1.js

@ -0,0 +1,225 @@
/*
* Document : be_pages_dashboard.js
* Author : pixelcave
* Description: Custom JS code used in default Dashboard v1 Page
*/
// Chart.js Charts, for more examples you can check out http://www.chartjs.org/docs
class pageDashboardv1 {
/*
* Init Charts
*
*/
static initChartsMain() {
// Set Global Chart.js configuration
Chart.defaults.color = '#818d96';
Chart.defaults.scale.grid.color = 'transparent';
Chart.defaults.scale.grid.zeroLineColor = 'transparent';
Chart.defaults.scale.display = false;
Chart.defaults.scale.beginAtZero = true;
Chart.defaults.elements.point.radius = 0;
Chart.defaults.elements.point.hoverRadius = 0;
Chart.defaults.plugins.tooltip.radius = 3;
Chart.defaults.plugins.legend.labels.boxWidth = 12;
// Get Chart Containers
let chartMainCon = document.getElementById('js-chartjs-dashboard-earnings');
// Set Main Chart variables
let chartMain, chartMainOptions, chartMainData, chartMainDataYear, chartMainDataMonth, chartMainDataWeek;
// Main Chart Options
chartMainOptions = {
responsive: true,
maintainAspectRatio: false,
tension: .4,
scales: {
y: {
suggestedMin: 0,
suggestedMax: 260
}
},
interaction: {
intersect: false,
},
plugins: {
tooltip: {
callbacks: {
label: function (context) {
return ' ' + context.parsed.y + ' Sales';
}
}
}
}
};
// Main Chart Default Data
chartMainData = {
labels: ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC'],
datasets: [
{
label: 'This Year',
fill: true,
backgroundColor: 'rgba(6, 101, 208, .5)',
borderColor: 'transparent',
pointBackgroundColor: 'rgba(6, 101, 208, 1)',
pointBorderColor: '#fff',
pointHoverBackgroundColor: '#fff',
pointHoverBorderColor: 'rgba(6, 101, 208, 1)',
data: [50, 210, 110, 90, 230, 130, 190, 75, 155, 120, 140, 230]
},
{
label: 'Last Year',
fill: true,
backgroundColor: 'rgba(6, 101, 208, .2)',
borderColor: 'transparent',
pointBackgroundColor: 'rgba(6, 101, 208, .2)',
pointBorderColor: '#fff',
pointHoverBackgroundColor: '#fff',
pointHoverBorderColor: 'rgba(6, 101, 208, .2)',
data: [210, 150, 90, 220, 150, 216, 143, 150, 240, 230, 136, 150]
}
]
};
// Main Chart for Year
chartMainDataYear = {
labels: ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC'],
datasets: [
{
label: 'This Year',
fill: true,
backgroundColor: 'rgba(6, 101, 208, .5)',
borderColor: 'transparent',
pointBackgroundColor: 'rgba(6, 101, 208, 1)',
pointBorderColor: '#fff',
pointHoverBackgroundColor: '#fff',
pointHoverBorderColor: 'rgba(6, 101, 208, 1)',
data: [50, 210, 110, 90, 230, 130, 190, 75, 155, 120, 140, 230]
},
{
label: 'Last Year',
fill: true,
backgroundColor: 'rgba(6, 101, 208, .2)',
borderColor: 'transparent',
pointBackgroundColor: 'rgba(6, 101, 208, .2)',
pointBorderColor: '#fff',
pointHoverBackgroundColor: '#fff',
pointHoverBorderColor: 'rgba(6, 101, 208, .2)',
data: [210, 150, 90, 220, 150, 216, 143, 150, 240, 230, 136, 150]
}
]
};
// Set up month labels
let chartMainDataMonthLabels = [];
for (let i = 0; i < 30; i++) {
chartMainDataMonthLabels[i] = (i === 29) ? '1 day ago' : (30 - i) + ' days ago';
}
// Main Chart Data for Month
chartMainDataMonth = {
labels: chartMainDataMonthLabels,
datasets: [
{
label: 'This Month',
fill: true,
backgroundColor: 'rgba(6, 101, 208, .5)',
borderColor: 'transparent',
pointBackgroundColor: 'rgba(6, 101, 208, 1)',
pointBorderColor: '#fff',
pointHoverBackgroundColor: '#fff',
pointHoverBorderColor: 'rgba(6, 101, 208, 1)',
data: [50, 210, 110, 90, 230, 130, 190, 75, 155, 120, 140, 230, 50, 210, 110, 90, 230, 130, 155, 120, 140, 230, 50, 210, 110, 90, 230, 130, 190, 75]
},
{
label: 'Last Month',
fill: true,
backgroundColor: 'rgba(6, 101, 208, .2)',
borderColor: 'transparent',
pointBackgroundColor: 'rgba(6, 101, 208, .2)',
pointBorderColor: '#fff',
pointHoverBackgroundColor: '#fff',
pointHoverBorderColor: 'rgba(6, 101, 208, .2)',
data: [210, 150, 90, 220, 150, 216, 143, 150, 136, 150, 210, 150, 90, 220, 150, 216, 240, 230, 136, 150, 210, 150, 90, 220, 150, 216, 143, 150, 240, 230]
}
]
};
// Main Chart Data for Week
chartMainDataWeek = {
labels: ['MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT', 'SUN'],
datasets: [
{
label: 'This Week',
fill: true,
backgroundColor: 'rgba(6, 101, 208, .5)',
borderColor: 'transparent',
pointBackgroundColor: 'rgba(6, 101, 208, 1)',
pointBorderColor: '#fff',
pointHoverBackgroundColor: '#fff',
pointHoverBorderColor: 'rgba(6, 101, 208, 1)',
data: [34, 42, 62, 78, 39, 83, 98]
},
{
label: 'Last Week',
fill: true,
backgroundColor: 'rgba(6, 101, 208, .2)',
borderColor: 'transparent',
pointBackgroundColor: 'rgba(6, 101, 208, .2)',
pointBorderColor: '#fff',
pointHoverBackgroundColor: '#fff',
pointHoverBorderColor: 'rgba(6, 101, 208, .2)',
data: [130, 95, 125, 160, 187, 110, 143]
}
]
};
// Init Main Chart
if (chartMainCon !== null) {
chartMain = new Chart(chartMainCon, {
type: 'line',
data: chartMainData,
options: chartMainOptions
});
}
// Toggle to Week data
document.querySelector('[data-toggle="dashboard-chart-set-week"]').addEventListener('click', () => {
chartMain.data.labels = chartMainDataWeek.labels;
chartMain.data.datasets[0] = chartMainDataWeek.datasets[0];
chartMain.data.datasets[1] = chartMainDataWeek.datasets[1];
chartMain.update();
});
// Toggle to Month data
document.querySelector('[data-toggle="dashboard-chart-set-month"]').addEventListener('click', () => {
chartMain.data.labels = chartMainDataMonth.labels;
chartMain.data.datasets[0] = chartMainDataMonth.datasets[0];
chartMain.data.datasets[1] = chartMainDataMonth.datasets[1];
chartMain.update();
});
// Toggle to Year data
document.querySelector('[data-toggle="dashboard-chart-set-year"]').addEventListener('click', () => {
chartMain.data.labels = chartMainDataYear.labels;
chartMain.data.datasets[0] = chartMainDataYear.datasets[0];
chartMain.data.datasets[1] = chartMainDataYear.datasets[1];
chartMain.update();
});
}
/*
* Init functionality
*
*/
static init() {
this.initChartsMain();
}
}
// Initialize when page loads
jQuery(() => {
pageDashboardv1.init();
});

104
src/main/resources/static/assets/_js/pages/be_pages_ecom_dashboard.js

@ -0,0 +1,104 @@
/*
* Document : be_pages_ecom_dashboard.js
* Author : pixelcave
* Description: Custom JS code used in eCommerce Dashboard Page
*/
// Chart.js Charts, for more examples you can check out http://www.chartjs.org/docs
class pageEcomDashboard {
/*
* Init Charts
*
*/
static initOverviewChart() {
// Set Global Chart.js configuration
Chart.defaults.color = '#818d96';
Chart.defaults.scale.grid.color = 'transparent';
Chart.defaults.scale.grid.zeroLineColor = 'transparent';
Chart.defaults.scale.beginAtZero = true;
Chart.defaults.elements.point.radius = 0;
Chart.defaults.elements.point.hoverRadius = 0;
Chart.defaults.plugins.tooltip.radius = 3;
Chart.defaults.plugins.legend.labels.boxWidth = 12;
// Get Chart Container
let chartOverviewCon = document.getElementById('js-chartjs-overview');
// Set Chart Variables
let chartOverview, chartOverviewOptions, chartOverviewData;
// Overview Chart Options
chartOverviewOptions = {
responsive: true,
maintainAspectRatio: false,
tension: .4,
scales: {
y: {
suggestedMin: 0,
suggestedMax: 600
}
},
interaction: {
intersect: false,
},
plugins: {
tooltip: {
callbacks: {
label: function (context) {
return '$ ' + context.parsed.y;
}
}
}
}
};
// Overview Chart Data
chartOverviewData = {
labels: ['MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT', 'SUN'],
datasets: [
{
label: 'This Week',
fill: true,
backgroundColor: 'rgba(6, 101, 208, .5)',
borderColor: 'transparent',
pointBackgroundColor: 'rgba(6, 101, 208, 1)',
pointBorderColor: '#fff',
pointHoverBackgroundColor: '#fff',
pointHoverBorderColor: 'rgba(6, 101, 208, 1)',
data: [369, 255, 420, 330, 460, 160, 350]
},
{
label: 'Last Week',
fill: true,
backgroundColor: 'rgba(6, 101, 208, .2)',
borderColor: 'transparent',
pointBackgroundColor: 'rgba(6, 101, 208, .2)',
pointBorderColor: '#fff',
pointHoverBackgroundColor: '#fff',
pointHoverBorderColor: 'rgba(6, 101, 208, .2)',
data: [270, 460, 290, 231, 419, 450, 280]
}
]
};
// Init Overview Chart
if (chartOverviewCon !== null) {
chartOverview = new Chart(chartOverviewCon, {
type: 'line',
data: chartOverviewData,
options: chartOverviewOptions
});
}
}
/*
* Init functionality
*
*/
static init() {
this.initOverviewChart();
}
}
// Initialize when page loads
Dashmix.onLoad(() => pageEcomDashboard.init());

271
src/main/resources/static/assets/_js/pages/be_pages_projects_tasks.js

@ -0,0 +1,271 @@
/*
* Document : be_pages_projects_tasks.js
* Author : pixelcave
* Description: Custom JS code used in Project Tasks and Tasks Dashboard Page
*/
// Helper variables
let taskIdNext, tasks, taskForm, taskInput, taskInputVal,
taskList, taskListStarred, taskListCompleted,
taskBadge, taskBadgeStarred, taskBadgeCompleted;
class pageTasks {
/*
* Init Tasks
*
*/
static initTasks() {
let self = this;
// Set variables
tasks = jQuery('.js-tasks');
taskForm = jQuery('#js-task-form');
taskInput = jQuery('#js-task-input');
taskList = jQuery('.js-task-list');
taskListStarred = jQuery('.js-task-list-starred');
taskListCompleted = jQuery('.js-task-list-completed');
taskBadge = jQuery('.js-task-badge');
taskBadgeStarred = jQuery('.js-task-badge-starred');
taskBadgeCompleted = jQuery('.js-task-badge-completed');
// Set your own next new task id based on your database setup
taskIdNext = 10;
// Update badges
this.badgesUpdate();
// New task form submission
taskForm.on('submit', e => {
e.preventDefault();
// Get input value
taskInputVal = taskInput.prop('value');
// Check if the user entered something
if (taskInputVal) {
// Add Task
self.taskAdd(taskInputVal);
// Clear and focus input field
taskInput.prop('value', '').focus();
}
});
// Task status update on checkbox click
let stask, staskId;
tasks.on('click', '.js-task-status', e => {
stask = jQuery(e.currentTarget).closest('.js-task');
staskId = stask.data('task-id');
// Check task status and toggle it
if (stask.data('task-completed')) {
self.taskSetActive(staskId);
} else {
self.taskSetCompleted(staskId);
}
});
// Task starred status update on star click
let ftask, ftaskId;
tasks.on('click', '.js-task-star', e => {
ftask = jQuery(e.currentTarget).closest('.js-task');
ftaskId = ftask.data('task-id');
// Check task starred status and toggle it
if (ftask.data('task-starred')) {
self.taskStarRemove(ftaskId);
} else {
self.taskStarAdd(ftaskId);
}
});
// Remove task on remove button click
tasks.on('click', '.js-task-remove', e => {
ftask = jQuery(e.currentTarget).closest('.js-task');
ftaskId = ftask.data('task-id');
// Remove task
self.taskRemove(ftaskId);
});
}
/*
* Update Badges
*
*/
static badgesUpdate() {
taskBadge.text(taskList.children().length || '');
taskBadgeStarred.text(taskListStarred.children().length || '');
taskBadgeCompleted.text(taskListCompleted.children().length || '');
}
/*
* Add a new task
*
*/
static taskAdd(taskContent) {
// Add it to the task list
taskList.prepend(`
<div class="js-task block block-rounded mb-2 animated fadeIn" data-task-id="${taskIdNext}" data-task-completed="false" data-task-starred="false">
<table class="table table-borderless table-vcenter mb-0">
<tr>
<td class="text-center pe-0" style="width: 38px;">
<div class="js-task-status form-check">
<input type="checkbox" class="form-check-input" id="tasks-cb-id${taskIdNext}" name="tasks-cb-id${taskIdNext}">
<label class="form-check-label" for="tasks-cb-id${taskIdNext}"></label>
</div>
</td>
<td class="js-task-content fw-semibold ps-0">
${jQuery('<span />').text(taskContent).html()}
</td>
<td class="text-end" style="width: 100px;">
<button type="button" class="js-task-star btn btn-sm btn-link text-warning">
<i class="far fa-star fa-fw"></i>
</button>
<button type="button" class="js-task-remove btn btn-sm btn-link text-danger">
<i class="fa fa-times fa-fw"></i>
</button>
</td>
</tr>
</table>
</div>
`);
// Update badges
this.badgesUpdate();
// Save the task based on your database setup
// ..
// Update task next id
taskIdNext++;
}
/*
* Remove a task
*
*/
static taskRemove(taskId) {
jQuery('.js-task[data-task-id="' + taskId + '"]').remove();
// Update badges
this.badgesUpdate();
// Remove the task based on your database setup
// ..
}
/*
* Star a task
*
*/
static taskStarAdd(taskId) {
let task = jQuery('.js-task[data-task-id="' + taskId + '"]');
// Check if exists and update accordignly the markup
if (task.length > 0) {
task.data('task-starred', true);
task.find('.js-task-star > i').toggleClass('fa far');
if (!task.data('task-completed')) {
task.prependTo(taskListStarred);
}
// Update badges
this.badgesUpdate();
// Star the task based on your database setup
// ..
}
}
/*
* Unstar a task
*
*/
static taskStarRemove(taskId) {
let task = jQuery('.js-task[data-task-id="' + taskId + '"]');
// Check if exists and update accordignly the markup
if (task.length > 0) {
task.data('task-starred', false);
task.find('.js-task-star > i').toggleClass('fa far');
if (!task.data('task-completed')) {
task.prependTo(taskList);
}
// Update badges
this.badgesUpdate();
// Unstar the task based on your database setup
// ..
}
}
/*
* Set a task to active
*
*/
static taskSetActive(taskId) {
let task = jQuery('.js-task[data-task-id="' + taskId + '"]');
// Check if exists and update accordignly
if (task.length > 0) {
task.data('task-completed', false);
task.find('.table').toggleClass('bg-body');
task.find('.js-task-status > input').prop('checked', false);
task.find('.js-task-content > del').contents().unwrap();
if (task.data('task-starred')) {
task.prependTo(taskListStarred);
} else {
task.prependTo(taskList);
}
// Update badges
this.badgesUpdate();
// Update task status based on your database setup
// ..
}
}
/*
* Set a task to completed
*
*/
static taskSetCompleted(taskId) {
let task = jQuery('.js-task[data-task-id="' + taskId + '"]');
// Check if exists and update accordignly
if (task.length > 0) {
task.data('task-completed', true);
task.find('.table').toggleClass('bg-body');
task.find('.js-task-status > input').prop('checked', true);
task.find('.js-task-content').wrapInner('<del></del>');
task.prependTo(taskListCompleted);
// Update badges
this.badgesUpdate();
// Update task status based on your database setup
// ..
}
}
/*
* Init functionality
*
*/
static init() {
this.initTasks();
}
}
// Initialize when page loads
Dashmix.onLoad(() => pageTasks.init());

101
src/main/resources/static/assets/_js/pages/be_tables_datatables.js

@ -0,0 +1,101 @@
/*
* Document : be_tables_datatables.js
* Author : pixelcave
* Description: Custom JS code used in DataTables Page
*/
// DataTables, for more examples you can check out https://www.datatables.net/
class pageTablesDatatables {
/*
* Init DataTables functionality
*
*/
static initDataTables() {
// Override a few default classes
jQuery.extend(jQuery.fn.dataTable.ext.classes, {
sWrapper: "dataTables_wrapper dt-bootstrap5",
sFilterInput: "form-control",
sLengthSelect: "form-select"
});
// Override a few defaults
jQuery.extend(true, jQuery.fn.dataTable.defaults, {
language: {
lengthMenu: "_MENU_",
search: "_INPUT_",
searchPlaceholder: "Search..",
info: "Page <strong>_PAGE_</strong> of <strong>_PAGES_</strong>",
paginate: {
first: '<i class="fa fa-angle-double-left"></i>',
previous: '<i class="fa fa-angle-left"></i>',
next: '<i class="fa fa-angle-right"></i>',
last: '<i class="fa fa-angle-double-right"></i>'
}
}
});
// Override buttons default classes
jQuery.extend(true, jQuery.fn.DataTable.Buttons.defaults, {
dom: {
button: {
className: 'btn btn-sm btn-primary'
},
}
});
// Init full DataTable
jQuery('.js-dataTable-full').DataTable({
pageLength: 5,
lengthMenu: [[5, 10, 20], [5, 10, 20]],
autoWidth: false
});
// Init DataTable with Buttons
jQuery('.js-dataTable-buttons').DataTable({
pageLength: 5,
lengthMenu: [[5, 10, 20], [5, 10, 20]],
autoWidth: false,
buttons: ['copy', 'csv', 'excel', 'pdf', 'print'],
dom: "<'row'<'col-sm-12'<'text-center bg-body-light py-2 mb-2'B>>>" +
"<'row'<'col-sm-12 col-md-6'l><'col-sm-12 col-md-6'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'p>>"
});
// Init full extra DataTable
jQuery('.js-dataTable-full-pagination').DataTable({
pagingType: "full_numbers",
pageLength: 5,
lengthMenu: [[5, 10, 20], [5, 10, 20]],
autoWidth: false
});
// Init simple DataTable
jQuery('.js-dataTable-simple').DataTable({
pageLength: 5,
lengthMenu: false,
searching: false,
autoWidth: false,
dom: "<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-6'i><'col-sm-6'p>>"
});
// Init responsive DataTable
jQuery('.js-dataTable-responsive').DataTable({
pagingType: "full_numbers",
pageLength: 5,
lengthMenu: [[5, 10, 20], [5, 10, 20]],
autoWidth: false,
responsive: true
});
}
/*
* Init functionality
*
*/
static init() {
this.initDataTables();
}
}
// Initialize when page loads
Dashmix.onLoad(() => pageTablesDatatables.init());

45
src/main/resources/static/assets/_js/pages/be_ui_animations.js

@ -0,0 +1,45 @@
/*
* Document : be_ui_animations.js
* Author : pixelcave
* Description: Custom JS code used in Animations Page
*/
class pageAnimations {
/*
* Animation toggle functionality
*
*/
static animationsToggle() {
let animationClass, animationButton, currentSection;
// On button click
document.querySelectorAll('.js-animation-section button').forEach(btn => {
btn.addEventListener('click', e => {
animationClass = btn.dataset.animationClass;
currentSection = btn.closest('.js-animation-section');
// Update class preview
currentSection.querySelector('.js-animation-preview').textContent = animationClass;
// Update animation object classes
let animationObject = currentSection.querySelector('.js-animation-object')
animationObject.classList = '';
animationObject.classList.add('js-animation-object');
animationObject.classList.add('animated');
animationObject.classList.add(animationClass);
});
});
}
/*
* Init functionality
*
*/
static init() {
this.animationsToggle();
}
}
// Initialize when page loads
Dashmix.onLoad(() => pageAnimations.init());

2184
src/main/resources/static/assets/_js/pages/be_ui_icons.js
File diff suppressed because it is too large
View File

41
src/main/resources/static/assets/_js/pages/be_ui_progress.js

@ -0,0 +1,41 @@
/*
* Document : be_ui_progress.js
* Author : pixelcave
* Description: Custom JS code used in Progress Page
*/
class pageProgress {
/*
* Bars randomize functionality
*
*/
static barsRandomize() {
document.querySelectorAll('.js-bar-randomize').forEach(item => {
item.addEventListener('click', e => {
item.closest('.block').querySelectorAll('.progress-bar').forEach(bar => {
let random = Math.floor((Math.random() * 91) + 10);
let content = bar.querySelector('span');
// Update progress width
bar.style.width = random + '%';
// Update progress label
if (content) {
content.textContent = random + '%';
}
});
});
});
}
/*
* Init functionality
*
*/
static init() {
this.barsRandomize();
}
}
// Initialize when page loads
Dashmix.onLoad(() => pageProgress.init());

73
src/main/resources/static/assets/_js/pages/db_analytics.js

@ -0,0 +1,73 @@
/*
* Document : db_analytics.js
* Author : pixelcave
* Description: Custom JS code used in Analytics Dashboard Page
*/
// Chart.js Charts, for more examples you can check out http://www.chartjs.org/docs
class pageDashboardAnalytics {
/*
* Init Charts
*
*/
static initChartsBars() {
// Set Global Chart.js configuration
Chart.defaults.color = '#818d96';
Chart.defaults.scale.grid.color = 'transparent';
Chart.defaults.scale.grid.zeroLineColor = 'transparent';
Chart.defaults.scale.beginAtZero = true;
Chart.defaults.elements.line.borderWidth = 1;
Chart.defaults.plugins.legend.labels.boxWidth = 12;
// Get Chart Containers
let chartBarsCon = document.getElementById('js-chartjs-analytics-bars');
// Set Chart and Chart Data variables
let chartBars, chartLinesBarsData;
// Bars Chart Data
chartLinesBarsData = {
labels: ['MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT', 'SUN'],
datasets: [
{
label: 'This Week',
fill: true,
backgroundColor: 'rgba(103, 114, 229, .75)',
borderColor: 'rgba(103, 114, 229, 1)',
pointBackgroundColor: 'rgba(103, 114, 229, 1)',
pointBorderColor: '#fff',
pointHoverBackgroundColor: '#fff',
pointHoverBorderColor: 'rgba(103, 114, 229, 1)',
data: [500, 750, 650, 570, 582, 480, 680]
},
{
label: 'Last Week',
fill: true,
backgroundColor: 'rgba(108, 117, 125, .15)',
borderColor: 'rgba(108, 117, 125, .75)',
pointBackgroundColor: 'rgba(108, 117, 125, 1)',
pointBorderColor: '#fff',
pointHoverBackgroundColor: '#fff',
pointHoverBorderColor: 'rgba(108, 117, 125, 1)',
data: [352, 530, 541, 521, 410, 395, 460]
}
]
};
// Init Chart
if (chartBarsCon !== null) {
chartBars = new Chart(chartBarsCon, {type: 'bar', data: chartLinesBarsData, options: { responsive: true, maintainAspectRatio: false }});
}
}
/*
* Init functionality
*
*/
static init() {
this.initChartsBars();
}
}
// Initialize when page loads
Dashmix.onLoad(() => pageDashboardAnalytics.init());

144
src/main/resources/static/assets/_js/pages/db_corporate_slim.js

@ -0,0 +1,144 @@
/*
* Document : db_corporate_slim.js
* Author : pixelcave
* Description: Custom JS code used in Corporate Slim Dashboard Page
*/
// Chart.js Charts, for more examples you can check out http://www.chartjs.org/docs
class DbCorporateSlim {
/*
* Init Charts
*
*/
static initCorporateChartJS() {
// Set Global Chart.js configuration
Chart.defaults.color = '#7c7c7c';
Chart.defaults.scale.grid.color = "transparent";
Chart.defaults.scale.grid.zeroLineColor = "transparent";
Chart.defaults.scale.display = false;
Chart.defaults.scale.beginAtZero = true;
Chart.defaults.elements.line.borderWidth = 2;
Chart.defaults.elements.point.radius = 6;
Chart.defaults.elements.point.hoverRadius = 10;
Chart.defaults.plugins.tooltip.radius = 3;
Chart.defaults.plugins.legend.display = false;
// Chart Containers
let chartCorporateSlimProjectsCon = document.getElementById('js-chartjs-corporate-slim-projects');
let chartCorporateSlimTicketsCon = document.getElementById('js-chartjs-corporate-slim-tickets');
// Chart Variables
let chartCorporateSlimProjects, chartCorporateSlimTickets;
// Lines Charts Data
let chartCorporateSlimProjectsData = {
labels: ['MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT', 'SUN'],
datasets: [
{
label: 'This Week',
fill: true,
backgroundColor: 'rgba(73, 80, 87, .1)',
borderColor: 'rgba(73, 80, 87, .35)',
pointBackgroundColor: 'rgba(73, 80, 87, .5)',
pointBorderColor: '#fff',
pointHoverBackgroundColor: '#fff',
pointHoverBorderColor: 'rgba(73, 80, 87, .5)',
data: [14, 16, 6, 14, 10, 19, 12]
}
]
};
let chartCorporateSlimProjectsOptions = {
responsive: true,
maintainAspectRatio: false,
tension: .4,
scales: {
y: {
suggestedMin: 0,
suggestedMax: 22
}
},
interaction: {
intersect: false,
},
plugins: {
tooltip: {
callbacks: {
label: function (context) {
return ' ' + context.parsed.y + ' Sales';
}
}
}
}
};
let chartCorporateSlimTicketsData = {
labels: ['MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT', 'SUN'],
datasets: [
{
label: 'This Week',
fill: true,
backgroundColor: 'rgba(130, 181, 75, .1)',
borderColor: 'rgba(130, 181, 75, .35)',
pointBackgroundColor: 'rgba(130, 181, 75, .5)',
pointBorderColor: '#fff',
pointHoverBackgroundColor: '#fff',
pointHoverBorderColor: 'rgba(130, 181, 75, .5)',
data: [35, 20, 29, 20, 40, 34, 45]
}
]
};
let chartCorporateSlimTicketsOptions = {
responsive: true,
maintainAspectRatio: false,
tension: .4,
scales: {
y: {
suggestedMin: 0,
suggestedMax: 50
}
},
interaction: {
intersect: false,
},
plugins: {
tooltip: {
callbacks: {
label: function (context) {
return ' ' + context.parsed.y + ' Tickets';
}
}
}
}
};
// Init Charts
if (chartCorporateSlimProjectsCon !== null) {
chartCorporateSlimProjects = new Chart(chartCorporateSlimProjectsCon, {
type: 'line',
data: chartCorporateSlimProjectsData,
options: chartCorporateSlimProjectsOptions
});
}
if (chartCorporateSlimTicketsCon !== null) {
chartCorporateSlimTickets = new Chart(chartCorporateSlimTicketsCon, {
type: 'line',
data: chartCorporateSlimTicketsData,
options: chartCorporateSlimTicketsOptions
});
}
}
/*
* Init functionality
*
*/
static init() {
this.initCorporateChartJS();
}
}
// Initialize when page loads
Dashmix.onLoad(() => DbCorporateSlim.init());

93
src/main/resources/static/assets/_js/pages/db_crypto.js

@ -0,0 +1,93 @@
/*
* Document : db_crypto.js
* Author : pixelcave
* Description: Custom JS code used in Crypto Dashboard Page
*/
// Chart.js Charts, for more examples you can check out http://www.chartjs.org/docs
class pageDashboardCrypto {
/*
* Init Charts
*
*/
static initChartsBitcoin() {
// Set Global Chart.js configuration
Chart.defaults.color = '#818d96';
Chart.defaults.scale.grid.color = 'transparent';
Chart.defaults.scale.grid.zeroLineColor = 'transparent';
Chart.defaults.scale.beginAtZero = true;
Chart.defaults.elements.point.radius = 0;
Chart.defaults.elements.point.hoverRadius = 0;
Chart.defaults.plugins.tooltip.radius = 3;
Chart.defaults.plugins.legend.display = false;
// Get Chart Container
let chartBitcoinCon = document.getElementById('js-chartjs-bitcoin');
// Set up labels
let chartBitcoinlabels = [];
for (let i = 0; i < 30; i++) {
chartBitcoinlabels[i] = (i === 29) ? '1 day ago' : (30 - i) + ' days ago';
}
// Crypto Data
let chartBitcoinData = [10500, 10400, 9500, 8268, 10218, 8250, 8707, 9284, 9718, 9950, 9879, 10147, 10883, 11071, 11332, 11584, 11878, 13540, 16501, 16007, 15142, 14869, 16762, 17276, 16808, 16678, 16771, 12900, 13100, 14000];
// Init Chart
if (chartBitcoinCon !== null) {
let chartBitcoin = new Chart(chartBitcoinCon, {
type: 'line',
data: {
labels: chartBitcoinlabels,
datasets: [
{
label: 'Bitcoin Price',
fill: true,
backgroundColor: 'rgba(255,193,7,.25)',
borderColor: 'rgba(255,193,7,1)',
pointBackgroundColor: 'rgba(255,193,7,1)',
pointBorderColor: '#fff',
pointHoverBackgroundColor: '#fff',
pointHoverBorderColor: 'rgba(255,193,7,1)',
data: chartBitcoinData
}
]
},
options: {
responsive: true,
maintainAspectRatio: false,
tension: .4,
scales: {
y: {
suggestedMin: 6000,
suggestedMax: 20000
}
},
interaction: {
intersect: false,
},
plugins: {
tooltip: {
callbacks: {
label: function (context) {
return ' $' + context.parsed.y;
}
}
}
}
}
});
}
}
/*
* Init functionality
*
*/
static init() {
this.initChartsBitcoin();
}
}
// Initialize when page loads
Dashmix.onLoad(() => pageDashboardCrypto.init());

42
src/main/resources/static/assets/_js/pages/op_auth_lock.js

@ -0,0 +1,42 @@
/*
* Document : op_auth_lock.js
* Author : pixelcave
* Description: Custom JS code used in Lock Page
*/
class pageAuthLock {
/*
* Init Lock Form Validation, for more examples you can check out https://github.com/jzaefferer/jquery-validation
*
*/
static initValidation() {
// Load default options for jQuery Validation plugin
Dashmix.helpers('jq-validation');
// Init Form Validation
jQuery('.js-validation-lock').validate({
rules: {
'lock-password': {
required: true,
minlength: 3
}
},
messages: {
'lock-password': {
required: 'Please enter your valid password'
}
}
});
}
/*
* Init functionality
*
*/
static init() {
this.initValidation();
}
}
// Initialize when page loads
Dashmix.onLoad(() => pageAuthLock.init());

42
src/main/resources/static/assets/_js/pages/op_auth_reminder.js

@ -0,0 +1,42 @@
/*
* Document : op_auth_reminder.js
* Author : pixelcave
* Description: Custom JS code used in Password Reminder Page
*/
class pageAuthReminder {
/*
* Init Password Reminder Form Validation, for more examples you can check out https://github.com/jzaefferer/jquery-validation
*
*/
static initValidation() {
// Load default options for jQuery Validation plugin
Dashmix.helpers('jq-validation');
// Init Form Validation
jQuery('.js-validation-reminder').validate({
rules: {
'reminder-credential': {
required: true,
minlength: 3
}
},
messages: {
'reminder-credential': {
required: 'Please enter a valid credential'
}
}
});
}
/*
* Init functionality
*
*/
static init() {
this.initValidation();
}
}
// Initialize when page loads
Dashmix.onLoad(() => pageAuthReminder.init());

51
src/main/resources/static/assets/_js/pages/op_auth_signin.js

@ -0,0 +1,51 @@
/*
* Document : op_auth_signin.js
* Author : pixelcave
* Description: Custom JS code used in Sign In Page
*/
class pageAuthSignIn {
/*
* Init Sign In Form Validation, for more examples you can check out https://github.com/jzaefferer/jquery-validation
*
*/
static initValidation() {
// Load default options for jQuery Validation plugin
Dashmix.helpers('jq-validation');
// Init Form Validation
jQuery('.js-validation-signin').validate({
rules: {
'login-username': {
required: true,
minlength: 3
},
'login-password': {
required: true,
minlength: 5
}
},
messages: {
'login-username': {
required: 'Please enter a username',
minlength: 'Your username must consist of at least 3 characters'
},
'login-password': {
required: 'Please provide a password',
minlength: 'Your password must be at least 5 characters long'
}
}
});
}
/*
* Init functionality
*
*/
static init() {
this.initValidation();
}
}
// Initialize when page loads
Dashmix.onLoad(() => pageAuthSignIn.init());

69
src/main/resources/static/assets/_js/pages/op_auth_signup.js

@ -0,0 +1,69 @@
/*
* Document : op_auth_signup.js
* Author : pixelcave
* Description: Custom JS code used in Sign Up Page
*/
class pageAuthSignUp {
/*
* Init Sign Up Form Validation, for more examples you can check out https://github.com/jzaefferer/jquery-validation
*
*/
static initValidation() {
// Load default options for jQuery Validation plugin
Dashmix.helpers('jq-validation');
// Init Form Validation
jQuery('.js-validation-signup').validate({
rules: {
'signup-username': {
required: true,
minlength: 3
},
'signup-email': {
required: true,
emailWithDot: true
},
'signup-password': {
required: true,
minlength: 5
},
'signup-password-confirm': {
required: true,
equalTo: '#signup-password'
},
'signup-terms': {
required: true
}
},
messages: {
'signup-username': {
required: 'Please enter a username',
minlength: 'Your username must consist of at least 3 characters'
},
'signup-email': 'Please enter a valid email address',
'signup-password': {
required: 'Please provide a password',
minlength: 'Your password must be at least 5 characters long'
},
'signup-password-confirm': {
required: 'Please provide a password',
minlength: 'Your password must be at least 5 characters long',
equalTo: 'Please enter the same password as above'
},
'signup-terms': 'You must agree to the service terms!'
}
});
}
/*
* Init functionality
*
*/
static init() {
this.initValidation();
}
}
// Initialize when page loads
Dashmix.onLoad(() => pageAuthSignUp.init());

34
src/main/resources/static/assets/_js/pages/op_coming_soon.js

@ -0,0 +1,34 @@
/*
* Document : op_coming_soon.js
* Author : pixelcave
* Description: Custom JS code used in Coming Soon Page
*/
class pageComingSoon {
/*
* Init Countdown.js, for more examples you can check out https://github.com/hilios/jQuery.countdown
*
*/
static countdown() {
jQuery('.js-countdown').countdown((new Date().getFullYear() + 2) + '/02/01', e => {
jQuery(e.currentTarget).html(e.strftime('<div class="row items-push push text-center">'
+ '<div class="col-6 col-md-3"><div class="fs-1 fw-bold text-white">%-D</div><div class="fs-sm fw-bold text-muted">DAYS</div></div>'
+ '<div class="col-6 col-md-3"><div class="fs-1 fw-bold text-white">%H</div><div class="fs-sm fw-bold text-muted">HOURS</div></div>'
+ '<div class="col-6 col-md-3"><div class="fs-1 fw-bold text-white">%M</div><div class="fs-sm fw-bold text-muted">MINUTES</div></div>'
+ '<div class="col-6 col-md-3"><div class="fs-1 fw-bold text-white">%S</div><div class="fs-sm fw-bold text-muted">SECONDS</div></div>'
+ '</div>'
));
});
}
/*
* Init functionality
*
*/
static init() {
this.countdown();
}
}
// Initialize when page loads
Dashmix.onLoad(() => pageComingSoon.init());

78
src/main/resources/static/assets/_js/pages/op_installation.js

@ -0,0 +1,78 @@
/*
* Document : op_installation.js
* Author : pixelcave
* Description: Custom JS code used in Installation Page
*/
// Form Validation, for more examples you can check out https://github.com/jzaefferer/jquery-validation
class pageInstallation {
/*
* Init Installation Form Validation
*
*/
static initValidationInstallation() {
// Load default options for jQuery Validation plugin
Dashmix.helpers('jq-validation');
// Init Form Validation
jQuery('.js-validation-installation').validate({
rules: {
'install-db-name': {
required: true
},
'install-db-username': {
required: true
},
'install-db-password': {
required: true
},
'install-admin-email': {
required: true,
emailWithDot: true
},
'install-admin-password': {
required: true,
minlength: 5
},
'install-admin-password-confirm': {
required: true,
equalTo: '#install-admin-password'
}
},
messages: {
'install-db-name': {
required: 'Please provide the name of your database'
},
'install-db-username': {
required: 'Please provide the username with access to your database'
},
'install-db-password': {
required: 'Please provide the password of your database user'
},
'install-admin-email': {
required: 'Please enter your email'
},
'install-admin-password': {
required: 'Please provide a password',
minlength: 'Your password must be at least 5 characters long'
},
'install-admin-password-confirm': {
required: 'Please provide a password',
minlength: 'Your password must be at least 5 characters long',
equalTo: 'Please enter the same password as above'
}
}
});
}
/*
* Init functionality
*
*/
static init() {
this.initValidationInstallation();
}
}
// Initialize when page loads
Dashmix.onLoad(() => pageInstallation.init());

149
src/main/resources/static/assets/_scss/bootstrap/_accordion.scss

@ -0,0 +1,149 @@
//
// Base styles
//
.accordion {
// scss-docs-start accordion-css-vars
--#{$prefix}accordion-color: #{$accordion-color};
--#{$prefix}accordion-bg: #{$accordion-bg};
--#{$prefix}accordion-transition: #{$accordion-transition};
--#{$prefix}accordion-border-color: #{$accordion-border-color};
--#{$prefix}accordion-border-width: #{$accordion-border-width};
--#{$prefix}accordion-border-radius: #{$accordion-border-radius};
--#{$prefix}accordion-inner-border-radius: #{$accordion-inner-border-radius};
--#{$prefix}accordion-btn-padding-x: #{$accordion-button-padding-x};
--#{$prefix}accordion-btn-padding-y: #{$accordion-button-padding-y};
--#{$prefix}accordion-btn-color: #{$accordion-button-color};
--#{$prefix}accordion-btn-bg: #{$accordion-button-bg};
--#{$prefix}accordion-btn-icon: #{escape-svg($accordion-button-icon)};
--#{$prefix}accordion-btn-icon-width: #{$accordion-icon-width};
--#{$prefix}accordion-btn-icon-transform: #{$accordion-icon-transform};
--#{$prefix}accordion-btn-icon-transition: #{$accordion-icon-transition};
--#{$prefix}accordion-btn-active-icon: #{escape-svg($accordion-button-active-icon)};
--#{$prefix}accordion-btn-focus-border-color: #{$accordion-button-focus-border-color};
--#{$prefix}accordion-btn-focus-box-shadow: #{$accordion-button-focus-box-shadow};
--#{$prefix}accordion-body-padding-x: #{$accordion-body-padding-x};
--#{$prefix}accordion-body-padding-y: #{$accordion-body-padding-y};
--#{$prefix}accordion-active-color: #{$accordion-button-active-color};
--#{$prefix}accordion-active-bg: #{$accordion-button-active-bg};
// scss-docs-end accordion-css-vars
}
.accordion-button {
position: relative;
display: flex;
align-items: center;
width: 100%;
padding: var(--#{$prefix}accordion-btn-padding-y) var(--#{$prefix}accordion-btn-padding-x);
@include font-size($font-size-base);
color: var(--#{$prefix}accordion-btn-color);
text-align: left; // Reset button style
background-color: var(--#{$prefix}accordion-btn-bg);
border: 0;
@include border-radius(0);
overflow-anchor: none;
@include transition(var(--#{$prefix}accordion-transition));
&:not(.collapsed) {
color: var(--#{$prefix}accordion-active-color);
background-color: var(--#{$prefix}accordion-active-bg);
box-shadow: inset 0 calc(-1 * var(--#{$prefix}accordion-border-width)) 0 var(--#{$prefix}accordion-border-color); // stylelint-disable-line function-disallowed-list
&::after {
background-image: var(--#{$prefix}accordion-btn-active-icon);
transform: var(--#{$prefix}accordion-btn-icon-transform);
}
}
// Accordion icon
&::after {
flex-shrink: 0;
width: var(--#{$prefix}accordion-btn-icon-width);
height: var(--#{$prefix}accordion-btn-icon-width);
margin-left: auto;
content: "";
background-image: var(--#{$prefix}accordion-btn-icon);
background-repeat: no-repeat;
background-size: var(--#{$prefix}accordion-btn-icon-width);
@include transition(var(--#{$prefix}accordion-btn-icon-transition));
}
&:hover {
z-index: 2;
}
&:focus {
z-index: 3;
border-color: var(--#{$prefix}accordion-btn-focus-border-color);
outline: 0;
box-shadow: var(--#{$prefix}accordion-btn-focus-box-shadow);
}
}
.accordion-header {
margin-bottom: 0;
}
.accordion-item {
color: var(--#{$prefix}accordion-color);
background-color: var(--#{$prefix}accordion-bg);
border: var(--#{$prefix}accordion-border-width) solid var(--#{$prefix}accordion-border-color);
&:first-of-type {
@include border-top-radius(var(--#{$prefix}accordion-border-radius));
.accordion-button {
@include border-top-radius(var(--#{$prefix}accordion-inner-border-radius));
}
}
&:not(:first-of-type) {
border-top: 0;
}
// Only set a border-radius on the last item if the accordion is collapsed
&:last-of-type {
@include border-bottom-radius(var(--#{$prefix}accordion-border-radius));
.accordion-button {
&.collapsed {
@include border-bottom-radius(var(--#{$prefix}accordion-inner-border-radius));
}
}
.accordion-collapse {
@include border-bottom-radius(var(--#{$prefix}accordion-border-radius));
}
}
}
.accordion-body {
padding: var(--#{$prefix}accordion-body-padding-y) var(--#{$prefix}accordion-body-padding-x);
}
// Flush accordion items
//
// Remove borders and border-radius to keep accordion items edge-to-edge.
.accordion-flush {
.accordion-collapse {
border-width: 0;
}
.accordion-item {
border-right: 0;
border-left: 0;
@include border-radius(0);
&:first-child { border-top: 0; }
&:last-child { border-bottom: 0; }
.accordion-button {
&,
&.collapsed {
@include border-radius(0);
}
}
}
}

71
src/main/resources/static/assets/_scss/bootstrap/_alert.scss

@ -0,0 +1,71 @@
//
// Base styles
//
.alert {
// scss-docs-start alert-css-vars
--#{$prefix}alert-bg: transparent;
--#{$prefix}alert-padding-x: #{$alert-padding-x};
--#{$prefix}alert-padding-y: #{$alert-padding-y};
--#{$prefix}alert-margin-bottom: #{$alert-margin-bottom};
--#{$prefix}alert-color: inherit;
--#{$prefix}alert-border-color: transparent;
--#{$prefix}alert-border: #{$alert-border-width} solid var(--#{$prefix}alert-border-color);
--#{$prefix}alert-border-radius: #{$alert-border-radius};
// scss-docs-end alert-css-vars
position: relative;
padding: var(--#{$prefix}alert-padding-y) var(--#{$prefix}alert-padding-x);
margin-bottom: var(--#{$prefix}alert-margin-bottom);
color: var(--#{$prefix}alert-color);
background-color: var(--#{$prefix}alert-bg);
border: var(--#{$prefix}alert-border);
@include border-radius(var(--#{$prefix}alert-border-radius));
}
// Headings for larger alerts
.alert-heading {
// Specified to prevent conflicts of changing $headings-color
color: inherit;
}
// Provide class for links that match alerts
.alert-link {
font-weight: $alert-link-font-weight;
}
// Dismissible alerts
//
// Expand the right padding and account for the close button's positioning.
.alert-dismissible {
padding-right: $alert-dismissible-padding-r;
// Adjust close link position
.btn-close {
position: absolute;
top: 0;
right: 0;
z-index: $stretched-link-z-index + 1;
padding: $alert-padding-y * 1.25 $alert-padding-x;
}
}
// scss-docs-start alert-modifiers
// Generate contextual modifier classes for colorizing the alert.
@each $state, $value in $theme-colors {
$alert-background: shift-color($value, $alert-bg-scale);
$alert-border: shift-color($value, $alert-border-scale);
$alert-color: shift-color($value, $alert-color-scale);
@if (contrast-ratio($alert-background, $alert-color) < $min-contrast-ratio) {
$alert-color: mix($value, color-contrast($alert-background), abs($alert-color-scale));
}
.alert-#{$state} {
@include alert-variant($alert-background, $alert-border, $alert-color);
}
}
// scss-docs-end alert-modifiers

38
src/main/resources/static/assets/_scss/bootstrap/_badge.scss

@ -0,0 +1,38 @@
// Base class
//
// Requires one of the contextual, color modifier classes for `color` and
// `background-color`.
.badge {
// scss-docs-start badge-css-vars
--#{$prefix}badge-padding-x: #{$badge-padding-x};
--#{$prefix}badge-padding-y: #{$badge-padding-y};
@include rfs($badge-font-size, --#{$prefix}badge-font-size);
--#{$prefix}badge-font-weight: #{$badge-font-weight};
--#{$prefix}badge-color: #{$badge-color};
--#{$prefix}badge-border-radius: #{$badge-border-radius};
// scss-docs-end badge-css-vars
display: inline-block;
padding: var(--#{$prefix}badge-padding-y) var(--#{$prefix}badge-padding-x);
@include font-size(var(--#{$prefix}badge-font-size));
font-weight: var(--#{$prefix}badge-font-weight);
line-height: 1;
color: var(--#{$prefix}badge-color);
text-align: center;
white-space: nowrap;
vertical-align: baseline;
@include border-radius(var(--#{$prefix}badge-border-radius));
@include gradient-bg();
// Empty badges collapse automatically
&:empty {
display: none;
}
}
// Quick fix for badges in buttons
.btn .badge {
position: relative;
top: -1px;
}

40
src/main/resources/static/assets/_scss/bootstrap/_breadcrumb.scss

@ -0,0 +1,40 @@
.breadcrumb {
// scss-docs-start breadcrumb-css-vars
--#{$prefix}breadcrumb-padding-x: #{$breadcrumb-padding-x};
--#{$prefix}breadcrumb-padding-y: #{$breadcrumb-padding-y};
--#{$prefix}breadcrumb-margin-bottom: #{$breadcrumb-margin-bottom};
@include rfs($breadcrumb-font-size, --#{$prefix}breadcrumb-font-size);
--#{$prefix}breadcrumb-bg: #{$breadcrumb-bg};
--#{$prefix}breadcrumb-border-radius: #{$breadcrumb-border-radius};
--#{$prefix}breadcrumb-divider-color: #{$breadcrumb-divider-color};
--#{$prefix}breadcrumb-item-padding-x: #{$breadcrumb-item-padding-x};
--#{$prefix}breadcrumb-item-active-color: #{$breadcrumb-active-color};
// scss-docs-end breadcrumb-css-vars
display: flex;
flex-wrap: wrap;
padding: var(--#{$prefix}breadcrumb-padding-y) var(--#{$prefix}breadcrumb-padding-x);
margin-bottom: var(--#{$prefix}breadcrumb-margin-bottom);
@include font-size(var(--#{$prefix}breadcrumb-font-size));
list-style: none;
background-color: var(--#{$prefix}breadcrumb-bg);
@include border-radius(var(--#{$prefix}breadcrumb-border-radius));
}
.breadcrumb-item {
// The separator between breadcrumbs (by default, a forward-slash: "/")
+ .breadcrumb-item {
padding-left: var(--#{$prefix}breadcrumb-item-padding-x);
&::before {
float: left; // Suppress inline spacings and underlining of the separator
padding-right: var(--#{$prefix}breadcrumb-item-padding-x);
color: var(--#{$prefix}breadcrumb-divider-color);
content: var(--#{$prefix}breadcrumb-divider, escape-svg($breadcrumb-divider)) #{"/* rtl:"} var(--#{$prefix}breadcrumb-divider, escape-svg($breadcrumb-divider-flipped)) #{"*/"};
}
}
&.active {
color: var(--#{$prefix}breadcrumb-item-active-color);
}
}

142
src/main/resources/static/assets/_scss/bootstrap/_button-group.scss

@ -0,0 +1,142 @@
// Make the div behave like a button
.btn-group,
.btn-group-vertical {
position: relative;
display: inline-flex;
vertical-align: middle; // match .btn alignment given font-size hack above
> .btn {
position: relative;
flex: 1 1 auto;
}
// Bring the hover, focused, and "active" buttons to the front to overlay
// the borders properly
> .btn-check:checked + .btn,
> .btn-check:focus + .btn,
> .btn:hover,
> .btn:focus,
> .btn:active,
> .btn.active {
z-index: 1;
}
}
// Optional: Group multiple button groups together for a toolbar
.btn-toolbar {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
.input-group {
width: auto;
}
}
.btn-group {
@include border-radius($btn-border-radius);
// Prevent double borders when buttons are next to each other
> :not(.btn-check:first-child) + .btn,
> .btn-group:not(:first-child) {
margin-left: -$btn-border-width;
}
// Reset rounded corners
> .btn:not(:last-child):not(.dropdown-toggle),
> .btn.dropdown-toggle-split:first-child,
> .btn-group:not(:last-child) > .btn {
@include border-end-radius(0);
}
// The left radius should be 0 if the button is:
// - the "third or more" child
// - the second child and the previous element isn't `.btn-check` (making it the first child visually)
// - part of a btn-group which isn't the first child
> .btn:nth-child(n + 3),
> :not(.btn-check) + .btn,
> .btn-group:not(:first-child) > .btn {
@include border-start-radius(0);
}
}
// Sizing
//
// Remix the default button sizing classes into new ones for easier manipulation.
.btn-group-sm > .btn { @extend .btn-sm; }
.btn-group-lg > .btn { @extend .btn-lg; }
//
// Split button dropdowns
//
.dropdown-toggle-split {
padding-right: $btn-padding-x * .75;
padding-left: $btn-padding-x * .75;
&::after,
.dropup &::after,
.dropend &::after {
margin-left: 0;
}
.dropstart &::before {
margin-right: 0;
}
}
.btn-sm + .dropdown-toggle-split {
padding-right: $btn-padding-x-sm * .75;
padding-left: $btn-padding-x-sm * .75;
}
.btn-lg + .dropdown-toggle-split {
padding-right: $btn-padding-x-lg * .75;
padding-left: $btn-padding-x-lg * .75;
}
// The clickable button for toggling the menu
// Set the same inset shadow as the :active state
.btn-group.show .dropdown-toggle {
@include box-shadow($btn-active-box-shadow);
// Show no shadow for `.btn-link` since it has no other button styles.
&.btn-link {
@include box-shadow(none);
}
}
//
// Vertical button groups
//
.btn-group-vertical {
flex-direction: column;
align-items: flex-start;
justify-content: center;
> .btn,
> .btn-group {
width: 100%;
}
> .btn:not(:first-child),
> .btn-group:not(:first-child) {
margin-top: -$btn-border-width;
}
// Reset rounded corners
> .btn:not(:last-child):not(.dropdown-toggle),
> .btn-group:not(:last-child) > .btn {
@include border-bottom-radius(0);
}
> .btn ~ .btn,
> .btn-group:not(:first-child) > .btn {
@include border-top-radius(0);
}
}

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

Loading…
Cancel
Save