Browse Source

first commit

master
hariprakash 3 years ago
commit
2ba7eb98a0
  1. BIN
      .DS_Store
  2. 32
      .classpath
  3. 23
      .project
  4. 4
      .settings/org.eclipse.core.resources.prefs
  5. 9
      .settings/org.eclipse.jdt.core.prefs
  6. 4
      .settings/org.eclipse.m2e.core.prefs
  7. 30
      HELP.md
  8. BIN
      bin/.DS_Store
  9. 33
      bin/.gitignore
  10. BIN
      bin/.mvn/wrapper/maven-wrapper.jar
  11. 2
      bin/.mvn/wrapper/maven-wrapper.properties
  12. 308
      bin/mvnw
  13. 205
      bin/mvnw.cmd
  14. 68
      bin/pom.xml
  15. BIN
      bin/src/main/java/in/gov/chennaicorporation/CM/Dashboard2/CmDashboard2Application.class
  16. 1
      bin/src/main/resources/application.properties
  17. BIN
      bin/src/test/java/in/gov/chennaicorporation/CM/Dashboard2/CmDashboard2ApplicationTests.class
  18. 25
      gccoffice.iml
  19. BIN
      gccoffice_uploads/.DS_Store
  20. BIN
      gccoffice_uploads/pan-card.jpeg
  21. BIN
      gccoffice_uploads/user-1.jpeg
  22. BIN
      gccoffice_uploads/userimg/.DS_Store
  23. BIN
      gccoffice_uploads/userimg/my.jpeg
  24. 308
      mvnw
  25. 205
      mvnw.cmd
  26. 102
      pom.xml
  27. BIN
      src/.DS_Store
  28. BIN
      src/main/.DS_Store
  29. BIN
      src/main/java/.DS_Store
  30. BIN
      src/main/java/in/.DS_Store
  31. BIN
      src/main/java/in/gov/.DS_Store
  32. BIN
      src/main/java/in/gov/chennaicorporation/.DS_Store
  33. BIN
      src/main/java/in/gov/chennaicorporation/gccoffice/.DS_Store
  34. 34
      src/main/java/in/gov/chennaicorporation/gccoffice/Circular/Controller/CircularAPIController.java
  35. 23
      src/main/java/in/gov/chennaicorporation/gccoffice/Circular/Controller/MainController.java
  36. 42
      src/main/java/in/gov/chennaicorporation/gccoffice/Circular/DBConnection/DBConnection.java
  37. 33
      src/main/java/in/gov/chennaicorporation/gccoffice/Circular/Dto/Departments.java
  38. 15
      src/main/java/in/gov/chennaicorporation/gccoffice/Circular/Repository/CircularRepository.java
  39. 124
      src/main/java/in/gov/chennaicorporation/gccoffice/Circular/Service/CircularService.java
  40. 24
      src/main/java/in/gov/chennaicorporation/gccoffice/GccOfficeApplication.java
  41. 23
      src/main/java/in/gov/chennaicorporation/gccoffice/configuration/AppConfig.java
  42. 111
      src/main/java/in/gov/chennaicorporation/gccoffice/configuration/DataSourceConfig.java
  43. 17
      src/main/java/in/gov/chennaicorporation/gccoffice/configuration/JacksonConfiguration.java
  44. 72
      src/main/java/in/gov/chennaicorporation/gccoffice/configuration/SecurityConfig.java
  45. 20
      src/main/java/in/gov/chennaicorporation/gccoffice/configuration/ThymeleafConfig.java
  46. 66
      src/main/java/in/gov/chennaicorporation/gccoffice/configuration/WebMvcConfig.java
  47. 10
      src/main/java/in/gov/chennaicorporation/gccoffice/controller/APIController.java
  48. 112
      src/main/java/in/gov/chennaicorporation/gccoffice/controller/CustomErrorController.java
  49. 33
      src/main/java/in/gov/chennaicorporation/gccoffice/controller/MainController.java
  50. 151
      src/main/java/in/gov/chennaicorporation/gccoffice/controller/MenuController.java
  51. 13
      src/main/java/in/gov/chennaicorporation/gccoffice/controller/login.java
  52. BIN
      src/main/java/in/gov/chennaicorporation/gccoffice/entity/.DS_Store
  53. 115
      src/main/java/in/gov/chennaicorporation/gccoffice/entity/AppModuleAccessEntity.java
  54. 126
      src/main/java/in/gov/chennaicorporation/gccoffice/entity/AppModuleEntity.java
  55. 153
      src/main/java/in/gov/chennaicorporation/gccoffice/entity/AppUserEntity.java
  56. 113
      src/main/java/in/gov/chennaicorporation/gccoffice/entity/AppUserGroupEntity.java
  57. 128
      src/main/java/in/gov/chennaicorporation/gccoffice/entity/MenuItemAccessEntity.java
  58. 153
      src/main/java/in/gov/chennaicorporation/gccoffice/entity/MenuItemEntity.java
  59. 143
      src/main/java/in/gov/chennaicorporation/gccoffice/entity/SubMenuItemAccessEntity.java
  60. 155
      src/main/java/in/gov/chennaicorporation/gccoffice/entity/SubMenuItemEntity.java
  61. 108
      src/main/java/in/gov/chennaicorporation/gccoffice/entity/UserInfoEntity.java
  62. BIN
      src/main/java/in/gov/chennaicorporation/gccoffice/garbagecollection/.DS_Store
  63. 59
      src/main/java/in/gov/chennaicorporation/gccoffice/garbagecollection/controller/APIController.java
  64. 81
      src/main/java/in/gov/chennaicorporation/gccoffice/garbagecollection/controller/MainController.java
  65. BIN
      src/main/java/in/gov/chennaicorporation/gccoffice/garbagecollection/modeldata/.DS_Store
  66. 242
      src/main/java/in/gov/chennaicorporation/gccoffice/garbagecollection/modeldata/Request.java
  67. 100
      src/main/java/in/gov/chennaicorporation/gccoffice/garbagecollection/modeldata/RequestStatus.java
  68. 279
      src/main/java/in/gov/chennaicorporation/gccoffice/interceptor/AppInterceptor.java
  69. 63
      src/main/java/in/gov/chennaicorporation/gccoffice/modeldata/Employee.java
  70. 55
      src/main/java/in/gov/chennaicorporation/gccoffice/modeldata/ErrorResponse.java
  71. 119
      src/main/java/in/gov/chennaicorporation/gccoffice/mtm/controller/APIController.java
  72. 46
      src/main/java/in/gov/chennaicorporation/gccoffice/mtm/controller/MainController.java
  73. 276
      src/main/java/in/gov/chennaicorporation/gccoffice/mtm/controller/MayorController.java
  74. 46
      src/main/java/in/gov/chennaicorporation/gccoffice/mtm/controller/OfficerController.java
  75. 1
      src/main/java/in/gov/chennaicorporation/gccoffice/mtm/controller/package-info.java
  76. 191
      src/main/java/in/gov/chennaicorporation/gccoffice/mtm/data/MTMOfficer.java
  77. 83
      src/main/java/in/gov/chennaicorporation/gccoffice/mtm/data/MtmComplaintTypes.java
  78. 226
      src/main/java/in/gov/chennaicorporation/gccoffice/mtm/data/MtmEvent.java
  79. 472
      src/main/java/in/gov/chennaicorporation/gccoffice/mtm/data/Petition.java
  80. 461
      src/main/java/in/gov/chennaicorporation/gccoffice/mtm/data/PetitionComplaint.java
  81. 1
      src/main/java/in/gov/chennaicorporation/gccoffice/mtm/data/package-info.java
  82. 1
      src/main/java/in/gov/chennaicorporation/gccoffice/mtm/package-info.java
  83. 82
      src/main/java/in/gov/chennaicorporation/gccoffice/petregistration/controller/APIController.java
  84. 168
      src/main/java/in/gov/chennaicorporation/gccoffice/petregistration/controller/MainController.java
  85. 46
      src/main/java/in/gov/chennaicorporation/gccoffice/petregistration/data/PetCountInfo.java
  86. 150
      src/main/java/in/gov/chennaicorporation/gccoffice/petregistration/data/RequestList.java
  87. 15
      src/main/java/in/gov/chennaicorporation/gccoffice/petregistration/data/ResponseWrapper.java
  88. 1
      src/main/java/in/gov/chennaicorporation/gccoffice/petregistration/data/package-info.java
  89. 1
      src/main/java/in/gov/chennaicorporation/gccoffice/petregistration/package-info.java
  90. 5
      src/main/java/in/gov/chennaicorporation/gccoffice/petregistration/service/API.java
  91. 209
      src/main/java/in/gov/chennaicorporation/gccoffice/qrassetfeedback/controller/APIController.java
  92. 127
      src/main/java/in/gov/chennaicorporation/gccoffice/qrassetfeedback/controller/MainController.java
  93. 301
      src/main/java/in/gov/chennaicorporation/gccoffice/qrassetfeedback/data/Asset.java
  94. 82
      src/main/java/in/gov/chennaicorporation/gccoffice/qrassetfeedback/data/AssetCategory.java
  95. 195
      src/main/java/in/gov/chennaicorporation/gccoffice/qrassetfeedback/data/AssetCategoryQuestion.java
  96. 123
      src/main/java/in/gov/chennaicorporation/gccoffice/qrassetfeedback/data/AssetParameter.java
  97. 276
      src/main/java/in/gov/chennaicorporation/gccoffice/qrassetfeedback/data/AssetParameterQuestions.java
  98. 357
      src/main/java/in/gov/chennaicorporation/gccoffice/qrassetfeedback/data/AssetQuestion.java
  99. 290
      src/main/java/in/gov/chennaicorporation/gccoffice/qrassetfeedback/data/Feedback.java
  100. 1
      src/main/java/in/gov/chennaicorporation/gccoffice/qrassetfeedback/package-info.java

BIN
.DS_Store

32
.classpath

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

23
.project

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>gccoffice</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>

4
.settings/org.eclipse.core.resources.prefs

@ -0,0 +1,4 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding/<project>=UTF-8

9
.settings/org.eclipse.jdt.core.prefs

@ -0,0 +1,9 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.methodParameters=generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=17

4
.settings/org.eclipse.m2e.core.prefs

@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

30
HELP.md

