commit
31300a0370
9176 changed files with 471488 additions and 0 deletions
-
33.gitignore
-
BIN.mvn/wrapper/maven-wrapper.jar
-
2.mvn/wrapper/maven-wrapper.properties
-
308mvnw
-
205mvnw.cmd
-
138pom.xml
-
13src/main/java/ItAssetApplication.java
-
81src/main/java/com/feedback/it_asset/AppConfig.java
-
16src/main/java/com/feedback/it_asset/ItAssetApplication.java
-
23src/main/java/com/feedback/it_asset/JacksonConfiguration.java
-
42src/main/java/com/feedback/it_asset/QRCodeGenerator.java
-
14src/main/java/com/feedback/it_asset/ServletInitializer.java
-
41src/main/java/com/feedback/it_asset/UserSession.java
-
19src/main/java/com/feedback/it_asset/WebConfig.java
-
59src/main/java/com/feedback/it_asset/component/UserSessionInterceptor.java
-
633src/main/java/com/feedback/it_asset/controller/APIController.java
-
123src/main/java/com/feedback/it_asset/controller/AssetController.java
-
25src/main/java/com/feedback/it_asset/controller/CommonAttributes.java
-
196src/main/java/com/feedback/it_asset/controller/FeedbackController.java
-
340src/main/java/com/feedback/it_asset/controller/MainController.java
-
18src/main/java/com/feedback/it_asset/dto/FeedbackCountResponse.java
-
31src/main/java/com/feedback/it_asset/dto/GccAssetDetailsDto.java
-
6src/main/java/com/feedback/it_asset/dto/ItAssetDashboardDto.java
-
34src/main/java/com/feedback/it_asset/dto/MonthWiseCountsDTO.java
-
91src/main/java/com/feedback/it_asset/entity/AssetCategory.java
-
164src/main/java/com/feedback/it_asset/entity/AssetCategoryQuestions.java
-
104src/main/java/com/feedback/it_asset/entity/AssetParameter.java
-
138src/main/java/com/feedback/it_asset/entity/AssetParameterQuestions.java
-
186src/main/java/com/feedback/it_asset/entity/GccAssetDetails.java
-
129src/main/java/com/feedback/it_asset/entity/GccFeedback.java
-
122src/main/java/com/feedback/it_asset/entity/GccFeedbackData.java
-
118src/main/java/com/feedback/it_asset/entity/GccFileData.java
-
40src/main/java/com/feedback/it_asset/entity/Role.java
-
133src/main/java/com/feedback/it_asset/entity/User.java
-
57src/main/java/com/feedback/it_asset/entity/UserRole.java
-
37src/main/java/com/feedback/it_asset/repository/AssetCategoryQuestionsRep.java
-
34src/main/java/com/feedback/it_asset/repository/AssetCategoryRep.java
-
42src/main/java/com/feedback/it_asset/repository/AssetParameterQuestionsRep.java
-
40src/main/java/com/feedback/it_asset/repository/AssetParameterRep.java
-
45src/main/java/com/feedback/it_asset/repository/GccAssetDetailsRep.java
-
91src/main/java/com/feedback/it_asset/repository/GccFeedbackDataRep.java
-
72src/main/java/com/feedback/it_asset/repository/GccFeedbackRep.java
-
18src/main/java/com/feedback/it_asset/repository/GccFileDataRep.java
-
17src/main/java/com/feedback/it_asset/repository/UserRepository.java
-
86src/main/java/com/feedback/it_asset/service/GccAssetService.java
-
30src/main/java/com/feedback/it_asset/service/MainService.java
-
44src/main/resources/application.properties
-
BINsrc/main/resources/static/assets/.DS_Store
-
BINsrc/main/resources/static/assets/._.DS_Store
-
BINsrc/main/resources/static/assets/.__js
-
BINsrc/main/resources/static/assets/.__scss
-
BINsrc/main/resources/static/assets/._css
-
BINsrc/main/resources/static/assets/._fonts
-
BINsrc/main/resources/static/assets/._js
-
BINsrc/main/resources/static/assets/._media
-
BINsrc/main/resources/static/assets/_js/._main
-
BINsrc/main/resources/static/assets/_js/._pages
-
BINsrc/main/resources/static/assets/_js/main/._app.js
-
BINsrc/main/resources/static/assets/_js/main/._modules
-
65src/main/resources/static/assets/_js/main/app.js
-
BINsrc/main/resources/static/assets/_js/main/modules/._helpers.js
-
BINsrc/main/resources/static/assets/_js/main/modules/._template.js
-
1110src/main/resources/static/assets/_js/main/modules/helpers.js
-
802src/main/resources/static/assets/_js/main/modules/template.js
-
BINsrc/main/resources/static/assets/_js/pages/._be_comp_calendar.js
-
BINsrc/main/resources/static/assets/_js/pages/._be_comp_charts.js
-
BINsrc/main/resources/static/assets/_js/pages/._be_comp_chat.js
-
BINsrc/main/resources/static/assets/_js/pages/._be_comp_dialogs.js
-
BINsrc/main/resources/static/assets/_js/pages/._be_comp_image_cropper.js
-
BINsrc/main/resources/static/assets/_js/pages/._be_comp_maps_vector.js
-
BINsrc/main/resources/static/assets/_js/pages/._be_comp_nestable.js
-
BINsrc/main/resources/static/assets/_js/pages/._be_comp_onboarding.js
-
BINsrc/main/resources/static/assets/_js/pages/._be_comp_rating.js
-
BINsrc/main/resources/static/assets/_js/pages/._be_forms_validation.js
-
BINsrc/main/resources/static/assets/_js/pages/._be_pages_dashboard.js
-
BINsrc/main/resources/static/assets/_js/pages/._be_pages_dashboard_v1.js
-
BINsrc/main/resources/static/assets/_js/pages/._be_pages_ecom_dashboard.js
-
BINsrc/main/resources/static/assets/_js/pages/._be_pages_projects_tasks.js
-
BINsrc/main/resources/static/assets/_js/pages/._be_tables_datatables.js
-
BINsrc/main/resources/static/assets/_js/pages/._be_ui_animations.js
-
BINsrc/main/resources/static/assets/_js/pages/._be_ui_icons.js
-
BINsrc/main/resources/static/assets/_js/pages/._be_ui_progress.js
-
BINsrc/main/resources/static/assets/_js/pages/._db_analytics.js
-
BINsrc/main/resources/static/assets/_js/pages/._db_corporate_slim.js
-
BINsrc/main/resources/static/assets/_js/pages/._db_crypto.js
-
BINsrc/main/resources/static/assets/_js/pages/._op_auth_lock.js
-
BINsrc/main/resources/static/assets/_js/pages/._op_auth_reminder.js
-
BINsrc/main/resources/static/assets/_js/pages/._op_auth_signin.js
-
BINsrc/main/resources/static/assets/_js/pages/._op_auth_signup.js
-
BINsrc/main/resources/static/assets/_js/pages/._op_coming_soon.js
-
BINsrc/main/resources/static/assets/_js/pages/._op_installation.js
-
179src/main/resources/static/assets/_js/pages/be_comp_calendar.js
-
143src/main/resources/static/assets/_js/pages/be_comp_charts.js
-
156src/main/resources/static/assets/_js/pages/be_comp_chat.js
-
106src/main/resources/static/assets/_js/pages/be_comp_dialogs.js
-
88src/main/resources/static/assets/_js/pages/be_comp_image_cropper.js
-
154src/main/resources/static/assets/_js/pages/be_comp_maps_vector.js
-
47src/main/resources/static/assets/_js/pages/be_comp_nestable.js
-
41src/main/resources/static/assets/_js/pages/be_comp_onboarding.js
-
50src/main/resources/static/assets/_js/pages/be_comp_rating.js
@ -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.5/apache-maven-3.9.5-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,138 @@ |
|||
<?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.4</version> |
|||
<relativePath/> <!-- lookup parent from repository --> |
|||
</parent> |
|||
<groupId>com.complaint</groupId> |
|||
<artifactId>it_asset</artifactId> |
|||
<version>0.0.1-SNAPSHOT</version> |
|||
<name>gccasset_feedback</name> |
|||
<description>Spring Boot Project for GCC IT Asset Feedback</description> |
|||
<properties> |
|||
<java.version>17</java.version> |
|||
</properties> |
|||
<dependencies> |
|||
<dependency> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-starter-data-jpa</artifactId> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-starter-thymeleaf</artifactId> |
|||
</dependency> |
|||
<!-- optional, it brings userful tags to display spring security stuff --> |
|||
<dependency> |
|||
<groupId>org.thymeleaf.extras</groupId> |
|||
<artifactId>thymeleaf-extras-springsecurity6</artifactId> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-starter-web</artifactId> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-devtools</artifactId> |
|||
<scope>runtime</scope> |
|||
<optional>true</optional> |
|||
</dependency> |
|||
<!-- optional, it brings userful tags to display spring security stuff --> |
|||
|
|||
<dependency> |
|||
<groupId>javax.xml.bind</groupId> |
|||
<artifactId>jaxb-api</artifactId> |
|||
<version>2.4.0-b180830.0359</version> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>com.google.zxing</groupId> |
|||
<artifactId>core</artifactId> |
|||
<version>3.4.1</version> |
|||
<scope>system</scope> |
|||
<systemPath>${project.basedir}/lib/core-3.4.1.jar</systemPath> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>com.google.zxing</groupId> |
|||
<artifactId>javase</artifactId> |
|||
<version>3.4.1</version> |
|||
<scope>system</scope> |
|||
<systemPath>${project.basedir}/lib/javase-3.4.1.jar</systemPath> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>com.google.zxing</groupId> |
|||
<artifactId>javase</artifactId> |
|||
<version>3.5.1</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>com.google.zxing</groupId> |
|||
<artifactId>core</artifactId> |
|||
<version>3.5.1</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.junit.jupiter</groupId> |
|||
<artifactId>junit-jupiter-api</artifactId> |
|||
<scope>test</scope> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>junit</groupId> |
|||
<artifactId>junit</artifactId> |
|||
<scope>test</scope> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.json</groupId> |
|||
<artifactId>json</artifactId> |
|||
<version>20210307</version> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>com.mysql</groupId> |
|||
<artifactId>mysql-connector-j</artifactId> |
|||
<scope>runtime</scope> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-starter-test</artifactId> |
|||
<scope>test</scope> |
|||
</dependency> |
|||
|
|||
<!-- Apache POI dependencies for working with Excel --> |
|||
<dependency> |
|||
<groupId>org.apache.poi</groupId> |
|||
<artifactId>poi</artifactId> |
|||
<version>4.1.2</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.apache.poi</groupId> |
|||
<artifactId>poi-ooxml</artifactId> |
|||
<version>4.1.2</version> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>org.apache.commons</groupId> |
|||
<artifactId>commons-text</artifactId> |
|||
<version>1.9</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-configuration-processor</artifactId> |
|||
<optional>true</optional> |
|||
</dependency> |
|||
</dependencies> |
|||
|
|||
<build> |
|||
<plugins> |
|||
<plugin> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-maven-plugin</artifactId> |
|||
</plugin> |
|||
</plugins> |
|||
</build> |
|||
|
|||
</project> |
|||
@ -0,0 +1,13 @@ |
|||
|
|||
|
|||
import org.springframework.boot.SpringApplication; |
|||
import org.springframework.boot.autoconfigure.SpringBootApplication; |
|||
|
|||
@SpringBootApplication |
|||
public class ItAssetApplication { |
|||
|
|||
public static void main(String[] args) { |
|||
SpringApplication.run(ItAssetApplication.class, args); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,81 @@ |
|||
package com.feedback.it_asset; |
|||
|
|||
import org.springframework.boot.context.properties.ConfigurationProperties; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
@Component |
|||
@ConfigurationProperties(prefix = "app") |
|||
public class AppConfig{ |
|||
|
|||
private String title; |
|||
private String baseUrl; |
|||
private String qrcodeUrl; |
|||
private String getOtpUrl; |
|||
private String erpUrl; |
|||
private String erpPropertTaxUrl; |
|||
private String ptaxid; |
|||
private String ptaxRegMobile; |
|||
public String getTitle() { |
|||
return title; |
|||
} |
|||
|
|||
public void setTitle(String title) { |
|||
this.title = title; |
|||
} |
|||
|
|||
public String getBaseUrl() { |
|||
return baseUrl; |
|||
} |
|||
|
|||
public void setBaseUrl(String baseUrl) { |
|||
this.baseUrl = baseUrl; |
|||
} |
|||
|
|||
public String getQrcodeUrl() { |
|||
return qrcodeUrl; |
|||
} |
|||
|
|||
public void setQrcodeUrl(String qrcodeUrl) { |
|||
this.qrcodeUrl = qrcodeUrl; |
|||
} |
|||
|
|||
public String getGetOtpUrl() { |
|||
return getOtpUrl; |
|||
} |
|||
|
|||
public void setGetOtpUrl(String getOtpUrl) { |
|||
this.getOtpUrl = getOtpUrl; |
|||
} |
|||
|
|||
public String getErpUrl() { |
|||
return erpUrl; |
|||
} |
|||
|
|||
public void setErpUrl(String erpUrl) { |
|||
this.erpUrl = erpUrl; |
|||
} |
|||
|
|||
public String getPtaxid() { |
|||
return ptaxid; |
|||
} |
|||
|
|||
public void setPtaxid(String ptaxid) { |
|||
this.ptaxid = ptaxid; |
|||
} |
|||
|
|||
public String getPtaxRegMobile() { |
|||
return ptaxRegMobile; |
|||
} |
|||
|
|||
public void setPtaxRegMobile(String ptaxRegMobile) { |
|||
this.ptaxRegMobile = ptaxRegMobile; |
|||
} |
|||
|
|||
public String getErpPropertTaxUrl() { |
|||
return erpPropertTaxUrl; |
|||
} |
|||
|
|||
public void setErpPropertTaxUrl(String erpPropertTaxUrl) { |
|||
this.erpPropertTaxUrl = erpPropertTaxUrl; |
|||
} |
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
package com.feedback.it_asset; |
|||
|
|||
import org.springframework.boot.SpringApplication; |
|||
import org.springframework.boot.autoconfigure.SpringBootApplication; |
|||
|
|||
@SpringBootApplication |
|||
public class ItAssetApplication { |
|||
|
|||
public static void main(String[] args) { |
|||
SpringApplication.run(ItAssetApplication.class, args); |
|||
} |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
@ -0,0 +1,23 @@ |
|||
package com.feedback.it_asset; |
|||
|
|||
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); |
|||
|
|||
// Debug log |
|||
System.out.println("Custom ObjectMapper configuration applied."); |
|||
|
|||
return objectMapper; |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,42 @@ |
|||
package com.feedback.it_asset; |
|||
|
|||
import java.io.ByteArrayOutputStream; |
|||
import java.io.IOException; |
|||
import java.util.Base64; |
|||
import java.util.HashMap; |
|||
import java.util.Map; |
|||
|
|||
import com.google.zxing.BarcodeFormat; |
|||
import com.google.zxing.EncodeHintType; |
|||
import com.google.zxing.WriterException; |
|||
import com.google.zxing.client.j2se.MatrixToImageWriter; |
|||
import com.google.zxing.common.BitMatrix; |
|||
import com.google.zxing.qrcode.QRCodeWriter; |
|||
|
|||
public class QRCodeGenerator { |
|||
|
|||
public static String generateQRCode(String data) throws WriterException, IOException { |
|||
int width = 350; // width of the QR code image |
|||
int height = 350; // height of the QR code image |
|||
String format = "png"; // format of the QR code image |
|||
String charset = "UTF-8"; // character set used to encode the data |
|||
|
|||
// create the QR code writer and hints |
|||
QRCodeWriter qrCodeWriter = new QRCodeWriter(); |
|||
Map<EncodeHintType, Object> hints = new HashMap<>(); |
|||
hints.put(EncodeHintType.CHARACTER_SET, charset); |
|||
|
|||
// generate the QR code matrix |
|||
BitMatrix matrix = qrCodeWriter.encode(data, BarcodeFormat.QR_CODE, width, height, hints); |
|||
|
|||
// create the QR code image as a byte array |
|||
ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
|||
MatrixToImageWriter.writeToStream(matrix, format, baos); |
|||
byte[] imageBytes = baos.toByteArray(); |
|||
|
|||
// encode the image data in base64 format |
|||
String base64EncodedImage = Base64.getEncoder().encodeToString(imageBytes); |
|||
|
|||
return base64EncodedImage; |
|||
} |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
package com.feedback.it_asset; |
|||
|
|||
import org.springframework.boot.builder.SpringApplicationBuilder; |
|||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; |
|||
|
|||
|
|||
public class ServletInitializer extends SpringBootServletInitializer{ |
|||
|
|||
@Override |
|||
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { |
|||
return application.sources(ItAssetApplication.class); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,41 @@ |
|||
package com.feedback.it_asset; |
|||
|
|||
import org.springframework.context.annotation.Scope; |
|||
import org.springframework.context.annotation.ScopedProxyMode; |
|||
import org.springframework.stereotype.Component; |
|||
import org.springframework.web.context.WebApplicationContext; |
|||
|
|||
@Component |
|||
@Scope(value = WebApplicationContext.SCOPE_SESSION, proxyMode = ScopedProxyMode.TARGET_CLASS) |
|||
public class UserSession { |
|||
private Integer userId; |
|||
private String userType; |
|||
private String dispayName; |
|||
|
|||
|
|||
public Integer getUserId() { |
|||
return userId; |
|||
} |
|||
|
|||
public void setUserId(Integer userId) { |
|||
this.userId = userId; |
|||
} |
|||
|
|||
public String getUserType() { |
|||
return userType; |
|||
} |
|||
|
|||
public void setUserType(String userType) { |
|||
this.userType = userType; |
|||
} |
|||
|
|||
public String getDispayName() { |
|||
return dispayName; |
|||
} |
|||
|
|||
public void setDispayName(String dispayName) { |
|||
this.dispayName = dispayName; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
//package com.feedback.it_asset; |
|||
// |
|||
//import org.springframework.beans.factory.annotation.Autowired; |
|||
//import org.springframework.context.annotation.Configuration; |
|||
//import org.springframework.web.servlet.config.annotation.InterceptorRegistry; |
|||
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
|||
// |
|||
//import com.feedback.it_asset.component.UserSessionInterceptor; |
|||
// |
|||
//@Configuration |
|||
//public class WebConfig implements WebMvcConfigurer { |
|||
// @Autowired |
|||
// private UserSessionInterceptor userSessionInterceptor; |
|||
// |
|||
// @Override |
|||
// public void addInterceptors(InterceptorRegistry registry) { |
|||
// registry.addInterceptor(userSessionInterceptor); |
|||
// } |
|||
//} |
|||
@ -0,0 +1,59 @@ |
|||
//package com.feedback.it_asset.component; |
|||
// |
|||
//import java.util.Arrays; |
|||
//import java.util.List; |
|||
// |
|||
//import org.springframework.beans.factory.annotation.Autowired; |
|||
//import org.springframework.stereotype.Component; |
|||
//import org.springframework.web.servlet.HandlerInterceptor; |
|||
// |
|||
//import com.feedback.it_asset.AppConfig; |
|||
//import com.feedback.it_asset.UserSession; |
|||
//import jakarta.servlet.http.HttpServletRequest; |
|||
//import jakarta.servlet.http.HttpServletResponse; |
|||
// |
|||
//@Component |
|||
//public class UserSessionInterceptor implements HandlerInterceptor { |
|||
// |
|||
// @Autowired |
|||
// private UserSession userSession; |
|||
// @Autowired |
|||
// private AppConfig appConfig; |
|||
// |
|||
// private static final List<String> EXCLUDED_URLS = Arrays.asList("/login", "/", "/api"); |
|||
// @Override |
|||
// public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { |
|||
// // Get the current request URL |
|||
// String requestUrl = request.getRequestURI(); |
|||
// |
|||
// // Exclude static resources from the check |
|||
// if (requestUrl.startsWith("/assets/") || requestUrl.startsWith("/css/") || requestUrl.startsWith("/js/") || requestUrl.startsWith("/images/") || requestUrl.startsWith("/api/")) { |
|||
// return true; // Allow the request to proceed without checking the login status |
|||
// } |
|||
// |
|||
// // Exclude the login page from the check |
|||
// // Exclude specific URLs from the check |
|||
// if (EXCLUDED_URLS.contains(requestUrl)) { |
|||
// return true; // Allow the request to proceed without checking the login status |
|||
// } |
|||
// // Check if the user is logged in |
|||
// // If logged in, add the userSession to the model |
|||
// // Return true to allow the request to proceed |
|||
// //if (isLoggedIn()) { |
|||
// if(userSession.getUserId() != null && userSession.getUserType() != null) { |
|||
// request.setAttribute("userSession", userSession); |
|||
// } else { |
|||
// request.setAttribute("title", "Login"); |
|||
// request.setAttribute("baseURL", appConfig.getBaseUrl()); |
|||
// response.sendRedirect("/login"); |
|||
// return false; // Stop further processing of the request |
|||
// } |
|||
// return true; // Allow the request to proceed |
|||
// } |
|||
// |
|||
// private boolean isLoggedIn() { |
|||
// // Implement your login check logic here |
|||
// // For example, check if the userSession contains the necessary information |
|||
// return userSession.getUserId() != null && userSession.getUserType() != null; |
|||
// } |
|||
//} |
|||
@ -0,0 +1,633 @@ |
|||
|
|||
package com.feedback.it_asset.controller; |
|||
|
|||
import java.text.SimpleDateFormat; |
|||
import java.time.LocalDateTime; |
|||
import java.time.format.DateTimeFormatter; |
|||
import java.util.AbstractMap; |
|||
import java.util.ArrayList; |
|||
import java.util.Arrays; |
|||
import java.util.Calendar; |
|||
import java.util.Collections; |
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.Random; |
|||
import java.util.stream.Collectors; |
|||
import java.util.stream.Stream; |
|||
|
|||
import org.apache.xmlbeans.impl.values.XmlUnsignedLongImpl; |
|||
import org.json.JSONArray; |
|||
import org.json.JSONException; |
|||
import org.json.JSONObject; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.boot.web.client.RestTemplateBuilder; |
|||
import org.springframework.http.HttpEntity; |
|||
import org.springframework.http.HttpHeaders; |
|||
import org.springframework.http.HttpMethod; |
|||
import org.springframework.http.HttpStatus; |
|||
import org.springframework.http.ResponseEntity; |
|||
import org.springframework.ui.Model; |
|||
import org.springframework.web.bind.annotation.DeleteMapping; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.PathVariable; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RequestParam; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
import org.springframework.web.client.RestTemplate; |
|||
|
|||
import com.feedback.it_asset.AppConfig; |
|||
import com.feedback.it_asset.dto.FeedbackCountResponse; |
|||
import com.feedback.it_asset.entity.AssetCategory; |
|||
import com.feedback.it_asset.entity.AssetCategoryQuestions; |
|||
import com.feedback.it_asset.entity.AssetParameter; |
|||
import com.feedback.it_asset.entity.AssetParameterQuestions; |
|||
import com.feedback.it_asset.entity.GccAssetDetails; |
|||
import com.feedback.it_asset.entity.GccFeedback; |
|||
import com.feedback.it_asset.entity.GccFeedbackData; |
|||
import com.feedback.it_asset.repository.AssetCategoryQuestionsRep; |
|||
import com.feedback.it_asset.repository.AssetCategoryRep; |
|||
import com.feedback.it_asset.repository.AssetParameterQuestionsRep; |
|||
import com.feedback.it_asset.repository.AssetParameterRep; |
|||
import com.feedback.it_asset.repository.GccAssetDetailsRep; |
|||
import com.feedback.it_asset.repository.GccFeedbackDataRep; |
|||
import com.feedback.it_asset.repository.GccFeedbackRep; |
|||
import com.feedback.it_asset.repository.GccFileDataRep; |
|||
import com.feedback.it_asset.service.GccAssetService; |
|||
|
|||
import jakarta.servlet.http.HttpServletRequest; |
|||
import jakarta.servlet.http.HttpSession; |
|||
|
|||
@RequestMapping("/api") |
|||
@RestController |
|||
public class APIController { |
|||
@Autowired |
|||
private AppConfig appConfig; |
|||
@Autowired |
|||
private AssetCategoryRep assetCategoryRep; |
|||
@Autowired |
|||
private AssetCategoryQuestionsRep assetCategoryQuestionRep; |
|||
@Autowired |
|||
private AssetParameterRep assetParameterRep; |
|||
@Autowired |
|||
private AssetParameterQuestionsRep assetParameterQuestionRep; |
|||
@Autowired |
|||
private GccAssetDetailsRep gccAssetDetailsRep; |
|||
@Autowired |
|||
private GccFileDataRep gccFileDataRep; |
|||
@Autowired |
|||
private GccFeedbackRep gccFeedbackRep; |
|||
@Autowired |
|||
private GccFeedbackDataRep gccFeedbackDataRep; |
|||
@Autowired |
|||
private GccAssetService gccAssetService; |
|||
|
|||
@GetMapping("/dashboard-summary") |
|||
|
|||
public ResponseEntity<Map<String, Object>> getDashboardSummary() { |
|||
|
|||
Long totalAssets = gccAssetDetailsRep.count(); |
|||
Long totalcomplaint = gccFeedbackRep.count(); |
|||
Integer closedcomp = gccFeedbackDataRep.onlyYesCount(); |
|||
Integer totalNoFeedbacks = gccFeedbackDataRep.onlyNoCount(); |
|||
System.out.println("..................."+totalAssets); |
|||
|
|||
Map<String, Object> summary = new HashMap<>(); |
|||
summary.put("totalAssets", totalAssets); |
|||
summary.put("totalFeedbacks", totalcomplaint); |
|||
summary.put("totalYesFeedbacks", closedcomp); |
|||
summary.put("totalNoFeedbacks", totalNoFeedbacks); |
|||
return ResponseEntity.ok(summary); |
|||
} |
|||
@GetMapping("/category") |
|||
private List<AssetCategory> categoryList(){ |
|||
return assetCategoryRep.showAll(); |
|||
} |
|||
@GetMapping("/category/{id}") |
|||
private List<AssetCategory> categoryList(@PathVariable("id") int id){ |
|||
return assetCategoryRep.findByCategoryId(id); |
|||
} |
|||
@GetMapping("/category/{id}/delete") |
|||
public int deleteCategory(@PathVariable("id") int id) { |
|||
return assetCategoryRep.deleteCategory(id); |
|||
} |
|||
@GetMapping("/category/question") |
|||
private List<AssetCategoryQuestions> categoryQuestionList(){ |
|||
return assetCategoryQuestionRep.showQuestionsAll(); |
|||
} |
|||
@GetMapping("/category/question/{id}") |
|||
private List<AssetCategoryQuestions> categoryQuestionList(@PathVariable("id") int id){ |
|||
return assetCategoryQuestionRep.findByQuestionId(id); |
|||
} |
|||
@GetMapping("/category/question/{id}/delete") |
|||
public int deleteCategoryQuestion(@PathVariable("id") int id) { |
|||
return assetCategoryQuestionRep.deleteQuestionCategory(id); |
|||
} |
|||
|
|||
@GetMapping("/parameter") |
|||
private List<AssetParameter> assetParameterList(){ |
|||
return assetParameterRep.showAll(); |
|||
} |
|||
@GetMapping("/parameter/{id}") |
|||
private List<AssetParameter> assetParameterList(@PathVariable("id") int id){ |
|||
return assetParameterRep.findByParameterId(id); |
|||
} |
|||
@GetMapping("/parameter/category/{id}") |
|||
private List<AssetParameter> assetParameters(@PathVariable("id") int id){ |
|||
return assetParameterRep.findByCategoryId(id); |
|||
} |
|||
@GetMapping("/parameter/{id}/delete") |
|||
public int deleteParameter(@PathVariable("id") int id) { |
|||
return assetParameterRep.deleteParameter(id); |
|||
} |
|||
@GetMapping("/parameter/question") |
|||
private List<AssetParameterQuestions> assetParameterQuestionList(){ |
|||
return assetParameterQuestionRep.findAll(); |
|||
} |
|||
@GetMapping("/parameter/question/{id}") |
|||
private List<AssetParameterQuestions> assetParameterQuestionList(@PathVariable("id") int id){ |
|||
return assetParameterQuestionRep.findByQuestionId(id); |
|||
} |
|||
@GetMapping("/parameter/question/{id}/delete") |
|||
public int deleteParameterQuestion(@PathVariable("id") int id) { |
|||
return assetParameterQuestionRep.deleteParameterQuestion(id); |
|||
} |
|||
|
|||
@GetMapping("/asset") |
|||
private List<GccAssetDetails> assetDetailsList(){ |
|||
return gccAssetDetailsRep.showAll(); |
|||
} |
|||
@GetMapping("/asset/{id}") |
|||
private List<GccAssetDetails> assetDetailsList(@PathVariable("id") int id){ |
|||
System.out.println("hii.............................////////////.................sss"); |
|||
|
|||
return gccAssetDetailsRep.findByAssetId(id); |
|||
} |
|||
@GetMapping("/asset/{id}/delete") |
|||
public int deleteByAssetId(@PathVariable("id") int id) { |
|||
return gccAssetDetailsRep.deleteByAssetId(id); |
|||
} |
|||
// @DeleteMapping("/asset/delete") |
|||
// public ResponseEntity<String> deleteByAssetID(@RequestParam("assetId") int assetId) { |
|||
// System.out.println("hii.............................////////////.................sss"); |
|||
// try { |
|||
// gccAssetDetailsRep.deleteByAssetId(assetId); |
|||
// return new ResponseEntity<>("Asset deleted successfully", HttpStatus.OK); |
|||
// } catch (Exception e) { |
|||
// return new ResponseEntity<>("Error deleting asset: " + e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR); |
|||
// } |
|||
// } |
|||
@GetMapping("/asset/file/{id}") |
|||
private List fileDataList(@PathVariable("id") int id){ |
|||
return Collections.singletonList(gccFileDataRep.findById(id)); |
|||
} |
|||
|
|||
@GetMapping(value = "/feedback") |
|||
public List getFeedbackList() { |
|||
return gccFeedbackRep.findAll(); |
|||
} |
|||
|
|||
@GetMapping("/feedback/{id}") |
|||
private List feedbackWithAsset(@PathVariable("id") int id){ |
|||
return gccFeedbackRep.findByFeedbackId(id); |
|||
//return Collections.singletonList(fileDataRepository.findById(id)); |
|||
} |
|||
@GetMapping("/feedback/data/{id}") |
|||
private List feedbackData(@PathVariable("id") int id){ |
|||
return gccFeedbackDataRep.findByfeedbackId(id); |
|||
//return Collections.singletonList(fileDataRepository.findById(id)); |
|||
} |
|||
|
|||
@GetMapping("/feedback/data/option/{option}") |
|||
public List viewFeedbackListByOption(@PathVariable("option") String option){ |
|||
//option = "["+option+"]"; |
|||
if (option != null && option.equals("[yes]")) { |
|||
return gccFeedbackRep.findByfeedbackAllYes(); |
|||
} |
|||
else{ |
|||
return gccFeedbackRep.findByfeedbackAnyNo(); |
|||
} |
|||
|
|||
} |
|||
|
|||
@GetMapping(value = "/sendOTP") |
|||
public String sendOtp(HttpServletRequest request, @RequestParam String mobileNo) { |
|||
String MobileNo=mobileNo; |
|||
System.out.print("\n MobileNo---:"+mobileNo); |
|||
Random rand = new Random(); |
|||
int otp = rand.nextInt(90000) + 10000; |
|||
System.out.print("\n otp---:"+otp); |
|||
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("dd-MMM-yyyy%20HH:mm"); |
|||
LocalDateTime now = LocalDateTime.now(); |
|||
System.out.println(dtf.format(now)); |
|||
|
|||
String SMSTEXT = "Welcome to GCC "+otp+" is your OTP for gcc QR System"; |
|||
|
|||
String urlString=appConfig.getGetOtpUrl()+"from=GCCCRP&key=qxg4mklD&sender=GCCCRP&to="+MobileNo+"&body="+SMSTEXT+"&entityid=1401572690000011081&templateid=1407168250479102852"; |
|||
System.out.println(urlString); |
|||
String bodyMessage = ""; |
|||
|
|||
try { |
|||
RestTemplate restTemplate = new RestTemplate(); |
|||
String Response = restTemplate.getForObject(urlString, String.class); |
|||
System.out.println(Response); |
|||
bodyMessage = Response.toString(); |
|||
} |
|||
catch (Exception e) { |
|||
// e.printStackTrace(); |
|||
System.out.print("ERROR---: "+e); |
|||
bodyMessage = "Error"; |
|||
} |
|||
/* |
|||
ResponseEntity<String> response = null; |
|||
RestTemplate restTemplate = new RestTemplate(); |
|||
String bodyMessage = ""; |
|||
HttpHeaders headers = new HttpHeaders(); |
|||
try { |
|||
HttpEntity<String> postData = new HttpEntity<String>(headers); |
|||
response = restTemplate.exchange(urlString, HttpMethod.POST, postData, String.class); |
|||
bodyMessage = response.getBody(); |
|||
System.out.println("\n bodyMessage"+bodyMessage); |
|||
|
|||
} catch (Exception e) { |
|||
// e.printStackTrace(); |
|||
System.out.print("ERROR---: "+e); |
|||
bodyMessage = "Error"; |
|||
} |
|||
|
|||
*/ |
|||
System.out.println("OTP sent successfully!"); |
|||
|
|||
HttpSession session = request.getSession(); |
|||
session.setAttribute("otp", otp); |
|||
return bodyMessage; |
|||
} |
|||
|
|||
// @GetMapping(value = "/verifyOTP") |
|||
// public String verifyOtp(HttpServletRequest request, @RequestParam String otp) { |
|||
// HttpSession session = request.getSession(); |
|||
// String bodyMessage = ""; |
|||
// try{ |
|||
// int session_otp = (Integer) session.getAttribute("otp"); |
|||
// System.out.println("session_otp---:"+session_otp); |
|||
// String string_entered_otp = otp; |
|||
// int entered_otp = Integer.parseInt(string_entered_otp); |
|||
// |
|||
// if(session_otp == entered_otp) |
|||
// { |
|||
// System.out.println("Entered OTP Correct"); |
|||
// bodyMessage = "Success"; |
|||
// session.setAttribute("verifiedotp", "success"); |
|||
// } |
|||
// else |
|||
// { |
|||
// System.out.println("Incorrect OTP. Please enter correct OTPs."); |
|||
// bodyMessage = "Error"; |
|||
// |
|||
// session.setAttribute("verifiedotp", "error"); |
|||
// } |
|||
// }catch (Exception e){ |
|||
// e.printStackTrace(); |
|||
// System.out.print("ERROR---: "+e); |
|||
// bodyMessage = "Error"; |
|||
// } |
|||
// return bodyMessage; |
|||
// } |
|||
|
|||
@GetMapping(value = "/verifyOTP") |
|||
public String verifyOtp(HttpServletRequest request, @RequestParam String otp) { |
|||
HttpSession session = request.getSession(); |
|||
try { |
|||
Integer session_otp = (Integer) session.getAttribute("otp"); |
|||
System.out.println("session_otp---:" + session_otp); |
|||
Integer entered_otp = Integer.parseInt(otp); |
|||
|
|||
if (session_otp != null && session_otp.equals(entered_otp)) { |
|||
System.out.println("Entered OTP Correct"); |
|||
session.setAttribute("verifiedotp", "success"); |
|||
return "Success"; |
|||
} else { |
|||
System.out.println("Incorrect OTP. Please enter correct OTPs."); |
|||
session.setAttribute("verifiedotp", "error"); |
|||
return "Error"; |
|||
} |
|||
} catch (NumberFormatException e) { |
|||
System.out.println("Invalid OTP format: " + otp); |
|||
return "Error"; |
|||
} catch (Exception e) { |
|||
System.out.println("Error verifying OTP: " + e.getMessage()); |
|||
return "Error"; |
|||
} |
|||
} |
|||
|
|||
|
|||
@GetMapping(value = "/getComplaintCategory") |
|||
public String getComplaintCategory() { |
|||
String urlString = appConfig.getErpUrl()+"serviceId=getComplCategory&ComplaintGroupId=null"; |
|||
ResponseEntity<String> response = null; |
|||
RestTemplate restTemplate = new RestTemplate(); |
|||
String bodyMessage = ""; |
|||
HttpHeaders headers = new HttpHeaders(); |
|||
try { |
|||
HttpEntity<String> postData = new HttpEntity<String>(headers); |
|||
response = restTemplate.exchange(urlString, HttpMethod.POST, postData, String.class); |
|||
bodyMessage = response.getBody(); |
|||
System.out.println("bodyMessage" + bodyMessage); |
|||
|
|||
} catch (Exception e) { |
|||
e.printStackTrace(); |
|||
//System.out.print("\n ERROR---: " + e); |
|||
bodyMessage = "Error"; |
|||
} |
|||
return bodyMessage; |
|||
} |
|||
|
|||
@GetMapping(value = "/getComplaintCategoryById") |
|||
public String getComplaintCategoryById(@RequestParam String comGroupId) { |
|||
String urlString = appConfig.getErpUrl()+"serviceId=getComplCategory&ComplaintGroupId="+comGroupId; |
|||
ResponseEntity<String> response = null; |
|||
RestTemplate restTemplate = new RestTemplate(); |
|||
String bodyMessage = "Error"; |
|||
HttpHeaders headers = new HttpHeaders(); |
|||
try { |
|||
HttpEntity<String> postData = new HttpEntity<String>(headers); |
|||
response = restTemplate.exchange(urlString, HttpMethod.GET, postData, String.class); |
|||
bodyMessage = response.getBody(); |
|||
System.out.println("bodyMessage" + bodyMessage); |
|||
|
|||
} catch (Exception e) { |
|||
e.printStackTrace(); |
|||
//System.out.print("\n ERROR---: " + e); |
|||
bodyMessage = "Error"; |
|||
} |
|||
return bodyMessage; |
|||
} |
|||
|
|||
|
|||
|
|||
@GetMapping(value = "/gcc-login") |
|||
public String publicLogin(HttpServletRequest request, @RequestParam String ptax, @RequestParam String uname, @RequestParam String upass) { |
|||
// Create a new RestTemplate instance using the RestTemplateBuilder |
|||
RestTemplate restTemplate = new RestTemplateBuilder().build(); |
|||
// Set the URL of the API endpoint and the parameters |
|||
String url = appConfig.getErpUrl(); |
|||
String serviceId = "GetPtaxDue"; |
|||
String serviceInput = "{\"mob\":\""+uname+"\"}"; |
|||
|
|||
//Send the HTTP GET request to the API endpoint and retrieve the response as a ResponseEntity<String> |
|||
ResponseEntity<String> response = restTemplate.getForEntity(url + "serviceId={serviceId}&serviceinput={serviceInput}", String.class, serviceId, serviceInput); |
|||
|
|||
// Parse the response body as a JSON object and extract the data you need |
|||
//System.out.println(responseBody); |
|||
//Check the HTTP status code of the response |
|||
if (response.getStatusCode().is2xxSuccessful()) { |
|||
// If the response status code is in the 2xx range (i.e., success), extract the response body |
|||
String responseBody = response.getBody(); |
|||
// Parse the response body as a JSON object and extract the data you need |
|||
System.out.println(responseBody); |
|||
try { |
|||
JSONObject jsonObject = new JSONObject(responseBody); |
|||
JSONArray proptaxArray = jsonObject.getJSONArray("PROPTAX"); |
|||
for (int i = 0; i < proptaxArray.length(); i++) { |
|||
JSONObject proptaxObj = proptaxArray.getJSONObject(i); |
|||
String ptaxId = proptaxObj.getString("PTAXID"); |
|||
if (ptax.equals(ptaxId)) { |
|||
System.out.println("PTAXID: " + ptaxId); |
|||
appConfig.setPtaxid(ptax); |
|||
appConfig.setPtaxRegMobile(uname); |
|||
return "Success"; |
|||
} else { |
|||
return "Error"; |
|||
} |
|||
|
|||
} |
|||
} catch (Exception e){ |
|||
return "error"; |
|||
} |
|||
|
|||
|
|||
} else { |
|||
// If the response status code is not in the 2xx range (i.e., an error occurred), handle the error |
|||
// Extract the error message from the response body |
|||
String responseBody = response.getBody(); |
|||
String errorMessage = null; |
|||
try { |
|||
JSONObject json = new JSONObject(responseBody); |
|||
errorMessage = json.getString("Message"); |
|||
} catch (JSONException e) { |
|||
// If the response body is not a valid JSON object, log the error and set the error message to a default value |
|||
e.printStackTrace(); |
|||
errorMessage = "An error occurred while processing the response."; |
|||
} |
|||
// Log the error message |
|||
System.err.println(errorMessage); |
|||
} |
|||
return "Success"; |
|||
} |
|||
// @GetMapping("/only-yes/count") |
|||
// public Integer onlyYesCount() { |
|||
// return gccFeedbackDataRep.onlyYesCount(); |
|||
// } |
|||
// @GetMapping("/only-no/count") |
|||
// public Integer onlyNoCount() { |
|||
// return gccFeedbackDataRep.onlyNoCount(); |
|||
// } |
|||
@GetMapping("/only-yes/counts") |
|||
public long[] onlyYesCounts() { |
|||
long count = gccFeedbackDataRep.countOnlyYesFeedback(); |
|||
return new long[]{count}; |
|||
} |
|||
@GetMapping("/only-no/count") |
|||
public long[] onlyNoCount() { |
|||
long count = gccFeedbackDataRep.onlyNoCount(); |
|||
return new long[]{count}; |
|||
} |
|||
// @GetMapping("/feedback/counts/{cdate}") |
|||
// public long[] getFeedbackCountsByMonth(@PathVariable String cdate) { |
|||
// long onlyYesCount = gccFeedbackDataRep.countOnlyYesFeedbackByMonth(cdate); |
|||
// long onlyNoCount = gccFeedbackDataRep.countOnlyNoFeedbackByMonth(cdate); |
|||
// |
|||
// return new long[]{onlyYesCount, onlyNoCount}; |
|||
// } |
|||
|
|||
/* |
|||
@GetMapping(value = "/gcc-login") |
|||
public String publicLogin(HttpServletRequest request, @RequestParam String ptax, @RequestParam String uname, @RequestParam String upass) { |
|||
// Api get Value |
|||
String urlParam = "{\"mob\":\"9789332040\"}"; |
|||
String bodyMessage = "Error"; |
|||
try { |
|||
String encodedUrl = URLEncoder.encode(urlParam, "UTF-8"); |
|||
//System.out.println(encodedUrl); |
|||
String ptaxTxt=ptax; |
|||
String[] ptaxparts = ptaxTxt.split("-"); |
|||
System.out.println(); |
|||
//String urlString = "https://erp.chennaicorporation.gov.in/ptis/external/collectionservice?channelID=3&serviceId=GetPropByMobile&ZONE="+ptaxparts[0]+"&DIV_CD="+ptaxparts[1]+"&OLD_BILL="+ptaxparts[2]+"&OLD_SUB="+ptaxparts[3]+"&MOBILE_NO="+uname+"&formatType=json"; |
|||
//String urlString = "https://erp.chennaicorporation.gov.in/egproftax/external/collectionservice?channelID=3&serviceId=GetDcb&ZONE=10&DIV_CD=134&CATEGORY_CODE=PE&UNIQUE_ID=07885"; |
|||
//String urlString = "https://erp.chennaicorporation.gov.in/pgr/external/mobileservice?serviceId=GetPtaxDue&serviceinput=" + encodedUrl; |
|||
//https://erp.chennaicorporation.gov.in/pgr/external/mobileservice?serviceId=GetPtaxDue&serviceinput={"mob":"9789332040"} |
|||
|
|||
String serviceId = "GetPtaxDue"; |
|||
String serviceInput = urlParam; |
|||
|
|||
ResponseEntity<String> response = null; |
|||
RestTemplate restTemplate = new RestTemplate(); |
|||
//String urlString = "https://chennaicorporation.gov.in/gcc/online-payment/property-tax/mobile-reg/mob_Asses_det.jsp?ServiceID=PT&SetInput={\"ZONE\":\"04\",\"DIV\":\"042\",\"BILL\":\"03251\",\"SB\":\"000\"}"; |
|||
HttpHeaders headers = new HttpHeaders(); |
|||
try { |
|||
HttpEntity<String> postData = new HttpEntity<String>(headers); |
|||
response = restTemplate.getForEntity(appConfig.getErpUrl()+"serviceId="+serviceId+"&serviceinput={"+serviceInput+"}", String.class); |
|||
bodyMessage = response.getBody(); |
|||
System.err.println("URL: " + appConfig.getErpUrl()+"serviceId={"+serviceId+"}&serviceinput={"+serviceInput+"}"); |
|||
System.out.println("bodyMessage" + bodyMessage); |
|||
|
|||
//String name = responseMap.get(0).get("BillId"); |
|||
|
|||
} catch (Exception e) { |
|||
// Log the exception and any relevant information |
|||
System.err.println("Error sending request: " + e.getMessage()); |
|||
System.err.println("URL: " + encodedUrl); |
|||
e.printStackTrace(); |
|||
} |
|||
//// |
|||
if ("9176617754".equals(uname) && "12345".equals(upass)) { |
|||
appConfig.setPtaxid(ptax); |
|||
appConfig.setPtaxRegMobile(uname); |
|||
bodyMessage = "Success"; |
|||
} else { |
|||
bodyMessage = "Error"; |
|||
} |
|||
return bodyMessage; |
|||
|
|||
} catch (UnsupportedEncodingException e) { |
|||
System.out.println("UTF-8 encoding is not supported"); |
|||
} |
|||
return bodyMessage; |
|||
} |
|||
|
|||
*/ |
|||
|
|||
// https://erp.chennaicorporation.gov.in/egproftax/external/collectionservice?channelID=3&serviceId=GetDcb&ZONE=10&DIV_CD=134&CATEGORY_CODE=PE&UNIQUE_ID=07885 |
|||
|
|||
// @GetMapping("/by-date") |
|||
// public ResponseEntity<List<GccFeedback>> getFeedbackByDate( |
|||
// @RequestParam("startDate") String startDate, |
|||
// @RequestParam("endDate") String endDate) { |
|||
// |
|||
// List<GccFeedback> feedbackList = gccFeedbackRep.feedbackTotalByDate(startDate, endDate); |
|||
// |
|||
// return new ResponseEntity<>(feedbackList, HttpStatus.OK); |
|||
// } |
|||
// @GetMapping("/by-date") |
|||
// public List<GccFeedbackData> getFeedbackByDate(@RequestParam("cdate") String cdate) { |
|||
// return gccFeedbackDataRep.feedbackByDate(cdate); |
|||
// } |
|||
// @GetMapping("/byDate/{cDate}") |
|||
// public List getFeedbackByDate(@PathVariable String cDate) { |
|||
// return gccFeedbackDataRep.getFeedbackByDate(cDate); |
|||
// } |
|||
@GetMapping("/allFeedback") |
|||
public List getAllFeedback() { |
|||
return gccFeedbackDataRep.findAllFeedback(); |
|||
} |
|||
@GetMapping("/all") |
|||
public List<GccFeedbackData> getAllGccFeedbackData() { |
|||
return gccFeedbackDataRep.showAll(); |
|||
} |
|||
|
|||
@GetMapping("/count/{cDate}") |
|||
public long countFeedbackByDate(@PathVariable String cDate) { |
|||
return gccFeedbackDataRep.countFeedbackByDate(cDate); |
|||
} |
|||
@GetMapping("/list/{cDate}") |
|||
public List<GccFeedbackData> getFeedbackListByDate(@PathVariable String cDate) { |
|||
try (Stream<GccFeedbackData> feedbackStream = gccFeedbackDataRep.findFeedbackByDate(cDate)) { |
|||
return feedbackStream.collect(Collectors.toList()); |
|||
}} |
|||
@GetMapping("/counts/{cdate}") |
|||
public ResponseEntity<?> countFeedbackByMonth(@PathVariable String cdate,Model model) { |
|||
String substring = cdate.substring(0, 7); |
|||
model.addAttribute("cdate", substring); |
|||
// model.addAttribute("cdate", yes); |
|||
|
|||
System.out.println(substring); |
|||
|
|||
List<GccFeedbackData> countFeedbackByMonth = gccFeedbackDataRep.countFeedbackByMonth(substring); |
|||
Map<String, Long> collect = countFeedbackByMonth.stream().collect(Collectors.groupingBy(GccFeedbackData::getFeedbackAns,Collectors.counting())); |
|||
|
|||
Long closedcomp = collect.getOrDefault("[yes]",0L); |
|||
Long pendingcomp = collect.getOrDefault("[no]",0L); |
|||
System.out.println(closedcomp); |
|||
|
|||
HashMap<String, Long> map=new HashMap<>(); |
|||
map.put("yes", closedcomp); |
|||
map.put("no", pendingcomp); |
|||
map.put("total", pendingcomp+closedcomp); |
|||
|
|||
// countFeedbackByMonth.stream() |
|||
// .collect(Collectors.groupingBy( |
|||
// entry -> , |
|||
// Collectors.groupingBy(DataEntry::getYesNo, Collectors.counting()) |
|||
// )); |
|||
// Do something with feedbackDataList if needed |
|||
|
|||
return ResponseEntity.ok(map); |
|||
} |
|||
|
|||
|
|||
// @GetMapping("/lists/{cDate}") |
|||
// public List getFeedbackListByMonth(@PathVariable String cDate) { |
|||
// try (List<GccFeedbackData> feedbackStream = gccFeedbackDataRep.findFeedbackByMonth(cDate)) { |
|||
// return feedbackStream.collect(Collectors.toList()); |
|||
// } |
|||
// |
|||
@GetMapping("/cou/{cdate}") |
|||
|
|||
public ResponseEntity<List<Map<String, Object>>> getFeedbackAnalysis() { |
|||
List<GccFeedbackData> feedbackDataList = gccFeedbackDataRep.findAll(); |
|||
|
|||
Map<Object, Map<Object, Long>> result = feedbackDataList.stream() |
|||
.filter(feedback -> feedback.getFeedbackAns() != null && feedback.getcDate() != null) |
|||
.map(feedback -> new AbstractMap.SimpleEntry<>(feedback.getFeedbackAns(), getMonth(feedback.getcDate()))) |
|||
.collect(Collectors.groupingBy( |
|||
AbstractMap.SimpleEntry::getKey, |
|||
Collectors.groupingBy( |
|||
AbstractMap.SimpleEntry::getValue, |
|||
Collectors.counting() |
|||
) |
|||
)); |
|||
|
|||
// Convert the result to the desired output format |
|||
List<Map<String, Object>> output = result.entrySet().stream() |
|||
.map(entry -> { |
|||
List<Long> counts = Arrays.asList(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L); |
|||
entry.getValue().forEach((month, count) -> counts.set(Integer.parseInt((String) month) - 1, count)); |
|||
Map<String, Object> outputEntry = new HashMap<>(); |
|||
outputEntry.put((String) entry.getKey(), counts); |
|||
return outputEntry; |
|||
}) |
|||
.collect(Collectors.toList()); |
|||
System.out.println("................neeed"+output); |
|||
return ResponseEntity.ok(output); |
|||
} |
|||
|
|||
private static String getMonth(String date) { |
|||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|||
try { |
|||
Calendar cal = Calendar.getInstance(); |
|||
cal.setTime(dateFormat.parse(date)); |
|||
return String.valueOf(cal.get(Calendar.MONTH) + 1); // Adding 1 because Calendar.MONTH is zero-based |
|||
} catch (Exception e) { |
|||
e.printStackTrace(); |
|||
return date; |
|||
} |
|||
} |
|||
|
|||
private static List<GccFeedbackData> getFeedbackData() { |
|||
return Arrays.asList( |
|||
new GccFeedbackData("[yes]", "2023-11-09 16:26:01"), |
|||
new GccFeedbackData("[no]", "2023-11-09 16:28:11") |
|||
// Add more data as needed |
|||
); |
|||
} |
|||
} |
|||
@ -0,0 +1,123 @@ |
|||
package com.feedback.it_asset.controller; |
|||
|
|||
import java.io.IOException; |
|||
import java.sql.Blob; |
|||
import java.sql.SQLException; |
|||
import java.time.LocalDateTime; |
|||
import java.util.ArrayList; |
|||
import java.util.Base64; |
|||
import java.util.List; |
|||
|
|||
import javax.sql.rowset.serial.SerialBlob; |
|||
|
|||
import org.springframework.beans.BeanUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Controller; |
|||
import org.springframework.ui.Model; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.ModelAttribute; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RequestMethod; |
|||
import org.springframework.web.bind.annotation.RequestParam; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import com.feedback.it_asset.AppConfig; |
|||
import com.feedback.it_asset.QRCodeGenerator; |
|||
import com.feedback.it_asset.dto.GccAssetDetailsDto; |
|||
import com.feedback.it_asset.entity.AssetCategory; |
|||
import com.feedback.it_asset.entity.GccAssetDetails; |
|||
import com.feedback.it_asset.entity.GccFileData; |
|||
import com.feedback.it_asset.repository.AssetCategoryRep; |
|||
import com.feedback.it_asset.repository.GccAssetDetailsRep; |
|||
import com.feedback.it_asset.repository.GccFileDataRep; |
|||
import com.feedback.it_asset.service.GccAssetService; |
|||
import com.google.zxing.WriterException; |
|||
|
|||
@Controller |
|||
public class AssetController { |
|||
@Autowired |
|||
private AppConfig appConfig; |
|||
@Autowired |
|||
AssetCategoryRep assetCategoryRep; |
|||
@Autowired |
|||
GccAssetDetailsRep gccAssetDetailsRep; |
|||
@Autowired |
|||
GccAssetService gccAssetService; |
|||
@Autowired |
|||
GccFileDataRep gccFileDataRep; |
|||
|
|||
@GetMapping("/gcc-asset-list") |
|||
public String ViewAssetlist(Model model) throws IOException, WriterException, SQLException { |
|||
List<AssetCategory> assetCategoryList = assetCategoryRep.showAll(); |
|||
model.addAttribute("assetcategorylist",assetCategoryList); |
|||
model.addAttribute("title","Asset Master List"); |
|||
|
|||
List<GccAssetDetails> assetDetailsList = gccAssetDetailsRep.showAll(); |
|||
assetDetailsList.forEach(mp -> { |
|||
|
|||
}); |
|||
List<GccAssetDetailsDto> assetDetailsDtoList = new ArrayList<>(); |
|||
for (GccAssetDetails assetDetails : assetDetailsList) { |
|||
GccAssetDetailsDto assetDetailsDto = new GccAssetDetailsDto(); |
|||
// Copy the properties from the entity to the DTO |
|||
BeanUtils.copyProperties(assetDetails, assetDetailsDto); |
|||
// Set the extra field |
|||
System.out.println("GCC Assets:"+appConfig.getQrcodeUrl()+"/"+assetDetails.getAssetCode()); |
|||
assetDetailsDto.setQrcodeimg(QRCodeGenerator.generateQRCode(appConfig.getQrcodeUrl()+"/"+assetDetails.getAssetCode())); |
|||
List<GccFileData> fileDataList = gccFileDataRep.showFileDataByAssetId(assetDetails.getAssetId()); |
|||
for (GccFileData fileData : fileDataList) { |
|||
System.out.println(fileData.getFileName()); |
|||
Blob imageBlob = fileData.getData(); |
|||
byte[] imageBytes = imageBlob.getBytes(1, (int) imageBlob.length()); |
|||
assetDetailsDto.setAssetimg(Base64.getEncoder().encodeToString(imageBytes)); |
|||
} |
|||
assetDetailsDtoList.add(assetDetailsDto); |
|||
} |
|||
// for (AssetDetails assetDetails : assetDetailsList) { |
|||
// System.out.println(assetDetails.getAssetCode() +":"+QRCodeGenerator.generateQRCode(assetDetails.getAssetCode())); |
|||
// assetDetails.setAssetCode(QRCodeGenerator.generateQRCode(assetDetails.getAssetCode())); |
|||
// } |
|||
model.addAttribute("assetdetailslist",assetDetailsDtoList); |
|||
//model.addAttribute("qrcode","iVBORw0KGgoAAAANSUhEUgAAAMgAAADIAQAAAACFI5MzAAAB+0lEQVR4Xu2XUWoDMQxEBb6WwVc36FoCd5422aSF/EnQQk3T7OoFbI1G2sTOp2U/A/f6J7+ebLNx3F0Xc7jvkYF64oe4x/K99hxXoIPs4boUM1sZJtBDSPTsdWLsuRrJQcnrM3o1ESBKStOYypVAA8EQpHqvb96pI6wg2W1Iyu4Px9eSbfL4iBVTZbOp96l8O8iUnnvhDuxhZuhbTlQt5RjGtqre8dBxGkgewTiG3E4Tk24D0T0OxPESU9WjfA2EcCz4EUVQe3ZWKdGOhqJUD3kPlw1E3pjUa6Xd5ZCXorWEhlW6thhHOsVL61KiW80iNW7gEhwPqCfUCpNoLAFH0FcNJBMjSX0Gl2TiHSQffc77osmoYAd5PMU35bsG0vMEtUT/VTvRwCKmHqOL6wmTlVSJcpOFbCHBttlfO6PZwuVE7ghmUvB4kv+nZXuVk2CGj3SJ43uF/aFoKWE6yIM6waJ2OgonqSfkqJplZylZKcp1PaFa+fTToGAiSVF8WU4eY5Vvj2LvihaTwIQEguK9KVpMtDvEeElR4wtlA2GRneKaTaRLK9cTfOFk6HwN4gaD1BPnT5YnycXg0O2tQSXBG3jPUXOufU+KeqJLyShJmUvnOfnqSU7xnfHrh2UHAU68TtVUyfuXRC3BIZudGRNMpL38OkEt+bD+yV8lXx4SQZQ4zzw1AAAAAElFTkSuQmCC"); |
|||
System.out.println("Get /gcc-asset-list"); |
|||
return "gcc-asset-list"; |
|||
} |
|||
|
|||
@RequestMapping(value = "/saveAsset", method = RequestMethod.POST) |
|||
public String saveAsset(@ModelAttribute("saveAsset") GccAssetDetails ad, @RequestParam(name = "paramId[]") String[] paramId,@RequestParam("assetFile") MultipartFile file) throws IOException, SQLException { |
|||
//areaId,assetAddress,assetClosingTime,assetLatitude,assetLongitude,assetName,assetOpeningTime,assetCode,catId,divId,zoneId,paramId |
|||
String paramIdquery=""; |
|||
paramIdquery+="["; |
|||
for (int i = 0; i < paramId.length; i++) { |
|||
paramIdquery += paramId[i]; |
|||
if (i < paramId.length - 1) { |
|||
paramIdquery += ","; |
|||
} |
|||
} |
|||
paramIdquery += "]"; |
|||
//Integer productId = assetService.saveAsset(ad.getAreaId(), ad.getAssetAddress(), ad.getAssetClosingTime(), ad.getAssetLatitude(), ad.getAssetLongitude(), ad.getAssetName(), ad.getAssetOpeningTime(), "PAR-001-0001-00001", ad.getAssetCategory().getcId(), ad.getDivId(), ad.getZoneId(), paramIdquery); |
|||
// String assetCode = String.format("PAR-001-0001-%5d", ad.getAssetCategory().getcId()); |
|||
// System.out.println("ok-----------------"+ad.getAssetId().getClass()); |
|||
String assetCode = String.format("%s-%04d",ad.getAssetName(), ad.getAssetCategory().getcId()); |
|||
System.out.println(assetCode); |
|||
|
|||
Integer productId = gccAssetDetailsRep.insertAsset(ad.getAssetLatitude(), ad.getAssetLongitude(), ad.getAssetName(), assetCode, ad.getAssetCategory().getcId(),ad.getDepartmentName(),ad.getPosition(), ad.getPerson(), paramIdquery); |
|||
Integer lastInId = gccAssetDetailsRep.getLastInsertedId(); |
|||
System.out.println("Last insert ID: " +lastInId); |
|||
GccAssetDetails gccAssetDetails = new GccAssetDetails(); |
|||
gccAssetDetails.setAssetId(lastInId); |
|||
LocalDateTime cdate = LocalDateTime.now(); |
|||
GccFileData fileData = new GccFileData(); |
|||
fileData.setFileName(file.getOriginalFilename()); |
|||
|
|||
byte[] fileBytes = file.getBytes(); |
|||
Blob fileBlob = new SerialBlob(fileBytes); |
|||
fileData.setData(fileBlob); |
|||
|
|||
fileData.setGccAssetDetails(gccAssetDetails); |
|||
fileData.setcDate(cdate); |
|||
gccFileDataRep.save(fileData); |
|||
return "redirect:/gcc-asset-list"; |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
package com.feedback.it_asset.controller; |
|||
|
|||
import org.springframework.web.bind.annotation.ControllerAdvice; |
|||
import org.springframework.web.bind.annotation.ModelAttribute; |
|||
|
|||
import com.feedback.it_asset.AppConfig; |
|||
|
|||
@ControllerAdvice |
|||
public class CommonAttributes { |
|||
|
|||
private final AppConfig appConfig; |
|||
|
|||
public CommonAttributes(AppConfig appConfig) { |
|||
this.appConfig=appConfig; |
|||
} |
|||
@ModelAttribute("baseurl") |
|||
public String baseUrl() { |
|||
return appConfig.getBaseUrl(); |
|||
} |
|||
@ModelAttribute("title") |
|||
public String baseTitle() { |
|||
return appConfig.getTitle(); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,196 @@ |
|||
package com.feedback.it_asset.controller; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
import java.util.stream.Collectors; |
|||
|
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Controller; |
|||
import org.springframework.ui.Model; |
|||
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.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RequestMethod; |
|||
import org.springframework.web.bind.annotation.RequestParam; |
|||
|
|||
import com.feedback.it_asset.AppConfig; |
|||
import com.feedback.it_asset.entity.AssetCategoryQuestions; |
|||
import com.feedback.it_asset.entity.AssetParameterQuestions; |
|||
import com.feedback.it_asset.entity.GccAssetDetails; |
|||
import com.feedback.it_asset.repository.AssetCategoryQuestionsRep; |
|||
import com.feedback.it_asset.repository.AssetParameterQuestionsRep; |
|||
import com.feedback.it_asset.repository.GccAssetDetailsRep; |
|||
import com.feedback.it_asset.repository.GccFeedbackDataRep; |
|||
import com.feedback.it_asset.repository.GccFeedbackRep; |
|||
@Controller |
|||
public class FeedbackController { |
|||
@Autowired |
|||
private AppConfig appConfig; |
|||
@Autowired |
|||
private GccAssetDetailsRep gccAssetDetailsRep; |
|||
@Autowired |
|||
private AssetCategoryQuestionsRep assetCategoryQuestionsRep; |
|||
@Autowired |
|||
private AssetParameterQuestionsRep assetParameterQuestionsRep; |
|||
@Autowired |
|||
private GccFeedbackRep gccFeedbackRep; |
|||
@Autowired |
|||
private GccFeedbackDataRep gccfeedbackDataRep; |
|||
|
|||
|
|||
@GetMapping("/gcc_asset_details-0.0.1-SNAPSHOT/qr-feedback/feedback/entry/qrcode={qrcode}") |
|||
|
|||
//testurl : http://localhost:8080/asset_details-0.0.1-SNAPSHOT/qr-feedback/feedback/entry/qrcode=PRK-01-001-00001 |
|||
|
|||
public String changeOldToNew(@PathVariable String qrcode){ |
|||
return "redirect:/gcc-complaint/"+qrcode; |
|||
/* |
|||
String assetId = assetDetailsRep.findByAssetCode(qrcode); |
|||
if (assetId != null) { |
|||
return "redirect:/public-feedback/"+assetId; |
|||
} else { |
|||
return "redirect:/public-feedback/"+qrcode; |
|||
} |
|||
*/ |
|||
} |
|||
@GetMapping("/gcc-complaint/{qrcode}") |
|||
public String viewPublicFeedbackForm(Model model, @PathVariable String qrcode) { |
|||
String assetId = gccAssetDetailsRep.findByAssetCode(qrcode); |
|||
Integer assetid = 0; |
|||
if (assetId != null) { |
|||
assetid = Integer.valueOf(assetId); |
|||
} |
|||
|
|||
List<GccAssetDetails> assetDetailsList = gccAssetDetailsRep.findByAssetId(assetid); |
|||
List<Integer> paramDbVal = new ArrayList<>(); |
|||
for (GccAssetDetails ad : assetDetailsList) { |
|||
//Basic Asset Details |
|||
model.addAttribute("assetId", ad.getAssetId()); |
|||
model.addAttribute("assetName", ad.getAssetName()); |
|||
///////////////////// |
|||
List<AssetCategoryQuestions> assetCategoryQuestionList = assetCategoryQuestionsRep.findByCatId(ad.getAssetCategory().getcId()); |
|||
model.addAttribute("feedbackquestionlist", assetCategoryQuestionList); |
|||
System.out.println(ad.getParamId()); |
|||
String paramDbStr = ad.getParamId().replaceAll("[\\[\\]\\s]", ""); |
|||
String[] paramIdStr = paramDbStr.split(","); |
|||
for (String a : paramIdStr) { |
|||
paramDbVal.add(Integer.parseInt(a)); |
|||
} |
|||
List<AssetParameterQuestions> assetParameterQuestionList = assetParameterQuestionsRep.findByParameterId(paramDbVal); |
|||
model.addAttribute("assetparameterquestionlist", assetParameterQuestionList); |
|||
} |
|||
model.addAttribute("title", "GCC Compaint Form"); |
|||
//model.addAttribute("baseurl", appConfig.getBaseUrl()); |
|||
return "gcc-complaint"; |
|||
} |
|||
|
|||
@RequestMapping(value="/gcc-complaint/save", method = RequestMethod.POST) |
|||
public String savePublicFeedback(@RequestParam MultiValueMap<String, String> formData, |
|||
@RequestParam(name = "uname") String name, |
|||
@RequestParam(name = "mobile") String mobile, |
|||
@RequestParam(name = "score") String rating, |
|||
@RequestParam(name = "assetId") Integer assetId) { |
|||
|
|||
System.out.println(formData.values().toString()); |
|||
System.out.println(assetId); |
|||
System.out.println(name); |
|||
System.out.println(mobile); |
|||
System.out.println(rating); |
|||
if(rating.isEmpty()){ |
|||
rating = "0"; |
|||
} |
|||
gccFeedbackRep.insertFeedback(assetId,name,mobile,rating); |
|||
Integer lastInId = gccFeedbackRep.getLastInsertedId(); |
|||
// process the form data here |
|||
for (String key : formData.keySet()) { |
|||
if (!key.equals("uname") |
|||
&& !key.equals("mobile") |
|||
&& !key.equals("score") |
|||
&& !key.equals("assetId") |
|||
) { |
|||
List<String> values = formData.get(key); |
|||
// remove empty values |
|||
List<String> filteredValues = values.stream() |
|||
.filter(value -> !value.isEmpty()) |
|||
.map(String::trim) |
|||
.collect(Collectors.toList()); |
|||
// do something with the field values |
|||
if (!filteredValues.isEmpty()) { |
|||
System.out.println("Field " + key + " has values: " + filteredValues); |
|||
String feedback = filteredValues.toString().trim(); |
|||
String[] parts = key.split("_"); |
|||
if (parts.length == 2) { |
|||
Integer cmqid = null, apqid = null, aqid = null; |
|||
if ("cq".equals(parts[0])) { |
|||
try { |
|||
cmqid = Integer.parseInt(parts[1]); |
|||
} catch (NumberFormatException e) {} |
|||
} else if ("pq".equals(parts[0])) { |
|||
try { |
|||
apqid = Integer.parseInt(parts[1]); |
|||
} catch (NumberFormatException e) {} |
|||
} else if ("aq".equals(parts[0])) { |
|||
try { |
|||
aqid = Integer.parseInt(parts[1]); |
|||
} catch (NumberFormatException e) {} |
|||
} |
|||
if (cmqid != null || apqid != null || aqid != null) { |
|||
String complaint_no =""; |
|||
/* |
|||
if(feedback.equals("[no]")){ |
|||
String complaintId = ""; |
|||
String nametxt = name; |
|||
String address = "null"; |
|||
String email = "null"; |
|||
String mobileNo = mobile; |
|||
String complaintType = "18"; |
|||
String complaintTitle = "Park"; |
|||
String complaintDetail = "TestDetail"; |
|||
String streetId = "25956"; |
|||
String image = "null"; |
|||
String latitude = "null"; |
|||
String longtitude = "null"; |
|||
String landmark = "null"; |
|||
|
|||
String urlString = "https://erp.chennaicorporation.gov.in/pgr/external/mobileservice?serviceId=RegComplaint&ComplainantName=" + nametxt + "&ComplainantAddr=" + address + "&MobileNo=" + mobileNo + "&Email=" + email + "&ComplaintType=" + complaintType + "&ComplaintTitle=" + complaintTitle + "&ComplaintDetails=" + complaintDetail + "&StreetId=" + streetId + "&Comp_Image=" + image + "&latitude=" + latitude + "&longtitude=" + longtitude + "&Landmark=" + landmark + ""; |
|||
System.out.print("urlString---: "+urlString); |
|||
|
|||
ResponseEntity<String> response = null; |
|||
RestTemplate restTemplate = new RestTemplate(); |
|||
String bodyMessage = ""; |
|||
HttpHeaders headers = new HttpHeaders(); |
|||
try { |
|||
HttpEntity<String> postData = new HttpEntity<String>(headers); |
|||
response = restTemplate.exchange(urlString, HttpMethod.POST, postData, String.class); |
|||
bodyMessage = response.getBody(); |
|||
System.out.println("\n bodyMessage : "+bodyMessage); |
|||
|
|||
} catch (Exception e) { |
|||
// e.printStackTrace(); |
|||
System.out.print("ERROR---: "+e); |
|||
bodyMessage = "Error"; |
|||
} |
|||
complaint_no = bodyMessage; |
|||
System.out.println("Ticket Created successfully!"); |
|||
} |
|||
*/ |
|||
gccfeedbackDataRep.insertFeedback(lastInId, cmqid, apqid, feedback, complaint_no); |
|||
|
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
return "redirect:/gcc-feedback-thanks"; |
|||
} |
|||
|
|||
@RequestMapping("gcc-feedback-thanks") |
|||
public String showFeedbackThanks(Model model) { |
|||
String txt = "Thanks for your feedback.<br>We're constantly trying to improve our services, so your input is valuable. We'll look closely at what you've said and see how we can improve things."; |
|||
model.addAttribute("title","Thanks for your feedback."); |
|||
model.addAttribute("thankstxt",txt); |
|||
return "gcc-feedback-thanks"; |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,340 @@ |
|||
package com.feedback.it_asset.controller; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.stream.Collectors; |
|||
|
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Controller; |
|||
import org.springframework.ui.Model; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.ModelAttribute; |
|||
import org.springframework.web.bind.annotation.PathVariable; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RequestMethod; |
|||
import org.springframework.web.bind.annotation.RequestParam; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import com.feedback.it_asset.AppConfig; |
|||
import com.feedback.it_asset.entity.AssetCategory; |
|||
import com.feedback.it_asset.entity.AssetCategoryQuestions; |
|||
import com.feedback.it_asset.entity.AssetParameter; |
|||
import com.feedback.it_asset.entity.AssetParameterQuestions; |
|||
import com.feedback.it_asset.entity.GccAssetDetails; |
|||
import com.feedback.it_asset.entity.GccFeedback; |
|||
import com.feedback.it_asset.entity.GccFeedbackData; |
|||
import com.feedback.it_asset.repository.AssetCategoryQuestionsRep; |
|||
import com.feedback.it_asset.repository.AssetCategoryRep; |
|||
import com.feedback.it_asset.repository.AssetParameterQuestionsRep; |
|||
import com.feedback.it_asset.repository.AssetParameterRep; |
|||
import com.feedback.it_asset.repository.GccAssetDetailsRep; |
|||
import com.feedback.it_asset.repository.GccFeedbackDataRep; |
|||
import com.feedback.it_asset.repository.GccFeedbackRep; |
|||
import com.feedback.it_asset.service.GccAssetService; |
|||
|
|||
@Controller |
|||
public class MainController { |
|||
@Autowired |
|||
private AppConfig appConfig; |
|||
@Autowired |
|||
private AssetCategoryRep assetCategoryRep; |
|||
@Autowired |
|||
private AssetCategoryQuestionsRep assetCategoryQuestionsRep; |
|||
@Autowired |
|||
private AssetParameterRep assetParameterRep; |
|||
@Autowired |
|||
private AssetParameterQuestionsRep assetParameterQuestionsRep; |
|||
@Autowired |
|||
private GccAssetDetailsRep gccAssetDetailsRep; |
|||
@Autowired |
|||
private GccFeedbackRep gccFeedbackRep; |
|||
@Autowired |
|||
private GccFeedbackDataRep gccFeedbackDataRep; |
|||
@Autowired |
|||
private GccAssetService gccAssetService; |
|||
|
|||
@RequestMapping("/") |
|||
public String viewLogin(Model model){ |
|||
model.addAttribute("title","Dashboard"); |
|||
System.out.println("Get /"); |
|||
// return "400"; |
|||
return "login"; |
|||
} |
|||
|
|||
|
|||
@GetMapping("/pendingchart.html") |
|||
public String showPendingChart() { |
|||
// Your logic here |
|||
return "pendingchart"; // Assuming "pendingchart" is the Thymeleaf template name |
|||
} |
|||
@GetMapping("/closedchart.html") |
|||
public String showClosedChart() { |
|||
// Your logic here |
|||
return "closedchart"; // Assuming "closedchart" is the Thymeleaf template name |
|||
} |
|||
@GetMapping("/totalchart.html") |
|||
public String showTotalChart() { |
|||
// Your logic here |
|||
return "totalchart"; // Assuming "closedchart" is the Thymeleaf template name |
|||
} |
|||
|
|||
// @RestController |
|||
// @RequestMapping("/api/feedback") |
|||
// public class GccFeedbackController { |
|||
// |
|||
// @Autowired |
|||
// private GccFeedbackRep gccFeedbackRep; |
|||
// |
|||
// @GetMapping("/all") |
|||
// public List<GccFeedbackData> getAllFeedbackData() { |
|||
// return GccFeedbackRep.showAll(); |
|||
// } |
|||
// } |
|||
|
|||
@RequestMapping("/dashboard") |
|||
public String viewHomePage(Model model){ |
|||
|
|||
|
|||
List<Map<String, Object>> feedbackAnalysis = gccAssetService.getFeedbackAnalysis(); |
|||
|
|||
|
|||
// model.addAttribute("months", months); |
|||
// model.addAttribute("closedValues", closedValues); |
|||
// model.addAttribute("pendingValues", pendingValues); |
|||
// model.addAttribute("totalValues", totalValues); |
|||
|
|||
|
|||
model.addAttribute("dashboard", feedbackAnalysis); |
|||
model.addAttribute("title","Dashboard"); |
|||
model.addAttribute("totalAssets",gccAssetDetailsRep.count()); |
|||
model.addAttribute("totalFeedbacks",gccFeedbackRep.count()); |
|||
model.addAttribute("totalYesFeedbacks",gccFeedbackDataRep.onlyYesCount()); |
|||
model.addAttribute("totalNoFeedbacks",gccFeedbackDataRep.onlyNoCount()); |
|||
System.out.println("Get /"); |
|||
// return "400"; |
|||
return "dashboard"; |
|||
} |
|||
|
|||
@GetMapping("/base-file") |
|||
public String viewTestPage(Model model){ |
|||
model.addAttribute("title","Base File"); |
|||
System.out.println("base file /"); |
|||
return "base"; |
|||
} |
|||
@GetMapping("/login") |
|||
public String viewDashboard(Model model){ |
|||
model.addAttribute("title","Login"); |
|||
System.out.println("Get /login"); |
|||
// return "400"; |
|||
return "login"; |
|||
} |
|||
|
|||
@RequestMapping(value = "/updateAsset", method = RequestMethod.POST) |
|||
public String updateAsset(@RequestParam("assetId")Integer assetId,@RequestParam("assetName")String assetName,@RequestParam("departmentName")String departmentName,@RequestParam("person")String person,@RequestParam("position")String position) { |
|||
//service.save(asse); |
|||
System.out.println(assetId+ " --- " ); |
|||
gccAssetDetailsRep.updateAsset(assetId,assetName,departmentName,person,position); |
|||
// return "400"; |
|||
return "redirect:/gcc-asset-list"; |
|||
} |
|||
|
|||
@GetMapping("/asset-category") |
|||
public String viewMasterEntry(Model model){ |
|||
List<AssetCategory> assetCategoryList = assetCategoryRep.showAll(); |
|||
model.addAttribute("assetcategorylist",assetCategoryList); |
|||
model.addAttribute("title","Asset Category"); |
|||
model.addAttribute("category", new AssetCategory()); |
|||
System.out.println("Get /asset-category"); |
|||
// return "400"; |
|||
return "asset-category"; |
|||
} |
|||
@RequestMapping(value = "/saveCategory", method = RequestMethod.POST) |
|||
public String saveCategory(@ModelAttribute("category") AssetCategory cat) { |
|||
//service.save(cat); |
|||
System.out.println(cat.getCatName() + " --- " +cat.getIsActive()); |
|||
assetCategoryRep.insertCategory(cat.getCatName(),cat.getIsActive()); |
|||
// return "400"; |
|||
return "redirect:/asset-category"; |
|||
} |
|||
|
|||
@RequestMapping(value = "/updateCategory", method = RequestMethod.POST) |
|||
public String updateCategory(@ModelAttribute("category") AssetCategory cat) { |
|||
//service.save(cat); |
|||
System.out.println(cat.getCatName() + " --- " +cat.getIsActive()); |
|||
assetCategoryRep.updateCategory(cat.getcId(),cat.getCatName(),cat.getIsActive()); |
|||
// return "400"; |
|||
return "redirect:/asset-category"; |
|||
} |
|||
|
|||
@GetMapping("/asset-category-questions") |
|||
public String viewMasterQuestionList(Model model){ |
|||
List<AssetCategoryQuestions> assetCategoryQuestionList = assetCategoryQuestionsRep.showQuestionsAll(); |
|||
model.addAttribute("assetcategoryquestionlist",assetCategoryQuestionList); |
|||
List<AssetCategory> assetCategoryList = assetCategoryRep.showAll(); |
|||
model.addAttribute("assetcategorylist",assetCategoryList); |
|||
model.addAttribute("title","Asset Master Question"); |
|||
model.addAttribute("categoryquestion", new AssetCategoryQuestions()); |
|||
System.out.println("Get /asset-master-questions"); |
|||
// return "400"; |
|||
return "asset-category-questions"; |
|||
} |
|||
|
|||
@RequestMapping(value = "/saveCategoryQuestion", method = RequestMethod.POST) |
|||
public String saveMasterQuestion(@ModelAttribute("categoryquestion") AssetCategoryQuestions cmq) { |
|||
//service.save(cat); |
|||
System.out.println(cmq.getAssetCategory().getcId() + " --- " +cmq.getIsActive()); |
|||
Integer catID = cmq.getAssetCategory().getcId(); |
|||
System.out.println("Send Value:"+catID); |
|||
assetCategoryQuestionsRep.insertQuestionCategory(catID,cmq.getEngQuestion(),cmq.getTamilQuestion(),cmq.getIsActive()); |
|||
// return "400"; |
|||
return "redirect:/asset-category-questions"; |
|||
} |
|||
@RequestMapping(value = "/updateCategoryQuestion", method = RequestMethod.POST) |
|||
public String updateMasterQuestion(@ModelAttribute("categoryquestion") AssetCategoryQuestions cmq) { |
|||
Integer catID = cmq.getAssetCategory().getcId(); |
|||
System.out.println(cmq.getCmqId()+" -- "+catID+" -- "+cmq.getTamilQuestion()); |
|||
assetCategoryQuestionsRep.updateQuestionCategory(cmq.getCmqId(),catID,cmq.getEngQuestion(),cmq.getTamilQuestion(),cmq.getIsActive()); |
|||
//return "400"; |
|||
return "redirect:/asset-category-questions"; |
|||
} |
|||
|
|||
@GetMapping("/asset-parameter") |
|||
public String viewMasterparameterist(Model model){ |
|||
List<AssetParameter> assetParameterList = assetParameterRep.showAll(); |
|||
model.addAttribute("assetparameterlist",assetParameterList); |
|||
List<AssetCategory> assetCategoryList = assetCategoryRep.showAll(); |
|||
model.addAttribute("assetcategorylist",assetCategoryList); |
|||
model.addAttribute("title","Asset Master Question"); |
|||
model.addAttribute("assetparameter", new AssetParameter()); |
|||
System.out.println("Get /asset-parameter"); |
|||
//return "400";// |
|||
return "asset-parameter"; |
|||
} |
|||
@RequestMapping(value = "/saveParameter", method = RequestMethod.POST) |
|||
public String saveMasterParameter(@ModelAttribute("assetparameter") AssetParameter parameter) { |
|||
//service.save(cat); |
|||
System.out.println(parameter.getAssetCategory().getcId() + " --- " +parameter.getIsActive()); |
|||
Integer catID = parameter.getAssetCategory().getcId(); |
|||
System.out.println("Send Value:"+catID); |
|||
assetParameterRep.insertParametert(catID,parameter.getParamName(),parameter.getIsActive()); |
|||
// return "400"; |
|||
return "redirect:/asset-parameter"; |
|||
} |
|||
@RequestMapping(value = "/updateParameter", method = RequestMethod.POST) |
|||
public String updateMasterParameter(@ModelAttribute("assetparameter") AssetParameter parameter) { |
|||
//service.save(cat); |
|||
System.out.println(parameter.getAssetCategory().getcId() + " --- " +parameter.getParamId()); |
|||
Integer catID = parameter.getAssetCategory().getcId(); |
|||
System.out.println("Send Value:"+catID); |
|||
assetParameterRep.updateParameter(parameter.getParamId(),catID,parameter.getParamName(),parameter.getIsActive()); |
|||
//return "400";// |
|||
return "redirect:/asset-parameter"; |
|||
} |
|||
@GetMapping("/asset-parameter-questions") |
|||
public String viewParameterQuestionList(Model model){ |
|||
List<AssetParameterQuestions> assetParameterQuestionList = assetParameterQuestionsRep.showQuestionsAll(); |
|||
model.addAttribute("assetparameterquestionlist",assetParameterQuestionList); |
|||
List<AssetParameter> assetParameterList = assetParameterRep.showAll(); |
|||
model.addAttribute("parameterlist",assetParameterList); |
|||
model.addAttribute("title","Asset Master Question"); |
|||
model.addAttribute("parameterquestion", new AssetParameterQuestions()); |
|||
System.out.println("Get /asset-master-questions"); |
|||
//return "400";// |
|||
return "asset-parameter-questions"; |
|||
} |
|||
@RequestMapping(value = "/saveParameterQuestion", method = RequestMethod.POST) |
|||
public String saveParameterQuestion(@ModelAttribute("parameterquestion") AssetParameterQuestions apq) { |
|||
System.out.println(apq.getAssetParameter().getParamId() + " --- " +apq.getIsActive()); |
|||
Integer parID = apq.getAssetParameter().getParamId(); |
|||
System.out.println("Send Value:"+parID); |
|||
assetParameterQuestionsRep.insertParameterQuestion(parID,apq.getEngQuestion(),apq.getTamilQuestion(),apq.getIsActive()); |
|||
// return "400"; |
|||
return "redirect:/asset-parameter-questions"; |
|||
} |
|||
@RequestMapping(value = "/updateParameterQuestion", method = RequestMethod.POST) |
|||
public String updateMasterQuestion(@ModelAttribute("parameterquestion") AssetParameterQuestions apq) { |
|||
Integer parID = apq.getAssetParameter().getParamId(); |
|||
System.out.println(apq.getApqId()+" -- "+parID+" -- "+apq.getTamilQuestion()); |
|||
assetParameterQuestionsRep.updateParameterQuestion(apq.getApqId(),parID,apq.getEngQuestion(),apq.getTamilQuestion(),apq.getIsActive()); |
|||
//return "400"; |
|||
return "redirect:/asset-parameter-questions"; |
|||
} |
|||
@GetMapping("/complaint-list") |
|||
public String viewFeedbackList(Model model){ |
|||
List<GccFeedback> gccFeedbackList = gccFeedbackRep.findAll(); |
|||
model.addAttribute("feedbacklist",gccFeedbackList); |
|||
model.addAttribute("title","Asset -GCC Complaint List"); |
|||
return "complaint-list"; |
|||
} |
|||
@GetMapping("/closed-complaint") |
|||
public String viewPositiveFeedbackList(Model model){ |
|||
List<GccFeedback> gccFeedbackList = gccFeedbackRep.findByfeedbackAllYes(); |
|||
model.addAttribute("feedbacklist",gccFeedbackList); |
|||
model.addAttribute("title","Asset - GCC Closed Complaint "); |
|||
return "closed-complaint"; |
|||
} |
|||
@GetMapping("/pending-complaint") |
|||
public String viewNegativeFeedbackList(Model model){ |
|||
List<GccFeedback> gccFeedbackList = gccFeedbackRep.findByfeedbackAllNo(); |
|||
model.addAttribute("feedbacklist",gccFeedbackList); |
|||
model.addAttribute("title","Asset -GCC Pending Complaint"); |
|||
return "pending-complaint"; |
|||
} |
|||
@GetMapping("/gcc-services-water") |
|||
public String viewGccServiceWater(Model model) { |
|||
model.addAttribute("title","GCC-Service-Water"); |
|||
model.addAttribute("pTax",appConfig.getPtaxid()); |
|||
model.addAttribute("regMobile",appConfig.getPtaxRegMobile()); |
|||
if("null".equals(appConfig.getPtaxid())){ |
|||
return "redirect:/gcc-login"; |
|||
} |
|||
return "gcc-services-2"; |
|||
} |
|||
|
|||
@GetMapping("/gcc-services-load") |
|||
public String viewifram(Model model, @RequestParam("url") String url) { |
|||
model.addAttribute("title","GCC-Service-Water"); |
|||
model.addAttribute("url",url); |
|||
model.addAttribute("pTax",appConfig.getPtaxid()); |
|||
model.addAttribute("regMobile",appConfig.getPtaxRegMobile()); |
|||
if("null".equals(appConfig.getPtaxid())){ |
|||
return "redirect:/gcc-login"; |
|||
} |
|||
System.out.println(url); |
|||
return "gcc-service-ifram"; |
|||
} |
|||
|
|||
@GetMapping("/gcc-services-load2") |
|||
public String viewifram2(Model model, @RequestParam("url") String url) { |
|||
model.addAttribute("title","GCC-Service-Water"); |
|||
model.addAttribute("url",url); |
|||
model.addAttribute("pTax",appConfig.getPtaxid()); |
|||
model.addAttribute("regMobile",appConfig.getPtaxRegMobile()); |
|||
System.out.println(url); |
|||
if("null".equals(appConfig.getPtaxid())){ |
|||
return "redirect:/gcc-login"; |
|||
} |
|||
return "gcc-service-ifram2"; |
|||
} |
|||
|
|||
@GetMapping("/gcc-login") |
|||
public String viewPubliclogin(Model model, @RequestParam(value = "ptaxid", defaultValue = "null") String ptaxNo) { |
|||
model.addAttribute("title","GCC-Login"); |
|||
model.addAttribute("ptax",ptaxNo); |
|||
String msg="Login to Your Account"; |
|||
if(ptaxNo.equals("null")){ |
|||
msg = "<p class='text-danger'>Invalid Session<br>Scan QR code and try Again!</p>"; |
|||
} |
|||
model.addAttribute("errortxt",msg); |
|||
return "gcc-login"; |
|||
} |
|||
|
|||
@GetMapping("/gcc-logout") |
|||
public String logout(Model model) { |
|||
|
|||
return "redirect:/login"; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
package com.feedback.it_asset.dto; |
|||
|
|||
public class FeedbackCountResponse { |
|||
|
|||
private long[] counts; |
|||
|
|||
public long[] getCounts() { |
|||
return counts; |
|||
} |
|||
|
|||
public void setCounts(long[] counts) { |
|||
this.counts = counts; |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,31 @@ |
|||
package com.feedback.it_asset.dto; |
|||
|
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
|
|||
import com.feedback.it_asset.entity.GccAssetDetails; |
|||
import com.feedback.it_asset.repository.GccFileDataRep; |
|||
|
|||
public class GccAssetDetailsDto extends GccAssetDetails { |
|||
@Autowired |
|||
GccFileDataRep gccFileDataRep; |
|||
private String qrcodeimg; |
|||
|
|||
private String assetimg; |
|||
|
|||
public String getQrcodeimg() { |
|||
return qrcodeimg; |
|||
} |
|||
|
|||
public void setQrcodeimg(String qrcodeimg) { |
|||
this.qrcodeimg = qrcodeimg; |
|||
} |
|||
|
|||
public String getAssetimg() { |
|||
return assetimg; |
|||
} |
|||
|
|||
public void setAssetimg(String assetimg) { |
|||
this.assetimg = assetimg; |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,6 @@ |
|||
package com.feedback.it_asset.dto; |
|||
|
|||
public class ItAssetDashboardDto { |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,34 @@ |
|||
package com.feedback.it_asset.dto; |
|||
public class MonthWiseCountsDTO { |
|||
private long onlyYesCount; |
|||
private long onlyNoCount; |
|||
|
|||
// Constructors, getters, setters, etc. |
|||
|
|||
public MonthWiseCountsDTO() { |
|||
// default constructor |
|||
} |
|||
|
|||
public MonthWiseCountsDTO(long onlyYesCount, long onlyNoCount) { |
|||
this.onlyYesCount = onlyYesCount; |
|||
this.onlyNoCount = onlyNoCount; |
|||
} |
|||
|
|||
public long getOnlyYesCount() { |
|||
return onlyYesCount; |
|||
} |
|||
|
|||
public void setOnlyYesCount(long onlyYesCount) { |
|||
this.onlyYesCount = onlyYesCount; |
|||
} |
|||
|
|||
public long getOnlyNoCount() { |
|||
return onlyNoCount; |
|||
} |
|||
|
|||
public void setOnlyNoCount(long onlyNoCount) { |
|||
this.onlyNoCount = onlyNoCount; |
|||
} |
|||
} |
|||
|
|||
|
|||
@ -0,0 +1,91 @@ |
|||
package com.feedback.it_asset.entity; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
|||
|
|||
import jakarta.persistence.Column; |
|||
import jakarta.persistence.Entity; |
|||
import jakarta.persistence.GeneratedValue; |
|||
import jakarta.persistence.GenerationType; |
|||
import jakarta.persistence.Id; |
|||
import jakarta.persistence.Table; |
|||
|
|||
@Entity |
|||
@Table(name = "asset_category") |
|||
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler"}) |
|||
public class AssetCategory { |
|||
@Id |
|||
@GeneratedValue(strategy= GenerationType.IDENTITY) |
|||
@Column(name = "cat_id",nullable = false) |
|||
private Integer cId; |
|||
@Column(name = "name",nullable = false) |
|||
private String catName; |
|||
@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 AssetCategory() { |
|||
|
|||
} |
|||
|
|||
public AssetCategory(Integer cId, String catName, Boolean isDelete, Boolean isActive, Integer createdBy, String cDate) { |
|||
this.cId = cId; |
|||
this.catName = catName; |
|||
this.isDelete = isDelete; |
|||
this.isActive = isActive; |
|||
this.createdBy = createdBy; |
|||
this.cDate = cDate; |
|||
} |
|||
|
|||
public Integer getcId() { |
|||
return cId; |
|||
} |
|||
|
|||
public void setcId(Integer cId) { |
|||
this.cId = cId; |
|||
} |
|||
|
|||
public String getCatName() { |
|||
return catName; |
|||
} |
|||
|
|||
public void setCatName(String catName) { |
|||
this.catName = catName; |
|||
} |
|||
|
|||
public Boolean getIsDelete() { |
|||
return isDelete; |
|||
} |
|||
|
|||
public void setIsDelete(Boolean delete) { |
|||
isDelete = delete; |
|||
} |
|||
|
|||
public Boolean getIsActive() { |
|||
return isActive; |
|||
} |
|||
|
|||
public void setIsActive(Boolean active) { |
|||
isActive = active; |
|||
} |
|||
|
|||
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,164 @@ |
|||
package com.feedback.it_asset.entity; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
|||
|
|||
import jakarta.persistence.Column; |
|||
import jakarta.persistence.Entity; |
|||
import jakarta.persistence.GeneratedValue; |
|||
import jakarta.persistence.GenerationType; |
|||
import jakarta.persistence.Id; |
|||
import jakarta.persistence.JoinColumn; |
|||
import jakarta.persistence.ManyToOne; |
|||
import jakarta.persistence.Table; |
|||
@Entity |
|||
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler"}) |
|||
@Table(name = "category_master_question") |
|||
public class AssetCategoryQuestions { |
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
@Column(name = "cmq_id", nullable = false) |
|||
private Integer cmqId; |
|||
|
|||
@ManyToOne |
|||
@JoinColumn(name="cat_id", nullable = false) |
|||
private AssetCategory assetCategory; |
|||
|
|||
@Column(name = "eng_question", nullable = false) |
|||
private String engQuestion; |
|||
|
|||
@Column(name = "tamil_question", nullable = false) |
|||
private String tamilQuestion; |
|||
|
|||
@Column(name = "com_group_id", nullable = true) |
|||
private String comGroupId; |
|||
@Column(name = "com_subgroup_id", nullable = true) |
|||
private String comSubGroupId; |
|||
@Column(name = "com_subgroup_name", nullable = true) |
|||
private String comSubGroupName; |
|||
|
|||
@Column(name = "qtype", nullable = false, columnDefinition = "VARCHAR(255) DEFAULT '1'") |
|||
private String qType; |
|||
|
|||
@Column(name = "isactive", nullable = false, columnDefinition = "BOOLEAN DEFAULT true") |
|||
private boolean isActive; |
|||
|
|||
@Column(name = "isdelete", nullable = false, columnDefinition = "BOOLEAN DEFAULT false") |
|||
private boolean isDelete; |
|||
|
|||
@Column(name = "created_by", nullable = false, columnDefinition = "INTEGER DEFAULT 0") |
|||
private Integer createdBy; |
|||
|
|||
@Column(name = "cdate", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") |
|||
private String cDate; |
|||
|
|||
public AssetCategoryQuestions(){ |
|||
|
|||
} |
|||
|
|||
public Integer getCmqId() { |
|||
return cmqId; |
|||
} |
|||
|
|||
public void setCmqId(Integer cmqId) { |
|||
this.cmqId = cmqId; |
|||
} |
|||
|
|||
|
|||
/* |
|||
public Integer getCatId() { |
|||
return catId; |
|||
} |
|||
|
|||
public void setCatId(Integer catId) { |
|||
this.catId = catId; |
|||
} |
|||
*/ |
|||
|
|||
public AssetCategory getAssetCategory() { |
|||
return assetCategory; |
|||
} |
|||
|
|||
public void setAssetCategory(AssetCategory 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 String getqType() { |
|||
return qType; |
|||
} |
|||
|
|||
public void setqType(String qType) { |
|||
this.qType = qType; |
|||
} |
|||
|
|||
public Boolean getIsActive() { |
|||
return isActive; |
|||
} |
|||
|
|||
public void setIsActive(Boolean active) { |
|||
isActive = active; |
|||
} |
|||
|
|||
public Boolean getIsDelete() { |
|||
return isDelete; |
|||
} |
|||
|
|||
public void setIsDelete(Boolean delete) { |
|||
isDelete = delete; |
|||
} |
|||
|
|||
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 String getComGroupId() { |
|||
return comGroupId; |
|||
} |
|||
|
|||
public void setComGroupId(String comGroupId) { |
|||
this.comGroupId = comGroupId; |
|||
} |
|||
|
|||
public String getComSubGroupId() { |
|||
return comSubGroupId; |
|||
} |
|||
|
|||
public void setComSubGroupId(String comSubGroupId) { |
|||
this.comSubGroupId = comSubGroupId; |
|||
} |
|||
|
|||
public String getComSubGroupName() { |
|||
return comSubGroupName; |
|||
} |
|||
|
|||
public void setComSubGroupName(String comSubGroupName) { |
|||
this.comSubGroupName = comSubGroupName; |
|||
} |
|||
} |
|||
@ -0,0 +1,104 @@ |
|||
package com.feedback.it_asset.entity; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
|||
|
|||
import jakarta.persistence.Column; |
|||
import jakarta.persistence.Entity; |
|||
import jakarta.persistence.GeneratedValue; |
|||
import jakarta.persistence.GenerationType; |
|||
import jakarta.persistence.Id; |
|||
import jakarta.persistence.JoinColumn; |
|||
import jakarta.persistence.ManyToOne; |
|||
import jakarta.persistence.Table; |
|||
|
|||
@Entity |
|||
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler"}) |
|||
@Table(name="asset_parameter") |
|||
public class AssetParameter { |
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
@Column(name = "param_id",nullable = false) |
|||
private Integer paramId; |
|||
@ManyToOne |
|||
@JoinColumn(name="cat_id", nullable = false,columnDefinition = "integer Default 0") |
|||
private AssetCategory assetCategory; |
|||
@Column(name = "name",nullable = false) |
|||
private String paramName; |
|||
@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 AssetParameter() { |
|||
} |
|||
|
|||
public AssetParameter(Integer paramId, AssetCategory assetCategory, String paramName, Boolean isDelete, Boolean isActive, Integer createdBy, String cDate) { |
|||
this.paramId = paramId; |
|||
this.assetCategory = assetCategory; |
|||
this.paramName = paramName; |
|||
this.isDelete = isDelete; |
|||
this.isActive = isActive; |
|||
this.createdBy = createdBy; |
|||
this.cDate = cDate; |
|||
} |
|||
|
|||
public Integer getParamId() { |
|||
return paramId; |
|||
} |
|||
|
|||
public void setParamId(Integer 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 getIsDelete() { |
|||
return isDelete; |
|||
} |
|||
|
|||
public void setIsDelete(Boolean isdelete) { |
|||
isDelete = isdelete; |
|||
} |
|||
|
|||
public Boolean getIsActive() { |
|||
return isActive; |
|||
} |
|||
|
|||
public void setIsActive(Boolean isactive) { |
|||
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,138 @@ |
|||
package com.feedback.it_asset.entity; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
|||
import jakarta.persistence.*; |
|||
|
|||
@Entity |
|||
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler"}) |
|||
@Table(name = "asset_parameter_question") |
|||
public class AssetParameterQuestions { |
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
@Column(name = "apq_id", nullable = false) |
|||
private Integer apqId; |
|||
@ManyToOne |
|||
@JoinColumn(name="param_id", nullable = false,columnDefinition = "integer Default 0") |
|||
private AssetParameter assetParameter; |
|||
@Column(name = "eng_question",nullable = false) |
|||
private String engQuestion; |
|||
@Column(name = "tamil_question",nullable = false) |
|||
private String tamilQuestion; |
|||
@Column(name = "qtype",nullable = false,columnDefinition = "VARCHAR(255) Default '1'") |
|||
private String qType; |
|||
@Column(name = "isactive",nullable = false,columnDefinition = "Boolean Default 1") |
|||
private Boolean isActive; |
|||
@Column(name = "isdelete",nullable = false,columnDefinition = "Boolean Default 0") |
|||
private Boolean isDelete; |
|||
@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 = "com_group_id", nullable = true) |
|||
private String comGroupId; |
|||
@Column(name = "com_subgroup_id", nullable = true) |
|||
private String comSubGroupId; |
|||
@Column(name = "com_subgroup_name", nullable = true) |
|||
private String comSubGroupName; |
|||
|
|||
public AssetParameterQuestions(){ |
|||
|
|||
} |
|||
|
|||
public Integer getApqId() { |
|||
return apqId; |
|||
} |
|||
|
|||
public void setApqId(Integer 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 getIsActive() { |
|||
return isActive; |
|||
} |
|||
|
|||
public void setIsActive(Boolean active) { |
|||
isActive = active; |
|||
} |
|||
|
|||
public Boolean getIsDelete() { |
|||
return isDelete; |
|||
} |
|||
|
|||
public void setIsDelete(Boolean delete) { |
|||
isDelete = delete; |
|||
} |
|||
|
|||
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 String getComGroupId() { |
|||
return comGroupId; |
|||
} |
|||
|
|||
public void setComGroupId(String comGroupId) { |
|||
this.comGroupId = comGroupId; |
|||
} |
|||
|
|||
public String getComSubGroupId() { |
|||
return comSubGroupId; |
|||
} |
|||
|
|||
public void setComSubGroupId(String comSubGroupId) { |
|||
this.comSubGroupId = comSubGroupId; |
|||
} |
|||
|
|||
public String getComSubGroupName() { |
|||
return comSubGroupName; |
|||
} |
|||
|
|||
public void setComSubGroupName(String comSubGroupName) { |
|||
this.comSubGroupName = comSubGroupName; |
|||
} |
|||
} |
|||
@ -0,0 +1,186 @@ |
|||
package com.feedback.it_asset.entity; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
|||
|
|||
|
|||
import jakarta.persistence.Column; |
|||
import jakarta.persistence.Entity; |
|||
import jakarta.persistence.GeneratedValue; |
|||
import jakarta.persistence.GenerationType; |
|||
import jakarta.persistence.Id; |
|||
import jakarta.persistence.JoinColumn; |
|||
import jakarta.persistence.ManyToOne; |
|||
import jakarta.persistence.Table; |
|||
|
|||
@Entity |
|||
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler"}) |
|||
@Table(name = "gcc_asset_details") |
|||
public class GccAssetDetails { |
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
@Column(name = "asset_id") |
|||
private Integer assetId; |
|||
|
|||
@ManyToOne |
|||
@JoinColumn(name="cat_id") |
|||
private AssetCategory assetCategory; |
|||
|
|||
@Column(name="department_name") |
|||
private String departmentName; |
|||
|
|||
@Column(name="position") |
|||
private String position; |
|||
|
|||
@Column(name="param_id") |
|||
private String paramId; |
|||
|
|||
@Column(name = "asset_name") |
|||
private String assetName; |
|||
|
|||
@Column(name = "asset_code", nullable = false) |
|||
private String assetCode; |
|||
|
|||
@Column(name = "assign_person", nullable = false) |
|||
private String person; |
|||
|
|||
@Column(name = "asset_latitude", nullable = false) |
|||
private String assetLatitude; |
|||
|
|||
@Column(name = "asset_longitude", nullable = false) |
|||
private String assetLongitude; |
|||
|
|||
@Column(name = "isdelete", nullable = false, columnDefinition = "boolean default false") |
|||
private Boolean isDelete = false; |
|||
|
|||
@Column(name = "isactive", nullable = false, columnDefinition = "boolean default true") |
|||
private Boolean isActive = true; |
|||
|
|||
@Column(name = "created_by", nullable = false, columnDefinition = "integer default 0") |
|||
private Integer createdBy = 0; |
|||
|
|||
@Column(name = "cdate", nullable = false, columnDefinition = "datetime default current_timestamp") |
|||
private String cDate; |
|||
|
|||
|
|||
public Integer getAssetId() { |
|||
return assetId; |
|||
} |
|||
|
|||
public void setAssetId(Integer assetId) { |
|||
this.assetId = assetId; |
|||
} |
|||
|
|||
/* |
|||
public Integer getCatId() { |
|||
return catId; |
|||
} |
|||
|
|||
public void setCatId(Integer catId) { |
|||
this.catId = catId; |
|||
} |
|||
*/ |
|||
|
|||
public AssetCategory getAssetCategory() { |
|||
return assetCategory; |
|||
} |
|||
|
|||
public void setAssetCategory(AssetCategory assetCategory) { |
|||
this.assetCategory = assetCategory; |
|||
} |
|||
|
|||
public String getDepartmentName() { |
|||
return departmentName; |
|||
} |
|||
|
|||
public void setDepartmentName(String departmentName) { |
|||
this.departmentName = departmentName; |
|||
} |
|||
|
|||
public String getPosition() { |
|||
return position; |
|||
} |
|||
|
|||
public void setPosition(String position) { |
|||
this.position = position; |
|||
} |
|||
|
|||
public String getPerson() { |
|||
return person; |
|||
} |
|||
|
|||
public void setPerson(String person) { |
|||
this.person = person; |
|||
} |
|||
|
|||
public String getParamId() { |
|||
return paramId; |
|||
} |
|||
|
|||
public void setParamId(String paramId) { |
|||
this.paramId = paramId; |
|||
} |
|||
|
|||
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 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 getIsDelete() { |
|||
return isDelete; |
|||
} |
|||
|
|||
public void setIsDelete(Boolean delete) { |
|||
isDelete = delete; |
|||
} |
|||
|
|||
public Boolean getIsActive() { |
|||
return isActive; |
|||
} |
|||
|
|||
public void setIsActive(Boolean active) { |
|||
isActive = active; |
|||
} |
|||
|
|||
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,129 @@ |
|||
package com.feedback.it_asset.entity; |
|||
|
|||
import java.sql.Blob; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
|||
|
|||
import jakarta.persistence.Column; |
|||
import jakarta.persistence.Entity; |
|||
import jakarta.persistence.GeneratedValue; |
|||
import jakarta.persistence.GenerationType; |
|||
import jakarta.persistence.Id; |
|||
import jakarta.persistence.JoinColumn; |
|||
import jakarta.persistence.Lob; |
|||
import jakarta.persistence.ManyToOne; |
|||
import jakarta.persistence.Table; |
|||
|
|||
@Entity |
|||
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler"}) |
|||
@Table(name = "gcc_feedback") |
|||
public class GccFeedback { |
|||
|
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
@Column(name = "feedback_id",nullable = false) |
|||
private Integer fbId; |
|||
@ManyToOne |
|||
@JoinColumn(name="asset_id",columnDefinition = "integer Default NULL") |
|||
private GccAssetDetails gccAssetDetails; |
|||
@Column(name = "name",nullable = false) |
|||
private String paramName; |
|||
@Column(name = "mobile",nullable = false) |
|||
private String mobileNo; |
|||
@Column(name = "rating",nullable = false, columnDefinition = "Integer Default 0") |
|||
private Integer ratingVal; |
|||
@Lob |
|||
private Blob file; |
|||
@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 GccFeedback() { |
|||
} |
|||
|
|||
public Integer getFbId() { |
|||
return fbId; |
|||
} |
|||
|
|||
public void setFbId(Integer fbId) { |
|||
this.fbId = fbId; |
|||
} |
|||
|
|||
public GccAssetDetails getGccAssetDetails() { |
|||
return gccAssetDetails; |
|||
} |
|||
|
|||
public void setGccAssetDetails(GccAssetDetails gccAssetDetails) { |
|||
this.gccAssetDetails = gccAssetDetails; |
|||
} |
|||
|
|||
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 Integer getRatingVal() { |
|||
return ratingVal; |
|||
} |
|||
|
|||
public void setRatingVal(Integer ratingVal) { |
|||
this.ratingVal = ratingVal; |
|||
} |
|||
|
|||
public Blob getFile() { |
|||
return file; |
|||
} |
|||
|
|||
public void setFile(Blob file) { |
|||
this.file = file; |
|||
} |
|||
|
|||
public Boolean getDelete() { |
|||
return isDelete; |
|||
} |
|||
|
|||
public void setDelete(Boolean delete) { |
|||
isDelete = delete; |
|||
} |
|||
|
|||
public Boolean getActive() { |
|||
return isActive; |
|||
} |
|||
|
|||
public void setActive(Boolean active) { |
|||
isActive = active; |
|||
} |
|||
|
|||
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,122 @@ |
|||
package com.feedback.it_asset.entity; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
|||
|
|||
import jakarta.persistence.Column; |
|||
import jakarta.persistence.Entity; |
|||
import jakarta.persistence.GeneratedValue; |
|||
import jakarta.persistence.GenerationType; |
|||
import jakarta.persistence.Id; |
|||
import jakarta.persistence.JoinColumn; |
|||
import jakarta.persistence.ManyToOne; |
|||
import jakarta.persistence.Table; |
|||
|
|||
@Entity |
|||
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler"}) |
|||
@Table(name = "gcc_feedback_data") |
|||
public class GccFeedbackData { |
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
@Column(name = "feedbackdata_id",nullable = false) |
|||
private Integer fbdId; |
|||
@ManyToOne |
|||
@JoinColumn(name="feedback_id") |
|||
private GccFeedback gccFeedback; |
|||
@ManyToOne |
|||
@JoinColumn(name="cmq_id") |
|||
private AssetCategoryQuestions assetCategoryQuestions; |
|||
@ManyToOne |
|||
@JoinColumn(name="apq_id") |
|||
private AssetParameterQuestions assetParameterQuestions; |
|||
@Column(name = "feedback") |
|||
private String feedbackAns; |
|||
@Column(name = "complaint_no") |
|||
private String complaintNo; |
|||
@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 = "cdate",nullable = false, columnDefinition = "DATETIME DEFAULT CURRENT_TIMESTAMP") |
|||
private String cDate; |
|||
|
|||
public GccFeedbackData() { |
|||
|
|||
} |
|||
|
|||
public GccFeedbackData(String string, String string2) { |
|||
// TODO Auto-generated constructor stub |
|||
} |
|||
|
|||
public Integer getFbdId() { |
|||
return fbdId; |
|||
} |
|||
|
|||
public void setFbdId(Integer fbdId) { |
|||
this.fbdId = fbdId; |
|||
} |
|||
|
|||
public GccFeedback getGccFeedback() { |
|||
return gccFeedback; |
|||
} |
|||
|
|||
public void setGccFeedback(GccFeedback gccFeedback) { |
|||
this.gccFeedback = gccFeedback; |
|||
} |
|||
|
|||
public AssetCategoryQuestions getAssetCategoryQuestions() { |
|||
return assetCategoryQuestions; |
|||
} |
|||
|
|||
public void setAssetCategoryQuestions(AssetCategoryQuestions assetCategoryQuestions) { |
|||
this.assetCategoryQuestions = assetCategoryQuestions; |
|||
} |
|||
|
|||
public AssetParameterQuestions getAssetParameterQuestions() { |
|||
return assetParameterQuestions; |
|||
} |
|||
|
|||
public void setAssetParameterQuestions(AssetParameterQuestions assetParameterQuestions) { |
|||
this.assetParameterQuestions = assetParameterQuestions; |
|||
} |
|||
|
|||
public String getFeedbackAns() { |
|||
return feedbackAns; |
|||
} |
|||
|
|||
public void setFeedbackAns(String feedbackAns) { |
|||
this.feedbackAns = feedbackAns; |
|||
} |
|||
|
|||
public String getComplaintNo() { |
|||
return complaintNo; |
|||
} |
|||
|
|||
public void setComplaintNo(String complaintNo) { |
|||
this.complaintNo = complaintNo; |
|||
} |
|||
|
|||
public Boolean getDelete() { |
|||
return isDelete; |
|||
} |
|||
|
|||
public void setDelete(Boolean delete) { |
|||
isDelete = delete; |
|||
} |
|||
|
|||
public Boolean getActive() { |
|||
return isActive; |
|||
} |
|||
|
|||
public void setActive(Boolean active) { |
|||
isActive = active; |
|||
} |
|||
|
|||
public String getcDate() { |
|||
return cDate; |
|||
} |
|||
|
|||
public void setcDate(String cDate) { |
|||
this.cDate = cDate; |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,118 @@ |
|||
package com.feedback.it_asset.entity; |
|||
|
|||
import java.sql.Blob; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
|||
|
|||
import jakarta.persistence.Column; |
|||
import jakarta.persistence.Entity; |
|||
import jakarta.persistence.GeneratedValue; |
|||
import jakarta.persistence.GenerationType; |
|||
import jakarta.persistence.Id; |
|||
import jakarta.persistence.JoinColumn; |
|||
import jakarta.persistence.Lob; |
|||
import jakarta.persistence.ManyToOne; |
|||
import jakarta.persistence.Table; |
|||
|
|||
@Entity |
|||
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler"}) |
|||
@Table(name = "gcc_file_Data") |
|||
public class GccFileData { |
|||
|
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
@Column(name = "file_id",nullable = false) |
|||
private Integer fileId; |
|||
|
|||
@ManyToOne |
|||
@JoinColumn(name="asset_id", nullable = false,columnDefinition = "integer Default 0") |
|||
private GccAssetDetails gccAssetDetails; |
|||
|
|||
@Column(name = "fileName", nullable = false) |
|||
private String fileName; |
|||
|
|||
@Lob |
|||
private Blob data; |
|||
|
|||
@Column(name = "isdelete", nullable = false, columnDefinition = "boolean default false") |
|||
private Boolean isdelete = false; |
|||
|
|||
@Column(name = "isactive", nullable = false, columnDefinition = "boolean default true") |
|||
private Boolean isactive = true; |
|||
|
|||
@Column(name = "created_by", nullable = false, columnDefinition = "integer default 0") |
|||
private Integer createdBy = 0; |
|||
|
|||
@Column(name = "cdate", nullable = false, columnDefinition = "datetime default current_timestamp") |
|||
private java.time.LocalDateTime cDate; |
|||
|
|||
public GccFileData() { |
|||
} |
|||
|
|||
public Integer getFileId() { |
|||
return fileId; |
|||
} |
|||
|
|||
public void setFileId(Integer fileId) { |
|||
this.fileId = fileId; |
|||
} |
|||
|
|||
public GccAssetDetails getGccAssetDetails() { |
|||
return gccAssetDetails; |
|||
} |
|||
|
|||
public void setGccAssetDetails(GccAssetDetails gccAssetDetails) { |
|||
this.gccAssetDetails = gccAssetDetails; |
|||
} |
|||
|
|||
public String getFileName() { |
|||
return fileName; |
|||
} |
|||
|
|||
public void setFileName(String fileName) { |
|||
this.fileName = fileName; |
|||
} |
|||
|
|||
public Blob getData() { |
|||
return data; |
|||
} |
|||
|
|||
public void setData(Blob data) { |
|||
this.data = data; |
|||
} |
|||
|
|||
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 java.time.LocalDateTime getcDate() { |
|||
return cDate; |
|||
} |
|||
|
|||
public void setcDate(java.time.LocalDateTime cDate) { |
|||
this.cDate = cDate; |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,40 @@ |
|||
package com.feedback.it_asset.entity; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
|||
|
|||
import jakarta.persistence.Column; |
|||
import jakarta.persistence.Entity; |
|||
import jakarta.persistence.GeneratedValue; |
|||
import jakarta.persistence.GenerationType; |
|||
import jakarta.persistence.Id; |
|||
import jakarta.persistence.Table; |
|||
|
|||
@Entity |
|||
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler"}) |
|||
@Table(name = "roles") |
|||
public class Role { |
|||
@Id |
|||
@Column(name = "role_id") |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
private Integer id; |
|||
|
|||
private String name; |
|||
public Integer getId() { |
|||
return id; |
|||
} |
|||
|
|||
public Role() { |
|||
} |
|||
|
|||
public void setId(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public String getName() { |
|||
return name; |
|||
} |
|||
|
|||
public void setName(String name) { |
|||
this.name = name; |
|||
} |
|||
} |
|||
@ -0,0 +1,133 @@ |
|||
package com.feedback.it_asset.entity; |
|||
|
|||
import java.util.HashSet; |
|||
import java.util.Set; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
|||
|
|||
import jakarta.persistence.CascadeType; |
|||
import jakarta.persistence.Column; |
|||
import jakarta.persistence.Entity; |
|||
import jakarta.persistence.FetchType; |
|||
import jakarta.persistence.Id; |
|||
import jakarta.persistence.JoinColumn; |
|||
import jakarta.persistence.JoinTable; |
|||
import jakarta.persistence.ManyToMany; |
|||
import jakarta.persistence.Table; |
|||
|
|||
@Entity |
|||
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler"}) |
|||
@Table(name = "users") |
|||
public class User { |
|||
@Id |
|||
@Column(name = "user_id") |
|||
private Long id; |
|||
@Column(name = "first_name") |
|||
private String firstName; |
|||
@Column(name = "last_name") |
|||
private String lastName; |
|||
@Column(name = "display_name") |
|||
private String displayName; |
|||
@Column(name = "uname") |
|||
private String userameTxt; |
|||
@Column(name = "pword") |
|||
private String passwordTxt; |
|||
|
|||
@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 = "cdate",nullable = false, columnDefinition = "DATETIME DEFAULT CURRENT_TIMESTAMP") |
|||
private String cDate; |
|||
|
|||
@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) |
|||
@JoinTable( |
|||
name = "users_roles", |
|||
joinColumns = @JoinColumn(name = "user_id"), |
|||
inverseJoinColumns = @JoinColumn(name = "role_id") |
|||
) |
|||
private Set<Role> roles = new HashSet<>(); |
|||
|
|||
public User() { |
|||
} |
|||
|
|||
public Long getId() { |
|||
return id; |
|||
} |
|||
|
|||
public void setId(Long id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public String getFirstName() { |
|||
return firstName; |
|||
} |
|||
|
|||
public void setFirstName(String firstName) { |
|||
this.firstName = firstName; |
|||
} |
|||
|
|||
public String getLastName() { |
|||
return lastName; |
|||
} |
|||
|
|||
public void setLastName(String lastName) { |
|||
this.lastName = lastName; |
|||
} |
|||
|
|||
public String getDisplayName() { |
|||
return displayName; |
|||
} |
|||
|
|||
public void setDisplayName(String displayName) { |
|||
this.displayName = displayName; |
|||
} |
|||
|
|||
public String getUserameTxt() { |
|||
return userameTxt; |
|||
} |
|||
|
|||
public void setUserameTxt(String userameTxt) { |
|||
this.userameTxt = userameTxt; |
|||
} |
|||
|
|||
public String getPasswordTxt() { |
|||
return passwordTxt; |
|||
} |
|||
|
|||
public void setPasswordTxt(String passwordTxt) { |
|||
this.passwordTxt = passwordTxt; |
|||
} |
|||
|
|||
public Boolean getDelete() { |
|||
return isDelete; |
|||
} |
|||
|
|||
public void setDelete(Boolean delete) { |
|||
isDelete = delete; |
|||
} |
|||
|
|||
public Boolean getActive() { |
|||
return isActive; |
|||
} |
|||
|
|||
public void setActive(Boolean active) { |
|||
isActive = active; |
|||
} |
|||
|
|||
public String getcDate() { |
|||
return cDate; |
|||
} |
|||
|
|||
public void setcDate(String cDate) { |
|||
this.cDate = cDate; |
|||
} |
|||
|
|||
public Set<Role> getRoles() { |
|||
return roles; |
|||
} |
|||
|
|||
public void setRoles(Set<Role> roles) { |
|||
this.roles = roles; |
|||
} |
|||
} |
|||
@ -0,0 +1,57 @@ |
|||
package com.feedback.it_asset.entity; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
|||
|
|||
import jakarta.persistence.Entity; |
|||
import jakarta.persistence.GeneratedValue; |
|||
import jakarta.persistence.GenerationType; |
|||
import jakarta.persistence.Id; |
|||
import jakarta.persistence.JoinColumn; |
|||
import jakarta.persistence.ManyToOne; |
|||
import jakarta.persistence.Table; |
|||
|
|||
@Entity |
|||
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler"}) |
|||
@Table(name = "users_roles") |
|||
public class UserRole { |
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
private Long id; |
|||
|
|||
@ManyToOne |
|||
@JoinColumn(name = "user_id", referencedColumnName = "user_id") |
|||
private User user; |
|||
|
|||
@ManyToOne |
|||
@JoinColumn(name = "role_id", referencedColumnName = "role_id") |
|||
private Role role; |
|||
|
|||
// constructor, getters, and setters |
|||
|
|||
public UserRole() { |
|||
} |
|||
|
|||
public Long getId() { |
|||
return id; |
|||
} |
|||
|
|||
public void setId(Long id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public User getUser() { |
|||
return user; |
|||
} |
|||
|
|||
public void setUser(User user) { |
|||
this.user = user; |
|||
} |
|||
|
|||
public Role getRole() { |
|||
return role; |
|||
} |
|||
|
|||
public void setRole(Role role) { |
|||
this.role = role; |
|||
} |
|||
} |
|||
@ -0,0 +1,37 @@ |
|||
package com.feedback.it_asset.repository; |
|||
|
|||
import java.util.List; |
|||
|
|||
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 com.feedback.it_asset.entity.AssetCategoryQuestions; |
|||
|
|||
import jakarta.transaction.Transactional; |
|||
@Repository |
|||
@Transactional |
|||
public interface AssetCategoryQuestionsRep extends JpaRepository<AssetCategoryQuestions, Integer> { |
|||
@Query(value = "SELECT LAST_INSERT_ID()", nativeQuery = true) |
|||
Long getLastInsertedId(); |
|||
@Query(value = "SELECT * FROM `category_master_question` WHERE `isdelete`=0",nativeQuery = true) |
|||
List<AssetCategoryQuestions> showQuestionsAll(); |
|||
@Query(value = "SELECT * FROM `category_master_question` WHERE `cmq_id`=:cmqid",nativeQuery = true) |
|||
List<AssetCategoryQuestions> findByQuestionId(@Param("cmqid") int cmqId); |
|||
@Query(value = "SELECT * FROM `category_master_question` WHERE `cat_id`=:cat_id",nativeQuery = true) |
|||
List<AssetCategoryQuestions> findByCatId(@Param("cat_id") int cat_id); |
|||
@Modifying |
|||
@Query(value ="insert into `category_master_question` (`cat_id`,`eng_question`,`tamil_question`,`isactive`) values (:cat_id, :eng_question, :tamil_question, :isactive)", nativeQuery = true) |
|||
void insertQuestionCategory(@Param("cat_id") Integer cat_id, @Param("eng_question") String engQuestion, @Param("tamil_question") String tamilQuestion, @Param("isactive") boolean isActive); |
|||
@Modifying |
|||
@Query(value ="UPDATE `category_master_question` SET `cat_id`=:cat_id,`eng_question`=:eng_question,`tamil_question`=:tamil_question,`isactive`=:isactive WHERE `cmq_id`=:cmq_id LIMIT 1", nativeQuery = true) |
|||
void updateQuestionCategory(@Param("cmq_id") Integer cmqId, @Param("cat_id") Integer cat_id, @Param("eng_question") String engQuestion, @Param("tamil_question") String tamilQuestion, @Param("isactive") boolean isActive); |
|||
@Modifying |
|||
@Query(value ="UPDATE `category_master_question` SET `com_group_id`=:comGroup, `com_subgroup_id`=:comSubGroup, `com_subgroup_name`=:comSubGroupName WHERE `cmq_id`=:cmq_id LIMIT 1", nativeQuery = true) |
|||
void updateComplaint(@Param("cmq_id") Integer cmqId, @Param("comGroup") String comGroup, @Param("comSubGroup") String comSubGroup, @Param("comSubGroupName") String comSubGroupName); |
|||
@Modifying |
|||
@Query(value="UPDATE `category_master_question` SET `isdelete`=1 WHERE `cmq_id`=:cmq_id LIMIT 1", nativeQuery = true) |
|||
int deleteQuestionCategory(@Param("cmq_id") Integer cmqId); |
|||
} |
|||
@ -0,0 +1,34 @@ |
|||
package com.feedback.it_asset.repository; |
|||
|
|||
import java.util.List; |
|||
|
|||
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 com.feedback.it_asset.entity.AssetCategory; |
|||
|
|||
import jakarta.transaction.Transactional; |
|||
@Repository |
|||
@Transactional |
|||
public interface AssetCategoryRep extends JpaRepository<AssetCategory, Integer>{ |
|||
@Query(value = "SELECT LAST_INSERT_ID()", nativeQuery = true) |
|||
Long getLastInsertedId(); |
|||
@Query(value = "SELECT * FROM `asset_category` WHERE `isdelete`=0",nativeQuery = true) |
|||
List<AssetCategory> showAll(); |
|||
@Query(value = "SELECT * FROM `asset_category` WHERE `cat_id`=:catid",nativeQuery = true) |
|||
List<AssetCategory> findByCategoryId(@Param("catid") int cId); |
|||
@Modifying |
|||
@Query(value ="INSERT INTO `asset_category` (`name`,`isactive`) VALUES (:name, :isactive)", nativeQuery = true) |
|||
void insertCategory(@Param("name") String catName,@Param("isactive") boolean isActive); |
|||
|
|||
@Modifying |
|||
@Query(value ="UPDATE `asset_category` SET `name`= :name, `isactive`= :isactive WHERE `cat_id`=:catid LIMIT 1", nativeQuery = true) |
|||
int updateCategory(@Param("catid") int cId,@Param("name") String catName,@Param("isactive") boolean isActive); |
|||
|
|||
@Modifying |
|||
@Query(value="UPDATE `asset_category` SET `isdelete`=1 WHERE `cat_id`=:catid LIMIT 1", nativeQuery = true) |
|||
int deleteCategory(@Param("catid") int cId); |
|||
} |
|||
@ -0,0 +1,42 @@ |
|||
package com.feedback.it_asset.repository; |
|||
|
|||
import java.util.List; |
|||
|
|||
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 com.feedback.it_asset.entity.AssetParameterQuestions; |
|||
|
|||
import jakarta.transaction.Transactional; |
|||
|
|||
@Repository |
|||
@Transactional |
|||
public interface AssetParameterQuestionsRep extends JpaRepository<AssetParameterQuestions, Integer>{ |
|||
@Query(value = "SELECT LAST_INSERT_ID()", nativeQuery = true) |
|||
Long getLastInsertedId(); |
|||
@Query(value = "SELECT * FROM `asset_parameter_question` WHERE `isdelete`=0",nativeQuery = true) |
|||
List<AssetParameterQuestions> showQuestionsAll(); |
|||
|
|||
@Query(value = "SELECT * FROM `asset_parameter_question` WHERE `apq_id`=:apqid",nativeQuery = true) |
|||
List<AssetParameterQuestions> findByQuestionId(@Param("apqid") int apqId); |
|||
|
|||
@Query(value = "SELECT * FROM `asset_parameter_question` WHERE `param_id` IN (:paramid)",nativeQuery = true) |
|||
List<AssetParameterQuestions> findByParameterId(@Param("paramid") List<Integer> paramId); |
|||
|
|||
@Modifying |
|||
@Query(value ="insert into `asset_parameter_question` (`param_id`,`eng_question`,`tamil_question`,`isactive`) values (:param_id, :eng_question, :tamil_question, :isactive)", nativeQuery = true) |
|||
Integer insertParameterQuestion(@Param("param_id") Integer paramId, @Param("eng_question") String engQuestion, @Param("tamil_question") String tamilQuestion, @Param("isactive") boolean isActive); |
|||
|
|||
@Modifying |
|||
@Query(value ="UPDATE `asset_parameter_question` SET `param_id`=:param_id,`eng_question`=:eng_question,`tamil_question`=:tamil_question,`isactive`=:isactive WHERE `apq_id`=:apq_id LIMIT 1", nativeQuery = true) |
|||
Integer updateParameterQuestion(@Param("apq_id") Integer apqId, @Param("param_id") Integer paramId, @Param("eng_question") String engQuestion, @Param("tamil_question") String tamilQuestion, @Param("isactive") boolean isActive); |
|||
@Modifying |
|||
@Query(value ="UPDATE `asset_parameter_question` SET `com_group_id`=:comGroup, `com_subgroup_id`=:comSubGroup, `com_subgroup_name`=:comSubGroupName WHERE `apq_id`=:apq_id LIMIT 1", nativeQuery = true) |
|||
void updateComplaint(@Param("apq_id") Integer apqId, @Param("comGroup") String comGroup, @Param("comSubGroup") String comSubGroup, @Param("comSubGroupName") String comSubGroupName); |
|||
@Modifying |
|||
@Query(value="UPDATE `asset_parameter_question` SET `isdelete`=1 WHERE `apq_id`=:apq_id LIMIT 1", nativeQuery = true) |
|||
int deleteParameterQuestion(@Param("apq_id") Integer apqId); |
|||
} |
|||
@ -0,0 +1,40 @@ |
|||
package com.feedback.it_asset.repository; |
|||
|
|||
import java.util.List; |
|||
|
|||
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 com.feedback.it_asset.entity.AssetParameter; |
|||
|
|||
import jakarta.transaction.Transactional; |
|||
|
|||
@Repository |
|||
@Transactional |
|||
public interface AssetParameterRep extends JpaRepository<AssetParameter, Integer>{ |
|||
@Query(value = "SELECT LAST_INSERT_ID()", nativeQuery = true) |
|||
Long getLastInsertedId(); |
|||
@Query(value = "SELECT * FROM `asset_parameter` WHERE `isdelete`=0",nativeQuery = true) |
|||
List<AssetParameter> showAll(); |
|||
|
|||
@Query(value = "SELECT * FROM `asset_parameter` WHERE `param_id`=:paramid",nativeQuery = true) |
|||
List<AssetParameter> findByParameterId(@Param("paramid") int paramId); |
|||
|
|||
@Query(value = "SELECT * FROM `asset_parameter` WHERE `cat_id`=:catid",nativeQuery = true) |
|||
List<AssetParameter> findByCategoryId(@Param("catid") int catid); |
|||
|
|||
@Modifying |
|||
@Query(value ="insert into `asset_parameter` (`cat_id`,`name`,`isactive`) values (:cat_id, :name, :isactive)", nativeQuery = true) |
|||
void insertParametert(@Param("cat_id") Integer catId, @Param("name") String paramName, @Param("isactive") boolean isActive); |
|||
|
|||
@Modifying |
|||
@Query(value="UPDATE `asset_parameter` SET `cat_id`=:cat_id,`name`=:name,`isactive`=:isactive WHERE `param_id`=:paramid LIMIT 1", nativeQuery = true) |
|||
int updateParameter(@Param("paramid") Integer paramId,@Param("cat_id") Integer catId, @Param("name") String paramName, @Param("isactive") boolean isActive); |
|||
|
|||
@Modifying |
|||
@Query(value = "UPDATE `asset_parameter` SET `isdelete`=1 WHERE `param_id`=:paramid LIMIT 1", nativeQuery = true) |
|||
int deleteParameter(@Param("paramid") Integer paramId); |
|||
} |
|||
@ -0,0 +1,45 @@ |
|||
package com.feedback.it_asset.repository; |
|||
|
|||
import java.util.List; |
|||
|
|||
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 com.feedback.it_asset.entity.GccAssetDetails; |
|||
|
|||
import jakarta.transaction.Transactional; |
|||
|
|||
@Repository |
|||
@Transactional |
|||
public interface GccAssetDetailsRep extends JpaRepository<GccAssetDetails, Integer>{ |
|||
@Query(value = "SELECT LAST_INSERT_ID()", nativeQuery = true) |
|||
Integer getLastInsertedId(); |
|||
@Query(value = "SELECT * FROM `gcc_asset_details` WHERE `isdelete`=0",nativeQuery = true) |
|||
List<GccAssetDetails> showAll(); |
|||
@Query(value = "SELECT * FROM `gcc_asset_details` WHERE `asset_id`=:assetId",nativeQuery = true) |
|||
List<GccAssetDetails> findByAssetId(@Param("assetId") int assetId); |
|||
@Modifying |
|||
@Query(value ="INSERT INTO `gcc_asset_details`(`asset_latitude`, `asset_longitude`, `asset_name`, `asset_code`, `cat_id`, `department_name`, `position`, `assign_person`, `param_id`) VALUES (:asset_latitude,:asset_longitude,:asset_name,:asset_code,:cat_id,:department_name,:position,:assign_person,:param_id)", nativeQuery = true) |
|||
Integer insertAsset(@Param("asset_latitude") String assetLatitude, @Param("asset_longitude") String assetLongitude, @Param("asset_name") String assetName, @Param("asset_code") String assetCode, @Param("cat_id") int catId, @Param("department_name") String departmentName, @Param("position") String position, @Param("assign_person") String person, @Param("param_id") String paramId); |
|||
@Modifying |
|||
@Query(value ="INSERT INTO `gcc_asset_details`(`asset_latitude`, `asset_longitude`, `asset_name`, `asset_code`, `cat_id`, `department_name`, `position`, `assign_person`, `param_id`) VALUES (:asset_latitude,:asset_longitude,:asset_name,:asset_code,:cat_id,:department_name,:position,:assign_person,:param_id)", nativeQuery = true) |
|||
Integer importAsset(@Param("asset_latitude") String assetLatitude, @Param("asset_longitude") String assetLongitude, @Param("asset_name") String assetName, @Param("asset_code") String assetCode, @Param("cat_id") int catId, @Param("department_name") String departmentName, @Param("position") String position, @Param("assign_person") String person, @Param("param_id") String paramId); |
|||
@Query(value = "SELECT `asset_id` FROM `gcc_asset_details` WHERE `asset_code`=:asset_code LIMIT 1", nativeQuery = true) |
|||
String findByAssetCode(@Param("asset_code") String assetCode); |
|||
|
|||
// @Modifying |
|||
// @Query(value = "DELETE FROM `gcc_asset_details` WHERE `asset_id` = :assetId", nativeQuery = true) |
|||
// void deleteByAssetId(@Param("assetId") int assetId); |
|||
@Modifying |
|||
@Query(value = "UPDATE `gcc_asset_details` set isdelete = 1 WHERE `asset_id` = :assetId", nativeQuery = true) |
|||
int deleteByAssetId(@Param("assetId") int assetId); |
|||
|
|||
@Modifying |
|||
@Query(value ="UPDATE `gcc_asset_details` SET `asset_name`= :asset_name, `department_name`= :department_name,`assign_person`= :assign_person, `position`= :position WHERE `asset_id`=:assetid LIMIT 1", nativeQuery = true) |
|||
int updateAsset(@Param("assetid") int assetId,@Param("asset_name") String assetName,@Param("department_name") String departmentName,@Param("assign_person") String person,@Param("position") String position); |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,91 @@ |
|||
package com.feedback.it_asset.repository; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.stream.Stream; |
|||
|
|||
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 com.feedback.it_asset.entity.GccFeedbackData; |
|||
|
|||
import jakarta.transaction.Transactional; |
|||
|
|||
@Repository |
|||
@Transactional |
|||
public interface GccFeedbackDataRep extends JpaRepository<GccFeedbackData, Integer>{ |
|||
@Query(value = "SELECT LAST_INSERT_ID()", nativeQuery = true) |
|||
Integer getLastInsertedId(); |
|||
@Query(value = "SELECT * FROM `gcc_feedback_data` WHERE `isdelete`=0",nativeQuery = true) |
|||
List<GccFeedbackData> showAll(); |
|||
@Modifying |
|||
@Query(value ="INSERT INTO `gcc_feedback_data`(`feedback_id`, `cmq_id`, `apq_id`,`feedback`,`complaint_no`) VALUES (:feedback_id, :cmq_id, :apq_id, :feedback, :complaint_no)", nativeQuery = true) |
|||
Integer insertFeedback(@Param("feedback_id") Integer feedbackId, @Param("cmq_id") Integer cmqId, @Param("apq_id") Integer apqId, @Param("feedback") String feedback, @Param("complaint_no") String complaint_no); |
|||
@Query(value = "SELECT * FROM `gcc_feedback_data` WHERE `feedback_id`=:feedbackId",nativeQuery = true) |
|||
List<GccFeedbackData> findByfeedbackId(@Param("feedbackId") int feedbackId); |
|||
@Query(value = "SELECT COUNT(*) AS num_rows\n" + |
|||
"FROM (\n" + |
|||
" SELECT feedback_id\n" + |
|||
" FROM gcc_feedback_data\n" + |
|||
" GROUP BY feedback_id\n" + |
|||
" HAVING COUNT(*) = SUM(feedback = '[yes]')\n" + |
|||
") AS subquery;",nativeQuery = true) |
|||
Integer onlyYesCount(); |
|||
@Query(value = "SELECT COUNT(*) AS num_rows\n" + |
|||
"FROM (\n" + |
|||
" SELECT feedback_id\n" + |
|||
" FROM gcc_feedback_data\n" + |
|||
" GROUP BY feedback_id\n" + |
|||
" HAVING COUNT(*) = SUM(feedback = '[no]')\n" + |
|||
") AS subquery;",nativeQuery = true) |
|||
Integer onlyNoCount(); |
|||
|
|||
// @Query(value = "SELECT feedback, cdate FROM `gcc_feedback_data` WHERE YEAR(`cdate`) = 2023", nativeQuery = true) |
|||
// List<GccFeedbackData> showAll1(); |
|||
// |
|||
// @Query(value = "SELECT * FROM `gcc_feedback_data` WHERE `isdelete` = 0 AND `cdate` = :cdate", nativeQuery = true) |
|||
// List<GccFeedbackData> feedbackByDate(@Param("cdate") String cdate); |
|||
// @Query(value = "SELECT feedback, cdate FROM `gcc_feedback_data` WHERE `isdelete` = 0 AND `cdate` = :cDate", nativeQuery = true) |
|||
// List feedbackByDate(@Param("cDate") String cDate); |
|||
// @Query(value = "SELECT * FROM `gcc_feedback_data` WHERE `cdate` = :cdate", nativeQuery = true) |
|||
// List<GccFeedbackData> findByCDate(@Param("cdate") String cdate); |
|||
// List getFeedbackByDate(String cDate); |
|||
|
|||
|
|||
@Query(value = "SELECT feedback,cdate FROM gcc_feedback_data WHERE isdelete = 0", nativeQuery = true) |
|||
List findAllFeedback(); |
|||
|
|||
@Query(value = "SELECT feedback, cdate FROM `gcc_feedback_data` WHERE `isdelete` = 0 AND YEAR(`cdate`) = YEAR(:cdate) AND MONTH(`cdate`) = MONTH(:cdate)", nativeQuery = true) |
|||
Stream<Map<String, Object>> feedbackByMonthStream(@Param("cdate") String cdate); |
|||
|
|||
|
|||
@Query(value = "SELECT COUNT(*) FROM `gcc_feedback_data` WHERE `isdelete` = 0 AND `cdate` = :cDate", nativeQuery = true) |
|||
long countFeedbackByDate(@Param("cDate") String cDate); |
|||
|
|||
@Query(value = "SELECT feedback, cdate FROM `gcc_feedback_data` WHERE `isdelete` = 0 AND `cdate` = :cDate", nativeQuery = true) |
|||
Stream<GccFeedbackData> findFeedbackByDate(@Param("cDate") String cDate); |
|||
|
|||
@Query(value = "SELECT * FROM `gcc_feedback_data` WHERE cdate LIKE :substring%", nativeQuery = true) |
|||
List<GccFeedbackData> countFeedbackByMonth( @Param("substring") String substring); |
|||
|
|||
@Query(value = "SELECT * FROM `gcc_feedback_data` WHERE `isdelete` = 0 AND MONTH(`cdate`) = MONTH(:cDate) AND YEAR(`cdate`) = YEAR(:cDate)", nativeQuery = true) |
|||
List<GccFeedbackData> findFeedbackByMonth(@Param("cDate") String cDate); |
|||
|
|||
|
|||
// @Query(value = "SELECT COUNT(*) FROM `gcc_feedback_data` WHERE MONTH(`cdate`) = MONTH(:cDate) AND feedback = '[yes]'", nativeQuery = true) |
|||
// long countOnlyYesFeedbackByMonth(String cdate); |
|||
// |
|||
// @Query(value = "SELECT COUNT(*) FROM `gcc_feedback_data` WHERE MONTH(`cdate`) = MONTH(:cDate) AND feedback = '[no]'", nativeQuery = true) |
|||
// long countOnlyNoFeedbackByMonth(@Param("cDate") String cDate); |
|||
|
|||
|
|||
@Query(value = "SELECT COUNT(*) FROM `gcc_feedback_data` WHERE feedback = '[yes]'", nativeQuery = true) |
|||
long countOnlyYesFeedback(); |
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
@ -0,0 +1,72 @@ |
|||
package com.feedback.it_asset.repository; |
|||
|
|||
import java.util.List; |
|||
|
|||
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 com.feedback.it_asset.entity.GccFeedback; |
|||
import com.feedback.it_asset.entity.GccFeedbackData; |
|||
|
|||
import jakarta.transaction.Transactional; |
|||
@Repository |
|||
@Transactional |
|||
public interface GccFeedbackRep extends JpaRepository<GccFeedback, Integer>{ |
|||
@Query(value = "SELECT LAST_INSERT_ID()", nativeQuery = true) |
|||
Integer getLastInsertedId(); |
|||
|
|||
@Query(value = "SELECT * FROM `gcc_feedback` WHERE `feedback_id`=:feedbackId",nativeQuery = true) |
|||
List<GccFeedback> findByFeedbackId(@Param("feedbackId") int feedbackId); |
|||
@Modifying |
|||
@Query(value ="INSERT INTO `gcc_feedback`(`asset_id`, `name`, `mobile`, `rating`) VALUES (:asset_id,:name,:mobile,:rating)", nativeQuery = true) |
|||
Integer insertFeedback(@Param("asset_id") int assetid, @Param("name") String name, @Param("mobile") String mobile,@Param("rating") String rating); |
|||
|
|||
@Query(value = "SELECT gf.*\n" + |
|||
"FROM gcc_feedback gf\n" + |
|||
"INNER JOIN gcc_feedback_data gfd ON gf.feedback_id = gfd.feedback_id\n" + |
|||
"GROUP BY gf.feedback_id\n" + |
|||
"HAVING COUNT(*) = SUM(gfd.feedback = '[yes]');",nativeQuery = true) |
|||
List<GccFeedback> findByfeedbackAllYes(); |
|||
|
|||
@Query(value = "SELECT gf.*\n" + |
|||
"FROM gcc_feedback gf\n" + |
|||
"INNER JOIN gcc_feedback_data gfd ON gf.feedback_id = gfd.feedback_id\n" + |
|||
"GROUP BY gf.feedback_id\n" + |
|||
"HAVING COUNT(*) = SUM(gfd.feedback = '[no]');",nativeQuery = true) |
|||
List<GccFeedback> findByfeedbackAllNo(); |
|||
|
|||
@Query(value = "SELECT gf.*\n" + |
|||
"FROM gcc_feedback gf\n" + |
|||
"INNER JOIN gcc_feedback_data gfd ON gf.feedback_id = gfd.feedback_id\n" + |
|||
"GROUP BY gf.feedback_id\n" + |
|||
"HAVING COUNT(*) <> SUM(gfd.feedback = '[yes]')\n" + |
|||
"AND COUNT(*) <> SUM(gfd.feedback = '[no]');",nativeQuery = true) |
|||
List<GccFeedback> findByfeedbackAnyNo(); |
|||
|
|||
@Query(value = "SELECT * FROM `gcc_feedback` WHERE `isdelete`=0 AND WHERE `cdate` BETWEEN :startDate AND :endDate",nativeQuery = true) |
|||
List<GccFeedback> feedbackTotalByDate(@Param("startDate") String startDate, @Param("endDate") String endDate); |
|||
@Query(value = "SELECT * FROM gcc_feedback\n" + |
|||
"WHERE feedback_id = (\n" + |
|||
" SELECT feedback_id\n" + |
|||
" FROM gcc_feedback_data\n" + |
|||
" WHERE cdate BETWEEN :startDate AND :endDate\n" + // Add the date range condition |
|||
" GROUP BY feedback_id\n" + |
|||
" HAVING COUNT(*) = SUM(feedback = :option)\n" + |
|||
");",nativeQuery = true) |
|||
List<GccFeedback> feedbackTotalByOptionDate(@Param("option") String option,@Param("startDate") String startDate, @Param("endDate") String endDate); |
|||
|
|||
|
|||
|
|||
static List<GccFeedbackData> showAll() { |
|||
// TODO Auto-generated method stub |
|||
return null; |
|||
} |
|||
// @Query(value = "SELECT feedback,cdate FROM `gcc_feedback_data` WHERE `isdelete` = 0 AND `cdate` = :cdate", nativeQuery = true) |
|||
// List<GccFeedbackData> feedbackByDate(@Param("cdate") String cdate); |
|||
|
|||
// List<GccFeedback> feedbackByDate(String cdate); |
|||
|
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
package com.feedback.it_asset.repository; |
|||
|
|||
import java.util.List; |
|||
|
|||
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 com.feedback.it_asset.entity.GccFileData; |
|||
|
|||
import jakarta.transaction.Transactional; |
|||
@Repository |
|||
@Transactional |
|||
public interface GccFileDataRep extends JpaRepository<GccFileData, Integer> { |
|||
@Query(value = "SELECT * FROM `gcc_file_Data` WHERE `isdelete`=0 AND `asset_id`=:asset_id",nativeQuery = true) |
|||
List<GccFileData> showFileDataByAssetId(@Param("asset_id") int assetId); |
|||
} |
|||
@ -0,0 +1,17 @@ |
|||
package com.feedback.it_asset.repository; |
|||
|
|||
import java.util.List; |
|||
|
|||
import org.springframework.data.jpa.repository.JpaRepository; |
|||
import org.springframework.data.jpa.repository.Query; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
import com.feedback.it_asset.entity.User; |
|||
|
|||
import jakarta.transaction.Transactional; |
|||
@Repository |
|||
@Transactional |
|||
public interface UserRepository extends JpaRepository<User, Long>{ |
|||
@Query(value = "SELECT * FROM `users` WHERE 1", nativeQuery = true) |
|||
List<User> showAll(); |
|||
} |
|||
@ -0,0 +1,86 @@ |
|||
package com.feedback.it_asset.service; |
|||
|
|||
import java.text.SimpleDateFormat; |
|||
import java.util.AbstractMap; |
|||
import java.util.Arrays; |
|||
import java.util.Calendar; |
|||
import java.util.Date; |
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.stream.Collectors; |
|||
import java.util.stream.Stream; |
|||
|
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.http.ResponseEntity; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import com.feedback.it_asset.entity.GccFeedbackData; |
|||
import com.feedback.it_asset.repository.GccAssetDetailsRep; |
|||
import com.feedback.it_asset.repository.GccFeedbackDataRep; |
|||
|
|||
import jakarta.transaction.Transactional; |
|||
|
|||
@Service |
|||
public class GccAssetService { |
|||
@Autowired |
|||
GccAssetDetailsRep gccAssetDetailsRep; |
|||
@Autowired |
|||
GccFeedbackDataRep gccFeedbackDataRep; |
|||
|
|||
public Integer saveAsset(String assetLatitude, String assetLongitude, String assetName, String assetCode, int catId, String departmentName, String position, String person, String paramId){ |
|||
return gccAssetDetailsRep.insertAsset(assetLatitude,assetLongitude,assetName,assetCode,catId,departmentName,position,person,paramId); |
|||
} |
|||
@Transactional |
|||
public void deleteByAssetName(int assetId) { |
|||
gccAssetDetailsRep.deleteByAssetId(assetId); |
|||
} |
|||
|
|||
|
|||
// public List<Object[]> getFeedbackByDate(String cDate) { |
|||
// return gccFeedbackDataRep.getFeedbackByDate(cDate); |
|||
// } |
|||
public List<Map<String, Object>> getFeedbackAnalysis() { |
|||
List<GccFeedbackData> feedbackDataList = gccFeedbackDataRep.findAll(); |
|||
|
|||
Map<Object, Map<Object, Long>> result = feedbackDataList.stream() |
|||
.filter(feedback -> feedback.getFeedbackAns() != null && feedback.getcDate() != null) |
|||
.map(feedback -> new AbstractMap.SimpleEntry<>(feedback.getFeedbackAns(), getMonth(feedback.getcDate()))) |
|||
.collect(Collectors.groupingBy( |
|||
AbstractMap.SimpleEntry::getKey, |
|||
Collectors.groupingBy( |
|||
AbstractMap.SimpleEntry::getValue, |
|||
Collectors.counting() |
|||
) |
|||
)); |
|||
|
|||
// Convert the result to the desired output format |
|||
List<Map<String, Object>> output = result.entrySet().stream() |
|||
.map(entry -> { |
|||
List<Long> counts = Arrays.asList(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L); |
|||
entry.getValue().forEach((month, count) -> counts.set(Integer.parseInt((String) month) - 1, count)); |
|||
Map<String, Object> outputEntry = new HashMap<>(); |
|||
outputEntry.put((String) entry.getKey(), counts); |
|||
return outputEntry; |
|||
}) |
|||
.collect(Collectors.toList()); |
|||
System.out.println("................neeed"+output); |
|||
return output; |
|||
} |
|||
|
|||
private static String getMonth(String date) { |
|||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|||
try { |
|||
Calendar cal = Calendar.getInstance(); |
|||
cal.setTime(dateFormat.parse(date)); |
|||
return String.valueOf(cal.get(Calendar.MONTH) + 1); // Adding 1 because Calendar.MONTH is zero-based |
|||
} catch (Exception e) { |
|||
e.printStackTrace(); |
|||
return date; |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,30 @@ |
|||
package com.feedback.it_asset.service; |
|||
|
|||
|
|||
import java.util.List; |
|||
|
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import com.feedback.it_asset.repository.AssetCategoryRep; |
|||
|
|||
@Service |
|||
public class MainService { |
|||
@Autowired |
|||
private AssetCategoryRep repo; |
|||
|
|||
public List<com.feedback.it_asset.entity.AssetCategory> listAll(){ |
|||
return repo.findAll(); |
|||
} |
|||
|
|||
public void save(com.feedback.it_asset.entity.AssetCategory category) { |
|||
repo.save(category); |
|||
} |
|||
public com.feedback.it_asset.entity.AssetCategory get(Integer id){ |
|||
return repo.findById(id).get(); |
|||
} |
|||
public void delete(Integer id){ |
|||
repo.deleteById(id); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,44 @@ |
|||
spring.datasource.url=jdbc:mysql://localhost:3306/it_asset |
|||
spring.datasource.username=root |
|||
spring.datasource.password=Sha619!@ |
|||
|
|||
|
|||
#spring.datasource.password=gccroot |
|||
|
|||
app.title=GREATER CHENNAI CORPORATION |
|||
server.port = 8071 |
|||
app.baseUrl=http://localhost:8071 |
|||
app.qrcodeUrl=http://localhost:8071/gcc-complaint |
|||
|
|||
app.getOtpUrl=https://api.onex-aura.com/api/sms? |
|||
app.erpUrl=https://erp.chennaicorporation.gov.in/pgr/external/mobileservice? |
|||
|
|||
app.ptaxid=null |
|||
app.ptaxRegMobile=null |
|||
|
|||
#Hibernate |
|||
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver |
|||
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQLDialect |
|||
#spring.jpa.show-sql=true |
|||
#spring.jpa.properties.hibernate.format_sql=true |
|||
#logging.level.org.hibernate.SQL=DEBUG |
|||
logging.level.org.hibernate.type=TRACE |
|||
#logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE |
|||
#logging.level.org.hibernate.type.descriptor.sql=TRACE |
|||
|
|||
logging.level.org.hibernate.SQL=DEBUG |
|||
logging.level.org.hibernate.orm.jdbc.bind=TRACE |
|||
logging.level.org.hibernate.type.descriptor.sql=TRACE |
|||
|
|||
|
|||
#logging.level.org.springframework.web=DEBUG |
|||
|
|||
#Hibernate auto ddl |
|||
spring.jpa.hibernate.ddl-auto=update |
|||
|
|||
spring.jackson.serialization.fail-on-empty-beans=false |
|||
|
|||
#server.error.include-message= always |
|||
#server.error.include-binding-errors= always |
|||
#server.error.include-stacktrace= |
|||
#server.error.include-exception= false |
|||
@ -0,0 +1,65 @@ |
|||
/* |
|||
* Document : app.js |
|||
* Author : pixelcave |
|||
* Description: Main entry point |
|||
* |
|||
*/ |
|||
|
|||
// Import required modules
|
|||
import Template from './modules/template'; |
|||
|
|||
// App extends Template
|
|||
export default class App extends Template { |
|||
/* |
|||
* Auto called when creating a new instance |
|||
* |
|||
*/ |
|||
constructor() { |
|||
super(); |
|||
} |
|||
|
|||
/* |
|||
* Here you can override or extend any function you want from Template class |
|||
* if you would like to change/extend/remove the default functionality. |
|||
* |
|||
* This way it will be easier for you to update the module files if a new update |
|||
* is released since all your changes will be in here overriding the original ones. |
|||
* |
|||
* Let's have a look at the _uiInit() function, the one that runs the first time |
|||
* we create an instance of Template class or App class which extends it. This function |
|||
* inits all vital functionality but you can change it to fit your own needs. |
|||
* |
|||
*/ |
|||
|
|||
/* |
|||
* EXAMPLE #1 - Removing default functionality by making it empty |
|||
* |
|||
*/ |
|||
|
|||
// _uiInit() {}
|
|||
|
|||
|
|||
/* |
|||
* EXAMPLE #2 - Extending default functionality with additional code |
|||
* |
|||
*/ |
|||
|
|||
// _uiInit() {
|
|||
// // Call original function
|
|||
// super._uiInit();
|
|||
//
|
|||
// // Your extra JS code afterwards
|
|||
// }
|
|||
|
|||
/* |
|||
* EXAMPLE #3 - Replacing default functionality by writing your own code |
|||
* |
|||
*/ |
|||
|
|||
// _uiInit() {
|
|||
// // Your own JS code without ever calling the original function's code
|
|||
// }
|
|||
} |
|||
|
|||
// Create a new instance of App
|
|||
window.Dashmix = new App(); |
|||
1110
src/main/resources/static/assets/_js/main/modules/helpers.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,802 @@ |
|||
/* |
|||
* Document : template.js |
|||
* Author : pixelcave |
|||
* Description: UI Framework custom functionality |
|||
* |
|||
*/ |
|||
|
|||
// Imports
|
|||
import * as bootstrap from 'bootstrap'; |
|||
import SimpleBar from 'simplebar'; |
|||
import Helpers from './helpers'; |
|||
|
|||
// Assignments
|
|||
window.bootstrap = bootstrap; |
|||
window.SimpleBar = SimpleBar; |
|||
|
|||
// Template
|
|||
export default class Template { |
|||
/* |
|||
* Auto called when creating a new instance |
|||
* |
|||
*/ |
|||
constructor() { |
|||
this.onLoad(() => this._uiInit()); |
|||
} |
|||
|
|||
/* |
|||
* Init all vital functionality |
|||
* |
|||
*/ |
|||
_uiInit() { |
|||
// Layout variables
|
|||
this._lHtml = document.documentElement; |
|||
this._lBody = document.body; |
|||
this._lpageLoader = document.getElementById('page-loader'); |
|||
this._lPage = document.getElementById('page-container'); |
|||
this._lSidebar = document.getElementById('sidebar'); |
|||
this._lSidebarScrollCon = this._lSidebar && this._lSidebar.querySelector('.js-sidebar-scroll'); |
|||
this._lSideOverlay = document.getElementById('side-overlay'); |
|||
this._lResize = false; |
|||
this._lHeader = document.getElementById('page-header'); |
|||
this._lHeaderSearch = document.getElementById('page-header-search'); |
|||
this._lHeaderSearchInput = document.getElementById('page-header-search-input'); |
|||
this._lHeaderLoader = document.getElementById('page-header-loader'); |
|||
this._lMain = document.getElementById('main-container'); |
|||
this._lFooter = document.getElementById('page-footer'); |
|||
|
|||
// Helper variables
|
|||
this._lSidebarScroll = false; |
|||
this._lSideOverlayScroll = false; |
|||
|
|||
// Base UI Init
|
|||
this._uiHandleTheme(); |
|||
this._uiHandleDarkMode(); |
|||
this._uiHandleSidebars(); |
|||
this._uiHandleHeader(); |
|||
this._uiHandleNav(); |
|||
|
|||
// API Init
|
|||
this._uiApiLayout(); |
|||
this._uiApiBlocks(); |
|||
|
|||
// Init the following helpers by default
|
|||
this.helpers([ |
|||
'bs-tooltip', |
|||
'bs-popover', |
|||
'dm-toggle-class', |
|||
'dm-year-copy', |
|||
'dm-ripple', |
|||
]); |
|||
|
|||
// Page Loader (hide it)
|
|||
this._uiHandlePageLoader(); |
|||
} |
|||
|
|||
/* |
|||
* Handles sidebar and side overlay scrolling functionality/styles |
|||
* |
|||
*/ |
|||
_uiHandleSidebars(mode = 'init') { |
|||
let self = this; |
|||
|
|||
if (self._lSidebar || self._lSideOverlay) { |
|||
if (mode === 'init') { |
|||
// Add 'side-trans-enabled' class to #page-container (enables sidebar and side overlay transition on open/close)
|
|||
// Fixes IE10, IE11 and Edge bug in which animation was executed on each page load
|
|||
self._lPage.classList.add('side-trans-enabled'); |
|||
|
|||
// Remove side transitions on window resizing
|
|||
window.addEventListener('resize', () => { |
|||
clearTimeout(self._lResize); |
|||
|
|||
self._lPage.classList.remove('side-trans-enabled'); |
|||
|
|||
self._lResize = setTimeout(() => { self._lPage.classList.add('side-trans-enabled'); }, 500); |
|||
}); |
|||
|
|||
// Init custom scrolling
|
|||
this._uiHandleSidebars('custom-scroll'); |
|||
} else if (mode = 'custom-scroll') { |
|||
// If .side-scroll is added to #page-container, enable custom scrolling
|
|||
if (self._lPage.classList.contains('side-scroll')) { |
|||
// Init custom scrolling on Sidebar
|
|||
if ((self._lSidebar) && !self._lSidebarScroll) { |
|||
self._lSidebarScroll = new SimpleBar(self._lSidebarScrollCon); |
|||
} |
|||
|
|||
// Init custom scrolling on Side Overlay
|
|||
if ((self._lSideOverlay) && !self._lSideOverlayScroll) { |
|||
self._lSideOverlayScroll = new SimpleBar(self._lSideOverlay); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
/* |
|||
* Handles header related classes |
|||
* |
|||
*/ |
|||
_uiHandleHeader() { |
|||
let self = this; |
|||
|
|||
// If the header is fixed and has the glass style, add the related class on scrolling to add a background color to the header
|
|||
if (self._lPage.classList.contains('page-header-glass') && self._lPage.classList.contains('page-header-fixed')) { |
|||
window.addEventListener('scroll', e => { |
|||
if (window.scrollY > 60) { |
|||
self._lPage.classList.add('page-header-scroll'); |
|||
} else { |
|||
self._lPage.classList.remove('page-header-scroll'); |
|||
} |
|||
}); |
|||
|
|||
window.dispatchEvent(new CustomEvent('scroll')); |
|||
} |
|||
} |
|||
|
|||
/* |
|||
* Toggle Submenu functionality |
|||
* |
|||
*/ |
|||
_uiHandleNav() { |
|||
let links = document.querySelectorAll('[data-toggle="submenu"]'); |
|||
|
|||
// When a submenu link is clicked
|
|||
if (links) { |
|||
links.forEach(link => { |
|||
link.addEventListener('click', e => { |
|||
e.preventDefault(); |
|||
|
|||
// Get main navigation
|
|||
let mainNav = link.closest('.nav-main'); |
|||
|
|||
// Check if we are in horizontal navigation, large screen and hover is enabled
|
|||
if ( |
|||
!( |
|||
(window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth) > 991 |
|||
&& mainNav.classList.contains('nav-main-horizontal') |
|||
&& mainNav.classList.contains('nav-main-hover') |
|||
) |
|||
) { |
|||
// Get link's parent
|
|||
let parentLi = link.closest('li'); |
|||
|
|||
if (parentLi.classList.contains('open')) { |
|||
// If submenu is open, close it..
|
|||
parentLi.classList.remove('open'); |
|||
|
|||
link.setAttribute('aria-expanded', 'false'); |
|||
} else { |
|||
// .. else if submenu is closed, close all other (same level) submenus first before open it
|
|||
Array.from(link.closest('ul').children).forEach(el => { |
|||
el.classList.remove('open'); |
|||
}); |
|||
|
|||
parentLi.classList.add('open'); |
|||
|
|||
link.setAttribute('aria-expanded', 'true'); |
|||
} |
|||
} |
|||
|
|||
return false; |
|||
}); |
|||
}); |
|||
} |
|||
} |
|||
|
|||
/* |
|||
* Page loading screen functionality |
|||
* |
|||
*/ |
|||
_uiHandlePageLoader(mode = 'hide', colorClass) { |
|||
if (mode === 'show') { |
|||
if (this._lpageLoader) { |
|||
if (colorClass) { |
|||
this._lpageLoader.className = ''; |
|||
this._lpageLoader.classList.add(colorClass); |
|||
} |
|||
|
|||
this._lpageLoader.classList.add('show'); |
|||
} else { |
|||
let pageLoader = document.createElement('div'); |
|||
|
|||
pageLoader.id = 'page-loader'; |
|||
|
|||
if (colorClass) { |
|||
pageLoader.classList.add(colorClass); |
|||
} |
|||
|
|||
pageLoader.classList.add('show'); |
|||
|
|||
this._lPage.insertBefore(pageLoader, this._lPage.firstChild); |
|||
|
|||
this._lpageLoader = document.getElementById('page-loader'); |
|||
} |
|||
} else if (mode === 'hide') { |
|||
if (this._lpageLoader) { |
|||
this._lpageLoader.classList.remove('show'); |
|||
} |
|||
} |
|||
} |
|||
|
|||
/* |
|||
* Saves/Retrieves Dark Mode preference to local storage |
|||
* |
|||
*/ |
|||
_uiHandleDarkMode(mode = 'init') { |
|||
let self = this; |
|||
|
|||
// If dark mode is not enabled by default remember default sidebar
|
|||
// and header style to return to after any possible dark mode disabling
|
|||
if (mode === 'init' && !self._lPage.classList.contains('dark-mode')) { |
|||
if (self._lPage.classList.contains('sidebar-dark')) { |
|||
localStorage.setItem('dashmixDefaultsSidebarDark', true); |
|||
} else { |
|||
localStorage.removeItem('dashmixDefaultsSidebarDark'); |
|||
} |
|||
|
|||
if (self._lPage.classList.contains('page-header-dark')) { |
|||
localStorage.setItem('dashmixDefaultsPageHeaderDark', true); |
|||
} else { |
|||
localStorage.removeItem('dashmixDefaultsPageHeaderDark'); |
|||
} |
|||
} |
|||
|
|||
// If remember-theme class is added in #page-container
|
|||
if (self._lPage.classList.contains('remember-theme')) { |
|||
let darkMode = localStorage.getItem('dashmixDarkMode') || false; |
|||
|
|||
if (mode === 'init') { |
|||
if (darkMode) { |
|||
self._lPage.classList.add('sidebar-dark'); |
|||
self._lPage.classList.add('page-header-dark'); |
|||
self._lPage.classList.add('dark-mode'); |
|||
} else if (mode === 'init') { |
|||
self._lPage.classList.remove('dark-mode'); |
|||
} |
|||
} else if (mode === 'on') { |
|||
localStorage.setItem('dashmixDarkMode', true); |
|||
} else if (mode === 'off') { |
|||
localStorage.removeItem('dashmixDarkMode'); |
|||
} |
|||
} else if (mode === 'init') { |
|||
localStorage.removeItem('dashmixDarkMode'); |
|||
} |
|||
} |
|||
|
|||
/* |
|||
* Set active color theme functionality |
|||
* |
|||
*/ |
|||
_uiHandleTheme() { |
|||
let self = this; |
|||
let themeEl = document.getElementById('css-theme'); |
|||
let rememberTheme = this._lPage.classList.contains('remember-theme') ? true : false; |
|||
|
|||
// If remember theme is enabled
|
|||
if (rememberTheme) { |
|||
let themeName = localStorage.getItem('dashmixThemeName') || false; |
|||
|
|||
// Update color theme
|
|||
if (themeName) { |
|||
self._uiUpdateTheme(themeEl, themeName); |
|||
} |
|||
|
|||
// Update theme element
|
|||
themeEl = document.getElementById('css-theme'); |
|||
} else { |
|||
localStorage.removeItem('dashmixThemeName'); |
|||
} |
|||
|
|||
// Set the active color theme link as active
|
|||
document.querySelectorAll('[data-toggle="theme"][data-theme="' + (themeEl ? themeEl.getAttribute('href') : 'default') + '"]').forEach(link => { |
|||
link.classList.add('active'); |
|||
}); |
|||
|
|||
// When a color theme link is clicked
|
|||
document.querySelectorAll('[data-toggle="theme"]').forEach(el => { |
|||
el.addEventListener('click', e => { |
|||
e.preventDefault(); |
|||
|
|||
// Get element's data
|
|||
let themeName = el.dataset.theme; |
|||
|
|||
// Set this color theme link as active
|
|||
document.querySelectorAll('[data-toggle="theme"]').forEach(link => { |
|||
link.classList.remove('active'); |
|||
}); |
|||
|
|||
document.querySelector('[data-toggle="theme"][data-theme="' + themeName + '"]').classList.add('active'); |
|||
|
|||
// Update color theme
|
|||
self._uiUpdateTheme(themeEl, themeName); |
|||
|
|||
// Update theme element
|
|||
themeEl = document.getElementById('css-theme'); |
|||
|
|||
// If remember theme is enabled, save the new active color theme
|
|||
if (rememberTheme) { |
|||
localStorage.setItem('dashmixThemeName', themeName); |
|||
} |
|||
}); |
|||
}); |
|||
} |
|||
|
|||
/* |
|||
* Updates the color theme |
|||
* |
|||
*/ |
|||
_uiUpdateTheme(themeEl, themeName) { |
|||
if (themeName === 'default') { |
|||
if (themeEl) { |
|||
themeEl.parentNode.removeChild(themeEl); |
|||
} |
|||
} else { |
|||
if (themeEl) { |
|||
themeEl.setAttribute('href', themeName); |
|||
} else { |
|||
let themeLink = document.createElement('link'); |
|||
|
|||
themeLink.id = 'css-theme'; |
|||
themeLink.setAttribute('rel', 'stylesheet'); |
|||
themeLink.setAttribute('href', themeName); |
|||
|
|||
document.getElementById('css-main').insertAdjacentElement('afterend', themeLink); |
|||
} |
|||
} |
|||
} |
|||
|
|||
/* |
|||
* Layout API |
|||
* |
|||
*/ |
|||
_uiApiLayout(mode = 'init') { |
|||
let self = this; |
|||
|
|||
// API with object literals
|
|||
let layoutAPI = { |
|||
init: () => { |
|||
let buttons = document.querySelectorAll('[data-toggle="layout"]'); |
|||
|
|||
// Call layout API on button click
|
|||
if (buttons) { |
|||
buttons.forEach(btn => { |
|||
btn.addEventListener('click', e => { |
|||
self._uiApiLayout(btn.dataset.action); |
|||
}); |
|||
}) |
|||
} |
|||
|
|||
// Prepend Page Overlay div if enabled (used when Side Overlay opens)
|
|||
if (self._lPage.classList.contains('enable-page-overlay')) { |
|||
let pageOverlay = document.createElement('div'); |
|||
pageOverlay.id = 'page-overlay'; |
|||
|
|||
self._lPage.insertBefore(pageOverlay, self._lPage.firstChild); |
|||
|
|||
document.getElementById('page-overlay').addEventListener('click', e => { |
|||
self._uiApiLayout('side_overlay_close'); |
|||
}); |
|||
} |
|||
}, |
|||
sidebar_pos_toggle: () => { |
|||
self._lPage.classList.toggle('sidebar-r'); |
|||
}, |
|||
sidebar_pos_left: () => { |
|||
self._lPage.classList.remove('sidebar-r'); |
|||
}, |
|||
sidebar_pos_right: () => { |
|||
self._lPage.classList.add('sidebar-r'); |
|||
}, |
|||
sidebar_toggle: () => { |
|||
if (window.innerWidth > 991) { |
|||
self._lPage.classList.toggle('sidebar-o'); |
|||
} else { |
|||
self._lPage.classList.toggle('sidebar-o-xs'); |
|||
} |
|||
}, |
|||
sidebar_open: () => { |
|||
if (window.innerWidth > 991) { |
|||
self._lPage.classList.add('sidebar-o'); |
|||
} else { |
|||
self._lPage.classList.add('sidebar-o-xs'); |
|||
} |
|||
}, |
|||
sidebar_close: () => { |
|||
if (window.innerWidth > 991) { |
|||
self._lPage.classList.remove('sidebar-o'); |
|||
} else { |
|||
self._lPage.classList.remove('sidebar-o-xs'); |
|||
} |
|||
}, |
|||
sidebar_mini_toggle: () => { |
|||
if (window.innerWidth > 991) { |
|||
self._lPage.classList.toggle('sidebar-mini'); |
|||
} |
|||
}, |
|||
sidebar_mini_on: () => { |
|||
if (window.innerWidth > 991) { |
|||
self._lPage.classList.add('sidebar-mini'); |
|||
} |
|||
}, |
|||
sidebar_mini_off: () => { |
|||
if (window.innerWidth > 991) { |
|||
self._lPage.classList.remove('sidebar-mini'); |
|||
} |
|||
}, |
|||
sidebar_style_toggle: () => { |
|||
if (self._lPage.classList.contains('sidebar-dark')) { |
|||
self._uiApiLayout('sidebar_style_light'); |
|||
} else { |
|||
self._uiApiLayout('sidebar_style_dark'); |
|||
} |
|||
}, |
|||
sidebar_style_dark: () => { |
|||
self._lPage.classList.add('sidebar-dark'); |
|||
localStorage.setItem('dashmixDefaultsSidebarDark', true); |
|||
}, |
|||
sidebar_style_light: () => { |
|||
self._lPage.classList.remove('sidebar-dark'); |
|||
self._lPage.classList.remove('dark-mode'); |
|||
localStorage.removeItem('dashmixDefaultsSidebarDark'); |
|||
}, |
|||
side_overlay_toggle: () => { |
|||
if (self._lPage.classList.contains('side-overlay-o')) { |
|||
self._uiApiLayout('side_overlay_close'); |
|||
} else { |
|||
self._uiApiLayout('side_overlay_open'); |
|||
} |
|||
}, |
|||
side_overlay_open: () => { |
|||
// When ESCAPE key is hit close the side overlay
|
|||
document.addEventListener('keydown', e => { |
|||
if (e.key === 'Esc' || e.key === 'Escape') { |
|||
self._uiApiLayout('side_overlay_close'); |
|||
} |
|||
}); |
|||
|
|||
self._lPage.classList.add('side-overlay-o'); |
|||
}, |
|||
side_overlay_close: () => { |
|||
self._lPage.classList.remove('side-overlay-o'); |
|||
}, |
|||
side_overlay_mode_hover_toggle: () => { |
|||
self._lPage.classList.toggle('side-overlay-hover'); |
|||
}, |
|||
side_overlay_mode_hover_on: () => { |
|||
self._lPage.classList.add('side-overlay-hover'); |
|||
}, |
|||
side_overlay_mode_hover_off: () => { |
|||
self._lPage.classList.remove('side-overlay-hover'); |
|||
}, |
|||
header_glass_toggle: () => { |
|||
self._lPage.classList.toggle('page-header-glass'); |
|||
self._uiHandleHeader(); |
|||
}, |
|||
header_glass_on: () => { |
|||
self._lPage.classList.add('page-header-glass'); |
|||
self._uiHandleHeader(); |
|||
}, |
|||
header_glass_off: () => { |
|||
self._lPage.classList.remove('page-header-glass'); |
|||
self._uiHandleHeader(); |
|||
}, |
|||
header_mode_toggle: () => { |
|||
self._lPage.classList.toggle('page-header-fixed'); |
|||
}, |
|||
header_mode_static: () => { |
|||
self._lPage.classList.remove('page-header-fixed'); |
|||
}, |
|||
header_mode_fixed: () => { |
|||
self._lPage.classList.add('page-header-fixed'); |
|||
}, |
|||
header_style_toggle: () => { |
|||
if (self._lPage.classList.contains('page-header-dark')) { |
|||
self._uiApiLayout('header_style_light'); |
|||
} else { |
|||
self._uiApiLayout('header_style_dark'); |
|||
} |
|||
}, |
|||
header_style_dark: () => { |
|||
self._lPage.classList.add('page-header-dark'); |
|||
localStorage.setItem('dashmixDefaultsPageHeaderDark', true); |
|||
}, |
|||
header_style_light: () => { |
|||
self._lPage.classList.remove('page-header-dark'); |
|||
self._lPage.classList.remove('dark-mode'); |
|||
localStorage.removeItem('dashmixDefaultsPageHeaderDark'); |
|||
}, |
|||
header_search_on: () => { |
|||
self._lHeaderSearch.classList.add('show'); |
|||
self._lHeaderSearchInput.focus(); |
|||
|
|||
// When ESCAPE key is hit close the search section
|
|||
document.addEventListener('keydown', e => { |
|||
if (e.key === 'Esc' || e.key === 'Escape') { |
|||
self._uiApiLayout('header_search_off'); |
|||
} |
|||
}); |
|||
}, |
|||
header_search_off: () => { |
|||
self._lHeaderSearch.classList.remove('show'); |
|||
self._lHeaderSearchInput.blur(); |
|||
}, |
|||
header_loader_on: () => { |
|||
self._lHeaderLoader.classList.add('show'); |
|||
}, |
|||
header_loader_off: () => { |
|||
self._lHeaderLoader.classList.remove('show'); |
|||
}, |
|||
dark_mode_toggle: () => { |
|||
if (self._lPage.classList.contains('dark-mode')) { |
|||
self._uiApiLayout('dark_mode_off'); |
|||
} else { |
|||
self._uiApiLayout('dark_mode_on'); |
|||
} |
|||
}, |
|||
dark_mode_on: () => { |
|||
self._lPage.classList.add('sidebar-dark'); |
|||
self._lPage.classList.add('page-header-dark'); |
|||
self._lPage.classList.add('dark-mode'); |
|||
this._uiHandleDarkMode('on'); |
|||
}, |
|||
dark_mode_off: () => { |
|||
if (!localStorage.getItem('dashmixDefaultsSidebarDark')) { |
|||
self._lPage.classList.remove('sidebar-dark'); |
|||
} |
|||
|
|||
if (!localStorage.getItem('dashmixDefaultsPageHeaderDark')) { |
|||
self._lPage.classList.remove('page-header-dark'); |
|||
} |
|||
|
|||
self._lPage.classList.remove('dark-mode'); |
|||
this._uiHandleDarkMode('off'); |
|||
}, |
|||
content_layout_toggle: () => { |
|||
if (self._lPage.classList.contains('main-content-boxed')) { |
|||
self._uiApiLayout('content_layout_narrow'); |
|||
} else if (self._lPage.classList.contains('main-content-narrow')) { |
|||
self._uiApiLayout('content_layout_full_width'); |
|||
} else { |
|||
self._uiApiLayout('content_layout_boxed'); |
|||
} |
|||
}, |
|||
content_layout_boxed: () => { |
|||
self._lPage.classList.remove('main-content-narrow'); |
|||
self._lPage.classList.add('main-content-boxed'); |
|||
}, |
|||
content_layout_narrow: () => { |
|||
self._lPage.classList.remove('main-content-boxed'); |
|||
self._lPage.classList.add('main-content-narrow'); |
|||
}, |
|||
content_layout_full_width: () => { |
|||
self._lPage.classList.remove('main-content-boxed'); |
|||
self._lPage.classList.remove('main-content-narrow'); |
|||
} |
|||
}; |
|||
|
|||
// Call layout API
|
|||
if (layoutAPI[mode]) { |
|||
layoutAPI[mode](); |
|||
} |
|||
} |
|||
|
|||
/* |
|||
* Blocks API |
|||
* |
|||
*/ |
|||
_uiApiBlocks(mode = 'init', block = false) { |
|||
let self = this; |
|||
|
|||
// Helper variables
|
|||
let elBlock, btnFullscreen, btnContentToggle; |
|||
|
|||
// Set default icons for fullscreen and content toggle buttons
|
|||
let iconBase = 'si'; |
|||
let iconFullscreen = 'si-size-fullscreen'; |
|||
let iconFullscreenActive = 'si-size-actual'; |
|||
let iconContent = 'si-arrow-up'; |
|||
let iconContentActive = 'si-arrow-down'; |
|||
|
|||
// API with object literals
|
|||
let blockAPI = { |
|||
init: () => { |
|||
// Auto add the default toggle icons to fullscreen and content toggle buttons
|
|||
document.querySelectorAll('[data-toggle="block-option"][data-action="fullscreen_toggle"]').forEach(btn => { |
|||
btn.innerHTML = '<i class="' + iconBase + ' ' + (btn.closest('.block').classList.contains('block-mode-fullscreen') ? iconFullscreenActive : iconFullscreen) + '"></i>'; |
|||
}); |
|||
|
|||
document.querySelectorAll('[data-toggle="block-option"][data-action="content_toggle"]').forEach(btn => { |
|||
btn.innerHTML = '<i class="' + iconBase + ' ' + (btn.closest('.block').classList.contains('block-mode-hidden') ? iconContentActive : iconContent) + '"></i>'; |
|||
}); |
|||
|
|||
// Call blocks API on option button click
|
|||
document.querySelectorAll('[data-toggle="block-option"]').forEach(btn => { |
|||
btn.addEventListener('click', e => { |
|||
this._uiApiBlocks(btn.dataset.action, btn.closest('.block')); |
|||
}); |
|||
}); |
|||
}, |
|||
fullscreen_toggle: () => { |
|||
elBlock.classList.remove('block-mode-pinned'); |
|||
elBlock.classList.toggle('block-mode-fullscreen'); |
|||
|
|||
// Update block option icon
|
|||
if (btnFullscreen) { |
|||
if (elBlock.classList.contains('block-mode-fullscreen')) { |
|||
btnFullscreen && btnFullscreen.querySelector('i').classList.replace(iconFullscreen, iconFullscreenActive); |
|||
} else { |
|||
btnFullscreen && btnFullscreen.querySelector('i').classList.replace(iconFullscreenActive, iconFullscreen); |
|||
} |
|||
} |
|||
}, |
|||
fullscreen_on: () => { |
|||
elBlock.classList.remove('block-mode-pinned') |
|||
elBlock.classList.add('block-mode-fullscreen'); |
|||
|
|||
// Update block option icon
|
|||
btnFullscreen && btnFullscreen.querySelector('i').classList.replace(iconFullscreen, iconFullscreenActive); |
|||
}, |
|||
fullscreen_off: () => { |
|||
elBlock.classList.remove('block-mode-fullscreen'); |
|||
|
|||
// Update block option icon
|
|||
btnFullscreen && btnFullscreen.querySelector('i').classList.replace(iconFullscreenActive, iconFullscreen); |
|||
}, |
|||
content_toggle: () => { |
|||
elBlock.classList.toggle('block-mode-hidden'); |
|||
|
|||
// Update block option icon
|
|||
if (btnContentToggle) { |
|||
if (elBlock.classList.contains('block-mode-hidden')) { |
|||
btnContentToggle.querySelector('i').classList.replace(iconContent, iconContentActive); |
|||
} else { |
|||
btnContentToggle.querySelector('i').classList.replace(iconContentActive, iconContent); |
|||
} |
|||
} |
|||
}, |
|||
content_hide: () => { |
|||
elBlock.classList.add('block-mode-hidden'); |
|||
|
|||
// Update block option icon
|
|||
btnContentToggle && btnContentToggle.querySelector('i').classList.replace(iconContent, iconContentActive); |
|||
}, |
|||
content_show: () => { |
|||
elBlock.classList.remove('block-mode-hidden'); |
|||
|
|||
// Update block option icon
|
|||
btnContentToggle && btnContentToggle.querySelector('i').classList.replace(iconContentActive, iconContent); |
|||
}, |
|||
state_toggle: () => { |
|||
elBlock.classList.toggle('block-mode-loading'); |
|||
|
|||
// Return block to normal state if the demostration mode is on in the refresh option button - data-action-mode="demo"
|
|||
if (elBlock.querySelector('[data-toggle="block-option"][data-action="state_toggle"][data-action-mode="demo"]')) { |
|||
setTimeout(() => { |
|||
elBlock.classList.remove('block-mode-loading'); |
|||
}, 2000); |
|||
} |
|||
}, |
|||
state_loading: () => { |
|||
elBlock.classList.add('block-mode-loading'); |
|||
}, |
|||
state_normal: () => { |
|||
elBlock.classList.remove('block-mode-loading'); |
|||
}, |
|||
pinned_toggle: () => { |
|||
elBlock.classList.remove('block-mode-fullscreen'); |
|||
elBlock.classList.toggle('block-mode-pinned'); |
|||
}, |
|||
pinned_on: () => { |
|||
elBlock.classList.remove('block-mode-fullscreen'); |
|||
elBlock.classList.add('block-mode-pinned'); |
|||
}, |
|||
pinned_off: () => { |
|||
elBlock.classList.remove('block-mode-pinned'); |
|||
}, |
|||
close: () => { |
|||
elBlock.classList.add('d-none'); |
|||
}, |
|||
open: () => { |
|||
elBlock.classList.remove('d-none'); |
|||
} |
|||
}; |
|||
|
|||
if (mode === 'init') { |
|||
// Call Block API
|
|||
blockAPI[mode](); |
|||
} else { |
|||
// Get block element
|
|||
elBlock = (block instanceof Element) ? block : document.querySelector(`${block}`); |
|||
|
|||
// If element exists, procceed with block functionality
|
|||
if (elBlock) { |
|||
// Get block option buttons if exist (need them to update their icons)
|
|||
btnFullscreen = elBlock.querySelector('[data-toggle="block-option"][data-action="fullscreen_toggle"]'); |
|||
btnContentToggle = elBlock.querySelector('[data-toggle="block-option"][data-action="content_toggle"]'); |
|||
|
|||
// Call Block API
|
|||
if (blockAPI[mode]) { |
|||
blockAPI[mode](); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
/* |
|||
******************************************************************************************** |
|||
* |
|||
* Helpers |
|||
* |
|||
********************************************************************************************* |
|||
*/ |
|||
|
|||
/* |
|||
* On DOM content loaded |
|||
* |
|||
*/ |
|||
onLoad(fn) { |
|||
if (document.readyState != 'loading') { |
|||
fn(); |
|||
} else { |
|||
document.addEventListener('DOMContentLoaded', fn); |
|||
} |
|||
} |
|||
|
|||
/* |
|||
******************************************************************************************** |
|||
* |
|||
* Create aliases for easier/quicker access to vital methods |
|||
* |
|||
********************************************************************************************* |
|||
*/ |
|||
|
|||
/* |
|||
* Init base functionality |
|||
* |
|||
*/ |
|||
init() { |
|||
this._uiInit(); |
|||
} |
|||
|
|||
/* |
|||
* Layout API |
|||
* |
|||
*/ |
|||
layout(mode) { |
|||
this._uiApiLayout(mode); |
|||
} |
|||
|
|||
/* |
|||
* Blocks API |
|||
* |
|||
*/ |
|||
block(mode, block) { |
|||
this._uiApiBlocks(mode, block); |
|||
} |
|||
|
|||
/* |
|||
* Handle Page Loader |
|||
* |
|||
*/ |
|||
loader(mode, colorClass) { |
|||
this._uiHandlePageLoader(mode, colorClass); |
|||
} |
|||
|
|||
/* |
|||
* Run Helpers |
|||
* |
|||
*/ |
|||
helpers(helpers, options = {}) { |
|||
Helpers.run(helpers, options); |
|||
} |
|||
|
|||
/* |
|||
* Run Helpers on DOM content loaded |
|||
* |
|||
*/ |
|||
helpersOnLoad(helpers, options = {}) { |
|||
this.onLoad(() => Helpers.run(helpers, options)); |
|||
} |
|||
} |
|||
@ -0,0 +1,179 @@ |
|||
/* |
|||
* Document : be_comp_calendar.js |
|||
* Author : pixelcave |
|||
* Description: Custom JS code used in Calendar Page |
|||
*/ |
|||
|
|||
// Full Calendar, for more examples you can check out http://fullcalendar.io/
|
|||
class pageCompCalendar { |
|||
/* |
|||
* Add event to the events list |
|||
* |
|||
*/ |
|||
static addEvent() { |
|||
let eventInput = document.querySelector('.js-add-event'); |
|||
let eventInputVal = ''; |
|||
|
|||
// When the add event form is submitted
|
|||
document.querySelector('.js-form-add-event').addEventListener('submit', e => { |
|||
e.preventDefault(); |
|||
|
|||
// Get input value
|
|||
eventInputVal = eventInput.value; |
|||
|
|||
// Check if the user entered something
|
|||
if (eventInputVal) { |
|||
let eventList = document.getElementById('js-events'); |
|||
let newEvent = document.createElement('li'); |
|||
let newEventDiv = document.createElement('div'); |
|||
|
|||
// Prepare new event div
|
|||
newEventDiv.classList.add('js-event'); |
|||
newEventDiv.classList.add('p-2'); |
|||
newEventDiv.classList.add('fs-sm'); |
|||
newEventDiv.classList.add('fw-medium'); |
|||
newEventDiv.classList.add('rounded'); |
|||
newEventDiv.classList.add('bg-info-light'); |
|||
newEventDiv.classList.add('text-info'); |
|||
newEventDiv.textContent = eventInputVal; |
|||
|
|||
// Prepare new event li
|
|||
newEvent.appendChild(newEventDiv); |
|||
|
|||
// Add it to the events list
|
|||
eventList.insertBefore(newEvent, eventList.firstChild); |
|||
|
|||
// Clear input field
|
|||
eventInput.value = ''; |
|||
} |
|||
}); |
|||
} |
|||
|
|||
/* |
|||
* Init drag and drop event functionality |
|||
* |
|||
*/ |
|||
static initEvents() { |
|||
new FullCalendar.Draggable(document.getElementById('js-events'), { |
|||
itemSelector: '.js-event', |
|||
eventData: function (eventEl) { |
|||
return { |
|||
title: eventEl.textContent, |
|||
backgroundColor: getComputedStyle(eventEl).color, |
|||
borderColor: getComputedStyle(eventEl).color |
|||
}; |
|||
} |
|||
}); |
|||
} |
|||
|
|||
/* |
|||
* Init calendar demo functionality |
|||
* |
|||
*/ |
|||
static initCalendar() { |
|||
let date = new Date(); |
|||
let d = date.getDate(); |
|||
let m = date.getMonth(); |
|||
let y = date.getFullYear(); |
|||
|
|||
let calendar = new FullCalendar.Calendar(document.getElementById('js-calendar'), { |
|||
themeSystem: 'standard', |
|||
firstDay: 1, |
|||
editable: true, |
|||
droppable: true, |
|||
headerToolbar: { |
|||
left: 'title', |
|||
right: 'prev,next today dayGridMonth,timeGridWeek,timeGridDay,listWeek' |
|||
}, |
|||
drop: function (info) { |
|||
info.draggedEl.parentNode.remove(); |
|||
}, |
|||
events: [ |
|||
{ |
|||
title: 'Gaming Day', |
|||
start: new Date(y, m, 1), |
|||
allDay: true |
|||
}, |
|||
{ |
|||
title: 'Skype Meeting', |
|||
start: new Date(y, m, 3) |
|||
}, |
|||
{ |
|||
title: 'Project X', |
|||
start: new Date(y, m, 9), |
|||
end: new Date(y, m, 12), |
|||
allDay: true, |
|||
color: '#e04f1a' |
|||
}, |
|||
{ |
|||
title: 'Work', |
|||
start: new Date(y, m, 17), |
|||
end: new Date(y, m, 19), |
|||
allDay: true, |
|||
color: '#82b54b' |
|||
}, |
|||
{ |
|||
id: 999, |
|||
title: 'Hiking (repeated)', |
|||
start: new Date(y, m, d - 1, 15, 0) |
|||
}, |
|||
{ |
|||
id: 999, |
|||
title: 'Hiking (repeated)', |
|||
start: new Date(y, m, d + 3, 15, 0) |
|||
}, |
|||
{ |
|||
title: 'Landing Template', |
|||
start: new Date(y, m, d - 3), |
|||
end: new Date(y, m, d - 3), |
|||
allDay: true, |
|||
color: '#ffb119' |
|||
}, |
|||
{ |
|||
title: 'Lunch', |
|||
start: new Date(y, m, d + 7, 15, 0), |
|||
color: '#82b54b' |
|||
}, |
|||
{ |
|||
title: 'Coding', |
|||
start: new Date(y, m, d, 8, 0), |
|||
end: new Date(y, m, d, 14, 0), |
|||
}, |
|||
{ |
|||
title: 'Trip', |
|||
start: new Date(y, m, 25), |
|||
end: new Date(y, m, 27), |
|||
allDay: true, |
|||
color: '#ffb119' |
|||
}, |
|||
{ |
|||
title: 'Reading', |
|||
start: new Date(y, m, d + 8, 20, 0), |
|||
end: new Date(y, m, d + 8, 22, 0) |
|||
}, |
|||
{ |
|||
title: 'Follow us on Twitter', |
|||
start: new Date(y, m, 22), |
|||
allDay: true, |
|||
url: 'http://twitter.com/pixelcave', |
|||
color: '#3c90df' |
|||
} |
|||
] |
|||
}); |
|||
|
|||
calendar.render(); |
|||
} |
|||
|
|||
/* |
|||
* Init functionality |
|||
* |
|||
*/ |
|||
static init() { |
|||
this.addEvent(); |
|||
this.initEvents(); |
|||
this.initCalendar(); |
|||
} |
|||
} |
|||
|
|||
// Initialize when page loads
|
|||
Dashmix.onLoad(() => pageCompCalendar.init()); |
|||
@ -0,0 +1,143 @@ |
|||
/* |
|||
* Document : be_comp_charts.js |
|||
* Author : pixelcave |
|||
* Description: Custom JS code used in Charts Page |
|||
*/ |
|||
|
|||
// Chart.js Charts, for more examples you can check out http://www.chartjs.org/docs
|
|||
class pageCompCharts { |
|||
/* |
|||
* Init Charts |
|||
* |
|||
*/ |
|||
static initChartsChartJS() { |
|||
// Set Global Chart.js configuration
|
|||
Chart.defaults.color = '#818d96'; |
|||
Chart.defaults.scale.grid.color = "rgba(0,0,0,.04)"; |
|||
Chart.defaults.scale.grid.zeroLineColor = "rgba(0,0,0,.1)"; |
|||
Chart.defaults.scale.beginAtZero = true; |
|||
Chart.defaults.elements.line.borderWidth = 2; |
|||
Chart.defaults.elements.point.radius = 5; |
|||
Chart.defaults.elements.point.hoverRadius = 7; |
|||
Chart.defaults.plugins.tooltip.radius = 3; |
|||
Chart.defaults.plugins.legend.labels.boxWidth = 12; |
|||
|
|||
// Get Chart Containers
|
|||
let chartLinesCon = document.getElementById('js-chartjs-lines'); |
|||
let chartBarsCon = document.getElementById('js-chartjs-bars'); |
|||
let chartRadarCon = document.getElementById('js-chartjs-radar'); |
|||
let chartPolarCon = document.getElementById('js-chartjs-polar'); |
|||
let chartPieCon = document.getElementById('js-chartjs-pie'); |
|||
let chartDonutCon = document.getElementById('js-chartjs-donut'); |
|||
|
|||
// Set Chart and Chart Data variables
|
|||
let chartLines, chartBars, chartRadar, chartPolar, chartPie, chartDonut; |
|||
let chartLinesBarsRadarData, chartPolarPieDonutData; |
|||
|
|||
// Lines/Bar/Radar Chart Data
|
|||
chartLinesBarsRadarData = { |
|||
labels: ['MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT', 'SUN'], |
|||
datasets: [ |
|||
{ |
|||
label: 'This Week', |
|||
fill: true, |
|||
backgroundColor: 'rgba(6, 101, 208, .75)', |
|||
borderColor: 'rgba(6, 101, 208, 1)', |
|||
pointBackgroundColor: 'rgba(6, 101, 208, 1)', |
|||
pointBorderColor: '#fff', |
|||
pointHoverBackgroundColor: '#fff', |
|||
pointHoverBorderColor: 'rgba(6, 101, 208, 1)', |
|||
data: [34, 42, 62, 78, 39, 83, 98] |
|||
}, |
|||
{ |
|||
label: 'Last Week', |
|||
fill: true, |
|||
backgroundColor: 'rgba(108, 117, 125, .25)', |
|||
borderColor: 'rgba(108, 117, 125, .75)', |
|||
pointBackgroundColor: 'rgba(108, 117, 125, 1)', |
|||
pointBorderColor: '#fff', |
|||
pointHoverBackgroundColor: '#fff', |
|||
pointHoverBorderColor: 'rgba(108, 117, 125, 1)', |
|||
data: [130, 95, 125, 160, 187, 110, 143] |
|||
} |
|||
] |
|||
}; |
|||
|
|||
// Polar/Pie/Donut Data
|
|||
chartPolarPieDonutData = { |
|||
labels: [ |
|||
'Earnings', |
|||
'Sales', |
|||
'Tickets' |
|||
], |
|||
datasets: [{ |
|||
data: [ |
|||
65, |
|||
15, |
|||
20 |
|||
], |
|||
backgroundColor: [ |
|||
'rgba(141, 196, 81, 1)', |
|||
'rgba(255, 177, 25, 1)', |
|||
'rgba(224, 79, 26, 1)' |
|||
], |
|||
hoverBackgroundColor: [ |
|||
'rgba(141, 196, 81, .5)', |
|||
'rgba(255, 177, 25, .5)', |
|||
'rgba(224, 79, 26, .5)' |
|||
] |
|||
}] |
|||
}; |
|||
|
|||
// Init Charts
|
|||
if (chartLinesCon !== null) { |
|||
chartLines = new Chart(chartLinesCon, {type: 'line', data: chartLinesBarsRadarData, options: { responsive: true, maintainAspectRatio: false, tension: .4 }}); |
|||
} |
|||
|
|||
if (chartBarsCon !== null) { |
|||
chartBars = new Chart(chartBarsCon, {type: 'bar', data: chartLinesBarsRadarData, options: { responsive: true, maintainAspectRatio: false }}); |
|||
} |
|||
|
|||
if (chartRadarCon !== null) { |
|||
chartRadar = new Chart(chartRadarCon, {type: 'radar', data: chartLinesBarsRadarData, options: { responsive: true, maintainAspectRatio: false }}); |
|||
} |
|||
|
|||
if (chartPolarCon !== null) { |
|||
chartPolar = new Chart(chartPolarCon, {type: 'polarArea', data: chartPolarPieDonutData, options: { responsive: true, maintainAspectRatio: false }}); |
|||
} |
|||
|
|||
if (chartPieCon !== null) { |
|||
chartPie = new Chart(chartPieCon, {type: 'pie', data: chartPolarPieDonutData, options: { responsive: true, maintainAspectRatio: false }}); |
|||
} |
|||
|
|||
if (chartDonutCon !== null) { |
|||
chartDonut = new Chart(chartDonutCon, {type: 'doughnut', data: chartPolarPieDonutData, options: { responsive: true, maintainAspectRatio: false }}); |
|||
} |
|||
} |
|||
|
|||
/* |
|||
* Randomize Easy Pie Chart values |
|||
* |
|||
*/ |
|||
static initRandomEasyPieChart() { |
|||
document.querySelectorAll('.js-pie-randomize').forEach(btn => { |
|||
btn.addEventListener('click', e => { |
|||
btn.closest('.block').querySelectorAll('.pie-chart').forEach(chart => { |
|||
jQuery(chart).data('easyPieChart').update(Math.floor((Math.random() * 100) + 1)); |
|||
}); |
|||
}); |
|||
}); |
|||
} |
|||
|
|||
/* |
|||
* Init functionality |
|||
* |
|||
*/ |
|||
static init() { |
|||
this.initChartsChartJS(); |
|||
this.initRandomEasyPieChart(); |
|||
} |
|||
} |
|||
|
|||
// Initialize when page loads
|
|||
Dashmix.onLoad(() => pageCompCharts.init()); |
|||
@ -0,0 +1,156 @@ |
|||
/* |
|||
* Document : be_comp_chat.js |
|||
* Author : pixelcave |
|||
* Description: Custom JS code used in Chat Page |
|||
*/ |
|||
|
|||
// Message Classes
|
|||
let classesMsgBase = ['fs-sm', 'd-inline-block', 'fw-medium', 'animated', 'fadeIn', 'bg-body-light', 'border-3', 'px-3', 'py-2', 'mb-2', 'shadow-sm', 'mw-100'], |
|||
classesMsgSelf = ['border-end', 'border-primary', 'rounded-start', 'text-start'], |
|||
classesMsgOther = ['border-start', 'border-dark', 'rounded-end'], |
|||
classesMsgHeader = ['fs-sm', 'text-muted', 'animated', 'fadeIn', 'my-2']; |
|||
|
|||
class pageCompChat { |
|||
/* |
|||
* Init chat |
|||
* |
|||
*/ |
|||
static initChat() { |
|||
let self = this; |
|||
|
|||
// Set variables
|
|||
let chatForms = document.querySelectorAll('.js-chat-form form'); |
|||
|
|||
// Init form submission
|
|||
chatForms.forEach(form => { |
|||
form.addEventListener('submit', e => { |
|||
// Stop form submission
|
|||
e.preventDefault(); |
|||
|
|||
// Get chat input
|
|||
let chatInput = e.currentTarget.querySelector('.js-chat-input'); |
|||
|
|||
// Add message
|
|||
self.chatAddMessage(parseInt(chatInput.dataset.targetChatId), chatInput.value, 'self', chatInput); |
|||
}); |
|||
}); |
|||
} |
|||
|
|||
/* |
|||
* Add a header message to a chat window |
|||
* |
|||
*/ |
|||
static chatAddHeader(chatId, chatMsg, chatMsgLevel) { |
|||
// Get chat messages window
|
|||
let chatWindow = document.querySelector('.js-chat-messages[data-chat-id="' + chatId + '"]'); |
|||
|
|||
// If header and chat window exists
|
|||
if (chatMsg && chatWindow !== null) { |
|||
// Create new message elements and add the correct classes
|
|||
let newChatMsgCon = document.createElement('div'); |
|||
let newChatMsg = document.createElement('div'); |
|||
|
|||
classesMsgHeader.forEach(cls => { |
|||
newChatMsg.classList.add(cls); |
|||
}); |
|||
|
|||
if (chatMsgLevel === 'self') { |
|||
newChatMsg.classList.add('text-end'); |
|||
newChatMsgCon.classList.add('ms-4'); |
|||
} else { |
|||
newChatMsgCon.classList.add('me-4'); |
|||
} |
|||
|
|||
// Set text message
|
|||
newChatMsg.innerText = chatMsg; |
|||
|
|||
// Append message to chat window
|
|||
newChatMsgCon.appendChild(newChatMsg); |
|||
chatWindow.appendChild(newChatMsgCon); |
|||
|
|||
// Scroll the message list to the bottom
|
|||
chatWindow.scrollTop = chatWindow.scrollHeight; |
|||
} |
|||
} |
|||
|
|||
/* |
|||
* Add a message to a chat window |
|||
* |
|||
*/ |
|||
static chatAddMessage(chatId, chatMsg, chatMsgLevel, chatInput) { |
|||
// Get chat messages window
|
|||
let chatWindow = document.querySelector('.js-chat-messages[data-chat-id="' + chatId + '"]'); |
|||
|
|||
// If message and chat window exists
|
|||
if (chatMsg && chatWindow !== null) { |
|||
// Create new message elements and add the correct classes
|
|||
let newChatMsgCon = document.createElement('div'); |
|||
let newChatMsg = document.createElement('div'); |
|||
|
|||
classesMsgBase.forEach(cls => { |
|||
newChatMsg.classList.add(cls); |
|||
}); |
|||
|
|||
if (chatMsgLevel === 'self') { |
|||
newChatMsgCon.classList.add('text-end'); |
|||
newChatMsgCon.classList.add('ms-4'); |
|||
|
|||
classesMsgSelf.forEach(cls => { |
|||
newChatMsg.classList.add(cls); |
|||
}); |
|||
} else { |
|||
newChatMsgCon.classList.add('me-4'); |
|||
|
|||
classesMsgOther.forEach(cls => { |
|||
newChatMsg.classList.add(cls); |
|||
}); |
|||
} |
|||
|
|||
// Set text message
|
|||
newChatMsg.innerText = chatMsg; |
|||
|
|||
// Append message to chat window
|
|||
newChatMsgCon.appendChild(newChatMsg); |
|||
chatWindow.appendChild(newChatMsgCon); |
|||
|
|||
// Scroll the message list to the bottom
|
|||
chatWindow.scrollTop = chatWindow.scrollHeight; |
|||
|
|||
// If input is set, reset it
|
|||
if (chatInput !== null) { |
|||
chatInput.value = ''; |
|||
} |
|||
} |
|||
} |
|||
|
|||
/* |
|||
* Init functionality |
|||
* |
|||
*/ |
|||
static init() { |
|||
this.initChat(); |
|||
} |
|||
|
|||
/* |
|||
* Add header |
|||
* |
|||
*/ |
|||
static addHeader(chatId, chatMsg, chatMsgLevel = '') { |
|||
this.chatAddHeader(chatId, chatMsg, chatMsgLevel); |
|||
} |
|||
|
|||
/* |
|||
* Add message |
|||
* |
|||
*/ |
|||
static addMessage(chatId, chatMsg, chatMsgLevel = '') { |
|||
this.chatAddMessage(chatId, chatMsg, chatMsgLevel, null); |
|||
} |
|||
} |
|||
|
|||
// Initialize when page loads
|
|||
Dashmix.onLoad(() => { |
|||
pageCompChat.init(); |
|||
|
|||
window.Chat = pageCompChat; |
|||
}); |
|||
@ -0,0 +1,106 @@ |
|||
/* |
|||
* Document : be_comp_dialogs.js |
|||
* Author : pixelcave |
|||
* Description: Custom JS code used in Dialogs Page |
|||
*/ |
|||
|
|||
// SweetAlert2, for more examples you can check out https://github.com/sweetalert2/sweetalert2
|
|||
class pageDialogs { |
|||
/* |
|||
* SweetAlert2 demo functionality |
|||
* |
|||
*/ |
|||
static sweetAlert2() { |
|||
// Set default properties
|
|||
let toast = Swal.mixin({ |
|||
buttonsStyling: false, |
|||
target: '#page-container', |
|||
customClass: { |
|||
confirmButton: 'btn btn-success m-1', |
|||
cancelButton: 'btn btn-danger m-1', |
|||
input: 'form-control' |
|||
} |
|||
}); |
|||
|
|||
// Init a simple dialog on button click
|
|||
document.querySelector('.js-swal-simple').addEventListener('click', e => { |
|||
toast.fire('Hi, this is just a simple message!'); |
|||
}); |
|||
|
|||
// Init an success dialog on button click
|
|||
document.querySelector('.js-swal-success').addEventListener('click', e => { |
|||
toast.fire('Success', 'Everything was updated perfectly!', 'success'); |
|||
}); |
|||
|
|||
// Init an info dialog on button click
|
|||
document.querySelector('.js-swal-info').addEventListener('click', e => { |
|||
toast.fire('Info', 'Just an informational message!', 'info'); |
|||
}); |
|||
|
|||
// Init an warning dialog on button click
|
|||
document.querySelector('.js-swal-warning').addEventListener('click', e => { |
|||
toast.fire('Warning', 'Something needs your attention!', 'warning'); |
|||
}); |
|||
|
|||
// Init an error dialog on button click
|
|||
document.querySelector('.js-swal-error').addEventListener('click', e => { |
|||
toast.fire('Oops...', 'Something went wrong!', 'error'); |
|||
}); |
|||
|
|||
// Init an question dialog on button click
|
|||
document.querySelector('.js-swal-question').addEventListener('click', e => { |
|||
toast.fire('Question', 'Are you sure about that?', 'question'); |
|||
}); |
|||
|
|||
// Init an example confirm dialog on button click
|
|||
document.querySelector('.js-swal-confirm').addEventListener('click', e => { |
|||
toast.fire({ |
|||
title: 'Are you sure?', |
|||
text: 'You will not be able to recover this imaginary file!', |
|||
icon: 'warning', |
|||
showCancelButton: true, |
|||
customClass: { |
|||
confirmButton: 'btn btn-danger m-1', |
|||
cancelButton: 'btn btn-secondary m-1' |
|||
}, |
|||
confirmButtonText: 'Yes, delete it!', |
|||
html: false, |
|||
preConfirm: e => { |
|||
return new Promise(resolve => { |
|||
setTimeout(() => { |
|||
resolve(); |
|||
}, 50); |
|||
}); |
|||
} |
|||
}).then(result => { |
|||
if (result.value) { |
|||
toast.fire('Deleted!', 'Your imaginary file has been deleted.', 'success'); |
|||
// result.dismiss can be 'overlay', 'cancel', 'close', 'esc', 'timer'
|
|||
} else if (result.dismiss === 'cancel') { |
|||
toast.fire('Cancelled', 'Your imaginary file is safe :)', 'error'); |
|||
} |
|||
}); |
|||
}); |
|||
|
|||
// Init an example confirm alert on button click
|
|||
document.querySelector('.js-swal-custom-position').addEventListener('click', e => { |
|||
toast.fire({ |
|||
position: 'top-end', |
|||
title: 'Perfect!', |
|||
text: 'Nice Position!', |
|||
icon: 'success' |
|||
}); |
|||
}); |
|||
} |
|||
|
|||
/* |
|||
* Init functionality |
|||
* |
|||
*/ |
|||
static init() { |
|||
this.sweetAlert2(); |
|||
} |
|||
} |
|||
|
|||
// Initialize when page loads
|
|||
Dashmix.onLoad(() => pageDialogs.init()); |
|||
@ -0,0 +1,88 @@ |
|||
/* |
|||
* Document : be_comp_image_cropper.js |
|||
* Author : pixelcave |
|||
* Description: Custom JS code used in Image Cropper Page |
|||
*/ |
|||
|
|||
// Image Cropper, for more examples you can check out https://fengyuanchen.github.io/cropperjs/
|
|||
class pageCompImageCropper { |
|||
/* |
|||
* Init image cropper demo functionality |
|||
* |
|||
*/ |
|||
static initImageCropper() { |
|||
// Get Image Container
|
|||
let image = document.getElementById('js-img-cropper'); |
|||
|
|||
// Set Options
|
|||
Cropper.setDefaults({ |
|||
aspectRatio: 4 / 3, |
|||
preview: '.js-img-cropper-preview' |
|||
}); |
|||
|
|||
// Init Image Cropper
|
|||
let cropper = new Cropper(image, { |
|||
crop: function (e) { |
|||
// e.detail contains all data required to crop the image server side
|
|||
// You will have to send it to your custom server side script and crop the image there
|
|||
// Since this event is fired each time you set the crop section, you could also use getData()
|
|||
// method on demand. Please check out https://fengyuanchen.github.io/cropperjs/ for more info
|
|||
// console.log(e.detail);
|
|||
} |
|||
}); |
|||
|
|||
// Mini Cropper API
|
|||
document.querySelectorAll('[data-toggle="cropper"]').forEach(btn => { |
|||
btn.addEventListener('click', e => { |
|||
let method = btn.dataset.method || false; |
|||
let option = btn.dataset.option || false; |
|||
|
|||
// Method selection with object literals
|
|||
let cropperAPI = { |
|||
zoom: () => { |
|||
cropper.zoom(option); |
|||
}, |
|||
setDragMode: () => { |
|||
cropper.setDragMode(option); |
|||
}, |
|||
rotate: () => { |
|||
cropper.rotate(option); |
|||
}, |
|||
scaleX: () => { |
|||
cropper.scaleX(option); |
|||
btn.dataset.option = -(option); |
|||
}, |
|||
scaleY: () => { |
|||
cropper.scaleY(option); |
|||
btn.dataset.option = -(option); |
|||
}, |
|||
setAspectRatio: () => { |
|||
cropper.setAspectRatio(option); |
|||
}, |
|||
crop: () => { |
|||
cropper.crop(); |
|||
}, |
|||
clear: () => { |
|||
cropper.clear(); |
|||
} |
|||
}; |
|||
|
|||
// If method exists, execute it
|
|||
if (cropperAPI[method]) { |
|||
cropperAPI[method](); |
|||
} |
|||
}); |
|||
}); |
|||
} |
|||
|
|||
/* |
|||
* Init functionality |
|||
* |
|||
*/ |
|||
static init() { |
|||
this.initImageCropper(); |
|||
} |
|||
} |
|||
|
|||
// Initialize when page loads
|
|||
Dashmix.onLoad(() => pageCompImageCropper.init()); |
|||
@ -0,0 +1,154 @@ |
|||
/* |
|||
* Document : be_comp_maps_vector.js |
|||
* Author : pixelcave |
|||
* Description: Custom JS code used in Vector Maps Page |
|||
*/ |
|||
|
|||
// Set default options for all maps
|
|||
let mapOptions = { |
|||
map: '', |
|||
backgroundColor: '#ffffff', |
|||
regionStyle: { |
|||
initial: { |
|||
fill: '#1F75D5', |
|||
'fill-opacity': 1, |
|||
stroke: 'none', |
|||
'stroke-width': 0, |
|||
'stroke-opacity': 1 |
|||
}, |
|||
hover: { |
|||
'fill-opacity': .8, |
|||
cursor: 'pointer' |
|||
} |
|||
} |
|||
}; |
|||
|
|||
// jVectorMap, for more examples you can check out http://jvectormap.com/documentation/
|
|||
class pageCompMapsVector { |
|||
/* |
|||
* Init World Map |
|||
* |
|||
*/ |
|||
static initMapWorld() { |
|||
// Set Active Map
|
|||
mapOptions['map'] = 'world_mill_en'; |
|||
|
|||
// Init Map
|
|||
jQuery('.js-vector-map-world').vectorMap(mapOptions); |
|||
} |
|||
|
|||
/* |
|||
* Init Europe Map |
|||
* |
|||
*/ |
|||
static initMapEurope() { |
|||
// Set Active Map
|
|||
mapOptions['map'] = 'europe_mill_en'; |
|||
|
|||
// Init Map
|
|||
jQuery('.js-vector-map-europe').vectorMap(mapOptions); |
|||
} |
|||
|
|||
/* |
|||
* Init USA Map |
|||
* |
|||
*/ |
|||
static initMapUsa() { |
|||
// Set Active Map
|
|||
mapOptions['map'] = 'us_aea_en'; |
|||
|
|||
// Init Map
|
|||
jQuery('.js-vector-map-usa').vectorMap(mapOptions); |
|||
} |
|||
|
|||
/* |
|||
* Init India Map |
|||
* |
|||
*/ |
|||
static initMapIndia() { |
|||
// Set Active Map
|
|||
mapOptions['map'] = 'in_mill_en'; |
|||
|
|||
// Init Map
|
|||
jQuery('.js-vector-map-india').vectorMap(mapOptions); |
|||
} |
|||
|
|||
/* |
|||
* Init China Map |
|||
* |
|||
*/ |
|||
static initMapChina() { |
|||
// Set Active Map
|
|||
mapOptions['map'] = 'cn_mill_en'; |
|||
|
|||
// Init Map
|
|||
jQuery('.js-vector-map-china').vectorMap(mapOptions); |
|||
} |
|||
|
|||
/* |
|||
* Init Australia Map |
|||
* |
|||
*/ |
|||
static initMapAustralia() { |
|||
// Set Active Map
|
|||
mapOptions['map'] = 'au_mill_en'; |
|||
|
|||
// Init Map
|
|||
jQuery('.js-vector-map-australia').vectorMap(mapOptions); |
|||
} |
|||
|
|||
/* |
|||
* Init South Africa Map |
|||
* |
|||
*/ |
|||
static initMapSouthAfrica() { |
|||
// Set Active Map
|
|||
mapOptions['map'] = 'za_mill_en'; |
|||
|
|||
// Init Map
|
|||
jQuery('.js-vector-map-south-africa').vectorMap(mapOptions); |
|||
} |
|||
|
|||
/* |
|||
* Init France Map |
|||
* |
|||
*/ |
|||
static initMapFrance() { |
|||
// Set Active Map
|
|||
mapOptions['map'] = 'fr_mill_en'; |
|||
|
|||
// Init Map
|
|||
jQuery('.js-vector-map-france').vectorMap(mapOptions); |
|||
} |
|||
|
|||
/* |
|||
* Init Germany Map |
|||
* |
|||
*/ |
|||
static initMapGermany() { |
|||
// Set Active Map
|
|||
mapOptions['map'] = 'de_mill_en'; |
|||
|
|||
// Init Map
|
|||
jQuery('.js-vector-map-germany').vectorMap(mapOptions); |
|||
} |
|||
|
|||
/* |
|||
* Init functionality |
|||
* |
|||
*/ |
|||
static init() { |
|||
this.initMapWorld(); |
|||
this.initMapEurope(); |
|||
this.initMapUsa(); |
|||
this.initMapIndia(); |
|||
this.initMapChina(); |
|||
this.initMapAustralia(); |
|||
this.initMapSouthAfrica(); |
|||
this.initMapFrance(); |
|||
this.initMapGermany(); |
|||
} |
|||
} |
|||
|
|||
// Initialize when page loads
|
|||
Dashmix.onLoad(() => pageCompMapsVector.init()); |
|||
@ -0,0 +1,47 @@ |
|||
/* |
|||
* Document : be_comp_nestable.js |
|||
* Author : pixelcave |
|||
* Description: Custom JS code used in Nestable Page |
|||
*/ |
|||
|
|||
// Nestable2, for more examples you can check out https://github.com/RamonSmit/Nestable2
|
|||
class pageCompNestable { |
|||
/* |
|||
* Nestable2 demo functionality |
|||
* |
|||
*/ |
|||
static nestable2() { |
|||
// Init Connected Lists
|
|||
jQuery('.js-nestable-connected-simple'). |
|||
add('.js-nestable-connected-icons'). |
|||
add('.js-nestable-connected-treeview').nestable({ |
|||
group: 0 |
|||
}); |
|||
|
|||
// Init Simple List
|
|||
jQuery('.js-nestable-simple').nestable({ |
|||
group: 1 |
|||
}); |
|||
|
|||
// Init Icons List
|
|||
jQuery('.js-nestable-icons').nestable({ |
|||
group: 2 |
|||
}); |
|||
|
|||
// Init Tree View List
|
|||
jQuery('.js-nestable-treeview').nestable({ |
|||
group: 3 |
|||
}); |
|||
} |
|||
|
|||
/* |
|||
* Init functionality |
|||
* |
|||
*/ |
|||
static init() { |
|||
this.nestable2(); |
|||
} |
|||
} |
|||
|
|||
// Initialize when page loads
|
|||
Dashmix.onLoad(() => pageCompNestable.init()); |
|||
@ -0,0 +1,41 @@ |
|||
/* |
|||
* Document : be_comp_onboarding.js |
|||
* Author : pixelcave |
|||
* Description: Custom JS code used in Onboarding Page |
|||
*/ |
|||
|
|||
// Onboarding Modal using Bootstrap Modal and Slick slider
|
|||
class pageCompOnboarding { |
|||
/* |
|||
* Init example onboarding modal functionality |
|||
* |
|||
*/ |
|||
static initOnboardingModal() { |
|||
// Get onboarding modal
|
|||
let modalEl = document.getElementById('modal-onboarding'); |
|||
let modal = new bootstrap.Modal(modalEl); |
|||
|
|||
// Show Onboarding Modal by default
|
|||
modal.show(); |
|||
|
|||
// Re-init Slick Slider every time the modal is shown
|
|||
modalEl.addEventListener('shown.bs.modal', e => { |
|||
// Remove enabled class added by the helper to prevent re-init
|
|||
document.querySelector('#modal-onboarding .js-slider').classList.remove('js-slider-enabled'); |
|||
|
|||
// Re-init Slick Slider
|
|||
Dashmix.helpers('jq-slick'); |
|||
}); |
|||
} |
|||
|
|||
/* |
|||
* Init functionality |
|||
* |
|||
*/ |
|||
static init() { |
|||
this.initOnboardingModal(); |
|||
} |
|||
} |
|||
|
|||
// Initialize when page loads
|
|||
Dashmix.onLoad(() => pageCompOnboarding.init()); |
|||
@ -0,0 +1,50 @@ |
|||
/* |
|||
* Document : be_comp_rating.js |
|||
* Author : pixelcave |
|||
* Description: Custom JS code used in Rating Page |
|||
*/ |
|||
|
|||
// jQuery Raty, for more examples you can check out https://github.com/wbotelhos/raty
|
|||
class pageCompRating { |
|||
/* |
|||
* Init demo rating functionality |
|||
* |
|||
*/ |
|||
static initRating() { |
|||
// Init Raty on .js-rating class
|
|||
jQuery('.js-rating').each((index, element) => { |
|||
let el = jQuery(element); |
|||
|
|||
el.raty({ |
|||
score: el.data('score') || 0, |
|||
number: el.data('number') || 5, |
|||
cancel: el.data('cancel') || false, |
|||
target: el.data('target') || false, |
|||
targetScore: el.data('target-score') || false, |
|||
precision: el.data('precision') || false, |
|||
cancelOff: el.data('cancel-off') || 'fa fa-fw fa-times-circle text-danger', |
|||
cancelOn: el.data('cancel-on') || 'fa fa-fw fa-times-circle', |
|||
starHalf: el.data('star-half') || 'fa fa-fw fa-star-half text-warning', |
|||
starOff: el.data('star-off') || 'fa fa-fw fa-star text-muted', |
|||
starOn: el.data('star-on') || 'fa fa-fw fa-star text-warning', |
|||
starType: 'i', |
|||
hints: ['Just Bad!', 'Almost There!', 'It’s ok!', 'That’s nice!', 'Incredible!'], |
|||
click: function (score, evt) { |
|||
// Here you could add your logic on rating click
|
|||
// console.log('ID: ' + this.id + "\nscore: " + score + "\nevent: " + evt);
|
|||
} |
|||
}); |
|||
}); |
|||
} |
|||
|
|||
/* |
|||
* Init functionality |
|||
* |
|||
*/ |
|||
static init() { |
|||
this.initRating(); |
|||
} |
|||
} |
|||
|
|||
// Initialize when page loads
|
|||
Dashmix.onLoad(() => pageCompRating.init()); |
|||
Some files were not shown because too many files changed in this diff
Write
Preview
Loading…
Cancel
Save
Reference in new issue