Browse Source
Main Branch Files
Main Branch Files
Project is built upon this base framework with sample scripts, utilizing Java, Spring Boot, Maven, and MySQL.MTM
commit
1f47b47e3f
17526 changed files with 2926413 additions and 0 deletions
-
BIN.DS_Store
-
30HELP.md
-
BINbin/.DS_Store
-
33bin/.gitignore
-
BINbin/.mvn/wrapper/maven-wrapper.jar
-
2bin/.mvn/wrapper/maven-wrapper.properties
-
308bin/mvnw
-
205bin/mvnw.cmd
-
68bin/pom.xml
-
BINbin/src/main/java/in/gov/chennaicorporation/CM/Dashboard2/CmDashboard2Application.class
-
1bin/src/main/resources/application.properties
-
BINbin/src/test/java/in/gov/chennaicorporation/CM/Dashboard2/CmDashboard2ApplicationTests.class
-
25gccoffice.iml
-
BINgccoffice_uploads/.DS_Store
-
BINgccoffice_uploads/pan-card.jpeg
-
BINgccoffice_uploads/user-1.jpeg
-
BINgccoffice_uploads/userimg/.DS_Store
-
BINgccoffice_uploads/userimg/my.jpeg
-
308mvnw
-
205mvnw.cmd
-
102pom.xml
-
BINsrc/.DS_Store
-
BINsrc/main/.DS_Store
-
BINsrc/main/java/.DS_Store
-
BINsrc/main/java/in/.DS_Store
-
BINsrc/main/java/in/gov/.DS_Store
-
BINsrc/main/java/in/gov/chennaicorporation/.DS_Store
-
BINsrc/main/java/in/gov/chennaicorporation/gccoffice/.DS_Store
-
23src/main/java/in/gov/chennaicorporation/gccoffice/GccOfficeApplication.java
-
20src/main/java/in/gov/chennaicorporation/gccoffice/configuration/AppConfig.java
-
111src/main/java/in/gov/chennaicorporation/gccoffice/configuration/DataSourceConfig.java
-
17src/main/java/in/gov/chennaicorporation/gccoffice/configuration/JacksonConfiguration.java
-
68src/main/java/in/gov/chennaicorporation/gccoffice/configuration/SecurityConfig.java
-
20src/main/java/in/gov/chennaicorporation/gccoffice/configuration/ThymeleafConfig.java
-
33src/main/java/in/gov/chennaicorporation/gccoffice/configuration/WebMvcConfig.java
-
10src/main/java/in/gov/chennaicorporation/gccoffice/controller/APIController.java
-
96src/main/java/in/gov/chennaicorporation/gccoffice/controller/CustomErrorController.java
-
33src/main/java/in/gov/chennaicorporation/gccoffice/controller/MainController.java
-
196src/main/java/in/gov/chennaicorporation/gccoffice/controller/MenuController.java
-
13src/main/java/in/gov/chennaicorporation/gccoffice/controller/login.java
-
BINsrc/main/java/in/gov/chennaicorporation/gccoffice/entity/.DS_Store
-
115src/main/java/in/gov/chennaicorporation/gccoffice/entity/AppModuleAccessEntity.java
-
126src/main/java/in/gov/chennaicorporation/gccoffice/entity/AppModuleEntity.java
-
154src/main/java/in/gov/chennaicorporation/gccoffice/entity/AppUserEntity.java
-
113src/main/java/in/gov/chennaicorporation/gccoffice/entity/AppUserGroupEntity.java
-
128src/main/java/in/gov/chennaicorporation/gccoffice/entity/MenuItemAccessEntity.java
-
153src/main/java/in/gov/chennaicorporation/gccoffice/entity/MenuItemEntity.java
-
143src/main/java/in/gov/chennaicorporation/gccoffice/entity/SubMenuItemAccessEntity.java
-
155src/main/java/in/gov/chennaicorporation/gccoffice/entity/SubMenuItemEntity.java
-
108src/main/java/in/gov/chennaicorporation/gccoffice/entity/UserInfoEntity.java
-
BINsrc/main/java/in/gov/chennaicorporation/gccoffice/garbagecollection/.DS_Store
-
59src/main/java/in/gov/chennaicorporation/gccoffice/garbagecollection/controller/APIController.java
-
81src/main/java/in/gov/chennaicorporation/gccoffice/garbagecollection/controller/MainController.java
-
BINsrc/main/java/in/gov/chennaicorporation/gccoffice/garbagecollection/modeldata/.DS_Store
-
242src/main/java/in/gov/chennaicorporation/gccoffice/garbagecollection/modeldata/Request.java
-
100src/main/java/in/gov/chennaicorporation/gccoffice/garbagecollection/modeldata/RequestStatus.java
-
38src/main/java/in/gov/chennaicorporation/gccoffice/interceptor/AppInterceptor.java
-
63src/main/java/in/gov/chennaicorporation/gccoffice/modeldata/Employee.java
-
55src/main/java/in/gov/chennaicorporation/gccoffice/modeldata/ErrorResponse.java
-
209src/main/java/in/gov/chennaicorporation/gccoffice/qrassetfeedback/controller/APIController.java
-
127src/main/java/in/gov/chennaicorporation/gccoffice/qrassetfeedback/controller/MainController.java
-
301src/main/java/in/gov/chennaicorporation/gccoffice/qrassetfeedback/data/Asset.java
-
82src/main/java/in/gov/chennaicorporation/gccoffice/qrassetfeedback/data/AssetCategory.java
-
195src/main/java/in/gov/chennaicorporation/gccoffice/qrassetfeedback/data/AssetCategoryQuestion.java
-
123src/main/java/in/gov/chennaicorporation/gccoffice/qrassetfeedback/data/AssetParameter.java
-
276src/main/java/in/gov/chennaicorporation/gccoffice/qrassetfeedback/data/AssetParameterQuestions.java
-
357src/main/java/in/gov/chennaicorporation/gccoffice/qrassetfeedback/data/AssetQuestion.java
-
290src/main/java/in/gov/chennaicorporation/gccoffice/qrassetfeedback/data/Feedback.java
-
23src/main/java/in/gov/chennaicorporation/gccoffice/repository/AppModuleAccessRepository.java
-
24src/main/java/in/gov/chennaicorporation/gccoffice/repository/AppModuleRepository.java
-
18src/main/java/in/gov/chennaicorporation/gccoffice/repository/AppUserRepository.java
-
25src/main/java/in/gov/chennaicorporation/gccoffice/repository/MenuItemAccessRepository.java
-
25src/main/java/in/gov/chennaicorporation/gccoffice/repository/MenuItemRepository.java
-
28src/main/java/in/gov/chennaicorporation/gccoffice/repository/SubMenuItemAccessRepository.java
-
29src/main/java/in/gov/chennaicorporation/gccoffice/repository/SubMenuItemRepository.java
-
16src/main/java/in/gov/chennaicorporation/gccoffice/repository/UserInfoRepository.java
-
80src/main/java/in/gov/chennaicorporation/gccoffice/service/CustomUserDetails.java
-
75src/main/java/in/gov/chennaicorporation/gccoffice/service/CustomUserDetailsService.java
-
75src/main/java/in/gov/chennaicorporation/gccoffice/service/LoginUserInfo.java
-
11src/main/java/in/gov/chennaicorporation/gccoffice/taxcollection/configuration/TaxCollectionRepositoryConfig.java
-
61src/main/java/in/gov/chennaicorporation/gccoffice/taxcollection/controller/MainController.java
-
165src/main/java/in/gov/chennaicorporation/gccoffice/taxcollection/controller/TaxCollectionRestController.java
-
198src/main/java/in/gov/chennaicorporation/gccoffice/taxcollection/entity/TaxCollectionRequestEntity.java
-
126src/main/java/in/gov/chennaicorporation/gccoffice/taxcollection/entity/TaxCollectionRequestStatusEntity.java
-
30src/main/java/in/gov/chennaicorporation/gccoffice/taxcollection/repository/TaxCollectionRequestRepository.java
-
39src/main/java/in/gov/chennaicorporation/gccoffice/taxcollection/service/TaxCollectionService.java
-
BINsrc/main/resources/.DS_Store
-
31src/main/resources/application.properties
-
BINsrc/main/resources/favicon.ico
-
BINsrc/main/resources/favicon.png
-
BINsrc/main/resources/static/.DS_Store
-
BINsrc/main/resources/static/Chennai_Corporation_Emblem.png
-
BINsrc/main/resources/static/assets/.DS_Store
-
BINsrc/main/resources/static/assets/dist/.DS_Store
-
5989src/main/resources/static/assets/dist/css/theme.css
-
7src/main/resources/static/assets/dist/css/theme.css.map
-
5src/main/resources/static/assets/dist/css/theme.min.css
-
7src/main/resources/static/assets/dist/css/theme.min.css.map
-
0src/main/resources/static/assets/dist/img/.gitignore
-
13src/main/resources/static/assets/dist/img/brand-white.svg
@ -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/) |
|||
|
|||
@ -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/ |
|||
@ -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 |
|||
@ -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 "$@" |
|||
@ -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% |
|||
@ -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> |
|||
@ -0,0 +1 @@ |
|||
|
|||
@ -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> |
|||
|
After Width: 500 | Height: 339 | Size: 38 KiB |
|
After Width: 1000 | Height: 1000 | Size: 90 KiB |
|
After Width: 1000 | Height: 1000 | Size: 90 KiB |
@ -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 "$@" |
|||
@ -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% |
|||
@ -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> |
|||
@ -0,0 +1,23 @@ |
|||
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) { |
|||
SpringApplication.run(GccOfficeApplication.class, args); |
|||
} |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
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 garbageCollection = "http://localhost:8067"; |
|||
|
|||
@Bean |
|||
public RestTemplate restTemplate() { |
|||
return new RestTemplate(); |
|||
} |
|||
|
|||
} |
|||
@ -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(""); |
|||
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(""); |
|||
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); |
|||
} |
|||
} |
|||
} |
|||
@ -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; |
|||
} |
|||
} |
|||
@ -0,0 +1,68 @@ |
|||
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 |
|||
} |
|||
|
|||
|
|||
@Basic |
|||
public PasswordEncoder passwordEncoder() { |
|||
return new BCryptPasswordEncoder(); |
|||
} |
|||
} |
|||
@ -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; |
|||
} |
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
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; |
|||
|
|||
@Configuration |
|||
public class WebMvcConfig implements WebMvcConfigurer { |
|||
private final String uploadDirectory; |
|||
|
|||
@Autowired |
|||
public WebMvcConfig( |
|||
@Value("${file.upload.directory}") String uploadDirectory) { |
|||
this.uploadDirectory = uploadDirectory; |
|||
} |
|||
@Override |
|||
public void addInterceptors(InterceptorRegistry registry) { |
|||
registry.addInterceptor(new AppInterceptor()); |
|||
} |
|||
|
|||
@Override |
|||
public void addResourceHandlers(ResourceHandlerRegistry registry) { |
|||
registry.addResourceHandler("/images/**").addResourceLocations("file:" + uploadDirectory +"/"); |
|||
} |
|||
} |
|||
|
|||
@ -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 { |
|||
|
|||
} |
|||
@ -0,0 +1,96 @@ |
|||
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"); |
|||
|
|||
// 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) |
|||
} |
|||
} |
|||
@ -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"; |
|||
} |
|||
} |
|||
@ -0,0 +1,196 @@ |
|||
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("menuItems") // This will add the mßenuItems to the model for all requests |
|||
public List<MenuItemEntity> getMenuItems() { |
|||
return menuItemRepository.findAll(); |
|||
} |
|||
*/ |
|||
@ModelAttribute("menuItemsHTML") // This will add the menuItems to the model for all requests |
|||
public String menuHTML() { |
|||
|
|||
if(LoginUserInfo.getLoginUserId() == null || LoginUserInfo.getUserGroupId()==null) { |
|||
return ""; |
|||
} |
|||
|
|||
//System.out.println("MenuController: ID: " + LoginUserInfo.getUserGroupId()); |
|||
List<AppModuleAccessEntity> getAppModuleAccessEntities; |
|||
List<AppModuleEntity> getAppModuleEntities; |
|||
if(LoginUserInfo.getUserRole().equals("ADMIN")) { |
|||
//getAppModuleAccessEntities = appModuleAccessRepository.findAll(); |
|||
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); |
|||
} |
|||
//System.out.println(LoginUserInfo.getUserRole()); |
|||
|
|||
|
|||
|
|||
|
|||
// Create a set to store module IDs to be excluded |
|||
//Set<AppModuleEntity> includeModuleIds = new HashSet<>(); |
|||
|
|||
/* |
|||
// Populate the set with module IDs to be excluded |
|||
for (AppModuleAccessEntity accessEntity : getAppModuleAccessEntities) { |
|||
includeModuleIds.add(accessEntity.getModuleId()); |
|||
} |
|||
|
|||
// Convert the set of module IDs to a comma-separated string |
|||
StringBuilder moduleIdsBuilder = new StringBuilder(); |
|||
for (AppModuleEntity moduleId : includeModuleIds) { |
|||
moduleIdsBuilder.append(moduleId.getId()).append(","); |
|||
} |
|||
*/ |
|||
// Convert the set of module IDs to a comma-separated string |
|||
|
|||
|
|||
//StringBuilder moduleIdsBuilder = new StringBuilder(); |
|||
|
|||
/* |
|||
for(i=0;i<checkModuleid.length;i++) { |
|||
System.out.println("Check ID:"+getAppModuleAccessEntities.get(i).getId()+"\n"); |
|||
//System.out.println("Check ID:"+checkModuleid[i]+"\n"); |
|||
} |
|||
*/ |
|||
// Remove the trailing comma |
|||
//String moduleIds = moduleIdsBuilder.length() > 0 ? moduleIdsBuilder.substring(0, moduleIdsBuilder.length() - 1) : ""; |
|||
|
|||
|
|||
//System.out.println("Module IDs:"+moduleIds); |
|||
|
|||
|
|||
|
|||
//System.out.println("IModule Size:"+getAppModuleEntities.size()); |
|||
String menuHTML = ""; |
|||
for (AppModuleEntity moduleName : getAppModuleEntities) { |
|||
//System.out.println("IN Module IDs:"+moduleName.getId()); |
|||
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; |
|||
} |
|||
} |
|||
@ -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"; |
|||
} |
|||
} |
|||
@ -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; |
|||
} |
|||
|
|||
} |
|||
@ -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; |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,154 @@ |
|||
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; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -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; |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
@ -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; |
|||
} |
|||
} |
|||
@ -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; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -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; |
|||
} |
|||
} |
|||
@ -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; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -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; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -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; |
|||
} |
|||
|
|||
} |
|||
@ -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"; |
|||
} |
|||
|
|||
} |
|||
@ -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; |
|||
} |
|||
|
|||
} |
|||
@ -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; |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,38 @@ |
|||
package in.gov.chennaicorporation.gccoffice.interceptor; |
|||
|
|||
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 javax.servlet.http.HttpServletRequest; |
|||
import javax.servlet.http.HttpServletResponse; |
|||
|
|||
public class AppInterceptor implements HandlerInterceptor { |
|||
|
|||
@Override |
|||
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, |
|||
ModelAndView modelAndView) throws Exception { |
|||
// Create a RequestMatcher for login and error URLs |
|||
RequestMatcher loginPageMatcher = new AntPathRequestMatcher("/login"); |
|||
RequestMatcher errorPageMatcher = new AntPathRequestMatcher("/error"); |
|||
|
|||
// Check if the current request matches the login or error page URLs |
|||
if (!loginPageMatcher.matches(request) && !errorPageMatcher.matches(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); |
|||
//System.out.println(userDetails.getAuthorities()); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -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; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -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; |
|||
} |
|||
|
|||
} |
|||
@ -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; |
|||
} |
|||
} |
|||
@ -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"; |
|||
} |
|||
|
|||
} |
|||
@ -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; |
|||
} |
|||
|
|||
} |
|||
} |
|||
@ -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; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -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; |
|||
} |
|||
|
|||
} |
|||
@ -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; |
|||
} |
|||
|
|||
} |
|||
@ -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; |
|||
} |
|||
|
|||
} |
|||
} |
|||
@ -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; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -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; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
package in.gov.chennaicorporation.gccoffice.repository; |
|||
|
|||
import java.util.List; |
|||
|
|||
import javax.transaction.Transactional; |
|||
|
|||
import org.springframework.data.jpa.repository.JpaRepository; |
|||
import org.springframework.data.jpa.repository.Query; |
|||
import org.springframework.data.repository.query.Param; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
import in.gov.chennaicorporation.gccoffice.entity.AppModuleAccessEntity; |
|||
import in.gov.chennaicorporation.gccoffice.entity.AppModuleEntity; |
|||
|
|||
@Repository |
|||
@Transactional |
|||
public interface AppModuleAccessRepository extends JpaRepository<AppModuleAccessEntity, Integer>{ |
|||
@Query(value = "SELECT LAST_INSERT_ID()", nativeQuery = true) |
|||
Integer getLastInsertedId(); |
|||
|
|||
@Query(value = "SELECT * FROM `modules_access` WHERE `usergroup_id`=:usergroup_id AND `isactive`=1 AND `isdelete`=0", nativeQuery = true) |
|||
List<AppModuleAccessEntity> findByUserGroupID(@Param("usergroup_id") String usergroup_id); |
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
package in.gov.chennaicorporation.gccoffice.repository; |
|||
|
|||
import java.util.List; |
|||
|
|||
import javax.transaction.Transactional; |
|||
|
|||
import org.springframework.data.jpa.repository.JpaRepository; |
|||
import org.springframework.data.jpa.repository.Query; |
|||
import org.springframework.data.repository.query.Param; |
|||
import org.springframework.stereotype.Repository; |
|||
import in.gov.chennaicorporation.gccoffice.entity.AppModuleEntity; |
|||
|
|||
@Repository |
|||
@Transactional |
|||
public interface AppModuleRepository extends JpaRepository<AppModuleEntity, Integer>{ |
|||
@Query(value = "SELECT LAST_INSERT_ID()", nativeQuery = true) |
|||
Integer getLastInsertedId(); |
|||
|
|||
@Query(value = "SELECT * FROM `modules` WHERE `isactive`=1 AND `isdelete`=0", nativeQuery = true) |
|||
List<AppModuleEntity> showAll(); |
|||
|
|||
@Query(value = "SELECT * FROM `modules` WHERE `id` IN (:checkModuleid) AND (`isactive`=1 AND `isdelete`=0) ORDER BY `id`", nativeQuery = true) |
|||
List<AppModuleEntity> showAllById(String[] checkModuleid); |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
package in.gov.chennaicorporation.gccoffice.repository; |
|||
|
|||
import javax.transaction.Transactional; |
|||
|
|||
import org.springframework.data.jpa.repository.JpaRepository; |
|||
import org.springframework.data.jpa.repository.Query; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
import in.gov.chennaicorporation.gccoffice.entity.AppUserEntity; |
|||
|
|||
@Repository |
|||
@Transactional |
|||
public interface AppUserRepository extends JpaRepository<AppUserEntity, Integer>{ |
|||
@Query(value = "SELECT LAST_INSERT_ID()", nativeQuery = true) |
|||
Integer getLastInsertedId(); |
|||
|
|||
AppUserEntity findByUsername(String username); |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
package in.gov.chennaicorporation.gccoffice.repository; |
|||
|
|||
import java.util.List; |
|||
|
|||
import javax.transaction.Transactional; |
|||
|
|||
import org.springframework.data.jpa.repository.JpaRepository; |
|||
import org.springframework.data.jpa.repository.Query; |
|||
import org.springframework.data.repository.query.Param; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
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; |
|||
|
|||
@Repository |
|||
@Transactional |
|||
public interface MenuItemAccessRepository extends JpaRepository<MenuItemAccessEntity, Integer>{ |
|||
@Query(value = "SELECT LAST_INSERT_ID()", nativeQuery = true) |
|||
Integer getLastInsertedId(); |
|||
|
|||
@Query(value = "SELECT * FROM `menuitem_access` WHERE (`usergroup_id`=:usergroup_id AND `module_id`=:module_id) AND (`isactive`=1 AND `isdelete`=0)", nativeQuery = true) |
|||
List<MenuItemAccessEntity> findByUserGroupID(@Param("usergroup_id") String usergroup_id, @Param("module_id") String module_id); |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
package in.gov.chennaicorporation.gccoffice.repository; |
|||
|
|||
import java.util.List; |
|||
|
|||
import javax.transaction.Transactional; |
|||
|
|||
import org.springframework.data.jpa.repository.JpaRepository; |
|||
import org.springframework.data.jpa.repository.Query; |
|||
import org.springframework.data.repository.query.Param; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
import in.gov.chennaicorporation.gccoffice.entity.MenuItemEntity; |
|||
|
|||
@Repository |
|||
@Transactional |
|||
public interface MenuItemRepository extends JpaRepository<MenuItemEntity, Integer>{ |
|||
@Query(value = "SELECT LAST_INSERT_ID()", nativeQuery = true) |
|||
Integer getLastInsertedId(); |
|||
|
|||
@Query(value = "SELECT * FROM `menuitem` WHERE (`isactive`=1 AND `isdelete`=0) AND `module_id`=:module_id", nativeQuery = true) |
|||
List<MenuItemEntity> getMenuItemByModuleId(@Param("module_id") int module_id); |
|||
|
|||
@Query(value = "SELECT * FROM `menuitem` WHERE (`isactive`=1 AND `isdelete`=0) AND (`module_id`=:module_id AND `id` IN (:checkMenuid))", nativeQuery = true) |
|||
List<MenuItemEntity> getMenuItemByModuleIdAccess(@Param("module_id") int module_id, String[] checkMenuid); |
|||
} |
|||
@ -0,0 +1,28 @@ |
|||
package in.gov.chennaicorporation.gccoffice.repository; |
|||
|
|||
import java.util.List; |
|||
|
|||
import javax.transaction.Transactional; |
|||
|
|||
import org.springframework.data.jpa.repository.JpaRepository; |
|||
import org.springframework.data.jpa.repository.Query; |
|||
import org.springframework.data.repository.query.Param; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
import in.gov.chennaicorporation.gccoffice.entity.AppModuleAccessEntity; |
|||
import in.gov.chennaicorporation.gccoffice.entity.AppModuleEntity; |
|||
import in.gov.chennaicorporation.gccoffice.entity.SubMenuItemAccessEntity; |
|||
import in.gov.chennaicorporation.gccoffice.entity.SubMenuItemEntity; |
|||
|
|||
@Repository |
|||
@Transactional |
|||
public interface SubMenuItemAccessRepository extends JpaRepository<SubMenuItemAccessEntity, Integer>{ |
|||
@Query(value = "SELECT LAST_INSERT_ID()", nativeQuery = true) |
|||
Integer getLastInsertedId(); |
|||
|
|||
@Query(value = "SELECT * FROM `menuitem_access` WHERE `usergroup_id`=:usergroup_id AND `isactive`=1 AND `isdelete`=0", nativeQuery = true) |
|||
List<SubMenuItemAccessEntity> findByUserGroupID(@Param("usergroup_id") String usergroup_id); |
|||
|
|||
@Query(value = "SELECT * FROM `submenuitem_access` WHERE (`usergroup_id`=:usergroup_id AND `module_id`=:module_id AND `menuitem_id`=:menuitem_id) AND (`isactive`=1 AND `isdelete`=0)", nativeQuery = true) |
|||
List<SubMenuItemAccessEntity> findByUserGroupIDAccess(@Param("usergroup_id") String usergroup_id,@Param("module_id") String module_id,@Param("menuitem_id") String menuitem_id); |
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
package in.gov.chennaicorporation.gccoffice.repository; |
|||
|
|||
import java.util.List; |
|||
|
|||
import javax.transaction.Transactional; |
|||
|
|||
import org.springframework.data.jpa.repository.JpaRepository; |
|||
import org.springframework.data.jpa.repository.Query; |
|||
import org.springframework.data.repository.query.Param; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
import in.gov.chennaicorporation.gccoffice.entity.SubMenuItemEntity; |
|||
|
|||
@Repository |
|||
@Transactional |
|||
public interface SubMenuItemRepository extends JpaRepository<SubMenuItemEntity, Integer>{ |
|||
@Query(value = "SELECT LAST_INSERT_ID()", nativeQuery = true) |
|||
Integer getLastInsertedId(); |
|||
|
|||
@Query(value = "SELECT * FROM `submenuitem` WHERE (`isactive`=1 AND `isdelete`=0) AND `module_id`=:module_id", nativeQuery = true) |
|||
List<SubMenuItemEntity> getSubMenuItemByModuleId(@Param("module_id") int module_id); |
|||
|
|||
@Query(value = "SELECT * FROM `submenuitem` WHERE (`isactive`=1 AND `isdelete`=0) AND `menuitem_id`=:menuitem_id", nativeQuery = true) |
|||
List<SubMenuItemEntity> getSubMenuItemByMenuItemId(@Param("menuitem_id") int menuitem_id); |
|||
|
|||
@Query(value = "SELECT * FROM `submenuitem` WHERE (`isactive`=1 AND `isdelete`=0) AND (`menuitem_id`=:menuitem_id AND `id` IN (:checkSubMenuid))", nativeQuery = true) |
|||
List<SubMenuItemEntity> getSubMenuItemByMenuItemIdAccess(@Param("menuitem_id") int menuitem_id,String[] checkSubMenuid); |
|||
|
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
package in.gov.chennaicorporation.gccoffice.repository; |
|||
|
|||
import javax.transaction.Transactional; |
|||
|
|||
import org.springframework.data.jpa.repository.JpaRepository; |
|||
import org.springframework.data.jpa.repository.Query; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
import in.gov.chennaicorporation.gccoffice.entity.UserInfoEntity; |
|||
|
|||
@Repository |
|||
@Transactional |
|||
public interface UserInfoRepository extends JpaRepository<UserInfoEntity, Integer>{ |
|||
@Query(value = "SELECT LAST_INSERT_ID()", nativeQuery = true) |
|||
Integer getLastInsertedId(); |
|||
} |
|||
@ -0,0 +1,80 @@ |
|||
package in.gov.chennaicorporation.gccoffice.service; |
|||
|
|||
import org.springframework.security.core.GrantedAuthority; |
|||
import org.springframework.security.core.userdetails.UserDetails; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Collection; |
|||
import java.util.Map; |
|||
|
|||
public class CustomUserDetails implements UserDetails, Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
private String username; |
|||
private String password; |
|||
private Collection<? extends GrantedAuthority> authorities; |
|||
private boolean accountNonExpired; |
|||
private boolean accountNonLocked; |
|||
private boolean credentialsNonExpired; |
|||
private boolean enabled; |
|||
private Map<String, Object> additionalAttributes; |
|||
|
|||
public CustomUserDetails(String username, String password, |
|||
Collection<? extends GrantedAuthority> authorities, |
|||
boolean accountNonExpired, |
|||
boolean accountNonLocked, |
|||
boolean credentialsNonExpired, |
|||
boolean enabled, |
|||
Map<String, Object> additionalAttributes) { |
|||
this.username = username; |
|||
this.password = password; |
|||
this.authorities = authorities; |
|||
this.accountNonExpired = accountNonExpired; |
|||
this.accountNonLocked = accountNonLocked; |
|||
this.credentialsNonExpired = credentialsNonExpired; |
|||
this.enabled = enabled; |
|||
this.additionalAttributes = additionalAttributes; |
|||
} |
|||
|
|||
@Override |
|||
public Collection<? extends GrantedAuthority> getAuthorities() { |
|||
return authorities; |
|||
} |
|||
|
|||
@Override |
|||
public String getPassword() { |
|||
return password; |
|||
} |
|||
|
|||
@Override |
|||
public String getUsername() { |
|||
return username; |
|||
} |
|||
|
|||
@Override |
|||
public boolean isAccountNonExpired() { |
|||
return accountNonExpired; |
|||
} |
|||
|
|||
@Override |
|||
public boolean isAccountNonLocked() { |
|||
return accountNonLocked; |
|||
} |
|||
|
|||
@Override |
|||
public boolean isCredentialsNonExpired() { |
|||
return credentialsNonExpired; |
|||
} |
|||
|
|||
@Override |
|||
public boolean isEnabled() { |
|||
return enabled; |
|||
} |
|||
|
|||
// Getter for additional attributes |
|||
public Map<String, Object> getAdditionalAttributes() { |
|||
return additionalAttributes; |
|||
} |
|||
} |
|||
|
|||
@ -0,0 +1,75 @@ |
|||
package in.gov.chennaicorporation.gccoffice.service; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.security.core.userdetails.UserDetails; |
|||
import org.springframework.security.core.userdetails.UserDetailsService; |
|||
import org.springframework.security.core.userdetails.UsernameNotFoundException; |
|||
import org.springframework.security.core.GrantedAuthority; |
|||
import org.springframework.security.core.authority.SimpleGrantedAuthority; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import in.gov.chennaicorporation.gccoffice.entity.AppUserEntity; |
|||
import in.gov.chennaicorporation.gccoffice.repository.AppUserRepository; |
|||
|
|||
@Service |
|||
public class CustomUserDetailsService implements UserDetailsService { |
|||
|
|||
private final AppUserRepository appUserRepository; |
|||
|
|||
@Autowired |
|||
public CustomUserDetailsService(AppUserRepository appUserRepository) { |
|||
this.appUserRepository = appUserRepository; |
|||
} |
|||
|
|||
@Override |
|||
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { |
|||
AppUserEntity appUserEntity = appUserRepository.findByUsername(username); |
|||
System.out.println(username); |
|||
if (appUserEntity == null) { |
|||
System.out.println("User not found"); |
|||
throw new UsernameNotFoundException("User not found"); |
|||
} |
|||
/* |
|||
return org.springframework.security.core.userdetails.User.builder() |
|||
.username(appUserEntity.getUsername()) |
|||
.password(appUserEntity.getPassword()) |
|||
.roles(appUserEntity.getRoles()) |
|||
.additionalAttributes(Map.of("userid", appUserEntity.getUserid())) |
|||
.build(); |
|||
*/ |
|||
|
|||
String userRole = appUserEntity.getRoles(); |
|||
// Ensure that the role starts with "ROLE_" |
|||
if (!userRole.startsWith("ROLE_")) { |
|||
userRole = "ROLE_" + userRole; |
|||
System.out.println("User Role: "+userRole); |
|||
} |
|||
// Create a SimpleGrantedAuthority for the user role |
|||
SimpleGrantedAuthority authority = new SimpleGrantedAuthority(userRole); |
|||
|
|||
// Create a list to hold the authority/role |
|||
List<GrantedAuthority> authorityList = new ArrayList<>(); |
|||
authorityList.add(authority); |
|||
|
|||
// Construct CustomUserDetails instance with custom attributes |
|||
CustomUserDetails userDetails = new CustomUserDetails( |
|||
appUserEntity.getUsername(), |
|||
appUserEntity.getPassword(), |
|||
authorityList, |
|||
true, |
|||
true, |
|||
true, |
|||
true, |
|||
Map.of("userid",appUserEntity.getUserid().getUserid(), |
|||
"usergroupid",appUserEntity.getUsergroup_id().getId(), |
|||
"userrole",appUserEntity.getRoles().toString() |
|||
) |
|||
); |
|||
|
|||
return userDetails; |
|||
} |
|||
} |
|||
@ -0,0 +1,75 @@ |
|||
package in.gov.chennaicorporation.gccoffice.service; |
|||
|
|||
import java.util.Map; |
|||
|
|||
import org.springframework.security.core.Authentication; |
|||
import org.springframework.security.core.context.SecurityContextHolder; |
|||
import org.springframework.security.core.userdetails.UserDetails; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
@Service |
|||
public class LoginUserInfo { |
|||
|
|||
public static UserDetails getCurrentUserDetails() { |
|||
Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); |
|||
if (authentication != null && authentication.isAuthenticated()) { |
|||
Object principal = authentication.getPrincipal(); |
|||
if (principal instanceof UserDetails) { |
|||
return (UserDetails) principal; |
|||
} |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
public static String getLoginUserId() { |
|||
UserDetails userDetails = LoginUserInfo.getCurrentUserDetails(); |
|||
if (userDetails instanceof CustomUserDetails) { |
|||
CustomUserDetails customUserDetails = (CustomUserDetails) userDetails; |
|||
Map<String, Object> additionalAttributes = customUserDetails.getAdditionalAttributes(); |
|||
if (additionalAttributes != null) { |
|||
Object userId = additionalAttributes.get("userid"); |
|||
Object groupId = additionalAttributes.get("groupid"); |
|||
if (userId != null) { |
|||
return userId.toString(); |
|||
} |
|||
} |
|||
/* |
|||
for (Map.Entry<String, Object> entry : additionalAttributes.entrySet()) { |
|||
String key = entry.getKey(); |
|||
Object value = entry.getValue(); |
|||
System.out.println("Key: " + key + ", Value: " + value); |
|||
}*/ |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
public static String getUserGroupId() { |
|||
UserDetails userDetails = LoginUserInfo.getCurrentUserDetails(); |
|||
if (userDetails instanceof CustomUserDetails) { |
|||
CustomUserDetails customUserDetails = (CustomUserDetails) userDetails; |
|||
Map<String, Object> additionalAttributes = customUserDetails.getAdditionalAttributes(); |
|||
if (additionalAttributes != null) { |
|||
Object userGroupId = additionalAttributes.get("usergroupid"); |
|||
if (userGroupId != null) { |
|||
return userGroupId.toString(); |
|||
} |
|||
} |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
public static String getUserRole() { |
|||
UserDetails userDetails = LoginUserInfo.getCurrentUserDetails(); |
|||
if (userDetails instanceof CustomUserDetails) { |
|||
CustomUserDetails customUserDetails = (CustomUserDetails) userDetails; |
|||
Map<String, Object> additionalAttributes = customUserDetails.getAdditionalAttributes(); |
|||
if (additionalAttributes != null) { |
|||
Object userRole = additionalAttributes.get("userrole"); |
|||
if (userRole != null) { |
|||
return userRole.toString(); |
|||
} |
|||
} |
|||
} |
|||
return null; |
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
package in.gov.chennaicorporation.gccoffice.taxcollection.configuration; |
|||
|
|||
import org.springframework.boot.autoconfigure.domain.EntityScan; |
|||
import org.springframework.context.annotation.ComponentScan; |
|||
import org.springframework.context.annotation.Configuration; |
|||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories; |
|||
|
|||
@Configuration |
|||
public class TaxCollectionRepositoryConfig { |
|||
// Additional configuration related to tax collection repositories, if needed |
|||
} |
|||
@ -0,0 +1,61 @@ |
|||
package in.gov.chennaicorporation.gccoffice.taxcollection.controller; |
|||
|
|||
import java.nio.file.Paths; |
|||
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.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.service.LoginUserInfo; |
|||
import in.gov.chennaicorporation.gccoffice.taxcollection.entity.TaxCollectionRequestEntity; |
|||
import in.gov.chennaicorporation.gccoffice.taxcollection.repository.TaxCollectionRequestRepository; |
|||
|
|||
@RequestMapping("/taxcollection") |
|||
@Controller("taxCollectionController") |
|||
public class MainController { |
|||
|
|||
private final RestTemplate restTemplate; |
|||
private final AppConfig appConfig; |
|||
private final TaxCollectionRequestRepository taxCollectionRequestRepository; |
|||
|
|||
@Autowired |
|||
public MainController( |
|||
RestTemplate restTemplate, |
|||
AppConfig appConfig, |
|||
TaxCollectionRequestRepository taxCollectionRequestRepository) { |
|||
this.restTemplate = restTemplate; |
|||
this.appConfig = appConfig; |
|||
this.taxCollectionRequestRepository = taxCollectionRequestRepository; |
|||
} |
|||
|
|||
@GetMapping({"", "/", "/index", "/dashboard"}) |
|||
public String home(Model model) { |
|||
return "modules/taxcollection/index"; |
|||
} |
|||
|
|||
@GetMapping("/request-create") |
|||
public String category(Model model) { |
|||
String LoginUserId = LoginUserInfo.getLoginUserId(); |
|||
model.addAttribute("LoginUserId",LoginUserId); |
|||
List<TaxCollectionRequestEntity> taxCollectionRequestEntities = taxCollectionRequestRepository.showAll(); |
|||
model.addAttribute("taxCollectionRequestEntities",taxCollectionRequestEntities); |
|||
return "modules/taxcollection/request-create"; |
|||
} |
|||
|
|||
@GetMapping("/showimage") |
|||
public String showimage(Model model) { |
|||
return "modules/taxcollection/request-create"; |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,165 @@ |
|||
package in.gov.chennaicorporation.gccoffice.taxcollection.controller; |
|||
|
|||
import java.io.IOException; |
|||
import java.nio.file.Files; |
|||
import java.nio.file.Paths; |
|||
import java.time.LocalDateTime; |
|||
import java.util.Collections; |
|||
import java.util.List; |
|||
import java.util.Optional; |
|||
import java.util.stream.Collectors; |
|||
|
|||
import javax.servlet.http.HttpServletRequest; |
|||
import javax.transaction.Transactional; |
|||
|
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.beans.factory.annotation.Value; |
|||
import org.springframework.http.HttpStatus; |
|||
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.RequestMethod; |
|||
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; |
|||
import in.gov.chennaicorporation.gccoffice.service.LoginUserInfo; |
|||
import in.gov.chennaicorporation.gccoffice.taxcollection.entity.TaxCollectionRequestEntity; |
|||
import in.gov.chennaicorporation.gccoffice.taxcollection.entity.TaxCollectionRequestStatusEntity; |
|||
import in.gov.chennaicorporation.gccoffice.taxcollection.repository.TaxCollectionRequestRepository; |
|||
import in.gov.chennaicorporation.gccoffice.taxcollection.service.TaxCollectionService; |
|||
|
|||
@RequestMapping("/api/taxcollection") |
|||
@RestController("taxCollectionRestController") |
|||
public class TaxCollectionRestController { |
|||
|
|||
private final TaxCollectionRequestRepository taxCollectionRequestRepository; |
|||
private final RestTemplate restTemplate; |
|||
private final AppConfig appConfig; |
|||
private final TaxCollectionService taxCollectionService; |
|||
private final String uploadDirectory; |
|||
|
|||
String bodyMessage = ""; |
|||
@Autowired |
|||
public TaxCollectionRestController( |
|||
TaxCollectionRequestRepository taxCollectionRequestRepository, |
|||
RestTemplate restTemplate, |
|||
AppConfig appConfig, |
|||
TaxCollectionService taxCollectionService, |
|||
@Value("${file.upload.directory}") String uploadDirectory) { |
|||
this.taxCollectionRequestRepository = taxCollectionRequestRepository; |
|||
this.restTemplate = restTemplate; |
|||
this.appConfig = appConfig; |
|||
this.taxCollectionService = taxCollectionService; |
|||
this.uploadDirectory = uploadDirectory; |
|||
} |
|||
|
|||
// API Calls List |
|||
@GetMapping(value = "/getPropertTaxPersonalDetails") |
|||
public String getPtaxpersonalDetails(@RequestParam String ptax) { |
|||
String ptaxTxt=ptax; |
|||
String[] ptaxparts = ptaxTxt.split("-"); |
|||
String serviceId = "PT"; |
|||
String SetInput = "{\"ZONE\":\""+ptaxparts[0]+"\",\"DIV\":\""+ptaxparts[1]+"\",\"BILL\":\""+ptaxparts[2]+"\",\"SB\":\""+ptaxparts[3]+"\"}"; |
|||
|
|||
ResponseEntity<String> response = restTemplate.getForEntity("https://chennaicorporation.gov.in/gcc/online-payment/property-tax/mobile-reg/mob_Asses_det.jsp?ServiceID={serviceId}&SetInput={SetInput}", |
|||
String.class, |
|||
serviceId, |
|||
SetInput); |
|||
bodyMessage = response.getBody().trim(); |
|||
|
|||
return bodyMessage; |
|||
} |
|||
|
|||
// List |
|||
@GetMapping(value = "/getTaxCollectionRequest") |
|||
private List<TaxCollectionRequestEntity> getTaxCollectionRequest(){ |
|||
return taxCollectionRequestRepository.showAll(); |
|||
} |
|||
|
|||
@GetMapping(value = "/getTaxCollectionRequestById") |
|||
private ResponseEntity<?> getTaxCollectionRequestById(@RequestParam("request_id") Integer request_id) { |
|||
Optional<TaxCollectionRequestEntity> result = taxCollectionRequestRepository.findById(request_id); |
|||
|
|||
if (result.isPresent()) { |
|||
return ResponseEntity.ok(result.get()); // Return the entity if it exists |
|||
} else { |
|||
return ResponseEntity.notFound().build(); // Return a 404 Not Found if the entity does not exist |
|||
} |
|||
} |
|||
|
|||
// Save & Update |
|||
@RequestMapping(value = "/saveTaxCollectionRequest", method = RequestMethod.POST) |
|||
public String saveTaxCollectionRequest(HttpServletRequest request, |
|||
@RequestParam("name") String name, |
|||
@RequestParam("mobile") String mobile, |
|||
@RequestParam("ptax") String ptax, |
|||
@RequestParam("usertype") String usertype, |
|||
@RequestParam("availabilitydate") String availabilitydate, |
|||
@RequestParam(name = "created_by", required = false) Integer created_by) { |
|||
TaxCollectionRequestEntity taxCollectionRequestEntity = new TaxCollectionRequestEntity(); |
|||
|
|||
String userId = LoginUserInfo.getLoginUserId(); |
|||
System.out.println("TaxCollectionRestController -> Login User ID: "+userId); |
|||
|
|||
LocalDateTime cdate = LocalDateTime.now(); |
|||
|
|||
if (created_by == null) { |
|||
created_by = 0; |
|||
} |
|||
|
|||
taxCollectionRequestEntity.setName(name); |
|||
taxCollectionRequestEntity.setMobile(mobile); |
|||
taxCollectionRequestEntity.setPtax(ptax); |
|||
taxCollectionRequestEntity.setUsertype(usertype); |
|||
taxCollectionRequestEntity.setAvailabilitydate(availabilitydate); |
|||
taxCollectionRequestEntity.setCreatedBy(created_by); |
|||
taxCollectionRequestEntity.setcDate(cdate.toString()); |
|||
taxCollectionRequestEntity.setIsActive(true); |
|||
taxCollectionRequestEntity.setIsDelete(false); |
|||
Integer lastinsertid = taxCollectionService.saveTaxCollectionRequest(taxCollectionRequestEntity); |
|||
return "Success"; |
|||
} |
|||
|
|||
@RequestMapping(value = "/saveTaxCollectionRequestStatus", method = RequestMethod.POST) |
|||
public String saveTaxCollectionRequestStatus(HttpServletRequest request, |
|||
@RequestParam("status") String status, |
|||
@RequestParam("comments") String comments, |
|||
@RequestParam("request_id") TaxCollectionRequestEntity request_id, |
|||
@RequestParam(name = "created_by", required = false) Integer created_by) { |
|||
|
|||
TaxCollectionRequestStatusEntity taxCollectionRequestStatusEntity = new TaxCollectionRequestStatusEntity(); |
|||
|
|||
LocalDateTime cdate = LocalDateTime.now(); |
|||
|
|||
if (created_by == null) { |
|||
created_by = 0; |
|||
} |
|||
|
|||
taxCollectionRequestStatusEntity.setStatus(status); |
|||
taxCollectionRequestStatusEntity.setComments(comments); |
|||
taxCollectionRequestStatusEntity.setTaxCollectionRequestEntity(request_id); |
|||
taxCollectionRequestStatusEntity.setCreatedBy(created_by); |
|||
taxCollectionRequestStatusEntity.setcDate(cdate.toString()); |
|||
taxCollectionRequestStatusEntity.setIsActive(true); |
|||
taxCollectionRequestStatusEntity.setIsDelete(false); |
|||
//Integer lastinsertid = taxCollectionService.saveTaxCollectionRequest(taxCollectionRequestStatusEntity); |
|||
return "Success"; |
|||
} |
|||
|
|||
@GetMapping("/files") |
|||
public ResponseEntity<List<String>> listFiles() { |
|||
try { |
|||
List<String> files = Files.list(Paths.get(uploadDirectory)) |
|||
.map(path -> path.getFileName().toString()) |
|||
.collect(Collectors.toList()); |
|||
|
|||
return ResponseEntity.ok(files); |
|||
} catch (IOException e) { |
|||
e.printStackTrace(); |
|||
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(Collections.emptyList()); |
|||
} |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,198 @@ |
|||
package in.gov.chennaicorporation.gccoffice.taxcollection.entity; |
|||
|
|||
import javax.persistence.Column; |
|||
import javax.persistence.Entity; |
|||
import javax.persistence.GeneratedValue; |
|||
import javax.persistence.GenerationType; |
|||
import javax.persistence.Id; |
|||
import javax.persistence.Table; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
|||
|
|||
@Entity |
|||
@Table(name = "collection_request") |
|||
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler"}) |
|||
public class TaxCollectionRequestEntity { |
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
@Column(name = "request_id",nullable = false) |
|||
private Integer request_id; |
|||
|
|||
@Column(name = "request_no",nullable = true) |
|||
private String requestNo; |
|||
|
|||
@Column(name = "name",nullable = false) |
|||
private String name; |
|||
|
|||
@Column(name = "mobile",nullable = false) |
|||
private String mobile; |
|||
|
|||
@Column(name = "ptax",nullable = false) |
|||
private String ptax; |
|||
|
|||
@Column(name = "usertype",nullable = false) |
|||
private String usertype; |
|||
|
|||
@Column(name = "availability_date",nullable = false, columnDefinition = "DATETIME DEFAULT CURRENT_TIMESTAMP") |
|||
private String availabilitydate; |
|||
|
|||
@Column(name = "status", nullable = false, columnDefinition = "VARCHAR(255) DEFAULT 'open'") |
|||
private String status; |
|||
|
|||
@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 TaxCollectionRequestEntity() { |
|||
|
|||
} |
|||
|
|||
|
|||
public TaxCollectionRequestEntity(Integer request_id, String requestNo, String name, String mobile, String ptax, |
|||
String usertype, String availabilitydate, String status, Boolean isDelete, Boolean isActive, |
|||
Integer createdBy, String cDate) { |
|||
super(); |
|||
this.request_id = request_id; |
|||
this.requestNo = requestNo; |
|||
this.name = name; |
|||
this.mobile = mobile; |
|||
this.ptax = ptax; |
|||
this.usertype = usertype; |
|||
this.availabilitydate = availabilitydate; |
|||
this.status = status; |
|||
this.isDelete = isDelete; |
|||
this.isActive = isActive; |
|||
this.createdBy = createdBy; |
|||
this.cDate = cDate; |
|||
} |
|||
|
|||
|
|||
public Integer getRequest_id() { |
|||
return request_id; |
|||
} |
|||
|
|||
|
|||
public void setRequest_id(Integer request_id) { |
|||
this.request_id = request_id; |
|||
} |
|||
|
|||
|
|||
public String getRequestNo() { |
|||
return requestNo; |
|||
} |
|||
|
|||
|
|||
public void setRequestNo(String requestNo) { |
|||
this.requestNo = requestNo; |
|||
} |
|||
|
|||
|
|||
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 getPtax() { |
|||
return ptax; |
|||
} |
|||
|
|||
|
|||
public void setPtax(String ptax) { |
|||
this.ptax = ptax; |
|||
} |
|||
|
|||
|
|||
public String getUsertype() { |
|||
return usertype; |
|||
} |
|||
|
|||
|
|||
public void setUsertype(String usertype) { |
|||
this.usertype = usertype; |
|||
} |
|||
|
|||
|
|||
public String getAvailabilitydate() { |
|||
return availabilitydate; |
|||
} |
|||
|
|||
|
|||
public void setAvailabilitydate(String availabilitydate) { |
|||
this.availabilitydate = availabilitydate; |
|||
} |
|||
|
|||
|
|||
public String getStatus() { |
|||
return status; |
|||
} |
|||
|
|||
|
|||
public void setStatus(String status) { |
|||
this.status = status; |
|||
} |
|||
|
|||
|
|||
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; |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,126 @@ |
|||
package in.gov.chennaicorporation.gccoffice.taxcollection.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; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
|||
|
|||
@Entity |
|||
@Table(name = "collection_request_status") |
|||
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler"}) |
|||
public class TaxCollectionRequestStatusEntity { |
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
@Column(name = "request_status_id",nullable = false) |
|||
private Integer request_status_id; |
|||
|
|||
@ManyToOne |
|||
@JoinColumn(name="request_id",nullable = false) |
|||
private TaxCollectionRequestEntity taxCollectionRequestEntity; |
|||
|
|||
@Column(name = "status",nullable = false) |
|||
private String status ; |
|||
|
|||
@Column(name = "comments",nullable = false) |
|||
private String comments; |
|||
|
|||
@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; |
|||
|
|||
@Column(name = "isdelete",nullable = false, columnDefinition = "Boolean default false") |
|||
private Boolean isDelete; |
|||
|
|||
@Column(name = "isactive",nullable = false, columnDefinition = "Boolean default true") |
|||
private Boolean isActive; |
|||
|
|||
public TaxCollectionRequestStatusEntity() { |
|||
|
|||
} |
|||
|
|||
public TaxCollectionRequestStatusEntity(Integer request_status_id, |
|||
TaxCollectionRequestEntity taxCollectionRequestEntity, String status, String comments, Integer createdBy, |
|||
String cDate, Boolean isDelete, Boolean isActive) { |
|||
super(); |
|||
this.request_status_id = request_status_id; |
|||
this.taxCollectionRequestEntity = taxCollectionRequestEntity; |
|||
this.status = status; |
|||
this.comments = comments; |
|||
this.createdBy = createdBy; |
|||
this.cDate = cDate; |
|||
this.isDelete = isDelete; |
|||
this.isActive = isActive; |
|||
} |
|||
|
|||
public Integer getRequest_status_id() { |
|||
return request_status_id; |
|||
} |
|||
|
|||
public void setRequest_status_id(Integer request_status_id) { |
|||
this.request_status_id = request_status_id; |
|||
} |
|||
|
|||
public TaxCollectionRequestEntity getTaxCollectionRequestEntity() { |
|||
return taxCollectionRequestEntity; |
|||
} |
|||
|
|||
public void setTaxCollectionRequestEntity(TaxCollectionRequestEntity taxCollectionRequestEntity) { |
|||
this.taxCollectionRequestEntity = taxCollectionRequestEntity; |
|||
} |
|||
|
|||
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 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; |
|||
} |
|||
|
|||
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; |
|||
} |
|||
} |
|||
@ -0,0 +1,30 @@ |
|||
package in.gov.chennaicorporation.gccoffice.taxcollection.repository; |
|||
|
|||
import java.util.List; |
|||
|
|||
import javax.transaction.Transactional; |
|||
|
|||
import org.springframework.data.jpa.repository.JpaRepository; |
|||
import org.springframework.data.jpa.repository.Modifying; |
|||
import org.springframework.data.jpa.repository.Query; |
|||
import org.springframework.data.repository.query.Param; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
import in.gov.chennaicorporation.gccoffice.taxcollection.entity.TaxCollectionRequestEntity; |
|||
|
|||
@Repository |
|||
@Transactional |
|||
public interface TaxCollectionRequestRepository extends JpaRepository<TaxCollectionRequestEntity, Integer> { |
|||
|
|||
@Query(value = "SELECT LAST_INSERT_ID()", nativeQuery = true) |
|||
Integer getLastInsertedId(); |
|||
|
|||
@Query(value = "SELECT * FROM `collection_request`", nativeQuery = true) |
|||
List<TaxCollectionRequestEntity> showAll(); |
|||
|
|||
// Insert |
|||
@Modifying |
|||
@Query(value ="insert into `collection_request` (`name`,`mobile`,`ptax`,`usertype`,`availability_date`, `created_by`) values (:name, :mobile, :ptax, :usertype, :availabilitydate, :created_by)", nativeQuery = true) |
|||
void saveData(String name, String mobile, String ptax, String usertype, String availabilitydate, Integer created_by); |
|||
|
|||
} |
|||
@ -0,0 +1,39 @@ |
|||
package in.gov.chennaicorporation.gccoffice.taxcollection.service; |
|||
|
|||
import javax.transaction.Transactional; |
|||
|
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import in.gov.chennaicorporation.gccoffice.taxcollection.entity.TaxCollectionRequestEntity; |
|||
import in.gov.chennaicorporation.gccoffice.taxcollection.entity.TaxCollectionRequestStatusEntity; |
|||
import in.gov.chennaicorporation.gccoffice.taxcollection.repository.TaxCollectionRequestRepository; |
|||
|
|||
@Service |
|||
public class TaxCollectionService { |
|||
private final TaxCollectionRequestRepository taxCollectionRequestRepository; |
|||
|
|||
|
|||
@Autowired |
|||
public TaxCollectionService(TaxCollectionRequestRepository taxCollectionRequestRepository) { |
|||
this.taxCollectionRequestRepository = taxCollectionRequestRepository; |
|||
} |
|||
|
|||
@Transactional |
|||
public Integer getLastInsertedId() { |
|||
return taxCollectionRequestRepository.getLastInsertedId(); |
|||
} |
|||
|
|||
@Transactional |
|||
public Integer saveTaxCollectionRequest(TaxCollectionRequestEntity taxCollectionRequestData) { |
|||
TaxCollectionRequestEntity taxCollectionRequestEntity = taxCollectionRequestRepository.save(taxCollectionRequestData); |
|||
return taxCollectionRequestEntity.getRequest_id(); |
|||
} |
|||
/* |
|||
@Transactional |
|||
public Integer saveTaxCollectionRequestStatus(TaxCollectionRequestEntity taxCollectionRequestData) { |
|||
TaxCollectionRequestEntity taxCollectionRequestEntity = taxCollectionRequestRepository.save(taxCollectionRequestData); |
|||
return taxCollectionRequestStatusEntity.(); |
|||
} |
|||
*/ |
|||
} |
|||
@ -0,0 +1,31 @@ |
|||
server.port = 8064 |
|||
#server.servlet.context-path=/gccoffice |
|||
server.error.include-stacktrace= on_param |
|||
# Hibernate logging |
|||
logging.level.org.hibernate.SQL=DEBUG |
|||
logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE |
|||
|
|||
# Enable CORS globally for all endpoints |
|||
spring.webmvc.cors.enabled=true |
|||
|
|||
# Comma-separated list of allowed origins |
|||
spring.webmvc.cors.allowed-origins=http://gccservices.chennaicorporation.gov.in,http://chennaicorporation.gov.in,http://117.232.67.158 |
|||
|
|||
# Comma-separated list of allowed HTTP methods |
|||
spring.webmvc.cors.allowed-methods=GET,POST,PUT,DELETE |
|||
|
|||
# Whether to include credentials such as cookies in CORS requests |
|||
spring.webmvc.cors.allow-credentials=true |
|||
|
|||
# Maximum age (in seconds) of the CORS response cache |
|||
spring.webmvc.cors.max-age=3600 |
|||
|
|||
server.servlet.session.tracking-modes=COOKIE |
|||
|
|||
#server.servlet.session.cookie.domain=.chennaicorporation.gov.in |
|||
|
|||
#logging.level.root=DEBUG |
|||
|
|||
file.upload.directory=${user.dir}/gccoffice_uploads |
|||
|
|||
server.address=0.0.0.0 |
|||
|
After Width: 32 | Height: 32 | Size: 3.5 KiB |
|
After Width: 328 | Height: 438 | Size: 188 KiB |
5989
src/main/resources/static/assets/dist/css/theme.css
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
7
src/main/resources/static/assets/dist/css/theme.css.map
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
5
src/main/resources/static/assets/dist/css/theme.min.css
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
7
src/main/resources/static/assets/dist/css/theme.min.css.map
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,13 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> |
|||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" |
|||
viewBox="0 0 54.3 54" style="enable-background:new 0 0 54.3 54;" xml:space="preserve"> |
|||
<style type="text/css"> |
|||
.st0{fill:#FFFFFF;} |
|||
.st1{fill:#EF4153;} |
|||
</style> |
|||
<path class="st0" d="M20.1,13.8v5H13v20.9H7.7V18.8H0.6v-5H20.1z"/> |
|||
<path class="st0" d="M46.2,39.7h-6.6l-7.4-11.1l-3.9,4.3v6.8H23V13.8h5.3v12.3l10.5-12.3h6.9l-9.8,10.7L46.2,39.7z"/> |
|||
<path class="st1" d="M52.8,39c-0.7,0.6-1.5,1-2.5,1c-1,0-1.9-0.3-2.5-1c-0.7-0.6-1-1.5-1-2.5c0-1,0.3-1.8,1-2.5c0.7-0.7,1.5-1,2.5-1 |
|||
c1,0,1.8,0.3,2.5,1c0.7,0.7,1,1.5,1,2.5C53.7,37.5,53.4,38.3,52.8,39z"/> |
|||
</svg> |
|||
Some files were not shown because too many files changed in this diff
Write
Preview
Loading…
Cancel
Save
Reference in new issue