@ -0,0 +1,30 @@
# Read Me First
The following was discovered as part of building this project:
* The JVM level was changed from '1.8' to '17', review the [JDK Version Range](https://github.com/spring-projects/spring-framework/wiki/Spring-Framework-Versions#jdk-version-range) on the wiki for more details.
* The original package name 'in.gov.chennaicorporation.CM Dashboard2' is invalid and this project uses 'in.gov.chennaicorporation.CM.Dashboard2' instead.
# Getting Started
### Reference Documentation
For further reference, please consider the following sections:
* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)
* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/3.1.1/maven-plugin/reference/html/)
* [Create an OCI image](https://docs.spring.io/spring-boot/docs/3.1.1/maven-plugin/reference/html/#build-image)
* [Spring Security](https://docs.spring.io/spring-boot/docs/3.1.1/reference/htmlsingle/#web.security)
* [Thymeleaf](https://docs.spring.io/spring-boot/docs/3.1.1/reference/htmlsingle/#web.servlet.spring-mvc.template-engines)
* [Spring Web](https://docs.spring.io/spring-boot/docs/3.1.1/reference/htmlsingle/#web)
### Guides
The following guides illustrate how to use some features concretely:
* [Accessing data with MySQL](https://spring.io/guides/gs/accessing-data-mysql/)
* [Securing a Web Application](https://spring.io/guides/gs/securing-web/)
* [Spring Boot and OAuth2](https://spring.io/guides/tutorials/spring-boot-oauth2/)
* [Authenticating a User with LDAP](https://spring.io/guides/gs/authenticating-ldap/)
* [Handling Form Submission](https://spring.io/guides/gs/handling-form-submission/)
* [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/)
* [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/)
* [Building REST services with Spring](https://spring.io/guides/tutorials/rest/)

BIN
bin/.DS_Store

33
bin/.gitignore

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

BIN
bin/.mvn/wrapper/maven-wrapper.jar

2
bin/.mvn/wrapper/maven-wrapper.properties

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

308
bin/mvnw

@ -0,0 +1,308 @@
#!/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.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Apache Maven Wrapper startup batch script, version 3.2.0
#
# Required ENV vars:
# ------------------
# JAVA_HOME - location of a JDK home dir
#
# Optional ENV vars
# -----------------
# 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
JAVA_HOME="$(/usr/libexec/java_home)"; export JAVA_HOME
else
JAVA_HOME="/Library/Java/Home"; export JAVA_HOME
fi
fi
;;
esac
if [ -z "$JAVA_HOME" ] ; then
if [ -r /etc/gentoo-release ] ; then
JAVA_HOME=$(java-config --jre-home)
fi
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
[ -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 "$JAVA_HOME" ] && [ -d "$JAVA_HOME" ] &&
JAVA_HOME="$(cd "$JAVA_HOME" || (echo "cannot cd into $JAVA_HOME."; exit 1); 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 2>/dev/null; \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
# 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/.." || exit 1; pwd)
fi
# end of workaround
done
printf '%s' "$(cd "$basedir" || exit 1; pwd)"
}
# concatenates all lines of a file
concat_lines() {
if [ -f "$1" ]; then
# Remove \r in case we run on Windows within Git Bash
# and check out the repository with auto CRLF management
# enabled. Otherwise, we may read lines that are delimited with
# \r\n and produce $'-Xarg\r' rather than -Xarg due to word
# splitting rules.
tr -s '\r\n' ' ' < "$1"
fi
}
log() {
if [ "$MVNW_VERBOSE" = true ]; then
printf '%s\n' "$1"
fi
}
BASE_DIR=$(find_maven_basedir "$(dirname "$0")")
if [ -z "$BASE_DIR" ]; then
exit 1;
fi
MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}; export MAVEN_PROJECTBASEDIR
log "$MAVEN_PROJECTBASEDIR"
##########################################################################################
# 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.
##########################################################################################
wrapperJarPath="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar"
if [ -r "$wrapperJarPath" ]; then
log "Found $wrapperJarPath"
else
log "Couldn't find $wrapperJarPath, downloading it ..."
if [ -n "$MVNW_REPOURL" ]; then
wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
else
wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
fi
while IFS="=" read -r key value; do
# Remove '\r' from value to allow usage on windows as IFS does not consider '\r' as a separator ( considers space, tab, new line ('\n'), and custom '=' )
safeValue=$(echo "$value" | tr -d '\r')
case "$key" in (wrapperUrl) wrapperUrl="$safeValue"; break ;;
esac
done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties"
log "Downloading from: $wrapperUrl"
if $cygwin; then
wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath")
fi
if command -v wget > /dev/null; then
log "Found wget ... using wget"
[ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--quiet"
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
wget $QUIET "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
else
wget $QUIET --http-user="$MVNW_USERNAME" --http-password="$MVNW_PASSWORD" "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
fi
elif command -v curl > /dev/null; then
log "Found curl ... using curl"
[ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--silent"
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
curl $QUIET -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath"
else
curl $QUIET --user "$MVNW_USERNAME:$MVNW_PASSWORD" -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath"
fi
else
log "Falling back to using Java to download"
javaSource="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.java"
javaClass="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.class"
# For Cygwin, switch paths to Windows format before running javac
if $cygwin; then
javaSource=$(cygpath --path --windows "$javaSource")
javaClass=$(cygpath --path --windows "$javaClass")
fi
if [ -e "$javaSource" ]; then
if [ ! -e "$javaClass" ]; then
log " - Compiling MavenWrapperDownloader.java ..."
("$JAVA_HOME/bin/javac" "$javaSource")
fi
if [ -e "$javaClass" ]; then
log " - Running MavenWrapperDownloader.java ..."
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$wrapperUrl" "$wrapperJarPath") || rm -f "$wrapperJarPath"
fi
fi
fi
fi
##########################################################################################
# End of extension
##########################################################################################
# If specified, validate the SHA-256 sum of the Maven wrapper jar file
wrapperSha256Sum=""
while IFS="=" read -r key value; do
case "$key" in (wrapperSha256Sum) wrapperSha256Sum=$value; break ;;
esac
done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties"
if [ -n "$wrapperSha256Sum" ]; then
wrapperSha256Result=false
if command -v sha256sum > /dev/null; then
if echo "$wrapperSha256Sum $wrapperJarPath" | sha256sum -c > /dev/null 2>&1; then
wrapperSha256Result=true
fi
elif command -v shasum > /dev/null; then
if echo "$wrapperSha256Sum $wrapperJarPath" | shasum -a 256 -c > /dev/null 2>&1; then
wrapperSha256Result=true
fi
else
echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available."
echo "Please install either command, or disable validation by removing 'wrapperSha256Sum' from your maven-wrapper.properties."
exit 1
fi
if [ $wrapperSha256Result = false ]; then
echo "Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised." >&2
echo "Investigate or delete $wrapperJarPath to attempt a clean download." >&2
echo "If you updated your Maven version, you need to update the specified wrapperSha256Sum property." >&2
exit 1
fi
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 "$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
# shellcheck disable=SC2086 # safe args
exec "$JAVACMD" \
$MAVEN_OPTS \
$MAVEN_DEBUG_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
"-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

205
bin/mvnw.cmd

@ -0,0 +1,205 @@
@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 Apache Maven Wrapper startup batch script, version 3.2.0
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@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 WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
IF "%%A"=="wrapperUrl" SET WRAPPER_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 WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
)
if "%MVNW_VERBOSE%" == "true" (
echo Couldn't find %WRAPPER_JAR%, downloading it ...
echo Downloading from: %WRAPPER_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('%WRAPPER_URL%', '%WRAPPER_JAR%')"^
"}"
if "%MVNW_VERBOSE%" == "true" (
echo Finished downloading %WRAPPER_JAR%
)
)
@REM End of extension
@REM If specified, validate the SHA-256 sum of the Maven wrapper jar file
SET WRAPPER_SHA_256_SUM=""
FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
IF "%%A"=="wrapperSha256Sum" SET WRAPPER_SHA_256_SUM=%%B
)
IF NOT %WRAPPER_SHA_256_SUM%=="" (
powershell -Command "&{"^
"$hash = (Get-FileHash \"%WRAPPER_JAR%\" -Algorithm SHA256).Hash.ToLower();"^
"If('%WRAPPER_SHA_256_SUM%' -ne $hash){"^
" Write-Output 'Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised.';"^
" Write-Output 'Investigate or delete %WRAPPER_JAR% to attempt a clean download.';"^
" Write-Output 'If you updated your Maven version, you need to update the specified wrapperSha256Sum property.';"^
" exit 1;"^
"}"^
"}"
if ERRORLEVEL 1 goto error
)
@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%

68
bin/pom.xml

@ -0,0 +1,68 @@
<?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.1.1</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>in.gov.chennaicorporation</groupId>
<artifactId>CM-Dashboard2</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>CM-Dashboard2</name>
<description>CM Dashboard API</description>
<properties>
<java.version>17</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</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.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-springsecurity6</artifactId>
</dependency>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

BIN
bin/src/main/java/in/gov/chennaicorporation/CM/Dashboard2/CmDashboard2Application.class

1
bin/src/main/resources/application.properties

@ -0,0 +1 @@

BIN
bin/src/test/java/in/gov/chennaicorporation/CM/Dashboard2/CmDashboard2ApplicationTests.class

25
gccoffice.iml

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="EclipseModuleManager">
<conelement value="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER" />
<src_description expected_position="0">
<src_folder value="file://$MODULE_DIR$/src/main/java" expected_position="0" />
<src_folder value="file://$MODULE_DIR$/src/main/resources" expected_position="1" />
<src_folder value="file://$MODULE_DIR$/src/test/java" expected_position="2" />
<src_folder value="file://$MODULE_DIR$/src/test/resources" expected_position="3" />
</src_description>
</component>
<component name="NewModuleRootManager">
<output url="file://$MODULE_DIR$/target/classes" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" isTestSource="false" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="jdk" jdkName="JavaSE-17" jdkType="JavaSDK" />
<orderEntry type="library" name="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER" level="application" />
</component>
</module>

BIN
gccoffice_uploads/.DS_Store

BIN
gccoffice_uploads/pan-card.jpeg

After

Width: 500  |  Height: 339  |  Size: 38 KiB

BIN
gccoffice_uploads/user-1.jpeg

After

Width: 1000  |  Height: 1000  |  Size: 90 KiB

BIN
gccoffice_uploads/userimg/.DS_Store

BIN
gccoffice_uploads/userimg/my.jpeg

After

Width: 1000  |  Height: 1000  |  Size: 90 KiB

308
mvnw

@ -0,0 +1,308 @@
#!/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.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Apache Maven Wrapper startup batch script, version 3.2.0
#
# Required ENV vars:
# ------------------
# JAVA_HOME - location of a JDK home dir
#
# Optional ENV vars
# -----------------
# 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
JAVA_HOME="$(/usr/libexec/java_home)"; export JAVA_HOME
else
JAVA_HOME="/Library/Java/Home"; export JAVA_HOME
fi
fi
;;
esac
if [ -z "$JAVA_HOME" ] ; then
if [ -r /etc/gentoo-release ] ; then
JAVA_HOME=$(java-config --jre-home)
fi
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
[ -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 "$JAVA_HOME" ] && [ -d "$JAVA_HOME" ] &&
JAVA_HOME="$(cd "$JAVA_HOME" || (echo "cannot cd into $JAVA_HOME."; exit 1); 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 2>/dev/null; \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
# 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/.." || exit 1; pwd)
fi
# end of workaround
done
printf '%s' "$(cd "$basedir" || exit 1; pwd)"
}
# concatenates all lines of a file
concat_lines() {
if [ -f "$1" ]; then
# Remove \r in case we run on Windows within Git Bash
# and check out the repository with auto CRLF management
# enabled. Otherwise, we may read lines that are delimited with
# \r\n and produce $'-Xarg\r' rather than -Xarg due to word
# splitting rules.
tr -s '\r\n' ' ' < "$1"
fi
}
log() {
if [ "$MVNW_VERBOSE" = true ]; then
printf '%s\n' "$1"
fi
}
BASE_DIR=$(find_maven_basedir "$(dirname "$0")")
if [ -z "$BASE_DIR" ]; then
exit 1;
fi
MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}; export MAVEN_PROJECTBASEDIR
log "$MAVEN_PROJECTBASEDIR"
##########################################################################################
# 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.
##########################################################################################
wrapperJarPath="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar"
if [ -r "$wrapperJarPath" ]; then
log "Found $wrapperJarPath"
else
log "Couldn't find $wrapperJarPath, downloading it ..."
if [ -n "$MVNW_REPOURL" ]; then
wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
else
wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
fi
while IFS="=" read -r key value; do
# Remove '\r' from value to allow usage on windows as IFS does not consider '\r' as a separator ( considers space, tab, new line ('\n'), and custom '=' )
safeValue=$(echo "$value" | tr -d '\r')
case "$key" in (wrapperUrl) wrapperUrl="$safeValue"; break ;;
esac
done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties"
log "Downloading from: $wrapperUrl"
if $cygwin; then
wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath")
fi
if command -v wget > /dev/null; then
log "Found wget ... using wget"
[ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--quiet"
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
wget $QUIET "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
else
wget $QUIET --http-user="$MVNW_USERNAME" --http-password="$MVNW_PASSWORD" "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
fi
elif command -v curl > /dev/null; then
log "Found curl ... using curl"
[ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--silent"
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
curl $QUIET -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath"
else
curl $QUIET --user "$MVNW_USERNAME:$MVNW_PASSWORD" -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath"
fi
else
log "Falling back to using Java to download"
javaSource="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.java"
javaClass="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.class"
# For Cygwin, switch paths to Windows format before running javac
if $cygwin; then
javaSource=$(cygpath --path --windows "$javaSource")
javaClass=$(cygpath --path --windows "$javaClass")
fi
if [ -e "$javaSource" ]; then
if [ ! -e "$javaClass" ]; then
log " - Compiling MavenWrapperDownloader.java ..."
("$JAVA_HOME/bin/javac" "$javaSource")
fi
if [ -e "$javaClass" ]; then
log " - Running MavenWrapperDownloader.java ..."
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$wrapperUrl" "$wrapperJarPath") || rm -f "$wrapperJarPath"
fi
fi
fi
fi
##########################################################################################
# End of extension
##########################################################################################
# If specified, validate the SHA-256 sum of the Maven wrapper jar file
wrapperSha256Sum=""
while IFS="=" read -r key value; do
case "$key" in (wrapperSha256Sum) wrapperSha256Sum=$value; break ;;
esac
done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties"
if [ -n "$wrapperSha256Sum" ]; then
wrapperSha256Result=false
if command -v sha256sum > /dev/null; then
if echo "$wrapperSha256Sum $wrapperJarPath" | sha256sum -c > /dev/null 2>&1; then
wrapperSha256Result=true
fi
elif command -v shasum > /dev/null; then
if echo "$wrapperSha256Sum $wrapperJarPath" | shasum -a 256 -c > /dev/null 2>&1; then
wrapperSha256Result=true
fi
else
echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available."
echo "Please install either command, or disable validation by removing 'wrapperSha256Sum' from your maven-wrapper.properties."
exit 1
fi
if [ $wrapperSha256Result = false ]; then
echo "Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised." >&2
echo "Investigate or delete $wrapperJarPath to attempt a clean download." >&2
echo "If you updated your Maven version, you need to update the specified wrapperSha256Sum property." >&2
exit 1
fi
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 "$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
# shellcheck disable=SC2086 # safe args
exec "$JAVACMD" \
$MAVEN_OPTS \
$MAVEN_DEBUG_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
"-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

205
mvnw.cmd

@ -0,0 +1,205 @@
@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 Apache Maven Wrapper startup batch script, version 3.2.0
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@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 WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
IF "%%A"=="wrapperUrl" SET WRAPPER_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 WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
)
if "%MVNW_VERBOSE%" == "true" (
echo Couldn't find %WRAPPER_JAR%, downloading it ...
echo Downloading from: %WRAPPER_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('%WRAPPER_URL%', '%WRAPPER_JAR%')"^
"}"
if "%MVNW_VERBOSE%" == "true" (
echo Finished downloading %WRAPPER_JAR%
)
)
@REM End of extension
@REM If specified, validate the SHA-256 sum of the Maven wrapper jar file
SET WRAPPER_SHA_256_SUM=""
FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
IF "%%A"=="wrapperSha256Sum" SET WRAPPER_SHA_256_SUM=%%B
)
IF NOT %WRAPPER_SHA_256_SUM%=="" (
powershell -Command "&{"^
"$hash = (Get-FileHash \"%WRAPPER_JAR%\" -Algorithm SHA256).Hash.ToLower();"^
"If('%WRAPPER_SHA_256_SUM%' -ne $hash){"^
" Write-Output 'Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised.';"^
" Write-Output 'Investigate or delete %WRAPPER_JAR% to attempt a clean download.';"^
" Write-Output 'If you updated your Maven version, you need to update the specified wrapperSha256Sum property.';"^
" exit 1;"^
"}"^
"}"
if ERRORLEVEL 1 goto error
)
@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%

102
pom.xml

@ -0,0 +1,102 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.4</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<!--<packaging>war</packaging>-->
<groupId>in.gov.chennaicorporation</groupId>
<artifactId>gccoffice</artifactId>
<version>0.0.1</version>
<name>GCC OFFICE</name>
<description>GCC Applications and Dashboard</description>
<properties>
<java.version>17</java.version>
<bootstrap.version>4.0.0-2</bootstrap.version>
<webjars-locator.version>0.30</webjars-locator.version>
<lombok.version>1.18.2</lombok.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</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.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-springsecurity6</artifactId>
<version>3.1.1.RELEASE</version> <!-- Replace with the appropriate version -->
</dependency>
<!-- Spring Boot Starter Data JPA -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<version>8.0.33</version> <!-- Replace with the appropriate version -->
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
<scope>runtime</scope>
</dependency>
<!-- Use jakarta.persistence -->
<dependency>
<groupId>jakarta.persistence</groupId>
<artifactId>jakarta.persistence-api</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<!--
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
-->
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

BIN
src/.DS_Store

BIN
src/main/.DS_Store

BIN
src/main/java/.DS_Store

BIN
src/main/java/in/.DS_Store

BIN
src/main/java/in/gov/.DS_Store

BIN
src/main/java/in/gov/chennaicorporation/.DS_Store

BIN
src/main/java/in/gov/chennaicorporation/gccoffice/.DS_Store

34
src/main/java/in/gov/chennaicorporation/gccoffice/Circular/Controller/CircularAPIController.java

@ -0,0 +1,34 @@
package in.gov.chennaicorporation.gccoffice.Circular.Controller;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import in.gov.chennaicorporation.gccoffice.Circular.Dto.Departments;
import in.gov.chennaicorporation.gccoffice.Circular.Service.CircularService;
@RestController
@RequestMapping("api/Circular")
public class CircularAPIController {
@Autowired
CircularService circularService;
@GetMapping(value="/getDepartment")
public List<Departments> getAllDepartments() {
return circularService.getAllDepartments();
}
// @GetMapping(value="/getInbox")
// public List<Map<String, Object>> getInbox() {
// return circularService.getInbox();
// }
@GetMapping(value="/getInbox")
public List<Object[]> getInbox() {
return circularService.getInbox();
}
}

23
src/main/java/in/gov/chennaicorporation/gccoffice/Circular/Controller/MainController.java

@ -0,0 +1,23 @@
package in.gov.chennaicorporation.gccoffice.Circular.Controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping("Circular")
public class MainController {
@GetMapping(value="/new")
public String getCircular() {
return "modules/Circular/CreateCircular";
}
@GetMapping(value="/inbox")
public String getCircularInbox() {
return "modules/Circular/CircularInbox";
}
@GetMapping(value="/report")
public String getCircularReport() {
return "modules/Circular/CircularReport";
}
}

42
src/main/java/in/gov/chennaicorporation/gccoffice/Circular/DBConnection/DBConnection.java

@ -0,0 +1,42 @@
package in.gov.chennaicorporation.gccoffice.Circular.DBConnection;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import org.springframework.stereotype.Component;
@Component
public class DBConnection {
private static Connection dbcon;
private static final String l_sUrl = "jdbc:oracle:thin:@10.1.0.14:1521:chncorp";
private static final String user = "coc_mis";
private static final String password = "coc_mis";
public static Connection getConnection() {
try {
Connection pgr_Con = DriverManager.getConnection(l_sUrl, user, password);
System.out.println("pgr_conn Con :" + l_sUrl);
dbcon = pgr_Con;
return pgr_Con;
} catch (SQLException e) {
e.printStackTrace();
}
return dbcon;
}
}

33
src/main/java/in/gov/chennaicorporation/gccoffice/Circular/Dto/Departments.java

@ -0,0 +1,33 @@
package in.gov.chennaicorporation.gccoffice.Circular.Dto;
import org.springframework.stereotype.Component;
@Component
public class Departments {
private int DEPT_ID;
private String DEPT_DESC;
public int getDEPT_ID() {
return DEPT_ID;
}
public void setDEPT_ID(int dEPT_ID) {
DEPT_ID = dEPT_ID;
}
public String getDEPT_DESC() {
return DEPT_DESC;
}
public void setDEPT_DESC(String dEPT_DESC) {
DEPT_DESC = dEPT_DESC;
}
public Departments(int dEPT_ID, String dEPT_DESC) {
super();
DEPT_ID = dEPT_ID;
DEPT_DESC = dEPT_DESC;
}
public Departments() {
super();
// TODO Auto-generated constructor stub
}
}

15
src/main/java/in/gov/chennaicorporation/gccoffice/Circular/Repository/CircularRepository.java

@ -0,0 +1,15 @@
//package in.gov.chennaicorporation.gccoffice.Circular.Repository;
//
//import java.util.List;
//
//import org.springframework.data.jpa.repository.Query;
//
//import in.gov.chennaicorporation.gccoffice.Circular.Dto.Departments;
//
//public interface CircularRepository {
//
//
//// @Query(value="select dept_id,dept_desc from department order by ORDER_ID")
//// List<Departments> getAllDepartments();
//
//}

124
src/main/java/in/gov/chennaicorporation/gccoffice/Circular/Service/CircularService.java

@ -0,0 +1,124 @@
package in.gov.chennaicorporation.gccoffice.Circular.Service;
import java.sql.Statement;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import in.gov.chennaicorporation.gccoffice.Circular.DBConnection.DBConnection;
import in.gov.chennaicorporation.gccoffice.Circular.Dto.Departments;
//import in.gov.chennaicorporation.gccoffice.Circular.Repository.CircularRepository;
@Service
public class CircularService {
@Autowired
DBConnection dBConnection;
// @Autowired
// CircularRepository circularRepository;
public String getDepartmentQuery() {
String sQry;
sQry = "select dept_id,dept_desc from department order by ORDER_ID";
return sQry;
}
public List<Departments> getAllDepartments() {
List<Departments> data= new ArrayList<>();
Connection con = DBConnection.getConnection();
Statement stmt;
try {
stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(getDepartmentQuery());
System.out.println("RS = "+rs);
while(rs.next()) {
int id = rs.getInt("DEPT_ID");
String name = rs.getNString("DEPT_DESC");
Departments dep = new Departments(id,name);
data.add(dep);
}
return data;
}
catch (Exception e) {
e.printStackTrace();
}
return null;
}
public String getinboxQuery() {
String sQry1;
sQry1="SELECT to_char(x.FDATE,'dd/mm/yyyy') FDATE,DEPT_DESC,nvl(SUBJECT,' ') SUBJECT,FILEPATH,to_char(x.CDATE,'dd/mm/yyyy') FUPDATE \r\n"
+ " FROM tbl_file_share x, department y where y.DEPT_ID=x.FROM_DEP AND X.TO_CODE='039' and nvl(cir_min,'C')='C'\r\n";
return sQry1;
}
// public List<Map<String, Object>> getInbox() {
// List<Map<String, Object>> rows = new ArrayList<>();
// Connection con = DBConnection.getConnection();
// Statement stmt;
//
// try {
// stmt = con.createStatement();
// ResultSet rs = stmt.executeQuery(getinboxQuery());
//
// while(rs.next()) {
// Map<String, Object> row = new HashMap<>();
// ResultSetMetaData metaData = rs.getMetaData();
// int columnCount = metaData.getColumnCount();
// for(int i=1; i<=columnCount; i++) {
// String columnName = metaData.getColumnName(i);
// Object columnValue = rs.getObject(i);
// System.out.println(columnName+" : "+ columnValue);
// row.put(columnName, columnValue);
// }
// rows.add(row);
//
// }
//
// return rows;
// }
// catch (Exception e) {
// e.printStackTrace();
// }
// return null;
// }
public List<Object[]> getInbox() {
List<Object[]> rows = new ArrayList<>();
Connection con = DBConnection.getConnection();
Statement stmt;
try {
stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(getinboxQuery());
while(rs.next()) {
System.out.println(rs.getString("FDATE"));
System.out.println();
Object[] row = new Object[] {
rs.getString("FDATE"),
rs.getString("DEPT_DESC"),
rs.getString("SUBJECT"),
rs.getString("FILEPATH"),
rs.getString("FUPDATE")
};
rows.add(row);
}
return rows;
}
catch (Exception e) {
e.printStackTrace();
}
return null;
}
}

24
src/main/java/in/gov/chennaicorporation/gccoffice/GccOfficeApplication.java

@ -0,0 +1,24 @@
package in.gov.chennaicorporation.gccoffice;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
@EntityScan(basePackages = {
"in.gov.chennaicorporation.gccoffice",
"in.gov.chennaicorporation.gccoffice.taxcollection.entity"
})
@ComponentScan(basePackages = {
"in.gov.chennaicorporation.gccoffice",
"in.gov.chennaicorporation.gccoffice.taxcollection",
"in.gov.chennaicorporation.gccoffice.garbagecollection"
})
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
public class GccOfficeApplication {
public static void main(String[] args) {
System.out.println("Hello");
SpringApplication.run(GccOfficeApplication.class, args);
}
}

23
src/main/java/in/gov/chennaicorporation/gccoffice/configuration/AppConfig.java

@ -0,0 +1,23 @@
package in.gov.chennaicorporation.gccoffice.configuration;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.web.client.RestTemplate;
@Configuration
public class AppConfig {
public String qrAssetFeedback = "http://localhost:8063";
public String mtm = "http://localhost:8060";
public String petRegistration = "http://117.232.67.158:8061";
public String garbageCollection = "http://localhost:8067";
@Bean
public RestTemplate restTemplate() {
return new RestTemplate();
}
}

111
src/main/java/in/gov/chennaicorporation/gccoffice/configuration/DataSourceConfig.java

@ -0,0 +1,111 @@
package in.gov.chennaicorporation.gccoffice.configuration;
import org.hibernate.jpa.HibernatePersistenceProvider;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.datasource.DriverManagerDataSource;
import org.springframework.orm.jpa.JpaTransactionManager;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import javax.persistence.EntityManagerFactory;
import javax.sql.DataSource;
import java.util.Properties;
@Configuration
@EnableTransactionManagement
public class DataSourceConfig {
@Configuration
@EnableTransactionManagement
@EnableJpaRepositories(
entityManagerFactoryRef = "appEntityManagerFactory",
transactionManagerRef = "appTransactionManager",
basePackages = {"in.gov.chennaicorporation.gccoffice.repository"})
public static class MysqlAppDataSourceConfig {
@Primary
@Bean(name = "mysqlAppDataSource")
public DataSource mysqlAppDataSource() {
DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setDriverClassName("com.mysql.cj.jdbc.Driver");
dataSource.setUrl("jdbc:mysql://localhost:3306/gcc_apps");
dataSource.setUsername("root");
dataSource.setPassword("root");
return dataSource;
}
/*
@Bean(name = "mysqlAppJdbcTemplate")
public JdbcTemplate mysqlAppJdbcTemplate(@Qualifier("mysqlAppDataSource") DataSource dataSource) {
return new JdbcTemplate(dataSource);
}
*/
@Primary
@Bean(name="appEntityManagerFactory")
public LocalContainerEntityManagerFactoryBean entityManagerFactory(
@Qualifier("mysqlAppDataSource") DataSource dataSource) {
LocalContainerEntityManagerFactoryBean entityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean();
entityManagerFactoryBean.setDataSource(dataSource);
entityManagerFactoryBean.setPackagesToScan("in.gov.chennaicorporation.gccoffice.entity");
entityManagerFactoryBean.setPersistenceProviderClass(HibernatePersistenceProvider.class);
Properties properties = new Properties();
properties.setProperty("hibernate.hbm2ddl.auto", "update");
entityManagerFactoryBean.setJpaProperties(properties);
return entityManagerFactoryBean;
}
@Primary
@Bean(name = "appTransactionManager")
public PlatformTransactionManager transactionManager(@Qualifier("appEntityManagerFactory") EntityManagerFactory entityManagerFactory) {
return new JpaTransactionManager(entityManagerFactory);
}
}
@Configuration
@EnableTransactionManagement
@EnableJpaRepositories(
entityManagerFactoryRef = "taxEntityManagerFactory",
transactionManagerRef = "taxTransactionManager",
basePackages = {"in.gov.chennaicorporation.gccoffice.taxcollection.repository"})
public static class MysqlTaxCollectionDataSourceConfig {
@Bean(name = "mysqlTaxCollectionDataSource")
public DataSource mysqlTaxCollectionDataSource() {
DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setDriverClassName("com.mysql.cj.jdbc.Driver");
dataSource.setUrl("jdbc:mysql://localhost:3306/gcc_tax_collection");
dataSource.setUsername("root");
dataSource.setPassword("root");
return dataSource;
}
/*
@Bean(name = "mysqlTaxCollectionJdbcTemplate")
public JdbcTemplate mysqlTaxCollectionJdbcTemplate(@Qualifier("mysqlTaxCollectionDataSource") DataSource dataSource) {
return new JdbcTemplate(dataSource);
}
*/
@Bean(name="taxEntityManagerFactory")
public LocalContainerEntityManagerFactoryBean taxEntityManagerFactory(
@Qualifier("mysqlTaxCollectionDataSource") DataSource dataSource) {
LocalContainerEntityManagerFactoryBean entityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean();
entityManagerFactoryBean.setDataSource(dataSource);
entityManagerFactoryBean.setPackagesToScan("in.gov.chennaicorporation.gccoffice.taxcollection.entity");
entityManagerFactoryBean.setPersistenceProviderClass(HibernatePersistenceProvider.class);
Properties properties = new Properties();
properties.setProperty("hibernate.hbm2ddl.auto", "update");
entityManagerFactoryBean.setJpaProperties(properties);
return entityManagerFactoryBean;
}
@Bean(name = "taxTransactionManager")
public PlatformTransactionManager taxTransactionManager(@Qualifier("taxEntityManagerFactory") EntityManagerFactory taxEntityManagerFactory) {
return new JpaTransactionManager(taxEntityManagerFactory);
}
}
}

17
src/main/java/in/gov/chennaicorporation/gccoffice/configuration/JacksonConfiguration.java

@ -0,0 +1,17 @@
package in.gov.chennaicorporation.gccoffice.configuration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
@Configuration
public class JacksonConfiguration {
@Bean
public ObjectMapper objectMapper() {
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
return objectMapper;
}
}

72
src/main/java/in/gov/chennaicorporation/gccoffice/configuration/SecurityConfig.java

@ -0,0 +1,72 @@
package in.gov.chennaicorporation.gccoffice.configuration;
import javax.persistence.Basic;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import in.gov.chennaicorporation.gccoffice.service.CustomUserDetailsService;
@Configuration
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {
private final CustomUserDetailsService customUserDetailsService;
@Autowired
public SecurityConfig(CustomUserDetailsService customUserDetailsService) {
this.customUserDetailsService = customUserDetailsService;
}
@Override
public void configure(WebSecurity web) throws Exception {
web
.ignoring()
.antMatchers("/static/**", "/assets/**", "/api/**","/images/**" );
//.antMatchers("/assets/**", "/css/**", "/js/**", "/images/**", "/fonts/**"); // Add the paths to your static resources here
}
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(customUserDetailsService).passwordEncoder(passwordEncoder());
}
// Configure authorization (URL-based access control)
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.cors().and() // Enable CORS
.csrf().disable() // Disable CSRF protection for simplicity (Enable if needed)
.authorizeRequests()
.antMatchers("/error").permitAll()
.antMatchers("/login").permitAll() // Add the login URL
.antMatchers("/admin/**").hasRole("ADMIN") // Add the admin URLs
.antMatchers("/**").hasAnyRole("USER", "ADMIN") // Add other URLs
.and()
.formLogin()
.loginPage("/login") // Customize the login page URL
.defaultSuccessUrl("/") // Include the success URL
.permitAll()
.and()
.logout()
.logoutUrl("/logout") // Include the logout URL
.logoutSuccessUrl("/login") // Include the success logout URL
.and()
.sessionManagement()
.sessionFixation()
.migrateSession(); // or .none(), .newSession()
}
@Basic
public PasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}
}

20
src/main/java/in/gov/chennaicorporation/gccoffice/configuration/ThymeleafConfig.java

@ -0,0 +1,20 @@
package in.gov.chennaicorporation.gccoffice.configuration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.thymeleaf.spring5.templateresolver.SpringResourceTemplateResolver;
import org.thymeleaf.templatemode.TemplateMode;
import org.thymeleaf.templateresolver.ITemplateResolver;
@Configuration
public class ThymeleafConfig {
@Bean
public ITemplateResolver templateResolver() {
SpringResourceTemplateResolver templateResolver = new SpringResourceTemplateResolver();
templateResolver.setPrefix("classpath:/templates/"); // Set your Thymeleaf templates prefix here
templateResolver.setSuffix(".html");
templateResolver.setTemplateMode(TemplateMode.HTML);
templateResolver.setCacheable(false); // Disable template caching for development environment
return templateResolver;
}
}

66
src/main/java/in/gov/chennaicorporation/gccoffice/configuration/WebMvcConfig.java

@ -0,0 +1,66 @@
package in.gov.chennaicorporation.gccoffice.configuration;
import java.nio.file.Paths;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import in.gov.chennaicorporation.gccoffice.interceptor.AppInterceptor;
import in.gov.chennaicorporation.gccoffice.repository.AppModuleAccessRepository;
import in.gov.chennaicorporation.gccoffice.repository.AppModuleRepository;
import in.gov.chennaicorporation.gccoffice.repository.MenuItemAccessRepository;
import in.gov.chennaicorporation.gccoffice.repository.MenuItemRepository;
import in.gov.chennaicorporation.gccoffice.repository.SubMenuItemAccessRepository;
import in.gov.chennaicorporation.gccoffice.repository.SubMenuItemRepository;
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
private final String uploadDirectory;
private AppModuleAccessRepository appModuleAccessRepository;
private MenuItemAccessRepository menuItemAccessRepository;
private SubMenuItemAccessRepository subMenuItemAccessRepository;
private AppModuleRepository appModuleRepository;
private MenuItemRepository menuItemRepository;
private SubMenuItemRepository subMenuItemRepository;
@Autowired
public WebMvcConfig(
@Value("${file.upload.directory}") String uploadDirectory,
AppModuleAccessRepository appModuleAccessRepository,
MenuItemAccessRepository menuItemAccessRepository,
SubMenuItemAccessRepository subMenuItemAccessRepository,
AppModuleRepository appModuleRepository,
MenuItemRepository menuItemRepository,
SubMenuItemRepository subMenuItemRepository) {
this.uploadDirectory = uploadDirectory;
this.appModuleAccessRepository = appModuleAccessRepository;
this.menuItemAccessRepository = menuItemAccessRepository;
this.subMenuItemAccessRepository = subMenuItemAccessRepository;
this.appModuleRepository = appModuleRepository;
this.menuItemRepository = menuItemRepository;
this.subMenuItemRepository = subMenuItemRepository;
}
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(new AppInterceptor(
appModuleAccessRepository,
menuItemAccessRepository,
subMenuItemAccessRepository,
appModuleRepository,
menuItemRepository,
subMenuItemRepository));
}
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/images/**").addResourceLocations("file:" + uploadDirectory +"/");
}
}

10
src/main/java/in/gov/chennaicorporation/gccoffice/controller/APIController.java

@ -0,0 +1,10 @@
package in.gov.chennaicorporation.gccoffice.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/api")
@RestController
public class APIController {
}

112
src/main/java/in/gov/chennaicorporation/gccoffice/controller/CustomErrorController.java

@ -0,0 +1,112 @@
package in.gov.chennaicorporation.gccoffice.controller;
import javax.servlet.http.HttpServletRequest;
import org.springframework.boot.web.servlet.error.ErrorController;
import org.springframework.http.HttpStatus;
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 org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.context.request.WebRequest;
import in.gov.chennaicorporation.gccoffice.modeldata.ErrorResponse;
@Controller
public class CustomErrorController implements ErrorController {
private static final String ERROR_PATH = "/error";
// Handle errors for web applications, return HTML error pages
@RequestMapping(value = ERROR_PATH, produces = "text/html")
public String handleWebError(HttpServletRequest request, Model model) {
// Retrieve error information from the request
// HttpStatus status = HttpStatus.valueOf((Integer) request.getAttribute("javax.servlet.error.status_code"));
//Throwable throwable = (Throwable) request.getAttribute("javax.servlet.error.exception");
// Retrieve error information from the request
Integer statusCode = (Integer) request.getAttribute("javax.servlet.error.status_code");
if (statusCode == null) {
// Add the error message to the model
model.addAttribute("errorStatus", "Error 403");
model.addAttribute("errorError", "403 - Access Denied");
model.addAttribute("errorMessage", "Oops, You don`t have permission to access this page.");
// Handle the case where the status code is null
// You may choose to set default values or redirect to a generic error page
return "error-403";
}
HttpStatus status = (statusCode != null) ? HttpStatus.valueOf(statusCode) : HttpStatus.INTERNAL_SERVER_ERROR;
Throwable throwable = (Throwable) request.getAttribute("javax.servlet.error.exception");
// Add custom error handling logic for web applications here
String errorPage = "error";
Integer errorStatus = 404;
String errorError = "Internal Server Error";
String errorMessage = "An error occurred"; // Default error message
// Print error information to the console
if (status != null) {
errorStatus = status.value();
errorError = status.getReasonPhrase();
System.err.println("HTTP Status: " + status +"\n "
+ "Status Code: "+status.value()+"\n"
+ "Status Error: "+status.getReasonPhrase());
// Check if the status code
if (status == HttpStatus.NOT_FOUND) {
errorPage = "error-404"; // 400 Error Page
}
else if (status == HttpStatus.INTERNAL_SERVER_ERROR) {
errorPage = "error-500"; // 500 Error page
}
else {
errorPage = "error"; //// Other Error page
}
}
if (throwable != null) {
// Retrieve the exception message
errorMessage = throwable.getMessage();
throwable.printStackTrace();
}
// Add the error message to the model
model.addAttribute("errorStatus", errorStatus);
model.addAttribute("errorError", errorError);
model.addAttribute("errorMessage", errorMessage);
return errorPage; // Return the name of your custom HTML error page (without the .html extension)
}
// Handle errors for RESTful APIs, return JSON error responses
@RequestMapping(value = ERROR_PATH, produces = "application/json")
@ResponseBody
public ResponseEntity<ErrorResponse> handleApiError(HttpServletRequest request) {
// Retrieve error information from the request
HttpStatus status = HttpStatus.valueOf((Integer) request.getAttribute("javax.servlet.error.status_code"));
Throwable throwable = (Throwable) request.getAttribute("javax.servlet.error.exception");
// Create an error response
ErrorResponse errorResponse = new ErrorResponse();
errorResponse.setStatus(status.value());
errorResponse.setError(status.getReasonPhrase());
errorResponse.setMessage("An error occurred");
if (throwable != null) {
errorResponse.setException(throwable.getMessage());
}
// Return a ResponseEntity with the custom JSON error response and HTTP status
return ResponseEntity.status(status).body(errorResponse);
}
@GetMapping(ERROR_PATH)
public String handleError() {
return "error-404"; // Return the name of your custom error page (without the .html extension)
}
}

33
src/main/java/in/gov/chennaicorporation/gccoffice/controller/MainController.java

@ -0,0 +1,33 @@
package in.gov.chennaicorporation.gccoffice.controller;
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 in.gov.chennaicorporation.gccoffice.service.LoginUserInfo;
//@RequestMapping("/mtmtest")
@Controller("gccOfficeController")
public class MainController {
private final LoginUserInfo loginUserInfo;
@Autowired
public MainController(LoginUserInfo loginUserInfo) {
this.loginUserInfo = loginUserInfo;
}
@GetMapping({"", "/", "/index"})
public String main(Model model) {
String userId = LoginUserInfo.getLoginUserId();
if (userId != null && !userId.isEmpty()) {
System.out.println("String UserID: " + userId);
}
return "index";
}
@GetMapping("/widget-statistic")
public String widgetStatistic(Model model) {
return "widget-statistic";
}
}

151
src/main/java/in/gov/chennaicorporation/gccoffice/controller/MenuController.java

@ -0,0 +1,151 @@
package in.gov.chennaicorporation.gccoffice.controller;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ModelAttribute;
import in.gov.chennaicorporation.gccoffice.entity.AppModuleAccessEntity;
import in.gov.chennaicorporation.gccoffice.entity.AppModuleEntity;
import in.gov.chennaicorporation.gccoffice.entity.AppUserGroupEntity;
import in.gov.chennaicorporation.gccoffice.entity.MenuItemAccessEntity;
import in.gov.chennaicorporation.gccoffice.entity.MenuItemEntity;
import in.gov.chennaicorporation.gccoffice.entity.SubMenuItemAccessEntity;
import in.gov.chennaicorporation.gccoffice.entity.SubMenuItemEntity;
import in.gov.chennaicorporation.gccoffice.repository.AppModuleAccessRepository;
import in.gov.chennaicorporation.gccoffice.repository.AppModuleRepository;
import in.gov.chennaicorporation.gccoffice.repository.MenuItemAccessRepository;
import in.gov.chennaicorporation.gccoffice.repository.MenuItemRepository;
import in.gov.chennaicorporation.gccoffice.repository.SubMenuItemAccessRepository;
import in.gov.chennaicorporation.gccoffice.repository.SubMenuItemRepository;
import in.gov.chennaicorporation.gccoffice.service.LoginUserInfo;
@ControllerAdvice
public class MenuController {
private final AppModuleRepository appModuleRepository;
private final MenuItemRepository menuItemRepository;
private final SubMenuItemRepository subMenuItemRepository;
private final AppModuleAccessRepository appModuleAccessRepository;
private final MenuItemAccessRepository menuItemAccessRepository;
private final SubMenuItemAccessRepository subMenuItemAccessRepository;
@Autowired
public MenuController(AppModuleRepository appModuleRepository,
MenuItemRepository menuItemRepository,
SubMenuItemRepository subMenuItemRepository,
AppModuleAccessRepository appModuleAccessRepository,
MenuItemAccessRepository menuItemAccessRepository,
SubMenuItemAccessRepository subMenuItemAccessRepository) {
this.appModuleRepository = appModuleRepository;
this.menuItemRepository = menuItemRepository;
this.subMenuItemRepository = subMenuItemRepository;
this.appModuleAccessRepository = appModuleAccessRepository;
this.menuItemAccessRepository = menuItemAccessRepository;
this.subMenuItemAccessRepository = subMenuItemAccessRepository;
}
@ModelAttribute("menuItemsHTML") // This will add the menuItems to the model for all requests
public String menuHTML() {
if(LoginUserInfo.getLoginUserId() == null || LoginUserInfo.getUserGroupId()==null) {
return "";
}
List<AppModuleAccessEntity> getAppModuleAccessEntities;
List<AppModuleEntity> getAppModuleEntities;
if(LoginUserInfo.getUserRole().equals("ADMIN")) {
getAppModuleEntities = appModuleRepository.showAll();
}
else {
getAppModuleAccessEntities = appModuleAccessRepository.findByUserGroupID(LoginUserInfo.getUserGroupId());
String[] checkModuleId = new String[getAppModuleAccessEntities.size()];
int i=0;
for (AppModuleAccessEntity accessEntity : getAppModuleAccessEntities) {
checkModuleId[i]=accessEntity.getModuleId().getId().toString();
i++;
}
getAppModuleEntities = appModuleRepository.showAllById(checkModuleId);
}
String menuHTML = "";
for (AppModuleEntity moduleName : getAppModuleEntities) {
menuHTML = menuHTML+"<div class=\"nav-item has-sub\"><a href=\"javascript:void(0)\"><i class=\""+moduleName.getIcon()+"\"></i><span>"+moduleName.getName()+"</span></a><div class=\"submenu-content\">";
List<MenuItemEntity> getMenuItems;
if(LoginUserInfo.getUserRole().equals("ADMIN")) {
getMenuItems = menuItemRepository.getMenuItemByModuleId(moduleName.getId());
}
else {
List<MenuItemAccessEntity> getMenuItemAccess = menuItemAccessRepository.findByUserGroupID(LoginUserInfo.getUserGroupId(), moduleName.getId().toString());
String[] checkMenuId = new String[getMenuItemAccess.size()];
int j=0;
for (MenuItemAccessEntity menuAccessEntity : getMenuItemAccess) {
checkMenuId[j]=menuAccessEntity.getMenuItemId().getId().toString();
j++;
}
getMenuItems = menuItemRepository.getMenuItemByModuleIdAccess(moduleName.getId(),checkMenuId);
}
String subMenuHTML = "";
for (MenuItemEntity menuItem : getMenuItems) {
if(menuItem.getHasSub()) {
if(LoginUserInfo.getUserRole().equals("ADMIN")) {
List<SubMenuItemEntity> getMenuSubItems = subMenuItemRepository.getSubMenuItemByMenuItemId(menuItem.getId());
String subSubMenuHTML = "";
for (SubMenuItemEntity subMenuItem : getMenuSubItems) {
subSubMenuHTML = subSubMenuHTML+"<a href=\"/"+subMenuItem.getUrl()+"\" class=\"menu-item\"><i class=\""+subMenuItem.getIcon()+"\"></i><span>"+subMenuItem.getName()+"</span></a>";
}
if(subSubMenuHTML.equals(""))
{
subMenuHTML = subMenuHTML+"<div class=\"nav-item has-sub\"><a href=\"javascript:void(0);\" class=\"menu-item\"><i class=\""+menuItem.getIcon()+"\"></i>"+menuItem.getName()+"</a></div>";
}
else {
subMenuHTML = subMenuHTML+"<div class=\"nav-item has-sub\"><a href=\"javascript:void(0);\" class=\"menu-item\"><i class=\""+menuItem.getIcon()+"\"></i>"+menuItem.getName()+"</a><div class=\"submenu-content\">"+subSubMenuHTML+"</div></div>";
}
}
else {
List<SubMenuItemAccessEntity> getSubMenuItemAccess = subMenuItemAccessRepository.findByUserGroupIDAccess(LoginUserInfo.getUserGroupId(), moduleName.getId().toString(), menuItem.getId().toString());
String[] checkSubMenuId = new String[getSubMenuItemAccess.size()];
if(checkSubMenuId.length>0)
{
int k=0;
for (SubMenuItemAccessEntity subMenuItemAccessEntity : getSubMenuItemAccess) {
checkSubMenuId[k]=subMenuItemAccessEntity.getSubMenuItemId().getId().toString();
k++;
}
List<SubMenuItemEntity> getMenuSubItems = subMenuItemRepository.getSubMenuItemByMenuItemIdAccess(menuItem.getId(),checkSubMenuId);
String subSubMenuHTML = "";
for (SubMenuItemEntity subMenuItem : getMenuSubItems) {
subSubMenuHTML = subSubMenuHTML+"<a href=\"/"+subMenuItem.getUrl()+"\" class=\"menu-item\"><i class=\""+subMenuItem.getIcon()+"\"></i><span>"+subMenuItem.getName()+"</span></a>";
}
subMenuHTML = subMenuHTML+"<div class=\"nav-item has-sub\"><a href=\"javascript:void(0);\" class=\"menu-item\"><i class=\""+menuItem.getIcon()+"\"></i>"+menuItem.getName()+"</a><div class=\"submenu-content\">"+subSubMenuHTML+"</div></div>";
}
else {
subMenuHTML = subMenuHTML+"<div class=\"nav-item has-sub\"><a href=\"javascript:void(0);\" class=\"menu-item\"><i class=\""+menuItem.getIcon()+"\"></i>"+menuItem.getName()+"</a></div>";
}
}
}
else {
subMenuHTML = subMenuHTML+"<a href=\"/"+menuItem.getUrl()+"\" class=\"menu-item\"><i class=\""+menuItem.getIcon()+"\"></i><span>"+menuItem.getName()+"</span></a>";
}
}
menuHTML = menuHTML+subMenuHTML+"</div></div>";
}
return menuHTML;
}
}

13
src/main/java/in/gov/chennaicorporation/gccoffice/controller/login.java

@ -0,0 +1,13 @@
package in.gov.chennaicorporation.gccoffice.controller;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
//@RequestMapping("/mtmtest")
@Controller
public class login {
@GetMapping("/login")
public String home(Model model) {
return "login";
}
}

BIN
src/main/java/in/gov/chennaicorporation/gccoffice/entity/.DS_Store

115
src/main/java/in/gov/chennaicorporation/gccoffice/entity/AppModuleAccessEntity.java

@ -0,0 +1,115 @@
package in.gov.chennaicorporation.gccoffice.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
@Entity
@Table(name = "modules_access")
public class AppModuleAccessEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id",nullable = false)
private Integer id;
@ManyToOne
@JoinColumn(name = "usergroup_id", referencedColumnName = "id")
private AppUserGroupEntity userGroupId;
@ManyToOne
@JoinColumn(name = "module_id", referencedColumnName = "id")
private AppModuleEntity moduleId;
@Column(name = "isdelete",nullable = false, columnDefinition = "Boolean default false")
private Boolean isDelete;
@Column(name = "isactive",nullable = false, columnDefinition = "Boolean default true")
private Boolean isActive;
@Column(name = "created_by",nullable = false, columnDefinition = "Integer Default 0")
private Integer createdBy;
@Column(name = "cdate",nullable = false, columnDefinition = "DATETIME DEFAULT CURRENT_TIMESTAMP")
private String cDate;
public AppModuleAccessEntity() {
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public AppUserGroupEntity getUserGroupId() {
return userGroupId;
}
public void setUserGroupId(AppUserGroupEntity userGroupId) {
this.userGroupId = userGroupId;
}
public AppModuleEntity getModuleId() {
return moduleId;
}
public void setModuleId(AppModuleEntity moduleId) {
this.moduleId = moduleId;
}
public Boolean getIsDelete() {
return isDelete;
}
public void setIsDelete(Boolean isDelete) {
this.isDelete = isDelete;
}
public Boolean getIsActive() {
return isActive;
}
public void setIsActive(Boolean isActive) {
this.isActive = isActive;
}
public Integer getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Integer createdBy) {
this.createdBy = createdBy;
}
public String getcDate() {
return cDate;
}
public void setcDate(String cDate) {
this.cDate = cDate;
}
}

126
src/main/java/in/gov/chennaicorporation/gccoffice/entity/AppModuleEntity.java

@ -0,0 +1,126 @@
package in.gov.chennaicorporation.gccoffice.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "modules")
public class AppModuleEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id",nullable = false)
private Integer id;
@Column(name = "name",nullable = false)
private String name;
@Column(name = "module_path",nullable = false)
private String modulePath;
@Column(name = "icon",nullable = true)
private String icon;
@Column(name = "isdelete",nullable = false, columnDefinition = "Boolean default false")
private Boolean isDelete;
@Column(name = "isactive",nullable = false, columnDefinition = "Boolean default true")
private Boolean isActive;
@Column(name = "created_by",nullable = false, columnDefinition = "Integer Default 0")
private Integer createdBy;
@Column(name = "cdate",nullable = false, columnDefinition = "DATETIME DEFAULT CURRENT_TIMESTAMP")
private String cDate;
public AppModuleEntity() {
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getModulePath() {
return modulePath;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public void setModulePath(String modulePath) {
this.modulePath = modulePath;
}
public Boolean getIsDelete() {
return isDelete;
}
public void setIsDelete(Boolean isDelete) {
this.isDelete = isDelete;
}
public Boolean getIsActive() {
return isActive;
}
public void setIsActive(Boolean isActive) {
this.isActive = isActive;
}
public Integer getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Integer createdBy) {
this.createdBy = createdBy;
}
public String getcDate() {
return cDate;
}
public void setcDate(String cDate) {
this.cDate = cDate;
}
}

153
src/main/java/in/gov/chennaicorporation/gccoffice/entity/AppUserEntity.java

@ -0,0 +1,153 @@
package in.gov.chennaicorporation.gccoffice.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
@Entity
@Table(name = "appusers")
public class AppUserEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id",nullable = false)
private Integer id;
@ManyToOne
@JoinColumn(name = "userid", referencedColumnName = "userid")
private UserInfoEntity userid;
@ManyToOne
@JoinColumn(name = "usergroup_id", referencedColumnName = "id")
private AppUserGroupEntity usergroup_id;
@Column(name = "username",nullable = false)
private String username;
@Column(name = "password",nullable = false)
private String password;
@Column(name = "roles",nullable = false)
private String roles;
@Column(name = "isdelete",nullable = false, columnDefinition = "Boolean default false")
private Boolean isDelete;
@Column(name = "isactive",nullable = false, columnDefinition = "Boolean default true")
private Boolean isActive;
@Column(name = "created_by",nullable = false, columnDefinition = "Integer Default 0")
private Integer createdBy;
@Column(name = "cdate",nullable = false, columnDefinition = "DATETIME DEFAULT CURRENT_TIMESTAMP")
private String cDate;
public AppUserEntity() {
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public UserInfoEntity getUserid() {
return userid;
}
public void setUserid(UserInfoEntity userid) {
this.userid = userid;
}
public AppUserGroupEntity getUsergroup_id() {
return usergroup_id;
}
public void setUsergroup_id(AppUserGroupEntity usergroup_id) {
this.usergroup_id = usergroup_id;
}
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 String getRoles() {
return roles;
}
public void setRoles(String roles) {
this.roles = roles;
}
public Boolean getIsDelete() {
return isDelete;
}
public void setIsDelete(Boolean isDelete) {
this.isDelete = isDelete;
}
public Boolean getIsActive() {
return isActive;
}
public void setIsActive(Boolean isActive) {
this.isActive = isActive;
}
public Integer getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Integer createdBy) {
this.createdBy = createdBy;
}
public String getcDate() {
return cDate;
}
public void setcDate(String cDate) {
this.cDate = cDate;
}
}

113
src/main/java/in/gov/chennaicorporation/gccoffice/entity/AppUserGroupEntity.java

@ -0,0 +1,113 @@
package in.gov.chennaicorporation.gccoffice.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "usergroup")
public class AppUserGroupEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id",nullable = false)
private Integer id;
@Column(name = "name",nullable = false)
private String name;
@Column(name = "icon",nullable = true)
private String icon;
@Column(name = "isdelete",nullable = false, columnDefinition = "Boolean default false")
private Boolean isDelete;
@Column(name = "isactive",nullable = false, columnDefinition = "Boolean default true")
private Boolean isActive;
@Column(name = "created_by",nullable = false, columnDefinition = "Integer Default 0")
private Integer createdBy;
@Column(name = "cdate",nullable = false, columnDefinition = "DATETIME DEFAULT CURRENT_TIMESTAMP")
private String cDate;
public AppUserGroupEntity() {
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public Boolean getIsDelete() {
return isDelete;
}
public void setIsDelete(Boolean isDelete) {
this.isDelete = isDelete;
}
public Boolean getIsActive() {
return isActive;
}
public void setIsActive(Boolean isActive) {
this.isActive = isActive;
}
public Integer getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Integer createdBy) {
this.createdBy = createdBy;
}
public String getcDate() {
return cDate;
}
public void setcDate(String cDate) {
this.cDate = cDate;
}
}

128
src/main/java/in/gov/chennaicorporation/gccoffice/entity/MenuItemAccessEntity.java

@ -0,0 +1,128 @@
package in.gov.chennaicorporation.gccoffice.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
@Entity
@Table(name = "menuitem_access")
public class MenuItemAccessEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id",nullable = false)
private Integer id;
@ManyToOne
@JoinColumn(name = "usergroup_id", referencedColumnName = "id")
private AppUserGroupEntity userGroupId;
@ManyToOne
@JoinColumn(name = "menuitem_id", referencedColumnName = "id")
private MenuItemEntity menuItemId;
@ManyToOne
@JoinColumn(name = "module_id", referencedColumnName = "id")
private AppModuleEntity moduleId;
@Column(name = "isdelete",nullable = false, columnDefinition = "Boolean default false")
private Boolean isDelete;
@Column(name = "isactive",nullable = false, columnDefinition = "Boolean default true")
private Boolean isActive;
@Column(name = "created_by",nullable = false, columnDefinition = "Integer Default 0")
private Integer createdBy;
@Column(name = "cdate",nullable = false, columnDefinition = "DATETIME DEFAULT CURRENT_TIMESTAMP")
private String cDate;
public MenuItemAccessEntity() {
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public AppUserGroupEntity getUserGroupId() {
return userGroupId;
}
public void setUserGroupId(AppUserGroupEntity userGroupId) {
this.userGroupId = userGroupId;
}
public MenuItemEntity getMenuItemId() {
return menuItemId;
}
public void setMenuItemId(MenuItemEntity menuItemId) {
this.menuItemId = menuItemId;
}
public AppModuleEntity getModuleId() {
return moduleId;
}
public void setModuleId(AppModuleEntity moduleId) {
this.moduleId = moduleId;
}
public Boolean getIsDelete() {
return isDelete;
}
public void setIsDelete(Boolean isDelete) {
this.isDelete = isDelete;
}
public Boolean getIsActive() {
return isActive;
}
public void setIsActive(Boolean isActive) {
this.isActive = isActive;
}
public Integer getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Integer createdBy) {
this.createdBy = createdBy;
}
public String getcDate() {
return cDate;
}
public void setcDate(String cDate) {
this.cDate = cDate;
}
}

153
src/main/java/in/gov/chennaicorporation/gccoffice/entity/MenuItemEntity.java

@ -0,0 +1,153 @@
package in.gov.chennaicorporation.gccoffice.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
@Entity
@Table(name = "menuitem")
public class MenuItemEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id",nullable = false)
private Integer id;
@ManyToOne
@JoinColumn(name = "module_id", referencedColumnName = "id")
private AppModuleEntity moduleId;
@Column(name = "name",nullable = false)
private String name;
@Column(name = "url",nullable = false)
private String url;
@Column(name = "icon",nullable = true)
private String icon;
@Column(name = "ishassub",nullable = false, columnDefinition = "Boolean default false")
private Boolean hasSub;
@Column(name = "isdelete",nullable = false, columnDefinition = "Boolean default false")
private Boolean isDelete;
@Column(name = "isactive",nullable = false, columnDefinition = "Boolean default true")
private Boolean isActive;
@Column(name = "created_by",nullable = false, columnDefinition = "Integer Default 0")
private Integer createdBy;
@Column(name = "cdate",nullable = false, columnDefinition = "DATETIME DEFAULT CURRENT_TIMESTAMP")
private String cDate;
public MenuItemEntity() {
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public AppModuleEntity getModuleId() {
return moduleId;
}
public void setModuleId(AppModuleEntity moduleId) {
this.moduleId = moduleId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public Boolean getHasSub() {
return hasSub;
}
public void setHasSub(Boolean hasSub) {
this.hasSub = hasSub;
}
public Boolean getIsDelete() {
return isDelete;
}
public void setIsDelete(Boolean isDelete) {
this.isDelete = isDelete;
}
public Boolean getIsActive() {
return isActive;
}
public void setIsActive(Boolean isActive) {
this.isActive = isActive;
}
public Integer getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Integer createdBy) {
this.createdBy = createdBy;
}
public String getcDate() {
return cDate;
}
public void setcDate(String cDate) {
this.cDate = cDate;
}
}

143
src/main/java/in/gov/chennaicorporation/gccoffice/entity/SubMenuItemAccessEntity.java

@ -0,0 +1,143 @@
package in.gov.chennaicorporation.gccoffice.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
@Entity
@Table(name = "submenuitem_access")
public class SubMenuItemAccessEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id",nullable = false)
private Integer id;
@ManyToOne
@JoinColumn(name = "usergroup_id", referencedColumnName = "id")
private AppUserGroupEntity userGroupId;
@ManyToOne
@JoinColumn(name = "submenuitem_id", referencedColumnName = "id")
private SubMenuItemEntity subMenuItemId;
@ManyToOne
@JoinColumn(name = "module_id", referencedColumnName = "id")
private AppModuleEntity moduleId;
@ManyToOne
@JoinColumn(name = "menuitem_id", referencedColumnName = "id")
private MenuItemEntity menuItemId;
@Column(name = "isdelete",nullable = false, columnDefinition = "Boolean default false")
private Boolean isDelete;
@Column(name = "isactive",nullable = false, columnDefinition = "Boolean default true")
private Boolean isActive;
@Column(name = "created_by",nullable = false, columnDefinition = "Integer Default 0")
private Integer createdBy;
@Column(name = "cdate",nullable = false, columnDefinition = "DATETIME DEFAULT CURRENT_TIMESTAMP")
private String cDate;
public SubMenuItemAccessEntity() {
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public AppUserGroupEntity getUserGroupId() {
return userGroupId;
}
public void setUserGroupId(AppUserGroupEntity userGroupId) {
this.userGroupId = userGroupId;
}
public SubMenuItemEntity getSubMenuItemId() {
return subMenuItemId;
}
public void setSubMenuItemId(SubMenuItemEntity subMenuItemId) {
this.subMenuItemId = subMenuItemId;
}
public AppModuleEntity getModuleId() {
return moduleId;
}
public void setModuleId(AppModuleEntity moduleId) {
this.moduleId = moduleId;
}
public MenuItemEntity getMenuItemId() {
return menuItemId;
}
public void setMenuItemId(MenuItemEntity menuItemId) {
this.menuItemId = menuItemId;
}
public Boolean getIsDelete() {
return isDelete;
}
public void setIsDelete(Boolean isDelete) {
this.isDelete = isDelete;
}
public Boolean getIsActive() {
return isActive;
}
public void setIsActive(Boolean isActive) {
this.isActive = isActive;
}
public Integer getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Integer createdBy) {
this.createdBy = createdBy;
}
public String getcDate() {
return cDate;
}
public void setcDate(String cDate) {
this.cDate = cDate;
}
}

155
src/main/java/in/gov/chennaicorporation/gccoffice/entity/SubMenuItemEntity.java

@ -0,0 +1,155 @@
package in.gov.chennaicorporation.gccoffice.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
@Entity
@Table(name = "submenuitem")
public class SubMenuItemEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id",nullable = false)
private Integer id;
@ManyToOne
@JoinColumn(name = "module_id", referencedColumnName = "id")
private AppModuleEntity moduleId;
@ManyToOne
@JoinColumn(name = "menuitem_id", referencedColumnName = "id")
private MenuItemEntity menuItemId;
@Column(name = "name",nullable = false)
private String name;
@Column(name = "url",nullable = false)
private String url;
@Column(name = "icon",nullable = true)
private String icon;
@Column(name = "isdelete",nullable = false, columnDefinition = "Boolean default false")
private Boolean isDelete;
@Column(name = "isactive",nullable = false, columnDefinition = "Boolean default true")
private Boolean isActive;
@Column(name = "created_by",nullable = false, columnDefinition = "Integer Default 0")
private Integer createdBy;
@Column(name = "cdate",nullable = false, columnDefinition = "DATETIME DEFAULT CURRENT_TIMESTAMP")
private String cDate;
public SubMenuItemEntity() {
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public AppModuleEntity getModuleId() {
return moduleId;
}
public void setModuleId(AppModuleEntity moduleId) {
this.moduleId = moduleId;
}
public MenuItemEntity getMenuItemId() {
return menuItemId;
}
public void setMenuItemId(MenuItemEntity menuItemId) {
this.menuItemId = menuItemId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public Boolean getIsDelete() {
return isDelete;
}
public void setIsDelete(Boolean isDelete) {
this.isDelete = isDelete;
}
public Boolean getIsActive() {
return isActive;
}
public void setIsActive(Boolean isActive) {
this.isActive = isActive;
}
public Integer getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Integer createdBy) {
this.createdBy = createdBy;
}
public String getcDate() {
return cDate;
}
public void setcDate(String cDate) {
this.cDate = cDate;
}
}

108
src/main/java/in/gov/chennaicorporation/gccoffice/entity/UserInfoEntity.java

@ -0,0 +1,108 @@
package in.gov.chennaicorporation.gccoffice.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "userinfo")
public class UserInfoEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "userid",nullable = false)
private Integer userid;
@Column(name = "name",nullable = false)
private String name;
@Column(name = "email")
private String email;
@Column(name = "phone")
private String phone;
@Column(name = "isdelete",nullable = false, columnDefinition = "Boolean default false")
private Boolean isDelete;
@Column(name = "isactive",nullable = false, columnDefinition = "Boolean default true")
private Boolean isActive;
@Column(name = "created_by",nullable = false, columnDefinition = "Integer Default 0")
private Integer createdBy;
@Column(name = "cdate",nullable = false, columnDefinition = "DATETIME DEFAULT CURRENT_TIMESTAMP")
private String cDate;
public UserInfoEntity() {
}
public Integer getUserid() {
return userid;
}
public void setUserid(Integer userid) {
this.userid = userid;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public Boolean getIsDelete() {
return isDelete;
}
public void setIsDelete(Boolean isDelete) {
this.isDelete = isDelete;
}
public Boolean getIsActive() {
return isActive;
}
public void setIsActive(Boolean isActive) {
this.isActive = isActive;
}
public Integer getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Integer createdBy) {
this.createdBy = createdBy;
}
public String getcDate() {
return cDate;
}
public void setcDate(String cDate) {
this.cDate = cDate;
}
}

BIN
src/main/java/in/gov/chennaicorporation/gccoffice/garbagecollection/.DS_Store

59
src/main/java/in/gov/chennaicorporation/gccoffice/garbagecollection/controller/APIController.java

@ -0,0 +1,59 @@
package in.gov.chennaicorporation.gccoffice.garbagecollection.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import in.gov.chennaicorporation.gccoffice.configuration.AppConfig;
@RequestMapping("/api/garbagecollection")
@RestController("garbageCollectionRestController")
public class APIController {
private final RestTemplate restTemplate;
private final AppConfig appConfig;
String bodyMessage = "";
@Autowired
public APIController(RestTemplate restTemplate, AppConfig appConfig) {
this.restTemplate = restTemplate;
this.appConfig = appConfig;
}
@GetMapping(value = "/getGarbageDetails")
public String getGarbageDetails(@RequestParam String requestid) {
ResponseEntity<String> response = restTemplate.getForEntity(appConfig.garbageCollection+"/api/getRequestById?requestid={requestid}", String.class,requestid);
bodyMessage = response.getBody().trim();
return bodyMessage;
}
@PostMapping(value = "/saveStatus")
public String saveStatus(@RequestParam("status") String status, @RequestParam("comments") String comments, @RequestParam("request_id") String request_id) {
//System.out.println("I AM IN");
ResponseEntity<String> response = restTemplate.getForEntity(appConfig.garbageCollection+"/api/saveStatus?status={status}&comments={comments}&request_id={request_id}", String.class,status,comments,request_id);
bodyMessage = response.getBody().trim();
return bodyMessage;
}
@GetMapping(value = "/getStatus")
public String getStatus(@RequestParam String requestid) {
ResponseEntity<String> response = restTemplate.getForEntity(appConfig.garbageCollection+"/api/getStatusByRequestId?requestid={requestid}", String.class,requestid);
bodyMessage = response.getBody().trim();
return bodyMessage;
}
@GetMapping(value = "/getStatusById")
public String getStatusById(@RequestParam String statusid) {
ResponseEntity<String> response = restTemplate.getForEntity(appConfig.garbageCollection+"/api/getStatusById?request_status_id={statusid}", String.class,statusid);
bodyMessage = response.getBody().trim();
return bodyMessage;
}
}

81
src/main/java/in/gov/chennaicorporation/gccoffice/garbagecollection/controller/MainController.java

@ -0,0 +1,81 @@
package in.gov.chennaicorporation.gccoffice.garbagecollection.controller;
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;
import org.springframework.web.client.RestTemplate;
import in.gov.chennaicorporation.gccoffice.configuration.AppConfig;
import in.gov.chennaicorporation.gccoffice.garbagecollection.modeldata.Request;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.Asset;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.AssetCategory;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.AssetCategoryQuestion;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.AssetParameter;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.AssetParameterQuestions;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.AssetQuestion;
@RequestMapping("/garbagecollection")
@Controller("garbageCollectionController")
public class MainController {
private final RestTemplate restTemplate;
private final AppConfig appConfig;
@Autowired
public MainController(RestTemplate restTemplate, AppConfig appConfig) {
this.restTemplate = restTemplate;
this.appConfig = appConfig;
}
@GetMapping({"", "/", "/index", "/dashboard"})
public String home(Model model) {
return "modules/garbagecollection/index";
}
@GetMapping("/request-create")
public String category(Model model) {
//String apiUrl = appConfig.qrAssetFeedback + "/api/category";
//AssetCategory[] assetCategoryList = restTemplate.getForObject(apiUrl, AssetCategory[].class);
//model.addAttribute("assetcategorylist",assetCategoryList);
return "modules/taxcollection/request-create";
}
@GetMapping("/request-new")
public String newRequestList(Model model) {
String apiUrl = appConfig.garbageCollection+"/api/getRequest";
Request[] requestList = restTemplate.getForObject(apiUrl, Request[].class);
model.addAttribute("requestlist",requestList);
return "modules/garbagecollection/request-new";
}
@GetMapping("/request-pending")
public String pendingRequestList(Model model) {
String apiUrl = appConfig.garbageCollection+"/api/getPendingRequest";
Request[] requestList = restTemplate.getForObject(apiUrl, Request[].class);
model.addAttribute("requestlist",requestList);
return "modules/garbagecollection/request-pending";
}
@GetMapping("/request-completed")
public String completedRequestList(Model model) {
String apiUrl = appConfig.garbageCollection+"/api/getCompletedRequest";
Request[] requestList = restTemplate.getForObject(apiUrl, Request[].class);
model.addAttribute("requestlist",requestList);
return "modules/garbagecollection/request-completed";
}
@GetMapping("/request-outofscope")
public String outofscopeRequestList(Model model) {
String apiUrl = appConfig.garbageCollection+"/api/getOutOfScopeRequest";
Request[] requestList = restTemplate.getForObject(apiUrl, Request[].class);
model.addAttribute("requestlist",requestList);
return "modules/garbagecollection/request-outofscope";
}
}

BIN
src/main/java/in/gov/chennaicorporation/gccoffice/garbagecollection/modeldata/.DS_Store

242
src/main/java/in/gov/chennaicorporation/gccoffice/garbagecollection/modeldata/Request.java

@ -0,0 +1,242 @@
package in.gov.chennaicorporation.gccoffice.garbagecollection.modeldata;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
public class Request {
private Integer requestId;
private String name;
private String mobile;
private String email;
private String address;
private String landmark;
private String zone;
private String division;
private String area;
private String locality;
private String street;
private String latitude;
private String longitude;
private String requestType;
private String garbageCategory;
private String status;
private String statusId;
private Boolean isDelete;
private Boolean isActive;
private Integer createdBy;
private String cDate;
@JsonCreator
public Request(@JsonProperty("request_id") Integer requestId,
@JsonProperty("name") String name,
@JsonProperty("mobile") String mobile,
@JsonProperty("email") String email,
@JsonProperty("address") String address,
@JsonProperty("landmark") String landmark,
@JsonProperty("zone") String zone,
@JsonProperty("division") String division,
@JsonProperty("area") String area,
@JsonProperty("locality") String locality,
@JsonProperty("street") String street,
@JsonProperty("latitude") String latitude,
@JsonProperty("longitude") String longitude,
@JsonProperty("request_type") String requestType,
@JsonProperty("garbage_category") String garbageCategory,
@JsonProperty("status") String status,
@JsonProperty("statusid") String statusId,
@JsonProperty("isdelete") Boolean isDelete,
@JsonProperty("isactive") Boolean isActive,
@JsonProperty("created_by") Integer createdBy,
@JsonProperty("cdate") String cDate) {
this.requestId = requestId;
this.name = name;
this.mobile = mobile;
this.email = email;
this.address = address;
this.landmark = landmark;
this.zone = zone;
this.division = division;
this.area = area;
this.locality = locality;
this.street = street;
this.latitude = latitude;
this.longitude = longitude;
this.requestType = requestType;
this.garbageCategory = garbageCategory;
this.status = status;
this.statusId = statusId;
this.garbageCategory = garbageCategory;
this.isDelete = isDelete;
this.isActive = isActive;
this.createdBy = createdBy;
this.cDate = cDate;
}
public Integer getRequestId() {
return requestId;
}
public void setRequestId(Integer requestId) {
this.requestId = requestId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getLandmark() {
return landmark;
}
public void setLandmark(String landmark) {
this.landmark = landmark;
}
public String getZone() {
return zone;
}
public void setZone(String zone) {
this.zone = zone;
}
public String getDivision() {
return division;
}
public void setDivision(String division) {
this.division = division;
}
public String getArea() {
return area;
}
public void setArea(String area) {
this.area = area;
}
public String getLocality() {
return locality;
}
public void setLocality(String locality) {
this.locality = locality;
}
public String getStreet() {
return street;
}
public void setStreet(String street) {
this.street = street;
}
public String getLatitude() {
return latitude;
}
public void setLatitude(String latitude) {
this.latitude = latitude;
}
public String getLongitude() {
return longitude;
}
public void setLongitude(String longitude) {
this.longitude = longitude;
}
public String getRequestType() {
return requestType;
}
public void setRequestType(String requestType) {
this.requestType = requestType;
}
public String getGarbageCategory() {
return garbageCategory;
}
public void setGarbageCategory(String garbageCategory) {
this.garbageCategory = garbageCategory;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getStatusId() {
return statusId;
}
public void setStatusId(String statusId) {
this.statusId = statusId;
}
public Boolean getIsDelete() {
return isDelete;
}
public void setIsDelete(Boolean isDelete) {
this.isDelete = isDelete;
}
public Boolean getIsActive() {
return isActive;
}
public void setIsActive(Boolean isActive) {
this.isActive = isActive;
}
public Integer getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Integer createdBy) {
this.createdBy = createdBy;
}
public String getcDate() {
return cDate;
}
public void setcDate(String cDate) {
this.cDate = cDate;
}
}

100
src/main/java/in/gov/chennaicorporation/gccoffice/garbagecollection/modeldata/RequestStatus.java

@ -0,0 +1,100 @@
package in.gov.chennaicorporation.gccoffice.garbagecollection.modeldata;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
public class RequestStatus {
private Integer statusId;
private Integer requestId;
private String status;
private String comments;
private Boolean isDelete;
private Boolean isActive;
private Integer createdBy;
private String cDate;
@JsonCreator
public RequestStatus(@JsonProperty("request_status_id") Integer statusId,
@JsonProperty("request_id") Integer requestId,
@JsonProperty("status") String status,
@JsonProperty("comments") String comments,
@JsonProperty("isdelete") Boolean isDelete,
@JsonProperty("isactive") Boolean isActive,
@JsonProperty("created_by") Integer createdBy,
@JsonProperty("cdate") String cDate) {
this.statusId = statusId;
this.requestId = requestId;
this.status = status;
this.comments = comments;
this.isDelete = isDelete;
this.isActive = isActive;
this.createdBy = createdBy;
this.cDate = cDate;
}
public Integer getStatusId() {
return statusId;
}
public void setStatusId(Integer statusId) {
this.statusId = statusId;
}
public Integer getRequestId() {
return requestId;
}
public void setRequestId(Integer requestId) {
this.requestId = requestId;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getComments() {
return comments;
}
public void setComments(String comments) {
this.comments = comments;
}
public Boolean getIsDelete() {
return isDelete;
}
public void setIsDelete(Boolean isDelete) {
this.isDelete = isDelete;
}
public Boolean getIsActive() {
return isActive;
}
public void setIsActive(Boolean isActive) {
this.isActive = isActive;
}
public Integer getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Integer createdBy) {
this.createdBy = createdBy;
}
public String getcDate() {
return cDate;
}
public void setcDate(String cDate) {
this.cDate = cDate;
}
}

279
src/main/java/in/gov/chennaicorporation/gccoffice/interceptor/AppInterceptor.java

@ -0,0 +1,279 @@
package in.gov.chennaicorporation.gccoffice.interceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
import org.springframework.security.web.util.matcher.RequestMatcher;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
import in.gov.chennaicorporation.gccoffice.entity.AppModuleAccessEntity;
import in.gov.chennaicorporation.gccoffice.entity.AppModuleEntity;
import in.gov.chennaicorporation.gccoffice.entity.MenuItemAccessEntity;
import in.gov.chennaicorporation.gccoffice.entity.MenuItemEntity;
import in.gov.chennaicorporation.gccoffice.entity.SubMenuItemAccessEntity;
import in.gov.chennaicorporation.gccoffice.entity.SubMenuItemEntity;
import in.gov.chennaicorporation.gccoffice.repository.AppModuleAccessRepository;
import in.gov.chennaicorporation.gccoffice.repository.AppModuleRepository;
import in.gov.chennaicorporation.gccoffice.repository.MenuItemAccessRepository;
import in.gov.chennaicorporation.gccoffice.repository.MenuItemRepository;
import in.gov.chennaicorporation.gccoffice.repository.SubMenuItemAccessRepository;
import in.gov.chennaicorporation.gccoffice.repository.SubMenuItemRepository;
import in.gov.chennaicorporation.gccoffice.service.LoginUserInfo;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class AppInterceptor implements HandlerInterceptor {
List<AppModuleAccessEntity> getAppModuleAccessEntities;
List<MenuItemAccessEntity> getMenuItemAccessEntities;
List<SubMenuItemAccessEntity> getSubMenuItemAccessEntities;
private AppModuleAccessRepository appModuleAccessRepository;
private MenuItemAccessRepository menuItemAccessRepository;
private SubMenuItemAccessRepository subMenuItemAccessRepository;
List<AppModuleEntity> getAppModuleEntities;
List<MenuItemEntity> getMenuItemEntities;
List<SubMenuItemEntity> getSubMenuItemEntities;
private AppModuleRepository appModuleRepository;
private MenuItemRepository menuItemRepository;
private SubMenuItemRepository subMenuItemRepository;
@Autowired
public AppInterceptor(AppModuleAccessRepository appModuleAccessRepository,
MenuItemAccessRepository menuItemAccessRepository,
SubMenuItemAccessRepository subMenuItemAccessRepository,
AppModuleRepository appModuleRepository,
MenuItemRepository menuItemRepository,
SubMenuItemRepository subMenuItemRepository) {
this.appModuleAccessRepository = appModuleAccessRepository;
this.menuItemAccessRepository = menuItemAccessRepository;
this.subMenuItemAccessRepository = subMenuItemAccessRepository;
this.appModuleRepository = appModuleRepository;
this.menuItemRepository = menuItemRepository;
this.subMenuItemRepository = subMenuItemRepository;
}
private boolean isLoginPage(HttpServletRequest request) {
RequestMatcher loginPageMatcher = new AntPathRequestMatcher("/login");
return loginPageMatcher.matches(request);
}
private boolean isErrorPage(HttpServletRequest request) {
RequestMatcher errorPageMatcher = new AntPathRequestMatcher("/error");
return errorPageMatcher.matches(request);
}
private boolean isfavicon(HttpServletRequest request) {
RequestMatcher loginPageMatcher = new AntPathRequestMatcher("/favicon.ico");
return loginPageMatcher.matches(request);
}
public static String[] Split(String request,String patten) {
String path = request;
// Split the string by "/"
String[] parts = path.split(patten);
/*
// Display the parts
for (String part : parts) {
System.out.println(part);
}
*/
return parts;
}
private boolean hasModuleAccess(String moduleName) {
getAppModuleEntities = appModuleRepository.findByModulePath(moduleName);
System.out.println("DataTable Size for the url ("+moduleName+"): "+getAppModuleEntities.size());
String moduleid = null;
if(getAppModuleEntities.size()>0) {
for ( AppModuleEntity appModuleEntity : getAppModuleEntities) {
moduleid = appModuleEntity.getId().toString();
}
if(moduleid != null) {
String userGroupId = LoginUserInfo.getUserGroupId();
System.out.println("Query input`s :\n userGroupId : "+userGroupId+"\n moduleid : "+moduleid);
getAppModuleAccessEntities = appModuleAccessRepository.findByAll(userGroupId,moduleid);
if(getAppModuleAccessEntities.size()>0) {
return true;
}
}
}
return false;
}
private boolean hasMenuAccess(String url,String moduleName,String menuName) {
if(!hasModuleAccess(moduleName)) {return false; }
getMenuItemEntities = menuItemRepository.findByUrl(url);
System.out.println("DataTable Size for the url ("+url+"): "+getMenuItemEntities.size());
String moduleid = null;
String menuid = null;
if(getMenuItemEntities.size()>0) {
for (MenuItemEntity MenuEntity : getMenuItemEntities) {
moduleid = MenuEntity.getModuleId().getId().toString();
menuid = MenuEntity.getId().toString();
}
if(moduleid != null && menuid != null) {
String userGroupId = LoginUserInfo.getUserGroupId();
System.out.println("Query input`s :\n userGroupId : "+userGroupId+"\n moduleid : "+moduleid+"\n menuid : "+menuid);
getMenuItemAccessEntities = menuItemAccessRepository.findByAll(userGroupId,moduleid,menuid);
if(getMenuItemAccessEntities.size()>0) {
return true;
}
}
}
return false;
}
private boolean hasSubMenuAccess(String url,String moduleName,String menuName,String subMenuName) {
if(!hasModuleAccess(moduleName)) {return false; }
getSubMenuItemEntities = subMenuItemRepository.findByUrl(url);
System.out.println("DataTable Size for the url ("+url+"): "+getSubMenuItemEntities.size());
String moduleid = null;
String menuid = null;
String submenuid = null;
if(getSubMenuItemEntities.size()>0) {
for (SubMenuItemEntity subMenuEntity : getSubMenuItemEntities) {
moduleid = subMenuEntity.getModuleId().getId().toString();
menuid = subMenuEntity.getMenuItemId().getId().toString();
submenuid = subMenuEntity.getId().toString();
}
if(moduleid != null && menuid != null && submenuid != null) {
String userGroupId = LoginUserInfo.getUserGroupId();
System.out.println("Query input`s :\n userGroupId : "+userGroupId+"\n moduleid : "+moduleid+"\n menuid : "+menuid+"\n submenuid : "+submenuid);
getSubMenuItemAccessEntities = subMenuItemAccessRepository.findByAll(userGroupId,moduleid,menuid,submenuid);
if(getSubMenuItemAccessEntities.size()>0) {
// Check Parent Menu Access (Menu Access)
if(moduleid != null && menuid != null) {
System.out.println("Query input`s :\n userGroupId : "+userGroupId+"\n moduleid : "+moduleid+"\n menuid : "+menuid);
getMenuItemAccessEntities = menuItemAccessRepository.findByAll(userGroupId,moduleid,menuid);
if(getMenuItemAccessEntities.size()>0) {
return true;
}
}
}
}
}
return false;
}
private boolean hasAccess(String path) {
if(LoginUserInfo.getUserRole().equals("ADMIN")) {
return true;
}
String url = removeLeadingSlash(path);
System.out.println("Give URL : "+path+" After remove leading slash : "+url);
// If default home page
if(path.equals("/")) {
return true;
}
//continue for access check
String[] parts = Split(url, "/");
if(parts.length<=0) {return true;}
System.out.println(parts.length);
if(parts.length>0) {
int j=0;
for (String part : parts) {
System.out.println(j+") URL SPLIT: "+part);
j++;
}
String moduleName = "";
String menuName = "";
String subMenuName = "";
if(parts.length==1) { // Check Only Module Access
moduleName = parts[0];
return hasModuleAccess(moduleName);
}
else if(parts.length==2) { // Check Module & Menu Access
moduleName = parts[0];
menuName = parts[1];
subMenuName = "";
return hasMenuAccess(url,moduleName,menuName);
}
else if(parts.length==3) { // Check Module , Menu & Sub-Menu Access
moduleName = parts[0];
menuName = parts[1];
subMenuName = parts[2];
return hasSubMenuAccess(url,moduleName,menuName,subMenuName);
}
}
return false;
}
public static String removeLeadingSlash(String input) {
if (input.startsWith("/")) {
return input.substring(1);
}
return input;
}
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
if (!isLoginPage(request) && !isErrorPage(request) && !isfavicon(request)) {
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
if (authentication != null && authentication.isAuthenticated()) {
String fullRequestURI = request.getRequestURI();
String contextPath = request.getContextPath();
String path = fullRequestURI.substring(contextPath.length());
if(!hasAccess(path)) {
Object principal = authentication.getPrincipal();
UserDetails userDetails = (UserDetails) principal;
System.out.println("1) Access Deny For --- " + userDetails.getAuthorities().toString());
// Redirect to the error page
//response.sendRedirect(request.getContextPath() + "/error");
request.getRequestDispatcher("/error").forward(request, response);
}
}
}
// Continue with the request processing
return true;
}
@Override
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,
ModelAndView modelAndView) throws Exception {
// Check if the current request matches the login or error page URLs
if (!isLoginPage(request) && !isErrorPage(request) && !isfavicon(request)) {
if (modelAndView != null) {
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
if (authentication != null && authentication.isAuthenticated()) {
Object principal = authentication.getPrincipal();
if (principal instanceof UserDetails) {
UserDetails userDetails = (UserDetails) principal;
modelAndView.addObject("currentUserDetails", userDetails);
}
}
}
}
}
}

63
src/main/java/in/gov/chennaicorporation/gccoffice/modeldata/Employee.java

@ -0,0 +1,63 @@
package in.gov.chennaicorporation.gccoffice.modeldata;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
public class Employee {
@JsonFormat(pattern = "yyyy/MM/dd")
@JsonProperty("start_date")
private Date startDate;
private Integer id;
private String position;
private String name;
private Double salary;
private String office;
private Integer extn;
public Date getStartDate() {
return startDate;
}
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getPosition() {
return position;
}
public void setPosition(String position) {
this.position = position;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Double getSalary() {
return salary;
}
public void setSalary(Double salary) {
this.salary = salary;
}
public String getOffice() {
return office;
}
public void setOffice(String office) {
this.office = office;
}
public Integer getExtn() {
return extn;
}
public void setExtn(Integer extn) {
this.extn = extn;
}
}

55
src/main/java/in/gov/chennaicorporation/gccoffice/modeldata/ErrorResponse.java

@ -0,0 +1,55 @@
package in.gov.chennaicorporation.gccoffice.modeldata;
public class ErrorResponse {
private int status;
private String error;
private String message;
private String exception;
// Constructors, getters, and setters for the above fields
public ErrorResponse(int status, String error, String message, String exception) {
this.status = status;
this.error = error;
this.message = message;
this.exception = exception;
}
public ErrorResponse() {
super();
// TODO Auto-generated constructor stub
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public String getError() {
return error;
}
public void setError(String error) {
this.error = error;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getException() {
return exception;
}
public void setException(String exception) {
this.exception = exception;
}
}

119
src/main/java/in/gov/chennaicorporation/gccoffice/mtm/controller/APIController.java

@ -0,0 +1,119 @@
package in.gov.chennaicorporation.gccoffice.mtm.controller;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.util.UriComponentsBuilder;
import in.gov.chennaicorporation.gccoffice.configuration.AppConfig;
@RequestMapping("/api/mtm")
@RestController("mtmapicontroller")
public class APIController {
private final RestTemplate restTemplate;
private final AppConfig appConfig;
String bodyMessage = "";
@Autowired
public APIController(RestTemplate restTemplate, AppConfig appConfig) {
this.restTemplate = restTemplate;
this.appConfig = appConfig;
}
@GetMapping(value="/setEventId")
public String setEventId(HttpSession session,
@RequestParam("eventid") String eventid){
if ("0".equals(eventid)) {
session.setAttribute("eventid", null);
}else{
session.setAttribute("eventid", eventid);
}
return "success";
}
/*
@GetMapping(value = "/dashboard")
public String getFeedbackAssetdetails(@RequestParam String fbId) {
String feedbackId = fbId;
ResponseEntity<String> response = restTemplate.getForEntity(appConfig.qrAssetFeedback+"/api/feedback/{feedbackId}",String.class,feedbackId);
bodyMessage = response.getBody().trim();
return bodyMessage;
}
*/
@GetMapping(value = "/getPetitionStatusPublic")
public String getPetitionStatusPublic(@RequestParam String petition_no) {
String baseURL = appConfig.mtm+"/api/getPetitionStatusPublic";
UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromUriString(baseURL)
.queryParam("petition_no", petition_no);
ResponseEntity<String> response = restTemplate.getForEntity(uriComponentsBuilder.toUriString(),String.class);
bodyMessage = response.getBody().trim();
return bodyMessage;
}
@GetMapping(value = "/getComMappingDetailsByPetId")
public String getComMappingDetailsByPetId(@RequestParam String petid) {
String baseURL = appConfig.mtm+"/api/getComMappingDetailsByPetId";
UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromUriString(baseURL)
.queryParam("petid", petid);
ResponseEntity<String> response = restTemplate.getForEntity(uriComponentsBuilder.toUriString(),String.class);
bodyMessage = response.getBody().trim();
return bodyMessage;
}
@GetMapping(value = "/getComMappingActionByMapId")
public String getComMappingActionByMapId(@RequestParam String mapid) {
String baseURL = appConfig.mtm+"/api/getComMappingActionByMapId";
UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromUriString(baseURL)
.queryParam("mapid", mapid);
ResponseEntity<String> response = restTemplate.getForEntity(uriComponentsBuilder.toUriString(),String.class);
bodyMessage = response.getBody().trim();
return bodyMessage;
}
@GetMapping(value = "/petitionFilesBypetitionId")
public String petitionFilesBypetitionId(@RequestParam String pid) {
String baseURL = appConfig.mtm+"/api/petitionFilesBypetitionId";
UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromUriString(baseURL)
.queryParam("pid", pid);
ResponseEntity<String> response = restTemplate.getForEntity(uriComponentsBuilder.toUriString(),String.class);
bodyMessage = response.getBody().trim();
return bodyMessage;
}
@GetMapping(value = "/viewBlobData")
public String viewBlobData(@RequestParam String id,@RequestParam String table) {
String baseURL = appConfig.mtm+"/api/viewBlobData";
UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromUriString(baseURL)
.queryParam("id", id)
.queryParam("table", table);
ResponseEntity<String> response = restTemplate.getForEntity(uriComponentsBuilder.toUriString(),String.class);
bodyMessage = response.getBody().trim();
return bodyMessage;
}
@GetMapping(value = "/getComMappingDetailsByMapId")
public String getComMappingDetailsByMapId(@RequestParam String mapid) {
String baseURL = appConfig.mtm+"/api/getComMappingDetailsByMapId";
UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromUriString(baseURL)
.queryParam("mapid", mapid);
ResponseEntity<String> response = restTemplate.getForEntity(uriComponentsBuilder.toUriString(),String.class);
bodyMessage = response.getBody().trim();
return bodyMessage;
}
}

46
src/main/java/in/gov/chennaicorporation/gccoffice/mtm/controller/MainController.java

@ -0,0 +1,46 @@
package in.gov.chennaicorporation.gccoffice.mtm.controller;
import java.util.Arrays;
import java.util.List;
import javax.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.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.client.RestTemplate;
import in.gov.chennaicorporation.gccoffice.configuration.AppConfig;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.Asset;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.AssetCategory;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.AssetCategoryQuestion;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.AssetParameter;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.AssetParameterQuestions;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.AssetQuestion;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.Feedback;
import in.gov.chennaicorporation.gccoffice.service.LoginUserInfo;
@RequestMapping("/mtm")
@Controller("mtmController")
public class MainController {
private final RestTemplate restTemplate;
private final LoginUserInfo loginUserInfo;
private final AppConfig appConfig;
@Autowired
public MainController(RestTemplate restTemplate, AppConfig appConfig,LoginUserInfo loginUserInfo) {
this.restTemplate = restTemplate;
this.appConfig = appConfig;
this.loginUserInfo = loginUserInfo;
}
@GetMapping({"", "/", "/index", "/dashboard"})
public String home(Model model,HttpSession session) {
session.setAttribute("userName", loginUserInfo.getLoginUserId().toString());
return "modules/mtm/index";
}
}

276
src/main/java/in/gov/chennaicorporation/gccoffice/mtm/controller/MayorController.java

@ -0,0 +1,276 @@
package in.gov.chennaicorporation.gccoffice.mtm.controller;
import javax.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.RequestMapping;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.util.UriComponentsBuilder;
import in.gov.chennaicorporation.gccoffice.configuration.AppConfig;
import in.gov.chennaicorporation.gccoffice.mtm.data.MTMOfficer;
import in.gov.chennaicorporation.gccoffice.mtm.data.MtmEvent;
import in.gov.chennaicorporation.gccoffice.mtm.data.Petition;
import in.gov.chennaicorporation.gccoffice.mtm.data.PetitionComplaint;
import in.gov.chennaicorporation.gccoffice.service.LoginUserInfo;
@RequestMapping("/mtm/mayor")
@Controller("mtmMayorController")
public class MayorController {
private final RestTemplate restTemplate;
private final AppConfig appConfig;
private final LoginUserInfo loginUserInfo;
private final String basePath = "modules/mtm/mayor";
@Autowired
public MayorController(RestTemplate restTemplate, AppConfig appConfig, LoginUserInfo loginUserInfo) {
this.restTemplate = restTemplate;
this.loginUserInfo = loginUserInfo;
this.appConfig = appConfig;
}
@GetMapping({"", "/", "/index", "/dashboard"})
public String home(Model model) {
return basePath+"/index";
}
@GetMapping({"/petition-list"})
public String showPetitionList(Model model,HttpSession session) {
String eventid = "0";
if(session.getAttribute("eventid")!= null && !session.getAttribute("eventid").equals("0")){
eventid = session.getAttribute("eventid").toString();
}
String baseUrl = appConfig.mtm + "/api/mayor/petition-list";
UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(baseUrl)
.queryParam("mtmid",eventid);
Petition[] petitionList = restTemplate.getForObject(builder.toUriString(), Petition[].class);
model.addAttribute("petitionlist",petitionList);
baseUrl = appConfig.mtm + "/api/event-list";
MtmEvent[] mtmEventsList = restTemplate.getForObject(baseUrl, MtmEvent[].class);
model.addAttribute("mtmEventsList",mtmEventsList);
/*
baseUrl = appConfig.mtm + "/api/complainttypes";
MtmComplaintTypes[] mtmComplaintTypesList = restTemplate.getForObject(baseUrl, MtmComplaintTypes[].class);
model.addAttribute("complaintTypesList",mtmComplaintTypesList);
//System.out.println("Length: "+mtmComplaintTypesList.length);
*/
return basePath+"/petition-list";
}
@GetMapping({"/completed-petition-list"})
public String showCompletedPetitionList(Model model,HttpSession session) {
String eventid = "0";
if(session.getAttribute("eventid")!= null && !session.getAttribute("eventid").equals("0")){
eventid = session.getAttribute("eventid").toString();
}
String baseUrl = appConfig.mtm + "/api/mayor/completed-petition-list";
UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(baseUrl)
.queryParam("mtmid",eventid);
Petition[] petitionList = restTemplate.getForObject(builder.toUriString(), Petition[].class);
model.addAttribute("petitionlist",petitionList);
baseUrl = appConfig.mtm + "/api/event-list";
MtmEvent[] mtmEventsList = restTemplate.getForObject(baseUrl, MtmEvent[].class);
model.addAttribute("mtmEventsList",mtmEventsList);
/*
baseUrl = appConfig.mtm + "/api/complainttypes";
MtmComplaintTypes[] mtmComplaintTypesList = restTemplate.getForObject(baseUrl, MtmComplaintTypes[].class);
model.addAttribute("complaintTypesList",mtmComplaintTypesList);
//System.out.println("Length: "+mtmComplaintTypesList.length);
*/
return basePath+"/completed-petition-list";
}
@GetMapping({"/partial-petition-list"})
public String showPartialPetitionList(Model model,HttpSession session) {
String eventid = "0";
if(session.getAttribute("eventid")!= null && !session.getAttribute("eventid").equals("0")){
eventid = session.getAttribute("eventid").toString();
}
String baseUrl = appConfig.mtm + "/api/mayor/partial-petition-list";
UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(baseUrl)
.queryParam("mtmid",eventid);
Petition[] petitionList = restTemplate.getForObject(builder.toUriString(), Petition[].class);
model.addAttribute("petitionlist",petitionList);
baseUrl = appConfig.mtm + "/api/event-list";
MtmEvent[] mtmEventsList = restTemplate.getForObject(baseUrl, MtmEvent[].class);
model.addAttribute("mtmEventsList",mtmEventsList);
/*
baseUrl = appConfig.mtm + "/api/complainttypes";
MtmComplaintTypes[] mtmComplaintTypesList = restTemplate.getForObject(baseUrl, MtmComplaintTypes[].class);
model.addAttribute("complaintTypesList",mtmComplaintTypesList);
//System.out.println("Length: "+mtmComplaintTypesList.length);
*/
return basePath+"/partial-petition-list";
}
@GetMapping({"/pending-petition-list"})
public String showPendingPetitionList(Model model,HttpSession session) {
String eventid = "0";
if(session.getAttribute("eventid")!= null && !session.getAttribute("eventid").equals("0")){
eventid = session.getAttribute("eventid").toString();
}
String baseUrl = appConfig.mtm + "/api/mayor/pending-petition-list";
UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(baseUrl)
.queryParam("mtmid",eventid);
Petition[] petitionList = restTemplate.getForObject(builder.toUriString(), Petition[].class);
model.addAttribute("petitionlist",petitionList);
baseUrl = appConfig.mtm + "/api/event-list";
MtmEvent[] mtmEventsList = restTemplate.getForObject(baseUrl, MtmEvent[].class);
model.addAttribute("mtmEventsList",mtmEventsList);
/*
baseUrl = appConfig.mtm + "/api/complainttypes";
MtmComplaintTypes[] mtmComplaintTypesList = restTemplate.getForObject(baseUrl, MtmComplaintTypes[].class);
model.addAttribute("complaintTypesList",mtmComplaintTypesList);
//System.out.println("Length: "+mtmComplaintTypesList.length);
*
*/
return basePath+"/pending-petition-list";
}
@GetMapping({"/complaint-list"})
public String showComplaintList(Model model,HttpSession session) {
String eventid = "0";
if(session.getAttribute("eventid")!= null && !session.getAttribute("eventid").equals("0")){
eventid = session.getAttribute("eventid").toString();
}
String baseUrl = appConfig.mtm + "/api/mayor/complaint-list";
UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(baseUrl)
.queryParam("mtmid",eventid);
PetitionComplaint[] petitionList = restTemplate.getForObject(builder.toUriString(), PetitionComplaint[].class);
model.addAttribute("petitionlist",petitionList);
baseUrl = appConfig.mtm + "/api/event-list";
MtmEvent[] mtmEventsList = restTemplate.getForObject(baseUrl, MtmEvent[].class);
model.addAttribute("mtmEventsList",mtmEventsList);
/*
baseUrl = appConfig.mtm + "/api/complainttypes";
MtmComplaintTypes[] mtmComplaintTypesList = restTemplate.getForObject(baseUrl, MtmComplaintTypes[].class);
model.addAttribute("complaintTypesList",mtmComplaintTypesList);
*/
return basePath+"/complaint-list";
}
@GetMapping({"/completed-complaint-list"})
public String showCompletedComplaintList(Model model,HttpSession session) {
String eventid = "0";
if(session.getAttribute("eventid")!= null && !session.getAttribute("eventid").equals("0")){
eventid = session.getAttribute("eventid").toString();
}
String baseUrl = appConfig.mtm + "/api/mayor/completed-complaint-list";
UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(baseUrl)
.queryParam("mtmid",eventid);
PetitionComplaint[] petitionList = restTemplate.getForObject(builder.toUriString(), PetitionComplaint[].class);
model.addAttribute("petitionlist",petitionList);
baseUrl = appConfig.mtm + "/api/event-list";
MtmEvent[] mtmEventsList = restTemplate.getForObject(baseUrl, MtmEvent[].class);
model.addAttribute("mtmEventsList",mtmEventsList);
/*
baseUrl = appConfig.mtm + "/api/complainttypes";
MtmComplaintTypes[] mtmComplaintTypesList = restTemplate.getForObject(baseUrl, MtmComplaintTypes[].class);
model.addAttribute("complaintTypesList",mtmComplaintTypesList);
*/
return basePath+"/completed-complaint-list";
}
@GetMapping({"/pending-complaint-list"})
public String showPendingComplaintList(Model model,HttpSession session) {
String eventid = "0";
if(session.getAttribute("eventid")!= null && !session.getAttribute("eventid").equals("0")){
eventid = session.getAttribute("eventid").toString();
}
String baseUrl = appConfig.mtm + "/api/mayor/pending-complaint-list";
UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(baseUrl)
.queryParam("mtmid",eventid);
PetitionComplaint[] petitionList = restTemplate.getForObject(builder.toUriString(), PetitionComplaint[].class);
model.addAttribute("petitionlist",petitionList);
baseUrl = appConfig.mtm + "/api/event-list";
MtmEvent[] mtmEventsList = restTemplate.getForObject(baseUrl, MtmEvent[].class);
model.addAttribute("mtmEventsList",mtmEventsList);
/*
baseUrl = appConfig.mtm + "/api/complainttypes";
MtmComplaintTypes[] mtmComplaintTypesList = restTemplate.getForObject(baseUrl, MtmComplaintTypes[].class);
model.addAttribute("complaintTypesList",mtmComplaintTypesList);
*/
return basePath+"/completed-complaint-list";
}
@GetMapping({"/by-event-list"})
public String showEventListReport(Model model,HttpSession session) {
String eventid = "0";
if(session.getAttribute("eventid")!= null && !session.getAttribute("eventid").equals("0")){
eventid = session.getAttribute("eventid").toString();
}
String baseUrl = appConfig.mtm + "/api/mayor/by-event-list";
UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(baseUrl)
.queryParam("mtmid",eventid);
MtmEvent[] mtmEventsTableList = restTemplate.getForObject(builder.toUriString(), MtmEvent[].class);
model.addAttribute("mtmEventsTableList",mtmEventsTableList);
baseUrl = appConfig.mtm + "/api/event-list";
MtmEvent[] mtmEventsList = restTemplate.getForObject(baseUrl, MtmEvent[].class);
model.addAttribute("mtmEventsList",mtmEventsList);
return basePath+"/by-event-list";
}
@GetMapping({"/by-officer-list"})
public String showOfficerListReport(Model model,HttpSession session) {
String eventid = "0";
if(session.getAttribute("eventid")!= null && !session.getAttribute("eventid").equals("0")){
eventid = session.getAttribute("eventid").toString();
}
String baseUrl = appConfig.mtm + "/api/mayor/by-officer-list";
UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(baseUrl)
.queryParam("mtmid",eventid);
MTMOfficer[] officerTableList = restTemplate.getForObject(builder.toUriString(), MTMOfficer[].class);
model.addAttribute("officerTableList",officerTableList);
baseUrl = appConfig.mtm + "/api/event-list";
MtmEvent[] mtmEventsList = restTemplate.getForObject(baseUrl, MtmEvent[].class);
model.addAttribute("mtmEventsList",mtmEventsList);
return basePath+"/by-officer-list";
}
}

46
src/main/java/in/gov/chennaicorporation/gccoffice/mtm/controller/OfficerController.java

@ -0,0 +1,46 @@
package in.gov.chennaicorporation.gccoffice.mtm.controller;
import java.util.Arrays;
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;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.client.RestTemplate;
import in.gov.chennaicorporation.gccoffice.configuration.AppConfig;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.Asset;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.AssetCategory;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.AssetCategoryQuestion;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.AssetParameter;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.AssetParameterQuestions;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.AssetQuestion;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.Feedback;
@RequestMapping("/mtm/officer")
@Controller("mtmOfficerController")
public class OfficerController {
private final RestTemplate restTemplate;
private final AppConfig appConfig;
private final String basePath = "modules/mtm/officer";
@Autowired
public OfficerController(RestTemplate restTemplate, AppConfig appConfig) {
this.restTemplate = restTemplate;
this.appConfig = appConfig;
}
@GetMapping({"", "/", "/index", "/dashboard"})
public String home(Model model) {
return basePath+"/index";
}
@GetMapping({"/petition-list"})
public String showPetitionList(Model model) {
return basePath+"/petition-list";
}
}

1
src/main/java/in/gov/chennaicorporation/gccoffice/mtm/controller/package-info.java

@ -0,0 +1 @@
package in.gov.chennaicorporation.gccoffice.mtm.controller;

191
src/main/java/in/gov/chennaicorporation/gccoffice/mtm/data/MTMOfficer.java

@ -0,0 +1,191 @@
package in.gov.chennaicorporation.gccoffice.mtm.data;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
public class MTMOfficer {
private String mapId;
private String petitionNumber;
private String mtmEventsPetitionId;
private String mtmEvents;
private String offID;
private String status;
private String mtmComplaintTypes;
private String isDelete;
private String isActive;
private String createdBy;
private String cDate;
private String officerName;
private String eventName;
private String officerPetitionCount;
private String officerCompletedCount;
private String officerPendingCount;
@JsonCreator
public MTMOfficer(
@JsonProperty("mapId") String mapId,
@JsonProperty("petitionNumber") String petitionNumber,
@JsonProperty("mtmEventsPetitionId") String mtmEventsPetitionId,
@JsonProperty("mtmEvents") String mtmEvents,
@JsonProperty("offID") String offID,
@JsonProperty("status") String status,
@JsonProperty("mtmComplaintTypes") String mtmComplaintTypes,
@JsonProperty("isDelete") String isDelete,
@JsonProperty("isActive") String isActive,
@JsonProperty("createdBy") String createdBy,
@JsonProperty("cDate") String cDate,
@JsonProperty("officer_name") String officerName,
@JsonProperty("event_name") String eventName,
@JsonProperty("officer_petition_count") String officerPetitionCount,
@JsonProperty("officer_completed_count") String officerCompletedCount,
@JsonProperty("officer_pending_count") String officerPendingCount
) {
this.mapId = mapId;
this.petitionNumber = petitionNumber;
this.mtmEventsPetitionId = mtmEventsPetitionId;
this.mtmEvents = mtmEvents;
this.offID = offID;
this.status = status;
this.mtmComplaintTypes = mtmComplaintTypes;
this.isDelete = isDelete;
this.isActive = isActive;
this.createdBy = createdBy;
this.cDate = cDate;
this.officerName = officerName;
this.eventName = eventName;
this.officerPetitionCount = officerPetitionCount;
this.officerCompletedCount = officerCompletedCount;
this.officerPendingCount = officerPendingCount;
}
public String getMapId() {
return mapId;
}
public void setMapId(String mapId) {
this.mapId = mapId;
}
public String getPetitionNumber() {
return petitionNumber;
}
public void setPetitionNumber(String petitionNumber) {
this.petitionNumber = petitionNumber;
}
public String getMtmEventsPetitionId() {
return mtmEventsPetitionId;
}
public void setMtmEventsPetitionId(String mtmEventsPetitionId) {
this.mtmEventsPetitionId = mtmEventsPetitionId;
}
public String getMtmEvents() {
return mtmEvents;
}
public void setMtmEvents(String mtmEvents) {
this.mtmEvents = mtmEvents;
}
public String getOffID() {
return offID;
}
public void setOffID(String offID) {
this.offID = offID;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getMtmComplaintTypes() {
return mtmComplaintTypes;
}
public void setMtmComplaintTypes(String mtmComplaintTypes) {
this.mtmComplaintTypes = mtmComplaintTypes;
}
public String getIsDelete() {
return isDelete;
}
public void setIsDelete(String isDelete) {
this.isDelete = isDelete;
}
public String getIsActive() {
return isActive;
}
public void setIsActive(String isActive) {
this.isActive = isActive;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public String getcDate() {
return cDate;
}
public void setcDate(String cDate) {
this.cDate = cDate;
}
public String getOfficerName() {
return officerName;
}
public void setOfficerName(String officerName) {
this.officerName = officerName;
}
public String getEventName() {
return eventName;
}
public void setEventName(String eventName) {
this.eventName = eventName;
}
public String getOfficerPetitionCount() {
return officerPetitionCount;
}
public void setOfficerPetitionCount(String officerPetitionCount) {
this.officerPetitionCount = officerPetitionCount;
}
public String getOfficerCompletedCount() {
return officerCompletedCount;
}
public void setOfficerCompletedCount(String officerCompletedCount) {
this.officerCompletedCount = officerCompletedCount;
}
public String getOfficerPendingCount() {
return officerPendingCount;
}
public void setOfficerPendingCount(String officerPendingCount) {
this.officerPendingCount = officerPendingCount;
}
}

83
src/main/java/in/gov/chennaicorporation/gccoffice/mtm/data/MtmComplaintTypes.java

@ -0,0 +1,83 @@
package in.gov.chennaicorporation.gccoffice.mtm.data;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.AssetParameterQuestions.AssetCategory;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.AssetParameterQuestions.AssetParameter;
public class MtmComplaintTypes {
private Long complaintTypeId;
private String complaintType;
private Boolean isDelete;
private Boolean isActive;
private Long createdBy;
private String cDate;
@JsonCreator
public MtmComplaintTypes(
@JsonProperty("complaintTypeId") Long complaintTypeId,
@JsonProperty("complaintType") String complaintType,
@JsonProperty("isDelete") Boolean isDelete,
@JsonProperty("isActive") Boolean isActive,
@JsonProperty("createdBy") Long createdBy,
@JsonProperty("cDate") String cDate
) {
this.complaintTypeId = complaintTypeId;
this.complaintType = complaintType;
this.isDelete = isDelete;
this.isActive = isActive;
this.createdBy = createdBy;
this.cDate = cDate;
}
public Long getComplaintTypeId() {
return complaintTypeId;
}
public void setComplaintTypeId(Long complaintTypeId) {
this.complaintTypeId = complaintTypeId;
}
public String getComplaintType() {
return complaintType;
}
public void setComplaintType(String complaintType) {
this.complaintType = complaintType;
}
public Boolean getIsDelete() {
return isDelete;
}
public void setIsDelete(Boolean isDelete) {
this.isDelete = isDelete;
}
public Boolean getIsActive() {
return isActive;
}
public void setIsActive(Boolean isActive) {
this.isActive = isActive;
}
public Long getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Long createdBy) {
this.createdBy = createdBy;
}
public String getcDate() {
return cDate;
}
public void setcDate(String cDate) {
this.cDate = cDate;
}
}

226
src/main/java/in/gov/chennaicorporation/gccoffice/mtm/data/MtmEvent.java

@ -0,0 +1,226 @@
package in.gov.chennaicorporation.gccoffice.mtm.data;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
public class MtmEvent {
private Long mtmId;
private String eventName;
private String eventAddress;
private String eventDate;
private String zone;
private String ackNo;
private Long startPetId;
private Boolean isDelete;
private Boolean isActive;
private Long createdBy;
private String cDate;
private String event_date;
private Long total_petitions;
private Long petitions_completed;
private Long petition_partially_completed;
private Long petitions_pending;
private Long total_compliants;
private Long compliants_completed;
private Long compliants_pending;
// Constructors, getters, and setters
@JsonCreator
public MtmEvent(
@JsonProperty("mtmId") Long mtmId,
@JsonProperty("eventName") String eventName,
@JsonProperty("eventAddress") String eventAddress,
@JsonProperty("eventDate") String eventDate,
@JsonProperty("zone") String zone,
@JsonProperty("ackNo") String ackNo,
@JsonProperty("startPetId") Long startPetId,
@JsonProperty("isDelete") Boolean isDelete,
@JsonProperty("isActive") Boolean isActive,
@JsonProperty("createdBy") Long createdBy,
@JsonProperty("cDate") String cDate,
@JsonProperty("event_date") String event_date,
@JsonProperty("total_petitions") Long total_petitions,
@JsonProperty("petitions_completed") Long petitions_completed,
@JsonProperty("petition_partially_completed") Long petition_partially_completed,
@JsonProperty("petitions_pending") Long petitions_pending,
@JsonProperty("total_compliants") Long total_compliants,
@JsonProperty("compliants_completed") Long compliants_completed,
@JsonProperty("compliants_pending") Long compliants_pending
) {
this.mtmId = mtmId;
this.eventName = eventName;
this.eventAddress = eventAddress;
this.eventDate = eventDate;
this.zone = zone;
this.ackNo = ackNo;
this.startPetId = startPetId;
this.isDelete = isDelete;
this.isActive = isActive;
this.createdBy = createdBy;
this.cDate = cDate;
this.event_date = event_date;
this.total_petitions = total_petitions;
this.petitions_completed = petitions_completed;
this.petition_partially_completed = petition_partially_completed;
this.petitions_pending = petitions_pending;
this.total_compliants = total_compliants;
this.compliants_completed = compliants_completed;
this.compliants_pending = compliants_pending;
}
public Long getMtmId() {
return mtmId;
}
public void setMtmId(Long mtmId) {
this.mtmId = mtmId;
}
public String getEventName() {
return eventName;
}
public void setEventName(String eventName) {
this.eventName = eventName;
}
public String getEventAddress() {
return eventAddress;
}
public void setEventAddress(String eventAddress) {
this.eventAddress = eventAddress;
}
public String getEventDate() {
return eventDate;
}
public void setEventDate(String eventDate) {
this.eventDate = eventDate;
}
public String getZone() {
return zone;
}
public void setZone(String zone) {
this.zone = zone;
}
public String getAckNo() {
return ackNo;
}
public void setAckNo(String ackNo) {
this.ackNo = ackNo;
}
public Long getStartPetId() {
return startPetId;
}
public void setStartPetId(Long startPetId) {
this.startPetId = startPetId;
}
public Boolean getIsDelete() {
return isDelete;
}
public void setIsDelete(Boolean isDelete) {
this.isDelete = isDelete;
}
public Boolean getIsActive() {
return isActive;
}
public void setIsActive(Boolean isActive) {
this.isActive = isActive;
}
public Long getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Long createdBy) {
this.createdBy = createdBy;
}
public String getcDate() {
return cDate;
}
public void setcDate(String cDate) {
this.cDate = cDate;
}
public String getEvent_date() {
return event_date;
}
public void setEvent_date(String event_date) {
this.event_date = event_date;
}
public Long getTotal_petitions() {
return total_petitions;
}
public void setTotal_petitions(Long total_petitions) {
this.total_petitions = total_petitions;
}
public Long getPetitions_completed() {
return petitions_completed;
}
public void setPetitions_completed(Long petitions_completed) {
this.petitions_completed = petitions_completed;
}
public Long getPetition_partially_completed() {
return petition_partially_completed;
}
public void setPetition_partially_completed(Long petition_partially_completed) {
this.petition_partially_completed = petition_partially_completed;
}
public Long getPetitions_pending() {
return petitions_pending;
}
public void setPetitions_pending(Long petitions_pending) {
this.petitions_pending = petitions_pending;
}
public Long getTotal_compliants() {
return total_compliants;
}
public void setTotal_compliants(Long total_compliants) {
this.total_compliants = total_compliants;
}
public Long getCompliants_completed() {
return compliants_completed;
}
public void setCompliants_completed(Long compliants_completed) {
this.compliants_completed = compliants_completed;
}
public Long getCompliants_pending() {
return compliants_pending;
}
public void setCompliants_pending(Long compliants_pending) {
this.compliants_pending = compliants_pending;
}
}

472
src/main/java/in/gov/chennaicorporation/gccoffice/mtm/data/Petition.java

@ -0,0 +1,472 @@
package in.gov.chennaicorporation.gccoffice.mtm.data;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
public class Petition {
private Long petitionId;
private MtmEvents mtmEvents;
private String petitionNumber;
private String petitionerName;
private String petitionerMobile;
private String petitionerComplaint;
private String petitionerAddress;
private String petitionerPincode;
private String petitionerNatureOfComplaint;
private String tableNo;
private Boolean isDelete;
private Boolean isActive;
private Long createdBy;
private String cDate;
private String status;
private String petitionerComplaint_txt;
@JsonCreator
public Petition(
@JsonProperty("petitionId") Long petitionId,
@JsonProperty("mtmEvents") MtmEvents mtmEvents,
@JsonProperty("petitionNumber") String petitionNumber,
@JsonProperty("petitionerName") String petitionerName,
@JsonProperty("petitionerMobile") String petitionerMobile,
@JsonProperty("petitionerComplaint") String petitionerComplaint,
@JsonProperty("petitionerAddress") String petitionerAddress,
@JsonProperty("petitionerPincode") String petitionerPincode,
@JsonProperty("petitionerNatureOfComplaint") String petitionerNatureOfComplaint,
@JsonProperty("tableNo") String tableNo,
@JsonProperty("isDelete") Boolean isDelete,
@JsonProperty("isActive") Boolean isActive,
@JsonProperty("createdBy") Long createdBy,
@JsonProperty("cDate") String cDate,
@JsonProperty("status") String status,
@JsonProperty("petitionerComplaint_txt") String petitionerComplaint_txt
) {
this.petitionId = petitionId;
this.mtmEvents = mtmEvents;
this.petitionNumber = petitionNumber;
this.petitionerName = petitionerName;
this.petitionerMobile = petitionerMobile;
this.petitionerComplaint = petitionerComplaint;
this.petitionerAddress = petitionerAddress;
this.petitionerPincode = petitionerPincode;
this.petitionerNatureOfComplaint = petitionerNatureOfComplaint;
this.tableNo = tableNo;
this.isDelete = isDelete;
this.isActive = isActive;
this.createdBy = createdBy;
this.cDate = cDate;
this.status = status;
this.petitionerComplaint_txt = petitionerComplaint_txt;
}
public Long getPetitionId() {
return petitionId;
}
public void setPetitionId(Long petitionId) {
this.petitionId = petitionId;
}
public MtmEvents getMtmEvents() {
return mtmEvents;
}
public void setMtmEvents(MtmEvents mtmEvents) {
this.mtmEvents = mtmEvents;
}
public String getPetitionNumber() {
return petitionNumber;
}
public void setPetitionNumber(String petitionNumber) {
this.petitionNumber = petitionNumber;
}
public String getPetitionerName() {
return petitionerName;
}
public void setPetitionerName(String petitionerName) {
this.petitionerName = petitionerName;
}
public String getPetitionerMobile() {
return petitionerMobile;
}
public void setPetitionerMobile(String petitionerMobile) {
this.petitionerMobile = petitionerMobile;
}
public String getPetitionerComplaint() {
return petitionerComplaint;
}
public void setPetitionerComplaint(String petitionerComplaint) {
this.petitionerComplaint = petitionerComplaint;
}
public String getPetitionerAddress() {
return petitionerAddress;
}
public void setPetitionerAddress(String petitionerAddress) {
this.petitionerAddress = petitionerAddress;
}
public String getPetitionerPincode() {
return petitionerPincode;
}
public void setPetitionerPincode(String petitionerPincode) {
this.petitionerPincode = petitionerPincode;
}
public String getPetitionerNatureOfComplaint() {
return petitionerNatureOfComplaint;
}
public void setPetitionerNatureOfComplaint(String petitionerNatureOfComplaint) {
this.petitionerNatureOfComplaint = petitionerNatureOfComplaint;
}
public String getTableNo() {
return tableNo;
}
public void setTableNo(String tableNo) {
this.tableNo = tableNo;
}
public Boolean getIsDelete() {
return isDelete;
}
public void setIsDelete(Boolean isDelete) {
this.isDelete = isDelete;
}
public Boolean getIsActive() {
return isActive;
}
public void setIsActive(Boolean isActive) {
this.isActive = isActive;
}
public Long getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Long createdBy) {
this.createdBy = createdBy;
}
public String getcDate() {
return cDate;
}
public void setcDate(String cDate) {
this.cDate = cDate;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getPetitionerComplaint_txt() {
return petitionerComplaint_txt;
}
public void setPetitionerComplaint_txt(String petitionerComplaint_txt) {
this.petitionerComplaint_txt = petitionerComplaint_txt;
}
// Define the nested classes for mtmEvents
public static class MtmEvents {
private Long mtmId;
private String eventName;
private String eventAddress;
private String eventDate;
private String zone;
private String ackNo;
private Long startPetId;
private Boolean isDelete;
private Boolean isActive;
private Long createdBy;
private String cDate;
private String event_date;
private Long total_petitions;
private Long petitions_completed;
private Long petition_partially_completed;
private Long petitions_pending;
private Long total_compliants;
private Long compliants_completed;
private Long compliants_pending;
@JsonCreator
public MtmEvents(
@JsonProperty("mtmId") Long mtmId,
@JsonProperty("eventName") String eventName,
@JsonProperty("eventAddress") String eventAddress,
@JsonProperty("eventDate") String eventDate,
@JsonProperty("zone") String zone,
@JsonProperty("ackNo") String ackNo,
@JsonProperty("startPetId") Long startPetId,
@JsonProperty("isDelete") Boolean isDelete,
@JsonProperty("isActive") Boolean isActive,
@JsonProperty("createdBy") Long createdBy,
@JsonProperty("cDate") String cDate,
@JsonProperty("event_date") String event_date,
@JsonProperty("total_petitions") Long total_petitions,
@JsonProperty("petitions_completed") Long petitions_completed,
@JsonProperty("petition_partially_completed") Long petition_partially_completed,
@JsonProperty("petitions_pending") Long petitions_pending,
@JsonProperty("total_compliants") Long total_compliants,
@JsonProperty("compliants_completed") Long compliants_completed,
@JsonProperty("compliants_pending") Long compliants_pending
) {
this.mtmId = mtmId;
this.eventName = eventName;
this.eventAddress = eventAddress;
this.eventDate = eventDate;
this.zone = zone;
this.ackNo = ackNo;
this.startPetId = startPetId;
this.isDelete = isDelete;
this.isActive = isActive;
this.createdBy = createdBy;
this.cDate = cDate;
this.event_date = event_date;
this.total_petitions = total_petitions;
this.petitions_completed = petitions_completed;
this.petition_partially_completed = petition_partially_completed;
this.petitions_pending = petitions_pending;
this.total_compliants = total_compliants;
this.compliants_completed = compliants_completed;
this.compliants_pending = compliants_pending;
}
public Long getMtmId() {
return mtmId;
}
public void setMtmId(Long mtmId) {
this.mtmId = mtmId;
}
public String getEventName() {
return eventName;
}
public void setEventName(String eventName) {
this.eventName = eventName;
}
public String getEventAddress() {
return eventAddress;
}
public void setEventAddress(String eventAddress) {
this.eventAddress = eventAddress;
}
public String getEventDate() {
return eventDate;
}
public void setEventDate(String eventDate) {
this.eventDate = eventDate;
}
public String getZone() {
return zone;
}
public void setZone(String zone) {
this.zone = zone;
}
public String getAckNo() {
return ackNo;
}
public void setAckNo(String ackNo) {
this.ackNo = ackNo;
}
public Long getStartPetId() {
return startPetId;
}
public void setStartPetId(Long startPetId) {
this.startPetId = startPetId;
}
public Boolean getIsDelete() {
return isDelete;
}
public void setIsDelete(Boolean isDelete) {
this.isDelete = isDelete;
}
public Boolean getIsActive() {
return isActive;
}
public void setIsActive(Boolean isActive) {
this.isActive = isActive;
}
public Long getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Long createdBy) {
this.createdBy = createdBy;
}
public String getcDate() {
return cDate;
}
public void setcDate(String cDate) {
this.cDate = cDate;
}
public String getEvent_date() {
return event_date;
}
public void setEvent_date(String event_date) {
this.event_date = event_date;
}
public Long getTotal_petitions() {
return total_petitions;
}
public void setTotal_petitions(Long total_petitions) {
this.total_petitions = total_petitions;
}
public Long getPetitions_completed() {
return petitions_completed;
}
public void setPetitions_completed(Long petitions_completed) {
this.petitions_completed = petitions_completed;
}
public Long getPetition_partially_completed() {
return petition_partially_completed;
}
public void setPetition_partially_completed(Long petition_partially_completed) {
this.petition_partially_completed = petition_partially_completed;
}
public Long getPetitions_pending() {
return petitions_pending;
}
public void setPetitions_pending(Long petitions_pending) {
this.petitions_pending = petitions_pending;
}
public Long getTotal_compliants() {
return total_compliants;
}
public void setTotal_compliants(Long total_compliants) {
this.total_compliants = total_compliants;
}
public Long getCompliants_completed() {
return compliants_completed;
}
public void setCompliants_completed(Long compliants_completed) {
this.compliants_completed = compliants_completed;
}
public Long getCompliants_pending() {
return compliants_pending;
}
public void setCompliants_pending(Long compliants_pending) {
this.compliants_pending = compliants_pending;
}
}
}

461
src/main/java/in/gov/chennaicorporation/gccoffice/mtm/data/PetitionComplaint.java

@ -0,0 +1,461 @@
package in.gov.chennaicorporation.gccoffice.mtm.data;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
public class PetitionComplaint {
private int mapId;
private String petitionNumber;
private MtmEventsPetitionId mtmEventsPetitionId;
private MtmEvents mtmEvents;
private String offID;
private String status;
private MtmComplaintTypes mtmComplaintTypes;
private boolean isDelete;
private boolean isActive;
private int createdBy;
private String cDate;
private String officer_name;
private String event_name;
private Integer officer_petition_count;
private Integer officer_completed_count;
private Integer officer_pending_count;
// Getters and setters for the above fields
public int getMapId() {
return mapId;
}
public void setMapId(int mapId) {
this.mapId = mapId;
}
public String getPetitionNumber() {
return petitionNumber;
}
public void setPetitionNumber(String petitionNumber) {
this.petitionNumber = petitionNumber;
}
public MtmEventsPetitionId getMtmEventsPetitionId() {
return mtmEventsPetitionId;
}
public void setMtmEventsPetitionId(MtmEventsPetitionId mtmEventsPetitionId) {
this.mtmEventsPetitionId = mtmEventsPetitionId;
}
public MtmEvents getMtmEvents() {
return mtmEvents;
}
public void setMtmEvents(MtmEvents mtmEvents) {
this.mtmEvents = mtmEvents;
}
public String getOffID() {
return offID;
}
public void setOffID(String offID) {
this.offID = offID;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public MtmComplaintTypes getMtmComplaintTypes() {
return mtmComplaintTypes;
}
public void setMtmComplaintTypes(MtmComplaintTypes mtmComplaintTypes) {
this.mtmComplaintTypes = mtmComplaintTypes;
}
public boolean isDelete() {
return isDelete;
}
public void setDelete(boolean isDelete) {
this.isDelete = isDelete;
}
public boolean isActive() {
return isActive;
}
public void setActive(boolean isActive) {
this.isActive = isActive;
}
public int getCreatedBy() {
return createdBy;
}
public void setCreatedBy(int createdBy) {
this.createdBy = createdBy;
}
public String getcDate() {
return cDate;
}
public void setcDate(String cDate) {
this.cDate = cDate;
}
public String getOfficer_name() {
return officer_name;
}
public void setOfficer_name(String officer_name) {
this.officer_name = officer_name;
}
public String getEvent_name() {
return event_name;
}
public void setEvent_name(String event_name) {
this.event_name = event_name;
}
public Integer getOfficer_petition_count() {
return officer_petition_count;
}
public void setOfficer_petition_count(Integer officer_petition_count) {
this.officer_petition_count = officer_petition_count;
}
public Integer getOfficer_completed_count() {
return officer_completed_count;
}
public void setOfficer_completed_count(Integer officer_completed_count) {
this.officer_completed_count = officer_completed_count;
}
public Integer getOfficer_pending_count() {
return officer_pending_count;
}
public void setOfficer_pending_count(Integer officer_pending_count) {
this.officer_pending_count = officer_pending_count;
}
public static class MtmEventsPetitionId {
private int petitionId;
private MtmEvents mtmEvents;
private String petitionNumber;
private String petitionerName;
private long petitionerMobile;
private String petitionerComplaint;
private String petitionerAddress;
private String petitionerPincode;
private String petitionerNatureOfComplaint;
private String tableNo;
private boolean isDelete;
private boolean isActive;
private long createdBy;
private String cDate;
private String status;
private String petitionerComplaint_txt;
// Getters and setters for the above fields
public int getPetitionId() {
return petitionId;
}
public void setPetitionId(int petitionId) {
this.petitionId = petitionId;
}
public MtmEvents getMtmEvents() {
return mtmEvents;
}
public void setMtmEvents(MtmEvents mtmEvents) {
this.mtmEvents = mtmEvents;
}
public String getPetitionNumber() {
return petitionNumber;
}
public void setPetitionNumber(String petitionNumber) {
this.petitionNumber = petitionNumber;
}
public String getPetitionerName() {
return petitionerName;
}
public void setPetitionerName(String petitionerName) {
this.petitionerName = petitionerName;
}
public long getPetitionerMobile() {
return petitionerMobile;
}
public void setPetitionerMobile(long petitionerMobile) {
this.petitionerMobile = petitionerMobile;
}
public String getPetitionerComplaint() {
return petitionerComplaint;
}
public void setPetitionerComplaint(String petitionerComplaint) {
this.petitionerComplaint = petitionerComplaint;
}
public String getPetitionerAddress() {
return petitionerAddress;
}
public void setPetitionerAddress(String petitionerAddress) {
this.petitionerAddress = petitionerAddress;
}
public String getPetitionerPincode() {
return petitionerPincode;
}
public void setPetitionerPincode(String petitionerPincode) {
this.petitionerPincode = petitionerPincode;
}
public String getPetitionerNatureOfComplaint() {
return petitionerNatureOfComplaint;
}
public void setPetitionerNatureOfComplaint(String petitionerNatureOfComplaint) {
this.petitionerNatureOfComplaint = petitionerNatureOfComplaint;
}
public String getTableNo() {
return tableNo;
}
public void setTableNo(String tableNo) {
this.tableNo = tableNo;
}
public boolean isDelete() {
return isDelete;
}
public void setDelete(boolean isDelete) {
this.isDelete = isDelete;
}
public boolean isActive() {
return isActive;
}
public void setActive(boolean isActive) {
this.isActive = isActive;
}
public long getCreatedBy() {
return createdBy;
}
public void setCreatedBy(long createdBy) {
this.createdBy = createdBy;
}
public String getcDate() {
return cDate;
}
public void setcDate(String cDate) {
this.cDate = cDate;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getPetitionerComplaint_txt() {
return petitionerComplaint_txt;
}
public void setPetitionerComplaint_txt(String petitionerComplaint_txt) {
this.petitionerComplaint_txt = petitionerComplaint_txt;
}
}
public static class MtmEvents {
private int mtmId;
private String eventName;
private String eventAddress;
private String eventDate;
private String zone;
private String ackNo;
private long startPetId;
private boolean isDelete;
private boolean isActive;
private long createdBy;
private String cDate;
private String event_date;
private Long total_petitions;
private Long petitions_completed;
private Long petition_partially_completed;
private Long petitions_pending;
private Long total_compliants;
private Long compliants_completed;
private Long compliants_pending;
// Getters and setters for the above fields
public int getMtmId() {
return mtmId;
}
public void setMtmId(int mtmId) {
this.mtmId = mtmId;
}
public String getEventName() {
return eventName;
}
public void setEventName(String eventName) {
this.eventName = eventName;
}
public String getEventAddress() {
return eventAddress;
}
public void setEventAddress(String eventAddress) {
this.eventAddress = eventAddress;
}
public String getEventDate() {
return eventDate;
}
public void setEventDate(String eventDate) {
this.eventDate = eventDate;
}
public String getZone() {
return zone;
}
public void setZone(String zone) {
this.zone = zone;
}
public String getAckNo() {
return ackNo;
}
public void setAckNo(String ackNo) {
this.ackNo = ackNo;
}
public long getStartPetId() {
return startPetId;
}
public void setStartPetId(long startPetId) {
this.startPetId = startPetId;
}
public boolean isDelete() {
return isDelete;
}
public void setDelete(boolean isDelete) {
this.isDelete = isDelete;
}
public boolean isActive() {
return isActive;
}
public void setActive(boolean isActive) {
this.isActive = isActive;
}
public long getCreatedBy() {
return createdBy;
}
public void setCreatedBy(long createdBy) {
this.createdBy = createdBy;
}
public String getcDate() {
return cDate;
}
public void setcDate(String cDate) {
this.cDate = cDate;
}
public String getEvent_date() {
return event_date;
}
public void setEvent_date(String event_date) {
this.event_date = event_date;
}
public Long getTotal_petitions() {
return total_petitions;
}
public void setTotal_petitions(Long total_petitions) {
this.total_petitions = total_petitions;
}
public Long getPetitions_completed() {
return petitions_completed;
}
public void setPetitions_completed(Long petitions_completed) {
this.petitions_completed = petitions_completed;
}
public Long getPetition_partially_completed() {
return petition_partially_completed;
}
public void setPetition_partially_completed(Long petition_partially_completed) {
this.petition_partially_completed = petition_partially_completed;
}
public Long getPetitions_pending() {
return petitions_pending;
}
public void setPetitions_pending(Long petitions_pending) {
this.petitions_pending = petitions_pending;
}
public Long getTotal_compliants() {
return total_compliants;
}
public void setTotal_compliants(Long total_compliants) {
this.total_compliants = total_compliants;
}
public Long getCompliants_completed() {
return compliants_completed;
}
public void setCompliants_completed(Long compliants_completed) {
this.compliants_completed = compliants_completed;
}
public Long getCompliants_pending() {
return compliants_pending;
}
public void setCompliants_pending(Long compliants_pending) {
this.compliants_pending = compliants_pending;
}
}
public static class MtmComplaintTypes {
private int complaintTypeId;
private String complaintType;
private boolean isDelete;
private boolean isActive;
private int createdBy;
private String cDate;
// Getters and setters for the above fields
public int getComplaintTypeId() {
return complaintTypeId;
}
public void setComplaintTypeId(int complaintTypeId) {
this.complaintTypeId = complaintTypeId;
}
public String getComplaintType() {
return complaintType;
}
public void setComplaintType(String complaintType) {
this.complaintType = complaintType;
}
public boolean isDelete() {
return isDelete;
}
public void setDelete(boolean isDelete) {
this.isDelete = isDelete;
}
public boolean isActive() {
return isActive;
}
public void setActive(boolean isActive) {
this.isActive = isActive;
}
public int getCreatedBy() {
return createdBy;
}
public void setCreatedBy(int createdBy) {
this.createdBy = createdBy;
}
public String getcDate() {
return cDate;
}
public void setcDate(String cDate) {
this.cDate = cDate;
}
}
}

1
src/main/java/in/gov/chennaicorporation/gccoffice/mtm/data/package-info.java

@ -0,0 +1 @@
package in.gov.chennaicorporation.gccoffice.mtm.data;

1
src/main/java/in/gov/chennaicorporation/gccoffice/mtm/package-info.java

@ -0,0 +1 @@
package in.gov.chennaicorporation.gccoffice.mtm;

82
src/main/java/in/gov/chennaicorporation/gccoffice/petregistration/controller/APIController.java

@ -0,0 +1,82 @@
package in.gov.chennaicorporation.gccoffice.petregistration.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.GetMapping;
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.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.util.UriComponentsBuilder;
import in.gov.chennaicorporation.gccoffice.configuration.AppConfig;
@RequestMapping("/api/petregistration")
@RestController("petRegistrationRest")
public class APIController {
private final RestTemplate restTemplate;
private final AppConfig appConfig;
String bodyMessage = "";
@Autowired
public APIController(RestTemplate restTemplate, AppConfig appConfig) {
this.restTemplate = restTemplate;
this.appConfig = appConfig;
}
@GetMapping(value = "/getpetimg")
public String getPetImage(@RequestParam String mobno,@RequestParam String uniqueid) {
String baseURL = appConfig.petRegistration+"/api/getpetimg";
UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromUriString(baseURL)
.queryParam("mobno", mobno)
.queryParam("uniqueid", uniqueid );
ResponseEntity<String> response = restTemplate.getForEntity(uriComponentsBuilder.toUriString(),String.class);
bodyMessage = response.getBody().trim();
return bodyMessage;
}
@GetMapping(value = "/getvaccineimg")
public String getVaccineImage(@RequestParam String mobno,@RequestParam String uniqueid) {
String baseURL = appConfig.petRegistration+"/api/getvacimg";
UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromUriString(baseURL)
.queryParam("mobno", mobno)
.queryParam("uniqueid", uniqueid );
ResponseEntity<String> response = restTemplate.getForEntity(uriComponentsBuilder.toUriString(),String.class);
bodyMessage = response.getBody().trim();
return bodyMessage;
}
@GetMapping(value = "/getapplicantimg")
public String getApplicantImage(@RequestParam String mobno,@RequestParam String uniqueid) {
String baseURL = appConfig.petRegistration+"/api/getapplicantimg";
UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromUriString(baseURL)
.queryParam("mobno", mobno)
.queryParam("uniqueid", uniqueid );
ResponseEntity<String> response = restTemplate.getForEntity(uriComponentsBuilder.toUriString(),String.class);
bodyMessage = response.getBody().trim();
return bodyMessage;
}
@GetMapping(value = "/getaddressproofimg")
public String getAddressProofImage(@RequestParam String mobno,@RequestParam String uniqueid) {
String baseURL = appConfig.petRegistration+"/api/getaddproofimg";
UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromUriString(baseURL)
.queryParam("mobno", mobno)
.queryParam("uniqueid", uniqueid );
ResponseEntity<String> response = restTemplate.getForEntity(uriComponentsBuilder.toUriString(),String.class);
bodyMessage = response.getBody().trim();
return bodyMessage;
}
}

168
src/main/java/in/gov/chennaicorporation/gccoffice/petregistration/controller/MainController.java

@ -0,0 +1,168 @@
package in.gov.chennaicorporation.gccoffice.petregistration.controller;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Lookup;
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 org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.util.UriComponentsBuilder;
import in.gov.chennaicorporation.gccoffice.configuration.AppConfig;
import in.gov.chennaicorporation.gccoffice.petregistration.data.PetCountInfo;
import in.gov.chennaicorporation.gccoffice.petregistration.data.RequestList;
import in.gov.chennaicorporation.gccoffice.service.LoginUserInfo;
@RequestMapping("/petregistration")
@Controller("petregistration")
public class MainController {
private final RestTemplate restTemplate;
private final LoginUserInfo loginUserInfo;
private final AppConfig appConfig;
@Autowired
public MainController(RestTemplate restTemplate,LoginUserInfo loginUserInfo, AppConfig appConfig) {
this.restTemplate = restTemplate;
this.loginUserInfo = loginUserInfo;
this.appConfig = appConfig;
}
@Lookup
public static String[] getDates() {
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.MONTH, -1);
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
String formattedDate = dateFormat.format(calendar.getTime());
String currentDate = dateFormat.format(new Date());
System.out.println("formattedDate : "+formattedDate);
return new String[] { formattedDate, currentDate };
}
@GetMapping({"", "/", "/index", "/dashboard"})
public String main(Model model,@RequestParam(required=false) String zone) {
String userId = LoginUserInfo.getLoginUserId();
String baseUrl = appConfig.petRegistration + "/api/admin/dashboard";
UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(baseUrl).queryParam("zone",zone);
PetCountInfo dash = restTemplate.getForObject(builder.toUriString(),PetCountInfo.class);
if (userId != null && !userId.isEmpty()) {
System.out.println("String UserID: " + userId);
}
model.addAttribute("dash",dash);
return "modules/petregistration/index";
}
@GetMapping("/requestlist")
public String viewRequest(Model model,
@RequestParam(required=false) String fromDate,
@RequestParam(required =false) String toDate,
@RequestParam(required=false) String zone) {
if(fromDate==null && toDate==null) {
String[] dates = getDates();
fromDate=dates[0];
toDate=dates[1];
model.addAttribute(fromDate);
model.addAttribute(toDate);
}
String baseUrl = appConfig.petRegistration + "/api/admin/licenserequest";
UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(baseUrl)
.queryParam("zone",zone)
.queryParam("fromDate",fromDate)
.queryParam("toDate",toDate);
RequestList[] requestList = restTemplate.getForObject(builder.toUriString(), RequestList[].class);
model.addAttribute("petlist",requestList);
return "modules/petregistration/request-list";
}
@GetMapping("/acceptedlist")
public String viewAccepted(Model model,
@RequestParam(required=false) String fromDate,
@RequestParam(required =false) String toDate,
@RequestParam(required=false) String zone) {
if(fromDate==null && toDate==null) {
String[] dates = getDates();
fromDate=dates[0];
toDate=dates[1];
model.addAttribute(fromDate);
model.addAttribute(toDate);
}
String baseUrl = appConfig.petRegistration + "/api/admin/acceptedlist";
UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(baseUrl)
.queryParam("zone",zone)
.queryParam("fromDate",fromDate)
.queryParam("toDate",toDate);
RequestList[] requestList = restTemplate.getForObject(builder.toUriString(), RequestList[].class);
model.addAttribute("petlist",requestList);
return "modules/petregistration/accepted-list";
}
@GetMapping("/rejectedlist")
public String viewRejected(Model model,
@RequestParam(required=false) String fromDate,
@RequestParam(required =false) String toDate,
@RequestParam(required=false) String zone) {
if(fromDate==null && toDate==null) {
String[] dates = getDates();
fromDate=dates[0];
toDate=dates[1];
model.addAttribute(fromDate);
model.addAttribute(toDate);
}
String baseUrl = appConfig.petRegistration + "/api/admin/rejectedlist";
UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(baseUrl)
.queryParam("zone",zone)
.queryParam("fromDate",fromDate)
.queryParam("toDate",toDate);
RequestList[] requestList = restTemplate.getForObject(builder.toUriString(), RequestList[].class);
model.addAttribute("petlist",requestList);
return "modules/petregistration/accepted-list";
}
@GetMapping("/licenseissued")
public String viewLicenseIssued(Model model,
@RequestParam(required=false) String fromDate,
@RequestParam(required =false) String toDate,
@RequestParam(required=false) String zone) {
if(fromDate==null && toDate==null) {
String[] dates = getDates();
fromDate=dates[0];
toDate=dates[1];
model.addAttribute(fromDate);
model.addAttribute(toDate);
}
String baseUrl = appConfig.petRegistration + "/api/admin/licenseIssued";
UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(baseUrl)
.queryParam("zone",zone)
.queryParam("fromDate",fromDate)
.queryParam("toDate",toDate);
RequestList[] requestList = restTemplate.getForObject(builder.toUriString(), RequestList[].class);
model.addAttribute("petlist",requestList);
return "modules/petregistration/accepted-list";
}
}

46
src/main/java/in/gov/chennaicorporation/gccoffice/petregistration/data/PetCountInfo.java

@ -0,0 +1,46 @@
package in.gov.chennaicorporation.gccoffice.petregistration.data;
import java.util.Map;
public class PetCountInfo {
private Map<String, Integer> dog;
private Map<String, Integer> cat;
private int userCount;
private int licCount;
// Getters and setters
public Map<String, Integer> getDog() {
return dog;
}
public void setDog(Map<String, Integer> dog) {
this.dog = dog;
}
public Map<String, Integer> getCat() {
return cat;
}
public void setCat(Map<String, Integer> cat) {
this.cat = cat;
}
public int getUserCount() {
return userCount;
}
public void setUserCount(int userCount) {
this.userCount = userCount;
}
public int getLicCount() {
return licCount;
}
public void setLicCount(int licCount) {
this.licCount = licCount;
}
}

150
src/main/java/in/gov/chennaicorporation/gccoffice/petregistration/data/RequestList.java

@ -0,0 +1,150 @@
package in.gov.chennaicorporation.gccoffice.petregistration.data;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
public class RequestList {
private int uniqueid;
private long mobilenum;
private String petname;
private String species;
private String breed;
private String gender;
private String registerdate;
private int status;
private String rejectreason;
private String zone;
private String statusdate;
private String updatedby;
// Constructor
public RequestList() {
}
@JsonCreator
public RequestList(@JsonProperty("uniqueid") int uniqueid,
@JsonProperty("mobilenum") long mobilenum,
@JsonProperty("petname") String petname,
@JsonProperty("species") String species,
@JsonProperty("breed") String breed,
@JsonProperty("gender") String gender,
@JsonProperty("registerdate") String registerdate,
@JsonProperty("status") int status,
@JsonProperty("rejectreason") String rejectreason,
@JsonProperty("zone") String zone,
@JsonProperty("statusdate") String statusdate,
@JsonProperty("updatedby") 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;
}
// Getters and setters for each field
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 int getStatus() {
return status;
}
public void setStatus(int 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 getStatusdate() {
return statusdate;
}
public void setStatusdate(String statusdate) {
this.statusdate = statusdate;
}
public String getUpdatedby() {
return updatedby;
}
public void setUpdatedby(String updatedby) {
this.updatedby = updatedby;
}
}

15
src/main/java/in/gov/chennaicorporation/gccoffice/petregistration/data/ResponseWrapper.java

@ -0,0 +1,15 @@
package in.gov.chennaicorporation.gccoffice.petregistration.data;
import java.util.List;
public class ResponseWrapper {
private List<RequestList> data;
public List<RequestList> getData() {
return data;
}
public void setData(List<RequestList> data) {
this.data = data;
}
}

1
src/main/java/in/gov/chennaicorporation/gccoffice/petregistration/data/package-info.java

@ -0,0 +1 @@
package in.gov.chennaicorporation.gccoffice.petregistration.data;

1
src/main/java/in/gov/chennaicorporation/gccoffice/petregistration/package-info.java

@ -0,0 +1 @@
package in.gov.chennaicorporation.gccoffice.petregistration;

5
src/main/java/in/gov/chennaicorporation/gccoffice/petregistration/service/API.java

@ -0,0 +1,5 @@
package in.gov.chennaicorporation.gccoffice.petregistration.service;
public class API {
}

209
src/main/java/in/gov/chennaicorporation/gccoffice/qrassetfeedback/controller/APIController.java

@ -0,0 +1,209 @@
package in.gov.chennaicorporation.gccoffice.qrassetfeedback.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.GetMapping;
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.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import in.gov.chennaicorporation.gccoffice.configuration.AppConfig;
@RequestMapping("/api/qrfeedback")
@RestController("qrassetfeedbackcontroller")
public class APIController {
private final RestTemplate restTemplate;
private final AppConfig appConfig;
String bodyMessage = "";
@Autowired
public APIController(RestTemplate restTemplate, AppConfig appConfig) {
this.restTemplate = restTemplate;
this.appConfig = appConfig;
}
@GetMapping(value = "/getFeedbackAssetdetails")
public String getFeedbackAssetdetails(@RequestParam String fbId) {
String feedbackId = fbId;
ResponseEntity<String> response = restTemplate.getForEntity(appConfig.qrAssetFeedback+"/api/feedback/{feedbackId}",String.class,feedbackId);
bodyMessage = response.getBody().trim();
return bodyMessage;
}
@GetMapping(value = "/getFeedbackData")
public String getFeedbackData(@RequestParam String fbId) {
String feedbackId = fbId;
ResponseEntity<String> response = restTemplate.getForEntity(appConfig.qrAssetFeedback+"/api/feedback/data/{feedbackId}",String.class,feedbackId);
bodyMessage = response.getBody().trim();
return bodyMessage;
}
@GetMapping(value = "/dashboard-summary")
public String getDashboardSummary() {
System.out.print("hi dashboard-summary");
ResponseEntity<String> response = restTemplate.getForEntity(appConfig.qrAssetFeedback+"/api/dashboard-summary",String.class);
bodyMessage = response.getBody().trim();
return bodyMessage;
}
@PostMapping(value = "/category/checkbyname")
public int checkByName(@RequestParam("catName") String catName) {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
MultiValueMap<String, String> params = new LinkedMultiValueMap<>();
params.add("catName", catName);
HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<>(params, headers);
ResponseEntity<Integer> response = restTemplate.postForEntity(appConfig.qrAssetFeedback + "/api/category/checkbyname", request, Integer.class);
return response.getBody();
}
@PostMapping(value = "/category/edit/checkbyname")
public int editCheckByName(@RequestParam("catName") String catName,@RequestParam("cId") String cId) {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
MultiValueMap<String, String> params = new LinkedMultiValueMap<>();
params.add("catName", catName);
params.add("cId", cId);
HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<>(params, headers);
ResponseEntity<Integer> response = restTemplate.postForEntity(appConfig.qrAssetFeedback + "/api/category/edit/checkbyname", request, Integer.class);
return response.getBody();
}
@PostMapping(value = "/category/{id}")
public String getCategoryById(@PathVariable("id") int id) {
ResponseEntity<String> response = restTemplate.getForEntity(appConfig.qrAssetFeedback+"/api/category/"+id,String.class);
bodyMessage = response.getBody().trim();
return bodyMessage;
}
@PostMapping(value = "/saveCategory")
public int saveCategory(@RequestParam("catName") String catName, @RequestParam("isActive") String isActive) {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
MultiValueMap<String, String> params = new LinkedMultiValueMap<>();
params.add("catName", catName);
params.add("isActive", isActive);
HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<>(params, headers);
ResponseEntity<Integer> response = restTemplate.postForEntity(appConfig.qrAssetFeedback + "/api/category/save", request, Integer.class);
return response.getBody();
}
@PostMapping(value = "/updateCategory")
public int updateCategory(@RequestParam("catName") String catName, @RequestParam("isActive") String isActive, @RequestParam("cId") String cId) {
//System.out.println(cId);
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
MultiValueMap<String, String> params = new LinkedMultiValueMap<>();
params.add("catName", catName);
params.add("isActive", isActive);
HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<>(params, headers);
ResponseEntity<Integer> response = restTemplate.postForEntity(appConfig.qrAssetFeedback + "/api/category/"+cId+"/update", request, Integer.class);
return response.getBody();
}
@GetMapping("/category/{id}/delete")
public String deleteCategory(@PathVariable("id") int id) {
ResponseEntity<String> response = restTemplate.getForEntity(appConfig.qrAssetFeedback+"/api/category/{id}/delete",String.class,id);
bodyMessage = response.getBody().trim();
return bodyMessage;
}
@PostMapping(value = "/category/question/{id}")
public String getCategoryQuestionById(@PathVariable("id") int id) {
ResponseEntity<String> response = restTemplate.getForEntity(appConfig.qrAssetFeedback+"/api/category/question/"+id,String.class);
bodyMessage = response.getBody().trim();
return bodyMessage;
}
@GetMapping("/category/question/{id}/delete")
public String deleteCategoryQuestion(@PathVariable("id") int id) {
ResponseEntity<String> response = restTemplate.getForEntity(appConfig.qrAssetFeedback+"/api/category/question/{id}/delete",String.class,id);
bodyMessage = response.getBody().trim();
return bodyMessage;
}
@PostMapping(value = "/saveCategoryQuestion")
public int saveCategoryQuestion(@RequestParam("assetCategory") String assetCategory,@RequestParam("engQuestion") String engQuestion,@RequestParam("tamilQuestion") String tamilQuestion, @RequestParam("isActive") String isActive) {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
MultiValueMap<String, String> params = new LinkedMultiValueMap<>();
params.add("assetCategory", assetCategory);
params.add("engQuestion", engQuestion);
params.add("tamilQuestion", tamilQuestion);
params.add("isActive", isActive);
HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<>(params, headers);
ResponseEntity<Integer> response = restTemplate.postForEntity(appConfig.qrAssetFeedback + "/api/category/question/save", request, Integer.class);
return response.getBody();
}
@PostMapping(value = "/updateCategoryQuestion")
public int updateCategoryQuestion(@RequestParam("cmqId") String cmqId,@RequestParam("assetCategory") String assetCategory,@RequestParam("engQuestion") String engQuestion,@RequestParam("tamilQuestion") String tamilQuestion, @RequestParam("isActive") String isActive) {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
MultiValueMap<String, String> params = new LinkedMultiValueMap<>();
params.add("assetCategory", assetCategory);
params.add("engQuestion", engQuestion);
params.add("tamilQuestion", tamilQuestion);
params.add("isActive", isActive);
HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<>(params, headers);
ResponseEntity<Integer> response = restTemplate.postForEntity(appConfig.qrAssetFeedback + "/api/category/question/"+cmqId+"/update", request, Integer.class);
return response.getBody();
}
@GetMapping(value = "/getComplaintCategory")
public String getComplaintCategory() {
ResponseEntity<String> response = restTemplate.getForEntity(appConfig.qrAssetFeedback+"/api/getComplaintCategory",String.class);
bodyMessage = response.getBody().trim();
return bodyMessage;
}
@PostMapping(value = "/getComplaintCategoryById")
public String getComplaintCategoryById(@RequestParam String comGroupId) {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
MultiValueMap<String, String> params = new LinkedMultiValueMap<>();
params.add("comGroupId", comGroupId);
HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<>(params, headers);
ResponseEntity<String> response = restTemplate.postForEntity(appConfig.qrAssetFeedback+"/api/getComplaintCategoryById",request,String.class);
bodyMessage = response.getBody().trim();
return bodyMessage;
}
}

127
src/main/java/in/gov/chennaicorporation/gccoffice/qrassetfeedback/controller/MainController.java

@ -0,0 +1,127 @@
package in.gov.chennaicorporation.gccoffice.qrassetfeedback.controller;
import java.util.Arrays;
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;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.client.RestTemplate;
import in.gov.chennaicorporation.gccoffice.configuration.AppConfig;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.Asset;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.AssetCategory;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.AssetCategoryQuestion;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.AssetParameter;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.AssetParameterQuestions;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.AssetQuestion;
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.Feedback;
@RequestMapping("/qrfeedback")
@Controller("qrAssetFeedbackController")
public class MainController {
private final RestTemplate restTemplate;
private final AppConfig appConfig;
@Autowired
public MainController(RestTemplate restTemplate, AppConfig appConfig) {
this.restTemplate = restTemplate;
this.appConfig = appConfig;
}
@GetMapping({"", "/", "/index", "/dashboard"})
public String home(Model model) {
return "modules/qrfeedback/index";
}
@GetMapping("/master/asset-category")
public String category(Model model) {
String apiUrl = appConfig.qrAssetFeedback + "/api/category";
AssetCategory[] assetCategoryList = restTemplate.getForObject(apiUrl, AssetCategory[].class);
model.addAttribute("assetcategorylist",assetCategoryList);
model.addAttribute("qrAssetFeedbackApiUrl",appConfig.qrAssetFeedback);
return "modules/qrfeedback/master/asset-category";
}
@GetMapping("/master/asset-category-questions")
public String categoryQuestions(Model model) {
String apiUrl = appConfig.qrAssetFeedback + "/api/category";
AssetCategory[] assetCategoryList = restTemplate.getForObject(apiUrl, AssetCategory[].class);
model.addAttribute("assetcategorylist",assetCategoryList);
apiUrl = appConfig.qrAssetFeedback + "/api/category/question";
AssetCategoryQuestion[] assetCategoryQuestionList = restTemplate.getForObject(apiUrl, AssetCategoryQuestion[].class);
model.addAttribute("assetcategoryquestionlist",assetCategoryQuestionList);
return "modules/qrfeedback/master/asset-category-questions";
}
@GetMapping("/master/asset-parameter")
public String parameter(Model model) {
String apiUrl = appConfig.qrAssetFeedback + "/api/parameter";
AssetParameter[] assetParameterList = restTemplate.getForObject(apiUrl, AssetParameter[].class);
model.addAttribute("assetparameterlist",assetParameterList);
return "modules/qrfeedback/master/asset-parameter";
}
@GetMapping("/master/asset-parameter-questions")
public String parameterQuestions(Model model) {
String apiUrl = appConfig.qrAssetFeedback + "/api/parameter/question";
AssetParameterQuestions[] assetParameterQuestionsList = restTemplate.getForObject(apiUrl, AssetParameterQuestions[].class);
model.addAttribute("assetparameterquestionslist",assetParameterQuestionsList);
return "modules/qrfeedback/master/asset-parameter-questions";
}
// For Asset
@GetMapping("/assets/asset-list")
public String asset(Model model) {
String apiUrl = appConfig.qrAssetFeedback + "/api/asset";
Asset[] assetList = restTemplate.getForObject(apiUrl, Asset[].class);
model.addAttribute("assetlist",assetList);
return "modules/qrfeedback/assets/asset-list";
}
@GetMapping("/assets/asset-questions")
public String assetQuestions(Model model) {
String apiUrl = appConfig.qrAssetFeedback + "/api/asset/question";
AssetQuestion[] assetQuestionsList = restTemplate.getForObject(apiUrl, AssetQuestion[].class);
model.addAttribute("assetquestionslist",assetQuestionsList);
return "modules/qrfeedback/assets/asset-questions";
}
@GetMapping("/feedbacks/feedback-list")
public String assetFeedback(Model model) {
String apiUrl = appConfig.qrAssetFeedback + "/api/feedback";
Feedback[] feedbackList = restTemplate.getForObject(apiUrl, Feedback[].class);
model.addAttribute("feedbacklist",feedbackList);
return "modules/qrfeedback/feedbacks/feedback-list";
}
@GetMapping("/feedbacks/feedback-list-yes")
public String assetFeedbackByTypeYes(Model model) {
String option = "[yes]";
String apiUrl = appConfig.qrAssetFeedback + "/api/feedback/data/option/"+option;
Feedback[] feedbackList = restTemplate.getForObject(apiUrl, Feedback[].class);
model.addAttribute("feedbacklist",feedbackList);
return "modules/qrfeedback/feedbacks/feedback-list-yes";
}
@GetMapping("/feedbacks/feedback-list-no")
public String assetFeedbackByTypeNo(Model model) {
String option = "[no]";
String apiUrl = appConfig.qrAssetFeedback + "/api/feedback/data/option/"+option;
Feedback[] feedbackList = restTemplate.getForObject(apiUrl, Feedback[].class);
model.addAttribute("feedbacklist",feedbackList);
return "modules/qrfeedback/feedbacks/feedback-list-no";
}
}

301
src/main/java/in/gov/chennaicorporation/gccoffice/qrassetfeedback/data/Asset.java

@ -0,0 +1,301 @@
package in.gov.chennaicorporation.gccoffice.qrassetfeedback.data;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
public class Asset {
private Long assetId;
private AssetCategory assetCategory;
private String paramId;
private Long zoneId;
private Long divId;
private String areaName;
private String locName;
private String streetName;
private String assetName;
private String assetCode;
private String assetAddress;
private String assetOpeningTime;
private String assetClosingTime;
private String assetLatitude;
private String assetLongitude;
private boolean isDelete;
private boolean isActive;
private Long createdBy;
private String cDate;
// Constructors
// Getters and Setters
// Other methods if needed
@JsonCreator
public Asset(
@JsonProperty("assetId") Long assetId,
@JsonProperty("assetCategory") AssetCategory assetCategory,
@JsonProperty("paramId") String paramId,
@JsonProperty("zoneId") Long zoneId,
@JsonProperty("divId") Long divId,
@JsonProperty("areaName") String areaName,
@JsonProperty("locName") String locName,
@JsonProperty("streetName") String streetName,
@JsonProperty("assetName") String assetName,
@JsonProperty("assetCode") String assetCode,
@JsonProperty("assetAddress") String assetAddress,
@JsonProperty("assetOpeningTime") String assetOpeningTime,
@JsonProperty("assetClosingTime") String assetClosingTime,
@JsonProperty("assetLatitude") String assetLatitude,
@JsonProperty("assetLongitude") String assetLongitude,
@JsonProperty("isDelete") boolean isDelete,
@JsonProperty("isActive") boolean isActive,
@JsonProperty("createdBy") Long createdBy,
@JsonProperty("cDate") String cDate
) {
this.assetId = assetId;
this.assetCategory = assetCategory;
this.paramId = paramId;
this.zoneId = zoneId;
this.divId = divId;
this.areaName = areaName;
this.locName = locName;
this.streetName = streetName;
this.assetName = assetName;
this.assetCode = assetCode;
this.assetAddress = assetAddress;
this.assetOpeningTime = assetOpeningTime;
this.assetClosingTime = assetClosingTime;
this.assetLatitude = assetLatitude;
this.assetLongitude = assetLongitude;
this.isDelete = isDelete;
this.isActive = isActive;
this.createdBy = createdBy;
this.cDate = cDate;
}
public Long getAssetId() {
return assetId;
}
public void setAssetId(Long assetId) {
this.assetId = assetId;
}
public AssetCategory getAssetCategory() {
return assetCategory;
}
public void setAssetCategory(AssetCategory assetCategory) {
this.assetCategory = assetCategory;
}
public String getParamId() {
return paramId;
}
public void setParamId(String paramId) {
this.paramId = paramId;
}
public Long getZoneId() {
return zoneId;
}
public void setZoneId(Long zoneId) {
this.zoneId = zoneId;
}
public Long getDivId() {
return divId;
}
public void setDivId(Long divId) {
this.divId = divId;
}
public String getAreaName() {
return areaName;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
public String getLocName() {
return locName;
}
public void setLocName(String locName) {
this.locName = locName;
}
public String getStreetName() {
return streetName;
}
public void setStreetName(String streetName) {
this.streetName = streetName;
}
public String getAssetName() {
return assetName;
}
public void setAssetName(String assetName) {
this.assetName = assetName;
}
public String getAssetCode() {
return assetCode;
}
public void setAssetCode(String assetCode) {
this.assetCode = assetCode;
}
public String getAssetAddress() {
return assetAddress;
}
public void setAssetAddress(String assetAddress) {
this.assetAddress = assetAddress;
}
public String getAssetOpeningTime() {
return assetOpeningTime;
}
public void setAssetOpeningTime(String assetOpeningTime) {
this.assetOpeningTime = assetOpeningTime;
}
public String getAssetClosingTime() {
return assetClosingTime;
}
public void setAssetClosingTime(String assetClosingTime) {
this.assetClosingTime = assetClosingTime;
}
public String getAssetLatitude() {
return assetLatitude;
}
public void setAssetLatitude(String assetLatitude) {
this.assetLatitude = assetLatitude;
}
public String getAssetLongitude() {
return assetLongitude;
}
public void setAssetLongitude(String assetLongitude) {
this.assetLongitude = assetLongitude;
}
public boolean isDelete() {
return isDelete;
}
public void setDelete(boolean isDelete) {
this.isDelete = isDelete;
}
public boolean isActive() {
return isActive;
}
public void setActive(boolean isActive) {
this.isActive = isActive;
}
public Long getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Long createdBy) {
this.createdBy = createdBy;
}
public String getcDate() {
return cDate;
}
public void setcDate(String cDate) {
this.cDate = cDate;
}
public static class AssetCategory {
private Long cId;
private String catName;
private boolean isDelete;
private boolean isActive;
private Long createdBy;
private String cDate;
// Constructors (JsonCreator)
@JsonCreator
public AssetCategory(
@JsonProperty("cId") Long cId,
@JsonProperty("catName") String catName,
@JsonProperty("isDelete") boolean isDelete,
@JsonProperty("isActive") boolean isActive,
@JsonProperty("createdBy") Long createdBy,
@JsonProperty("cDate") String cDate
) {
this.cId = cId;
this.catName = catName;
this.isDelete = isDelete;
this.isActive = isActive;
this.createdBy = createdBy;
this.cDate = cDate;
}
public Long getcId() {
return cId;
}
public void setcId(Long cId) {
this.cId = cId;
}
public String getCatName() {
return catName;
}
public void setCatName(String catName) {
this.catName = catName;
}
public boolean isDelete() {
return isDelete;
}
public void setDelete(boolean isDelete) {
this.isDelete = isDelete;
}
public boolean isActive() {
return isActive;
}
public void setActive(boolean isActive) {
this.isActive = isActive;
}
public Long getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Long createdBy) {
this.createdBy = createdBy;
}
public String getcDate() {
return cDate;
}
public void setcDate(String cDate) {
this.cDate = cDate;
}
}
}

82
src/main/java/in/gov/chennaicorporation/gccoffice/qrassetfeedback/data/AssetCategory.java

@ -0,0 +1,82 @@
package in.gov.chennaicorporation.gccoffice.qrassetfeedback.data;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
public class AssetCategory {
private Long cId;
private String catName;
private boolean isDelete;
private boolean isActive;
private Long createdBy;
private String cDate;
// Constructor
public AssetCategory() {
}
@JsonCreator
public AssetCategory(@JsonProperty("cId") Long cId,
@JsonProperty("catName") String catName,
@JsonProperty("isDelete") boolean isDelete,
@JsonProperty("isActive") boolean isActive,
@JsonProperty("createdBy") Long createdBy,
@JsonProperty("cDate") String cDate) {
this.cId = cId;
this.catName = catName;
this.isDelete = isDelete;
this.isActive = isActive;
this.createdBy = createdBy;
this.cDate = cDate;
}
public Long getcId() {
return cId;
}
public void setcId(Long cId) {
this.cId = cId;
}
public String getCatName() {
return catName;
}
public void setCatName(String catName) {
this.catName = catName;
}
public boolean isDelete() {
return isDelete;
}
public void setDelete(boolean isDelete) {
this.isDelete = isDelete;
}
public boolean isActive() {
return isActive;
}
public void setActive(boolean isActive) {
this.isActive = isActive;
}
public Long getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Long createdBy) {
this.createdBy = createdBy;
}
public String getcDate() {
return cDate;
}
public void setcDate(String cDate) {
this.cDate = cDate;
}
}

195
src/main/java/in/gov/chennaicorporation/gccoffice/qrassetfeedback/data/AssetCategoryQuestion.java

@ -0,0 +1,195 @@
package in.gov.chennaicorporation.gccoffice.qrassetfeedback.data;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
public class AssetCategoryQuestion {
private Long cmqId;
private AssetCategoryInfo assetCategory;
private String engQuestion;
private String tamilQuestion;
private Long comGroupId;
private Long comSubGroupId;
private String comSubGroupName;
private String qType;
private boolean isActive;
private boolean isDelete;
private Long createdBy;
private String cDate;
// Constructors
// Getters and Setters
// Other methods if needed
@JsonCreator
public AssetCategoryQuestion(
@JsonProperty("cmqId") Long cmqId,
@JsonProperty("assetCategory") AssetCategoryInfo assetCategory,
@JsonProperty("engQuestion") String engQuestion,
@JsonProperty("tamilQuestion") String tamilQuestion,
@JsonProperty("comGroupId") Long comGroupId,
@JsonProperty("comSubGroupId") Long comSubGroupId,
@JsonProperty("comSubGroupName") String comSubGroupName,
@JsonProperty("qType") String qType,
@JsonProperty("isActive") boolean isActive,
@JsonProperty("isDelete") boolean isDelete,
@JsonProperty("createdBy") Long createdBy,
@JsonProperty("cDate") String cDate
) {
this.cmqId = cmqId;
this.assetCategory = assetCategory;
this.engQuestion = engQuestion;
this.tamilQuestion = tamilQuestion;
this.comGroupId = comGroupId;
this.comSubGroupId = comSubGroupId;
this.comSubGroupName = comSubGroupName;
this.qType = qType;
this.isActive = isActive;
this.isDelete = isDelete;
this.createdBy = createdBy;
this.cDate = cDate;
}
// Define the inner class for assetCategory
public static class AssetCategoryInfo {
private Long cId;
private String catName;
private boolean isDelete;
private boolean isActive;
private Long createdBy;
private String cDate;
public Long getcId() {
return cId;
}
public void setcId(Long cId) {
this.cId = cId;
}
public String getCatName() {
return catName;
}
public void setCatName(String catName) {
this.catName = catName;
}
public boolean isDelete() {
return isDelete;
}
public void setDelete(boolean isDelete) {
this.isDelete = isDelete;
}
public boolean isActive() {
return isActive;
}
public void setActive(boolean isActive) {
this.isActive = isActive;
}
public Long getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Long createdBy) {
this.createdBy = createdBy;
}
public String getcDate() {
return cDate;
}
public void setcDate(String cDate) {
this.cDate = cDate;
}
}
public Long getCmqId() {
return cmqId;
}
public void setCmqId(Long cmqId) {
this.cmqId = cmqId;
}
public AssetCategoryInfo getAssetCategory() {
return assetCategory;
}
public void setAssetCategory(AssetCategoryInfo assetCategory) {
this.assetCategory = assetCategory;
}
public String getEngQuestion() {
return engQuestion;
}
public void setEngQuestion(String engQuestion) {
this.engQuestion = engQuestion;
}
public String getTamilQuestion() {
return tamilQuestion;
}
public void setTamilQuestion(String tamilQuestion) {
this.tamilQuestion = tamilQuestion;
}
public Long getComGroupId() {
return comGroupId;
}
public void setComGroupId(Long comGroupId) {
this.comGroupId = comGroupId;
}
public Long getComSubGroupId() {
return comSubGroupId;
}
public void setComSubGroupId(Long comSubGroupId) {
this.comSubGroupId = comSubGroupId;
}
public String getComSubGroupName() {
return comSubGroupName;
}
public void setComSubGroupName(String comSubGroupName) {
this.comSubGroupName = comSubGroupName;
}
public String getqType() {
return qType;
}
public void setqType(String qType) {
this.qType = qType;
}
public boolean isActive() {
return isActive;
}
public void setActive(boolean isActive) {
this.isActive = isActive;
}
public boolean isDelete() {
return isDelete;
}
public void setDelete(boolean isDelete) {
this.isDelete = isDelete;
}
public Long getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Long createdBy) {
this.createdBy = createdBy;
}
public String getcDate() {
return cDate;
}
public void setcDate(String cDate) {
this.cDate = cDate;
}
}

123
src/main/java/in/gov/chennaicorporation/gccoffice/qrassetfeedback/data/AssetParameter.java

@ -0,0 +1,123 @@
package in.gov.chennaicorporation.gccoffice.qrassetfeedback.data;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
public class AssetParameter {
private Long paramId;
private AssetCategoryInfo assetCategory;
private String paramName;
private boolean isDelete;
private boolean isActive;
private Long createdBy;
private String cDate;
// Constructor
public AssetParameter() {
}
@JsonCreator
public AssetParameter(@JsonProperty("paramId") Long paramId,
@JsonProperty("catName") String catName,
@JsonProperty("isDelete") boolean isDelete,
@JsonProperty("isActive") boolean isActive,
@JsonProperty("createdBy") Long createdBy,
@JsonProperty("cDate") String cDate) {
this.paramId = paramId;
this.paramName = catName;
this.isDelete = isDelete;
this.isActive = isActive;
this.createdBy = createdBy;
this.cDate = cDate;
}
// Define the inner class for assetCategory
public static class AssetCategoryInfo {
private Long cId;
private String catName;
private boolean isDelete;
private boolean isActive;
private Long createdBy;
private String cDate;
public Long getcId() {
return cId;
}
public void setcId(Long cId) {
this.cId = cId;
}
public String getCatName() {
return catName;
}
public void setCatName(String catName) {
this.catName = catName;
}
public boolean isDelete() {
return isDelete;
}
public void setDelete(boolean isDelete) {
this.isDelete = isDelete;
}
public boolean isActive() {
return isActive;
}
public void setActive(boolean isActive) {
this.isActive = isActive;
}
public Long getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Long createdBy) {
this.createdBy = createdBy;
}
public String getcDate() {
return cDate;
}
public void setcDate(String cDate) {
this.cDate = cDate;
}
}
public Long getParamId() {
return paramId;
}
public void setParamId(Long paramId) {
this.paramId = paramId;
}
public AssetCategoryInfo getAssetCategory() {
return assetCategory;
}
public void setAssetCategory(AssetCategoryInfo assetCategory) {
this.assetCategory = assetCategory;
}
public String getParamName() {
return paramName;
}
public void setParamName(String paramName) {
this.paramName = paramName;
}
public boolean isDelete() {
return isDelete;
}
public void setDelete(boolean isDelete) {
this.isDelete = isDelete;
}
public boolean isActive() {
return isActive;
}
public void setActive(boolean isActive) {
this.isActive = isActive;
}
public Long getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Long createdBy) {
this.createdBy = createdBy;
}
public String getcDate() {
return cDate;
}
public void setcDate(String cDate) {
this.cDate = cDate;
}
}

276
src/main/java/in/gov/chennaicorporation/gccoffice/qrassetfeedback/data/AssetParameterQuestions.java

@ -0,0 +1,276 @@
package in.gov.chennaicorporation.gccoffice.qrassetfeedback.data;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
public class AssetParameterQuestions {
private Long apqId;
private AssetParameter assetParameter;
private String engQuestion;
private String tamilQuestion;
private String qType;
private boolean isActive;
private boolean isDelete;
private Long createdBy;
private String cDate;
// Constructors (JsonCreator)
@JsonCreator
public AssetParameterQuestions(
@JsonProperty("apqId") Long apqId,
@JsonProperty("assetParameter") AssetParameter assetParameter,
@JsonProperty("engQuestion") String engQuestion,
@JsonProperty("tamilQuestion") String tamilQuestion,
@JsonProperty("qType") String qType,
@JsonProperty("isActive") boolean isActive,
@JsonProperty("isDelete") boolean isDelete,
@JsonProperty("createdBy") Long createdBy,
@JsonProperty("cDate") String cDate
) {
this.apqId = apqId;
this.assetParameter = assetParameter;
this.engQuestion = engQuestion;
this.tamilQuestion = tamilQuestion;
this.qType = qType;
this.isActive = isActive;
this.isDelete = isDelete;
this.createdBy = createdBy;
this.cDate = cDate;
}
public Long getApqId() {
return apqId;
}
public void setApqId(Long apqId) {
this.apqId = apqId;
}
public AssetParameter getAssetParameter() {
return assetParameter;
}
public void setAssetParameter(AssetParameter assetParameter) {
this.assetParameter = assetParameter;
}
public String getEngQuestion() {
return engQuestion;
}
public void setEngQuestion(String engQuestion) {
this.engQuestion = engQuestion;
}
public String getTamilQuestion() {
return tamilQuestion;
}
public void setTamilQuestion(String tamilQuestion) {
this.tamilQuestion = tamilQuestion;
}
public String getqType() {
return qType;
}
public void setqType(String qType) {
this.qType = qType;
}
public boolean isActive() {
return isActive;
}
public void setActive(boolean isActive) {
this.isActive = isActive;
}
public boolean isDelete() {
return isDelete;
}
public void setDelete(boolean isDelete) {
this.isDelete = isDelete;
}
public Long getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Long createdBy) {
this.createdBy = createdBy;
}
public String getcDate() {
return cDate;
}
public void setcDate(String cDate) {
this.cDate = cDate;
}
// Define the nested classes for assetParameter and assetCategory
public static class AssetParameter {
private Long paramId;
private AssetCategory assetCategory;
private String paramName;
private boolean isDelete;
private boolean isActive;
private Long createdBy;
private String cDate;
// Constructors (JsonCreator)
@JsonCreator
public AssetParameter(
@JsonProperty("paramId") Long paramId,
@JsonProperty("assetCategory") AssetCategory assetCategory,
@JsonProperty("paramName") String paramName,
@JsonProperty("isDelete") boolean isDelete,
@JsonProperty("isActive") boolean isActive,
@JsonProperty("createdBy") Long createdBy,
@JsonProperty("cDate") String cDate
) {
this.paramId = paramId;
this.assetCategory = assetCategory;
this.paramName = paramName;
this.isDelete = isDelete;
this.isActive = isActive;
this.createdBy = createdBy;
this.cDate = cDate;
}
public Long getParamId() {
return paramId;
}
public void setParamId(Long paramId) {
this.paramId = paramId;
}
public AssetCategory getAssetCategory() {
return assetCategory;
}
public void setAssetCategory(AssetCategory assetCategory) {
this.assetCategory = assetCategory;
}
public String getParamName() {
return paramName;
}
public void setParamName(String paramName) {
this.paramName = paramName;
}
public boolean isDelete() {
return isDelete;
}
public void setDelete(boolean isDelete) {
this.isDelete = isDelete;
}
public boolean isActive() {
return isActive;
}
public void setActive(boolean isActive) {
this.isActive = isActive;
}
public Long getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Long createdBy) {
this.createdBy = createdBy;
}
public String getcDate() {
return cDate;
}
public void setcDate(String cDate) {
this.cDate = cDate;
}
}
public static class AssetCategory {
private Long cId;
private String catName;
private boolean isDelete;
private boolean isActive;
private Long createdBy;
private String cDate;
// Constructors (JsonCreator)
@JsonCreator
public AssetCategory(
@JsonProperty("cId") Long cId,
@JsonProperty("catName") String catName,
@JsonProperty("isDelete") boolean isDelete,
@JsonProperty("isActive") boolean isActive,
@JsonProperty("createdBy") Long createdBy,
@JsonProperty("cDate") String cDate
) {
this.cId = cId;
this.catName = catName;
this.isDelete = isDelete;
this.isActive = isActive;
this.createdBy = createdBy;
this.cDate = cDate;
}
public Long getcId() {
return cId;
}
public void setcId(Long cId) {
this.cId = cId;
}
public String getCatName() {
return catName;
}
public void setCatName(String catName) {
this.catName = catName;
}
public boolean isDelete() {
return isDelete;
}
public void setDelete(boolean isDelete) {
this.isDelete = isDelete;
}
public boolean isActive() {
return isActive;
}
public void setActive(boolean isActive) {
this.isActive = isActive;
}
public Long getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Long createdBy) {
this.createdBy = createdBy;
}
public String getcDate() {
return cDate;
}
public void setcDate(String cDate) {
this.cDate = cDate;
}
}
}

357
src/main/java/in/gov/chennaicorporation/gccoffice/qrassetfeedback/data/AssetQuestion.java

@ -0,0 +1,357 @@
package in.gov.chennaicorporation.gccoffice.qrassetfeedback.data;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
public class AssetQuestion {
private Long aqId;
private AssetDetails assetDetails;
private String engQuestion;
private String tamilQuestion;
private String qType;
private boolean isActive;
private boolean isDelete;
private Long createdBy;
private String cDate;
// Constructors, Getters and Setters
@JsonCreator
public AssetQuestion(
@JsonProperty("aqId") Long aqId,
@JsonProperty("assetDetails") AssetDetails assetDetails,
@JsonProperty("engQuestion") String engQuestion,
@JsonProperty("tamilQuestion") String tamilQuestion,
@JsonProperty("qType") String qType,
@JsonProperty("isActive") boolean isActive,
@JsonProperty("isDelete") boolean isDelete,
@JsonProperty("createdBy") Long createdBy,
@JsonProperty("cDate") String cDate
) {
this.aqId = aqId;
this.assetDetails = assetDetails;
this.engQuestion = engQuestion;
this.tamilQuestion = tamilQuestion;
this.qType = qType;
this.isActive = isActive;
this.isDelete = isDelete;
this.createdBy = createdBy;
this.cDate = cDate;
}
public Long getAqId() {
return aqId;
}
public void setAqId(Long aqId) {
this.aqId = aqId;
}
public AssetDetails getAssetDetails() {
return assetDetails;
}
public void setAssetDetails(AssetDetails assetDetails) {
this.assetDetails = assetDetails;
}
public String getEngQuestion() {
return engQuestion;
}
public void setEngQuestion(String engQuestion) {
this.engQuestion = engQuestion;
}
public String getTamilQuestion() {
return tamilQuestion;
}
public void setTamilQuestion(String tamilQuestion) {
this.tamilQuestion = tamilQuestion;
}
public String getqType() {
return qType;
}
public void setqType(String qType) {
this.qType = qType;
}
public boolean isActive() {
return isActive;
}
public void setActive(boolean isActive) {
this.isActive = isActive;
}
public boolean isDelete() {
return isDelete;
}
public void setDelete(boolean isDelete) {
this.isDelete = isDelete;
}
public Long getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Long createdBy) {
this.createdBy = createdBy;
}
public String getcDate() {
return cDate;
}
public void setcDate(String cDate) {
this.cDate = cDate;
}
public static class AssetDetails {
private Long assetId;
private AssetCategory assetCategory;
private String paramId;
private Long zoneId;
private Long divId;
private String areaName;
private String locName;
private String streetName;
private String assetName;
private String assetCode;
private String assetAddress;
private String assetOpeningTime;
private String assetClosingTime;
private String assetLatitude;
private String assetLongitude;
private boolean isDelete;
private boolean isActive;
private Long createdBy;
private String cDate;
// Constructors, Getters and Setters
public AssetDetails() {
}
public Long getAssetId() {
return assetId;
}
public void setAssetId(Long assetId) {
this.assetId = assetId;
}
public AssetCategory getAssetCategory() {
return assetCategory;
}
public void setAssetCategory(AssetCategory assetCategory) {
this.assetCategory = assetCategory;
}
public String getParamId() {
return paramId;
}
public void setParamId(String paramId) {
this.paramId = paramId;
}
public Long getZoneId() {
return zoneId;
}
public void setZoneId(Long zoneId) {
this.zoneId = zoneId;
}
public Long getDivId() {
return divId;
}
public void setDivId(Long divId) {
this.divId = divId;
}
public String getAreaName() {
return areaName;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
public String getLocName() {
return locName;
}
public void setLocName(String locName) {
this.locName = locName;
}
public String getStreetName() {
return streetName;
}
public void setStreetName(String streetName) {
this.streetName = streetName;
}
public String getAssetName() {
return assetName;
}
public void setAssetName(String assetName) {
this.assetName = assetName;
}
public String getAssetCode() {
return assetCode;
}
public void setAssetCode(String assetCode) {
this.assetCode = assetCode;
}
public String getAssetAddress() {
return assetAddress;
}
public void setAssetAddress(String assetAddress) {
this.assetAddress = assetAddress;
}
public String getAssetOpeningTime() {
return assetOpeningTime;
}
public void setAssetOpeningTime(String assetOpeningTime) {
this.assetOpeningTime = assetOpeningTime;
}
public String getAssetClosingTime() {
return assetClosingTime;
}
public void setAssetClosingTime(String assetClosingTime) {
this.assetClosingTime = assetClosingTime;
}
public String getAssetLatitude() {
return assetLatitude;
}
public void setAssetLatitude(String assetLatitude) {
this.assetLatitude = assetLatitude;
}
public String getAssetLongitude() {
return assetLongitude;
}
public void setAssetLongitude(String assetLongitude) {
this.assetLongitude = assetLongitude;
}
public boolean isDelete() {
return isDelete;
}
public void setDelete(boolean isDelete) {
this.isDelete = isDelete;
}
public boolean isActive() {
return isActive;
}
public void setActive(boolean isActive) {
this.isActive = isActive;
}
public Long getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Long createdBy) {
this.createdBy = createdBy;
}
public String getcDate() {
return cDate;
}
public void setcDate(String cDate) {
this.cDate = cDate;
}
public static class AssetCategory {
private Long cId;
private String catName;
private boolean isDelete;
private boolean isActive;
private Long createdBy;
private String cDate;
// Constructors, Getters and Setters
public AssetCategory() {
}
public Long getcId() {
return cId;
}
public void setcId(Long cId) {
this.cId = cId;
}
public String getCatName() {
return catName;
}
public void setCatName(String catName) {
this.catName = catName;
}
public boolean isDelete() {
return isDelete;
}
public void setDelete(boolean isDelete) {
this.isDelete = isDelete;
}
public boolean isActive() {
return isActive;
}
public void setActive(boolean isActive) {
this.isActive = isActive;
}
public Long getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Long createdBy) {
this.createdBy = createdBy;
}
public String getcDate() {
return cDate;
}
public void setcDate(String cDate) {
this.cDate = cDate;
}
}
}
}

290
src/main/java/in/gov/chennaicorporation/gccoffice/qrassetfeedback/data/Feedback.java

@ -0,0 +1,290 @@
package in.gov.chennaicorporation.gccoffice.qrassetfeedback.data;
public class Feedback {
private int fbId;
private AssetDetails assetDetails;
private String paramName;
private String mobileNo;
private int ratingVal;
private Object file;
private int createdBy;
private String cDate;
private boolean delete;
private boolean active;
public Feedback() {
super();
}
public int getFbId() {
return fbId;
}
public void setFbId(int fbId) {
this.fbId = fbId;
}
public AssetDetails getAssetDetails() {
return assetDetails;
}
public void setAssetDetails(AssetDetails assetDetails) {
this.assetDetails = assetDetails;
}
public String getParamName() {
return paramName;
}
public void setParamName(String paramName) {
this.paramName = paramName;
}
public String getMobileNo() {
return mobileNo;
}
public void setMobileNo(String mobileNo) {
this.mobileNo = mobileNo;
}
public int getRatingVal() {
return ratingVal;
}
public void setRatingVal(int ratingVal) {
this.ratingVal = ratingVal;
}
public Object getFile() {
return file;
}
public void setFile(Object file) {
this.file = file;
}
public int getCreatedBy() {
return createdBy;
}
public void setCreatedBy(int createdBy) {
this.createdBy = createdBy;
}
public String getCDate() {
return cDate;
}
public void setCDate(String cDate) {
this.cDate = cDate;
}
public boolean isDelete() {
return delete;
}
public void setDelete(boolean delete) {
this.delete = delete;
}
public boolean isActive() {
return active;
}
public void setActive(boolean active) {
this.active = active;
}
public class AssetDetails {
private int assetId;
private AssetCategory assetCategory;
private String paramId;
private int zoneId;
private int divId;
private String areaName;
private String locName;
private String streetName;
private String assetName;
private String assetCode;
private String assetAddress;
private String assetOpeningTime;
private String assetClosingTime;
private String assetLatitude;
private String assetLongitude;
private boolean isDelete;
private boolean isActive;
private int createdBy;
private String cDate;
public AssetDetails() {
super();
}
public int getAssetId() {
return assetId;
}
public void setAssetId(int assetId) {
this.assetId = assetId;
}
public AssetCategory getAssetCategory() {
return assetCategory;
}
public void setAssetCategory(AssetCategory assetCategory) {
this.assetCategory = assetCategory;
}
public String getParamId() {
return paramId;
}
public void setParamId(String paramId) {
this.paramId = paramId;
}
public int getZoneId() {
return zoneId;
}
public void setZoneId(int zoneId) {
this.zoneId = zoneId;
}
public int getDivId() {
return divId;
}
public void setDivId(int divId) {
this.divId = divId;
}
public String getAreaName() {
return areaName;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
public String getLocName() {
return locName;
}
public void setLocName(String locName) {
this.locName = locName;
}
public String getStreetName() {
return streetName;
}
public void setStreetName(String streetName) {
this.streetName = streetName;
}
public String getAssetName() {
return assetName;
}
public void setAssetName(String assetName) {
this.assetName = assetName;
}
public String getAssetCode() {
return assetCode;
}
public void setAssetCode(String assetCode) {
this.assetCode = assetCode;
}
public String getAssetAddress() {
return assetAddress;
}
public void setAssetAddress(String assetAddress) {
this.assetAddress = assetAddress;
}
public String getAssetOpeningTime() {
return assetOpeningTime;
}
public void setAssetOpeningTime(String assetOpeningTime) {
this.assetOpeningTime = assetOpeningTime;
}
public String getAssetClosingTime() {
return assetClosingTime;
}
public void setAssetClosingTime(String assetClosingTime) {
this.assetClosingTime = assetClosingTime;
}
public String getAssetLatitude() {
return assetLatitude;
}
public void setAssetLatitude(String assetLatitude) {
this.assetLatitude = assetLatitude;
}
public String getAssetLongitude() {
return assetLongitude;
}
public void setAssetLongitude(String assetLongitude) {
this.assetLongitude = assetLongitude;
}
public boolean isDelete() {
return isDelete;
}
public void setDelete(boolean isDelete) {
this.isDelete = isDelete;
}
public boolean isActive() {
return isActive;
}
public void setActive(boolean isActive) {
this.isActive = isActive;
}
public int getCreatedBy() {
return createdBy;
}
public void setCreatedBy(int createdBy) {
this.createdBy = createdBy;
}
public String getcDate() {
return cDate;
}
public void setcDate(String cDate) {
this.cDate = cDate;
}
// Asset Category
public class AssetCategory {
private int cId;
private String catName;
private boolean isDelete;
private boolean isActive;
private int createdBy;
private String cDate;
public AssetCategory() {
super();
}
public int getcId() {
return cId;
}
public void setcId(int cId) {
this.cId = cId;
}
public String getCatName() {
return catName;
}
public void setCatName(String catName) {
this.catName = catName;
}
public boolean isDelete() {
return isDelete;
}
public void setDelete(boolean isDelete) {
this.isDelete = isDelete;
}
public boolean isActive() {
return isActive;
}
public void setActive(boolean isActive) {
this.isActive = isActive;
}
public int getCreatedBy() {
return createdBy;
}
public void setCreatedBy(int createdBy) {
this.createdBy = createdBy;
}
public String getcDate() {
return cDate;
}
public void setcDate(String cDate) {
this.cDate = cDate;
}
}
}
}

1
src/main/java/in/gov/chennaicorporation/gccoffice/qrassetfeedback/package-info.java

@ -0,0 +1 @@
package in.gov.chennaicorporation.gccoffice.qrassetfeedback;

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

Loading…
Cancel
Save