-
33.gitignore
-
BIN.mvn/wrapper/maven-wrapper.jar
-
2.mvn/wrapper/maven-wrapper.properties
-
BINcommunityHallDocuments/Celebration/3_reconsileReportimg-2.png
-
BINcommunityHallDocuments/Celebration/4_reconsileReportimg-2.png
-
BINcommunityHallDocuments/Celebration/5_reconsileReportimg-2.png
-
BINcommunityHallDocuments/Mariage/8_Screenshot 2023-10-05 155117.png
-
BINcommunityHallDocuments/Mariage/8_reconsileReportimg-2.png
-
BINcommunityHallDocuments/hallImages/onlineTransactionTable.png
-
BINcommunityHallDocuments/hallImages/payment_refund_process.png
-
308mvnw
-
205mvnw.cmd
-
60pom.xml
-
13src/main/java/com/gcc/communityHall/CommunityHallApplication.java
-
58src/main/java/com/gcc/communityHall/component/UserSessionInterceptor.java
-
80src/main/java/com/gcc/communityHall/configuration/WebConfig.java
-
9src/main/java/com/gcc/communityHall/controller/AdminAPIController.java
-
9src/main/java/com/gcc/communityHall/controller/CareTakerController.java
-
9src/main/java/com/gcc/communityHall/controller/OfficerController.java
-
9src/main/java/com/gcc/communityHall/controller/RestAPIController.java
-
192src/main/java/com/gcc/communityHall/controller/TestController.java
-
13src/main/java/com/gcc/communityHall/controller/UserController.java
-
21src/main/java/com/gcc/communityHall/dto/SaveBooking.java
-
23src/main/java/com/gcc/communityHall/entity/ApplicationLogs.java
-
26src/main/java/com/gcc/communityHall/entity/BookingCalendar.java
-
264src/main/java/com/gcc/communityHall/entity/BookingDetails.java
-
76src/main/java/com/gcc/communityHall/entity/BookingDocuments.java
-
26src/main/java/com/gcc/communityHall/entity/BookingHistory.java
-
32src/main/java/com/gcc/communityHall/entity/Damage.java
-
27src/main/java/com/gcc/communityHall/entity/EbDetails.java
-
27src/main/java/com/gcc/communityHall/entity/GccBlockingDate.java
-
285src/main/java/com/gcc/communityHall/entity/HallDetails.java
-
42src/main/java/com/gcc/communityHall/entity/HallImages.java
-
76src/main/java/com/gcc/communityHall/entity/Login.java
-
22src/main/java/com/gcc/communityHall/entity/Payments.java
-
67src/main/java/com/gcc/communityHall/entity/ReasonDocumentMaster.java
-
60src/main/java/com/gcc/communityHall/entity/ReasonMaster.java
-
18src/main/java/com/gcc/communityHall/entity/RefundTransaction.java
-
27src/main/java/com/gcc/communityHall/entity/Settlement.java
-
64src/main/java/com/gcc/communityHall/entity/SmsSender.java
-
74src/main/java/com/gcc/communityHall/entity/UserHistory.java
-
187src/main/java/com/gcc/communityHall/entity/Users.java
-
47src/main/java/com/gcc/communityHall/others/AppConfig.java
-
50src/main/java/com/gcc/communityHall/others/UserSession.java
-
20src/main/java/com/gcc/communityHall/paymentService/DTO/Merchant.java
-
25src/main/java/com/gcc/communityHall/paymentService/DTO/RefundRequest.java
-
57src/main/java/com/gcc/communityHall/paymentService/DTO/Transaction.java
-
23src/main/java/com/gcc/communityHall/paymentService/DTO/TransactionData.java
-
100src/main/java/com/gcc/communityHall/paymentService/config/PaymentConfig.java
-
157src/main/java/com/gcc/communityHall/paymentService/controller/PaymentAPIController.java
-
139src/main/java/com/gcc/communityHall/paymentService/controller/PaymentController.java
-
81src/main/java/com/gcc/communityHall/paymentService/entity/RefundResponse.java
-
115src/main/java/com/gcc/communityHall/paymentService/entity/TransactionResponse.java
-
31src/main/java/com/gcc/communityHall/paymentService/refund/DTO/ErrorDetails.java
-
99src/main/java/com/gcc/communityHall/paymentService/refund/DTO/PaymentMethod.java
-
172src/main/java/com/gcc/communityHall/paymentService/refund/DTO/PaymentTransaction.java
-
82src/main/java/com/gcc/communityHall/paymentService/refund/DTO/TransactionRefundResponse.java
-
14src/main/java/com/gcc/communityHall/paymentService/repository/TransRefundResRepository.java
-
35src/main/java/com/gcc/communityHall/paymentService/repository/TransactionResponseRepository.java
-
38src/main/java/com/gcc/communityHall/paymentService/service/PaymentGatewayService.java
-
300src/main/java/com/gcc/communityHall/paymentService/service/PaymentGatewayServiceImpl.java
-
37src/main/java/com/gcc/communityHall/paymentService/service/TransactionNumberGenerator.java
-
9src/main/java/com/gcc/communityHall/repository/BookingCalendarRepository.java
-
9src/main/java/com/gcc/communityHall/repository/BookingDetailsRepository.java
-
9src/main/java/com/gcc/communityHall/repository/BookingDocumentsRepository.java
-
9src/main/java/com/gcc/communityHall/repository/BookingHistoryRepository.java
-
9src/main/java/com/gcc/communityHall/repository/DamageRepository.java
-
10src/main/java/com/gcc/communityHall/repository/EbDetailsRepository.java
-
10src/main/java/com/gcc/communityHall/repository/GccBlockingDateRepository.java
-
10src/main/java/com/gcc/communityHall/repository/HallDetailsRepository.java
-
10src/main/java/com/gcc/communityHall/repository/HallImagesRepository.java
-
10src/main/java/com/gcc/communityHall/repository/LoginRepository.java
-
10src/main/java/com/gcc/communityHall/repository/PaymentsRepository.java
-
9src/main/java/com/gcc/communityHall/repository/ReasonDocMasterRepository.java
-
9src/main/java/com/gcc/communityHall/repository/ReasonMasterRepository.java
-
10src/main/java/com/gcc/communityHall/repository/RefundTransactionRepository.java
-
9src/main/java/com/gcc/communityHall/repository/SettlementRepository.java
-
9src/main/java/com/gcc/communityHall/repository/SmsSenderRepository.java
-
9src/main/java/com/gcc/communityHall/repository/UserHistoryRepository.java
-
14src/main/java/com/gcc/communityHall/repository/UsersRepository.java
-
14src/main/java/com/gcc/communityHall/service/BookingService.java
-
4src/main/java/com/gcc/communityHall/service/CalendarService.java
-
31src/main/java/com/gcc/communityHall/service/HallDetailService.java
-
149src/main/java/com/gcc/communityHall/service/Impl/BookingServiceImpl.java
-
4src/main/java/com/gcc/communityHall/service/Impl/CalendarServiceImpl.java
-
114src/main/java/com/gcc/communityHall/service/Impl/HallDetailServiceImpl.java
-
4src/main/java/com/gcc/communityHall/service/Impl/LoginServiceImpl.java
-
43src/main/java/com/gcc/communityHall/service/Impl/ReasonMasterImpl.java
-
4src/main/java/com/gcc/communityHall/service/Impl/TransactionServiceImpl.java
-
80src/main/java/com/gcc/communityHall/service/Impl/UserServiceImpl.java
-
4src/main/java/com/gcc/communityHall/service/LoginService.java
-
9src/main/java/com/gcc/communityHall/service/ReasonMasterService.java
-
4src/main/java/com/gcc/communityHall/service/TransactionService.java
-
16src/main/java/com/gcc/communityHall/service/UserService.java
-
25src/main/resources/application.properties
-
7src/main/resources/paymentConfig.properties
-
59src/main/resources/templates/index.html
-
13src/test/java/com/gcc/communityHall/CommunityHallApplicationTests.java
@ -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 |
|||
|
After Width: 1909 | Height: 925 | Size: 80 KiB |
|
After Width: 1909 | Height: 925 | Size: 80 KiB |
|
After Width: 1909 | Height: 925 | Size: 80 KiB |
|
After Width: 1105 | Height: 817 | Size: 114 KiB |
|
After Width: 1909 | Height: 925 | Size: 80 KiB |
|
After Width: 1920 | Height: 629 | Size: 87 KiB |
|
After Width: 1906 | Height: 987 | Size: 258 KiB |
@ -0,0 +1,308 @@ |
|||
#!/bin/sh |
|||
# ---------------------------------------------------------------------------- |
|||
# Licensed to the Apache Software Foundation (ASF) under one |
|||
# or more contributor license agreements. See the NOTICE file |
|||
# distributed with this work for additional information |
|||
# regarding copyright ownership. The ASF licenses this file |
|||
# to you under the Apache License, Version 2.0 (the |
|||
# "License"); you may not use this file except in compliance |
|||
# with the License. You may obtain a copy of the License at |
|||
# |
|||
# https://www.apache.org/licenses/LICENSE-2.0 |
|||
# |
|||
# Unless required by applicable law or agreed to in writing, |
|||
# software distributed under the License is distributed on an |
|||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|||
# KIND, either express or implied. See the License for the |
|||
# specific language governing permissions and limitations |
|||
# under the License. |
|||
# ---------------------------------------------------------------------------- |
|||
|
|||
# ---------------------------------------------------------------------------- |
|||
# Apache Maven Wrapper startup batch script, version 3.2.0 |
|||
# |
|||
# Required ENV vars: |
|||
# ------------------ |
|||
# JAVA_HOME - location of a JDK home dir |
|||
# |
|||
# Optional ENV vars |
|||
# ----------------- |
|||
# MAVEN_OPTS - parameters passed to the Java VM when running Maven |
|||
# e.g. to debug Maven itself, use |
|||
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 |
|||
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files |
|||
# ---------------------------------------------------------------------------- |
|||
|
|||
if [ -z "$MAVEN_SKIP_RC" ] ; then |
|||
|
|||
if [ -f /usr/local/etc/mavenrc ] ; then |
|||
. /usr/local/etc/mavenrc |
|||
fi |
|||
|
|||
if [ -f /etc/mavenrc ] ; then |
|||
. /etc/mavenrc |
|||
fi |
|||
|
|||
if [ -f "$HOME/.mavenrc" ] ; then |
|||
. "$HOME/.mavenrc" |
|||
fi |
|||
|
|||
fi |
|||
|
|||
# OS specific support. $var _must_ be set to either true or false. |
|||
cygwin=false; |
|||
darwin=false; |
|||
mingw=false |
|||
case "$(uname)" in |
|||
CYGWIN*) cygwin=true ;; |
|||
MINGW*) mingw=true;; |
|||
Darwin*) darwin=true |
|||
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home |
|||
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html |
|||
if [ -z "$JAVA_HOME" ]; then |
|||
if [ -x "/usr/libexec/java_home" ]; then |
|||
JAVA_HOME="$(/usr/libexec/java_home)"; export JAVA_HOME |
|||
else |
|||
JAVA_HOME="/Library/Java/Home"; export JAVA_HOME |
|||
fi |
|||
fi |
|||
;; |
|||
esac |
|||
|
|||
if [ -z "$JAVA_HOME" ] ; then |
|||
if [ -r /etc/gentoo-release ] ; then |
|||
JAVA_HOME=$(java-config --jre-home) |
|||
fi |
|||
fi |
|||
|
|||
# For Cygwin, ensure paths are in UNIX format before anything is touched |
|||
if $cygwin ; then |
|||
[ -n "$JAVA_HOME" ] && |
|||
JAVA_HOME=$(cygpath --unix "$JAVA_HOME") |
|||
[ -n "$CLASSPATH" ] && |
|||
CLASSPATH=$(cygpath --path --unix "$CLASSPATH") |
|||
fi |
|||
|
|||
# For Mingw, ensure paths are in UNIX format before anything is touched |
|||
if $mingw ; then |
|||
[ -n "$JAVA_HOME" ] && [ -d "$JAVA_HOME" ] && |
|||
JAVA_HOME="$(cd "$JAVA_HOME" || (echo "cannot cd into $JAVA_HOME."; exit 1); pwd)" |
|||
fi |
|||
|
|||
if [ -z "$JAVA_HOME" ]; then |
|||
javaExecutable="$(which javac)" |
|||
if [ -n "$javaExecutable" ] && ! [ "$(expr "\"$javaExecutable\"" : '\([^ ]*\)')" = "no" ]; then |
|||
# readlink(1) is not available as standard on Solaris 10. |
|||
readLink=$(which readlink) |
|||
if [ ! "$(expr "$readLink" : '\([^ ]*\)')" = "no" ]; then |
|||
if $darwin ; then |
|||
javaHome="$(dirname "\"$javaExecutable\"")" |
|||
javaExecutable="$(cd "\"$javaHome\"" && pwd -P)/javac" |
|||
else |
|||
javaExecutable="$(readlink -f "\"$javaExecutable\"")" |
|||
fi |
|||
javaHome="$(dirname "\"$javaExecutable\"")" |
|||
javaHome=$(expr "$javaHome" : '\(.*\)/bin') |
|||
JAVA_HOME="$javaHome" |
|||
export JAVA_HOME |
|||
fi |
|||
fi |
|||
fi |
|||
|
|||
if [ -z "$JAVACMD" ] ; then |
|||
if [ -n "$JAVA_HOME" ] ; then |
|||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then |
|||
# IBM's JDK on AIX uses strange locations for the executables |
|||
JAVACMD="$JAVA_HOME/jre/sh/java" |
|||
else |
|||
JAVACMD="$JAVA_HOME/bin/java" |
|||
fi |
|||
else |
|||
JAVACMD="$(\unset -f command 2>/dev/null; \command -v java)" |
|||
fi |
|||
fi |
|||
|
|||
if [ ! -x "$JAVACMD" ] ; then |
|||
echo "Error: JAVA_HOME is not defined correctly." >&2 |
|||
echo " We cannot execute $JAVACMD" >&2 |
|||
exit 1 |
|||
fi |
|||
|
|||
if [ -z "$JAVA_HOME" ] ; then |
|||
echo "Warning: JAVA_HOME environment variable is not set." |
|||
fi |
|||
|
|||
# traverses directory structure from process work directory to filesystem root |
|||
# first directory with .mvn subdirectory is considered project base directory |
|||
find_maven_basedir() { |
|||
if [ -z "$1" ] |
|||
then |
|||
echo "Path not specified to find_maven_basedir" |
|||
return 1 |
|||
fi |
|||
|
|||
basedir="$1" |
|||
wdir="$1" |
|||
while [ "$wdir" != '/' ] ; do |
|||
if [ -d "$wdir"/.mvn ] ; then |
|||
basedir=$wdir |
|||
break |
|||
fi |
|||
# workaround for JBEAP-8937 (on Solaris 10/Sparc) |
|||
if [ -d "${wdir}" ]; then |
|||
wdir=$(cd "$wdir/.." || exit 1; pwd) |
|||
fi |
|||
# end of workaround |
|||
done |
|||
printf '%s' "$(cd "$basedir" || exit 1; pwd)" |
|||
} |
|||
|
|||
# concatenates all lines of a file |
|||
concat_lines() { |
|||
if [ -f "$1" ]; then |
|||
# Remove \r in case we run on Windows within Git Bash |
|||
# and check out the repository with auto CRLF management |
|||
# enabled. Otherwise, we may read lines that are delimited with |
|||
# \r\n and produce $'-Xarg\r' rather than -Xarg due to word |
|||
# splitting rules. |
|||
tr -s '\r\n' ' ' < "$1" |
|||
fi |
|||
} |
|||
|
|||
log() { |
|||
if [ "$MVNW_VERBOSE" = true ]; then |
|||
printf '%s\n' "$1" |
|||
fi |
|||
} |
|||
|
|||
BASE_DIR=$(find_maven_basedir "$(dirname "$0")") |
|||
if [ -z "$BASE_DIR" ]; then |
|||
exit 1; |
|||
fi |
|||
|
|||
MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}; export MAVEN_PROJECTBASEDIR |
|||
log "$MAVEN_PROJECTBASEDIR" |
|||
|
|||
########################################################################################## |
|||
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central |
|||
# This allows using the maven wrapper in projects that prohibit checking in binary data. |
|||
########################################################################################## |
|||
wrapperJarPath="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" |
|||
if [ -r "$wrapperJarPath" ]; then |
|||
log "Found $wrapperJarPath" |
|||
else |
|||
log "Couldn't find $wrapperJarPath, downloading it ..." |
|||
|
|||
if [ -n "$MVNW_REPOURL" ]; then |
|||
wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" |
|||
else |
|||
wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" |
|||
fi |
|||
while IFS="=" read -r key value; do |
|||
# Remove '\r' from value to allow usage on windows as IFS does not consider '\r' as a separator ( considers space, tab, new line ('\n'), and custom '=' ) |
|||
safeValue=$(echo "$value" | tr -d '\r') |
|||
case "$key" in (wrapperUrl) wrapperUrl="$safeValue"; break ;; |
|||
esac |
|||
done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" |
|||
log "Downloading from: $wrapperUrl" |
|||
|
|||
if $cygwin; then |
|||
wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath") |
|||
fi |
|||
|
|||
if command -v wget > /dev/null; then |
|||
log "Found wget ... using wget" |
|||
[ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--quiet" |
|||
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then |
|||
wget $QUIET "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" |
|||
else |
|||
wget $QUIET --http-user="$MVNW_USERNAME" --http-password="$MVNW_PASSWORD" "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" |
|||
fi |
|||
elif command -v curl > /dev/null; then |
|||
log "Found curl ... using curl" |
|||
[ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--silent" |
|||
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then |
|||
curl $QUIET -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath" |
|||
else |
|||
curl $QUIET --user "$MVNW_USERNAME:$MVNW_PASSWORD" -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath" |
|||
fi |
|||
else |
|||
log "Falling back to using Java to download" |
|||
javaSource="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.java" |
|||
javaClass="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.class" |
|||
# For Cygwin, switch paths to Windows format before running javac |
|||
if $cygwin; then |
|||
javaSource=$(cygpath --path --windows "$javaSource") |
|||
javaClass=$(cygpath --path --windows "$javaClass") |
|||
fi |
|||
if [ -e "$javaSource" ]; then |
|||
if [ ! -e "$javaClass" ]; then |
|||
log " - Compiling MavenWrapperDownloader.java ..." |
|||
("$JAVA_HOME/bin/javac" "$javaSource") |
|||
fi |
|||
if [ -e "$javaClass" ]; then |
|||
log " - Running MavenWrapperDownloader.java ..." |
|||
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$wrapperUrl" "$wrapperJarPath") || rm -f "$wrapperJarPath" |
|||
fi |
|||
fi |
|||
fi |
|||
fi |
|||
########################################################################################## |
|||
# End of extension |
|||
########################################################################################## |
|||
|
|||
# If specified, validate the SHA-256 sum of the Maven wrapper jar file |
|||
wrapperSha256Sum="" |
|||
while IFS="=" read -r key value; do |
|||
case "$key" in (wrapperSha256Sum) wrapperSha256Sum=$value; break ;; |
|||
esac |
|||
done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" |
|||
if [ -n "$wrapperSha256Sum" ]; then |
|||
wrapperSha256Result=false |
|||
if command -v sha256sum > /dev/null; then |
|||
if echo "$wrapperSha256Sum $wrapperJarPath" | sha256sum -c > /dev/null 2>&1; then |
|||
wrapperSha256Result=true |
|||
fi |
|||
elif command -v shasum > /dev/null; then |
|||
if echo "$wrapperSha256Sum $wrapperJarPath" | shasum -a 256 -c > /dev/null 2>&1; then |
|||
wrapperSha256Result=true |
|||
fi |
|||
else |
|||
echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." |
|||
echo "Please install either command, or disable validation by removing 'wrapperSha256Sum' from your maven-wrapper.properties." |
|||
exit 1 |
|||
fi |
|||
if [ $wrapperSha256Result = false ]; then |
|||
echo "Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised." >&2 |
|||
echo "Investigate or delete $wrapperJarPath to attempt a clean download." >&2 |
|||
echo "If you updated your Maven version, you need to update the specified wrapperSha256Sum property." >&2 |
|||
exit 1 |
|||
fi |
|||
fi |
|||
|
|||
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" |
|||
|
|||
# For Cygwin, switch paths to Windows format before running java |
|||
if $cygwin; then |
|||
[ -n "$JAVA_HOME" ] && |
|||
JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME") |
|||
[ -n "$CLASSPATH" ] && |
|||
CLASSPATH=$(cygpath --path --windows "$CLASSPATH") |
|||
[ -n "$MAVEN_PROJECTBASEDIR" ] && |
|||
MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR") |
|||
fi |
|||
|
|||
# Provide a "standardized" way to retrieve the CLI args that will |
|||
# work with both Windows and non-Windows executions. |
|||
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*" |
|||
export MAVEN_CMD_LINE_ARGS |
|||
|
|||
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain |
|||
|
|||
# shellcheck disable=SC2086 # safe args |
|||
exec "$JAVACMD" \ |
|||
$MAVEN_OPTS \ |
|||
$MAVEN_DEBUG_OPTS \ |
|||
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ |
|||
"-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ |
|||
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" |
|||
@ -0,0 +1,205 @@ |
|||
@REM ---------------------------------------------------------------------------- |
|||
@REM Licensed to the Apache Software Foundation (ASF) under one |
|||
@REM or more contributor license agreements. See the NOTICE file |
|||
@REM distributed with this work for additional information |
|||
@REM regarding copyright ownership. The ASF licenses this file |
|||
@REM to you under the Apache License, Version 2.0 (the |
|||
@REM "License"); you may not use this file except in compliance |
|||
@REM with the License. You may obtain a copy of the License at |
|||
@REM |
|||
@REM https://www.apache.org/licenses/LICENSE-2.0 |
|||
@REM |
|||
@REM Unless required by applicable law or agreed to in writing, |
|||
@REM software distributed under the License is distributed on an |
|||
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|||
@REM KIND, either express or implied. See the License for the |
|||
@REM specific language governing permissions and limitations |
|||
@REM under the License. |
|||
@REM ---------------------------------------------------------------------------- |
|||
|
|||
@REM ---------------------------------------------------------------------------- |
|||
@REM Apache Maven Wrapper startup batch script, version 3.2.0 |
|||
@REM |
|||
@REM Required ENV vars: |
|||
@REM JAVA_HOME - location of a JDK home dir |
|||
@REM |
|||
@REM Optional ENV vars |
|||
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands |
|||
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending |
|||
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven |
|||
@REM e.g. to debug Maven itself, use |
|||
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 |
|||
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files |
|||
@REM ---------------------------------------------------------------------------- |
|||
|
|||
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' |
|||
@echo off |
|||
@REM set title of command window |
|||
title %0 |
|||
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' |
|||
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% |
|||
|
|||
@REM set %HOME% to equivalent of $HOME |
|||
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") |
|||
|
|||
@REM Execute a user defined script before this one |
|||
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre |
|||
@REM check for pre script, once with legacy .bat ending and once with .cmd ending |
|||
if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* |
|||
if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* |
|||
:skipRcPre |
|||
|
|||
@setlocal |
|||
|
|||
set ERROR_CODE=0 |
|||
|
|||
@REM To isolate internal variables from possible post scripts, we use another setlocal |
|||
@setlocal |
|||
|
|||
@REM ==== START VALIDATION ==== |
|||
if not "%JAVA_HOME%" == "" goto OkJHome |
|||
|
|||
echo. |
|||
echo Error: JAVA_HOME not found in your environment. >&2 |
|||
echo Please set the JAVA_HOME variable in your environment to match the >&2 |
|||
echo location of your Java installation. >&2 |
|||
echo. |
|||
goto error |
|||
|
|||
:OkJHome |
|||
if exist "%JAVA_HOME%\bin\java.exe" goto init |
|||
|
|||
echo. |
|||
echo Error: JAVA_HOME is set to an invalid directory. >&2 |
|||
echo JAVA_HOME = "%JAVA_HOME%" >&2 |
|||
echo Please set the JAVA_HOME variable in your environment to match the >&2 |
|||
echo location of your Java installation. >&2 |
|||
echo. |
|||
goto error |
|||
|
|||
@REM ==== END VALIDATION ==== |
|||
|
|||
:init |
|||
|
|||
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". |
|||
@REM Fallback to current working directory if not found. |
|||
|
|||
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% |
|||
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir |
|||
|
|||
set EXEC_DIR=%CD% |
|||
set WDIR=%EXEC_DIR% |
|||
:findBaseDir |
|||
IF EXIST "%WDIR%"\.mvn goto baseDirFound |
|||
cd .. |
|||
IF "%WDIR%"=="%CD%" goto baseDirNotFound |
|||
set WDIR=%CD% |
|||
goto findBaseDir |
|||
|
|||
:baseDirFound |
|||
set MAVEN_PROJECTBASEDIR=%WDIR% |
|||
cd "%EXEC_DIR%" |
|||
goto endDetectBaseDir |
|||
|
|||
:baseDirNotFound |
|||
set MAVEN_PROJECTBASEDIR=%EXEC_DIR% |
|||
cd "%EXEC_DIR%" |
|||
|
|||
:endDetectBaseDir |
|||
|
|||
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig |
|||
|
|||
@setlocal EnableExtensions EnableDelayedExpansion |
|||
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a |
|||
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% |
|||
|
|||
:endReadAdditionalConfig |
|||
|
|||
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" |
|||
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" |
|||
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain |
|||
|
|||
set WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" |
|||
|
|||
FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( |
|||
IF "%%A"=="wrapperUrl" SET WRAPPER_URL=%%B |
|||
) |
|||
|
|||
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central |
|||
@REM This allows using the maven wrapper in projects that prohibit checking in binary data. |
|||
if exist %WRAPPER_JAR% ( |
|||
if "%MVNW_VERBOSE%" == "true" ( |
|||
echo Found %WRAPPER_JAR% |
|||
) |
|||
) else ( |
|||
if not "%MVNW_REPOURL%" == "" ( |
|||
SET WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" |
|||
) |
|||
if "%MVNW_VERBOSE%" == "true" ( |
|||
echo Couldn't find %WRAPPER_JAR%, downloading it ... |
|||
echo Downloading from: %WRAPPER_URL% |
|||
) |
|||
|
|||
powershell -Command "&{"^ |
|||
"$webclient = new-object System.Net.WebClient;"^ |
|||
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ |
|||
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ |
|||
"}"^ |
|||
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%WRAPPER_URL%', '%WRAPPER_JAR%')"^ |
|||
"}" |
|||
if "%MVNW_VERBOSE%" == "true" ( |
|||
echo Finished downloading %WRAPPER_JAR% |
|||
) |
|||
) |
|||
@REM End of extension |
|||
|
|||
@REM If specified, validate the SHA-256 sum of the Maven wrapper jar file |
|||
SET WRAPPER_SHA_256_SUM="" |
|||
FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( |
|||
IF "%%A"=="wrapperSha256Sum" SET WRAPPER_SHA_256_SUM=%%B |
|||
) |
|||
IF NOT %WRAPPER_SHA_256_SUM%=="" ( |
|||
powershell -Command "&{"^ |
|||
"$hash = (Get-FileHash \"%WRAPPER_JAR%\" -Algorithm SHA256).Hash.ToLower();"^ |
|||
"If('%WRAPPER_SHA_256_SUM%' -ne $hash){"^ |
|||
" Write-Output 'Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised.';"^ |
|||
" Write-Output 'Investigate or delete %WRAPPER_JAR% to attempt a clean download.';"^ |
|||
" Write-Output 'If you updated your Maven version, you need to update the specified wrapperSha256Sum property.';"^ |
|||
" exit 1;"^ |
|||
"}"^ |
|||
"}" |
|||
if ERRORLEVEL 1 goto error |
|||
) |
|||
|
|||
@REM Provide a "standardized" way to retrieve the CLI args that will |
|||
@REM work with both Windows and non-Windows executions. |
|||
set MAVEN_CMD_LINE_ARGS=%* |
|||
|
|||
%MAVEN_JAVA_EXE% ^ |
|||
%JVM_CONFIG_MAVEN_PROPS% ^ |
|||
%MAVEN_OPTS% ^ |
|||
%MAVEN_DEBUG_OPTS% ^ |
|||
-classpath %WRAPPER_JAR% ^ |
|||
"-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ |
|||
%WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* |
|||
if ERRORLEVEL 1 goto error |
|||
goto end |
|||
|
|||
:error |
|||
set ERROR_CODE=1 |
|||
|
|||
:end |
|||
@endlocal & set ERROR_CODE=%ERROR_CODE% |
|||
|
|||
if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost |
|||
@REM check for post script, once with legacy .bat ending and once with .cmd ending |
|||
if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" |
|||
if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" |
|||
:skipRcPost |
|||
|
|||
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' |
|||
if "%MAVEN_BATCH_PAUSE%"=="on" pause |
|||
|
|||
if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% |
|||
|
|||
cmd /C exit /B %ERROR_CODE% |
|||
@ -0,0 +1,60 @@ |
|||
<?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.2.3</version> |
|||
<relativePath/> <!-- lookup parent from repository --> |
|||
</parent> |
|||
<groupId>com.gcc</groupId> |
|||
<artifactId>communityHall</artifactId> |
|||
<version>0.0.1-SNAPSHOT</version> |
|||
<name>communityHall</name> |
|||
<description>Community Hall Project developed by GCC</description> |
|||
<properties> |
|||
<java.version>17</java.version> |
|||
</properties> |
|||
<dependencies> |
|||
<dependency> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-starter-data-jpa</artifactId> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-starter-thymeleaf</artifactId> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-starter-web</artifactId> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>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> |
|||
|
|||
<dependency> |
|||
<groupId>com.google.code.gson</groupId> |
|||
<artifactId>gson</artifactId> |
|||
<version>2.10.1</version> |
|||
</dependency> |
|||
</dependencies> |
|||
|
|||
<build> |
|||
<plugins> |
|||
<plugin> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-maven-plugin</artifactId> |
|||
</plugin> |
|||
</plugins> |
|||
</build> |
|||
|
|||
</project> |
|||
@ -0,0 +1,13 @@ |
|||
package com.gcc.communityHall; |
|||
|
|||
import org.springframework.boot.SpringApplication; |
|||
import org.springframework.boot.autoconfigure.SpringBootApplication; |
|||
|
|||
@SpringBootApplication |
|||
public class CommunityHallApplication { |
|||
|
|||
public static void main(String[] args) { |
|||
SpringApplication.run(CommunityHallApplication.class, args); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,58 @@ |
|||
package com.gcc.communityHall.component; |
|||
|
|||
|
|||
import com.gcc.communityHall.others.AppConfig; |
|||
import com.gcc.communityHall.others.UserSession; |
|||
import jakarta.servlet.http.HttpServletRequest; |
|||
import jakarta.servlet.http.HttpServletResponse; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
import org.springframework.web.servlet.HandlerInterceptor; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
|
|||
@Component |
|||
public class UserSessionInterceptor implements HandlerInterceptor { |
|||
|
|||
@Autowired |
|||
private UserSession userSession; |
|||
@Autowired |
|||
private AppConfig appConfig; |
|||
private static final List<String> EXCLUDED_URLS = Arrays.asList("/login", "/"); |
|||
@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,80 @@ |
|||
package com.gcc.communityHall.configuration; |
|||
|
|||
|
|||
import com.gcc.communityHall.component.UserSessionInterceptor; |
|||
import com.gcc.communityHall.entity.ReasonMaster; |
|||
import com.gcc.communityHall.repository.ReasonMasterRepository; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.beans.factory.annotation.Value; |
|||
import org.springframework.context.annotation.Configuration; |
|||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; |
|||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; |
|||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
|||
|
|||
import java.io.File; |
|||
import java.util.List; |
|||
|
|||
@Configuration |
|||
public class WebConfig implements WebMvcConfigurer { |
|||
private final String uploadDirectory; |
|||
private final String hallImageUploadDirectory; |
|||
|
|||
@Autowired |
|||
private ReasonMasterRepository reasonMasterRepository; |
|||
|
|||
@Autowired |
|||
public WebConfig( |
|||
@Value("${file.upload.directory}") String uploadDirectory, |
|||
@Value("${file.hall.upload.directory}") String hallImageUploadDirectory |
|||
) |
|||
{ |
|||
this.hallImageUploadDirectory=hallImageUploadDirectory; |
|||
this.uploadDirectory = uploadDirectory; |
|||
} |
|||
@Autowired |
|||
private UserSessionInterceptor userSessionInterceptor; |
|||
@Override |
|||
public void addInterceptors(InterceptorRegistry registry) { |
|||
registry.addInterceptor(userSessionInterceptor); |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
@Override |
|||
public void addResourceHandlers(ResourceHandlerRegistry registry) { |
|||
System.out.println(uploadDirectory); |
|||
File f = new File(uploadDirectory); |
|||
File imgDir = new File(hallImageUploadDirectory); |
|||
List<ReasonMaster> reasonMasters =reasonMasterRepository.findAll(); |
|||
|
|||
if(!f.exists()) { |
|||
f.mkdirs(); |
|||
if(!imgDir.exists()){ |
|||
imgDir.mkdirs(); |
|||
} |
|||
for (ReasonMaster reason: reasonMasters ) { |
|||
File sf = new File(uploadDirectory+"/"+reason.getReason()); |
|||
if(!sf.exists()){ |
|||
sf.mkdirs(); |
|||
} |
|||
|
|||
} |
|||
|
|||
} |
|||
else if(!imgDir.exists()){ |
|||
imgDir.mkdirs(); |
|||
} |
|||
|
|||
for (ReasonMaster reason: reasonMasters ) { |
|||
File sf = new File(uploadDirectory+"/"+reason.getReason()); |
|||
if(!sf.exists()){ |
|||
sf.mkdirs(); |
|||
} |
|||
registry.addResourceHandler("/images/"+reason.getReason().toLowerCase()+"/**").addResourceLocations("file:" + uploadDirectory+"/"+reason.getReason() +"/"); |
|||
} |
|||
registry.addResourceHandler("/images/hall/**").addResourceLocations("file:" + hallImageUploadDirectory +"/"); |
|||
|
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
package com.gcc.communityHall.controller; |
|||
|
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
@RestController |
|||
@RequestMapping("/admin/api") |
|||
public class AdminAPIController { |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
package com.gcc.communityHall.controller; |
|||
|
|||
import org.springframework.stereotype.Controller; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
|
|||
@Controller |
|||
@RequestMapping("/careTaker") |
|||
public class CareTakerController { |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
package com.gcc.communityHall.controller; |
|||
|
|||
import org.springframework.stereotype.Controller; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
|
|||
@Controller |
|||
@RequestMapping("/officer") |
|||
public class OfficerController { |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
package com.gcc.communityHall.controller; |
|||
|
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
@RestController |
|||
@RequestMapping("/api") |
|||
public class RestAPIController { |
|||
} |
|||
@ -0,0 +1,192 @@ |
|||
package com.gcc.communityHall.controller; |
|||
|
|||
import com.gcc.communityHall.entity.HallDetails; |
|||
import com.gcc.communityHall.entity.ReasonMaster; |
|||
import com.gcc.communityHall.entity.Users; |
|||
import com.gcc.communityHall.others.UserSession; |
|||
import com.gcc.communityHall.service.Impl.BookingServiceImpl; |
|||
import com.gcc.communityHall.service.Impl.HallDetailServiceImpl; |
|||
import com.gcc.communityHall.service.Impl.UserServiceImpl; |
|||
import com.gcc.communityHall.service.ReasonMasterService; |
|||
import jakarta.servlet.http.HttpServletRequest; |
|||
import jakarta.servlet.http.Part; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.http.MediaType; |
|||
import org.springframework.http.ResponseEntity; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
import org.springframework.web.multipart.MultipartHttpServletRequest; |
|||
|
|||
import java.util.*; |
|||
|
|||
@RestController |
|||
@RequestMapping("/api/test") |
|||
public class TestController { |
|||
|
|||
@Autowired |
|||
UserServiceImpl userService; |
|||
|
|||
@Autowired |
|||
BookingServiceImpl bookingService; |
|||
|
|||
@Autowired |
|||
HallDetailServiceImpl hallDetailService; |
|||
|
|||
@Autowired |
|||
ReasonMasterService reasonMasterService; |
|||
|
|||
@Autowired |
|||
private UserSession userSession; |
|||
|
|||
@PostMapping("/saveUser") |
|||
public ResponseEntity<?> saveUser(@RequestBody Users users){ |
|||
return ResponseEntity.ok(userService.user(users)); |
|||
} |
|||
@GetMapping("/getUser") |
|||
public ResponseEntity<?> getUserByID(@RequestParam int userId){ |
|||
return ResponseEntity.ok(userService.getUserById(userId)); |
|||
} |
|||
@GetMapping("/getUserByStatus") |
|||
public ResponseEntity<?> getUserByStatus(@RequestParam Users.userStatus userStatus){ |
|||
return ResponseEntity.ok(userService.getUserByStatus(userStatus)); |
|||
} |
|||
@GetMapping("/getUserByType") |
|||
public ResponseEntity<?> getUserByType(@RequestParam Users.userType userType){ |
|||
return ResponseEntity.ok(userService.getUserByType(userType)); |
|||
} |
|||
|
|||
@GetMapping("/updateUserByStatus") |
|||
public ResponseEntity<?> getUserStatus(@RequestParam int userId,Users.userStatus userStatus,@RequestParam String comments){ |
|||
return ResponseEntity.ok(userService.updateUserStatus(userId,userStatus,comments)); |
|||
} |
|||
|
|||
@PostMapping("/saveHallDetails") |
|||
public ResponseEntity<?> saveHall( |
|||
@RequestParam String hallName, |
|||
@RequestParam float depositAmount, |
|||
@RequestParam float halfDayAmt,@RequestParam float fullDayAmt, |
|||
@RequestParam float gst ,@RequestParam float hallArea,@RequestParam String ebNumber, |
|||
@RequestParam int parkingCapacity,@RequestParam int seatingCapacity, |
|||
@RequestParam String doorNo,@RequestParam String street, |
|||
@RequestParam String area,@RequestParam String zone, |
|||
@RequestParam String division, @RequestParam(required = false) String landMark, |
|||
@RequestParam String city, |
|||
@RequestParam int pinCode, @RequestParam(required = false) String latitude, |
|||
@RequestParam(required = false) String longitude,@RequestParam String hallInchargeName, |
|||
@RequestParam long hallInchargeNo, @RequestParam(required = false) HallDetails.HallStatus status, |
|||
@RequestParam String updatedId, |
|||
@RequestParam MultipartFile hallImages[]){ |
|||
System.out.println(hallImages.length); |
|||
// System.out.println(hallDetails); |
|||
// hallDetailService.saveHallDetails(hallDetails,hallImages); |
|||
hallDetailService.saveHall(hallName,depositAmount,halfDayAmt,fullDayAmt,gst,hallArea,ebNumber,parkingCapacity,seatingCapacity,doorNo, |
|||
street,area,zone,division,landMark,city,pinCode,latitude,longitude,hallInchargeName,hallInchargeNo,status, updatedId,hallImages); |
|||
return ResponseEntity.ok(""); |
|||
} |
|||
|
|||
@GetMapping("/getHall") |
|||
public ResponseEntity<?> getHallByID(@RequestParam int hallId){ |
|||
return ResponseEntity.ok(hallDetailService.getHallById(hallId)); |
|||
} |
|||
|
|||
@PostMapping("/saveReason") |
|||
public ResponseEntity<?> saveReason(@RequestBody ReasonMaster reasaon){ |
|||
return ResponseEntity.ok(reasonMasterService.saveTheReason(reasaon)); |
|||
} |
|||
|
|||
@GetMapping("/getReason") |
|||
public ResponseEntity<?> getReasonByID(@RequestParam int reasonId){ |
|||
return ResponseEntity.ok(reasonMasterService.getReasonById(reasonId)); |
|||
} |
|||
|
|||
@PostMapping(path = "/saveTheRequest", consumes = { "multipart/form-data" }) |
|||
public ResponseEntity<?> saveTheBookingDetails(HttpServletRequest request) { |
|||
|
|||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; |
|||
Map<String, List<Object>> formData = new HashMap<>(); |
|||
|
|||
|
|||
// Iterate through the request parameters |
|||
Enumeration<String> parameterNames = multipartRequest.getParameterNames(); |
|||
while (parameterNames.hasMoreElements()) { |
|||
String paramName = parameterNames.nextElement(); |
|||
String[] paramValues = multipartRequest.getParameterValues(paramName); |
|||
formData.put(paramName, Arrays.asList(paramValues)); |
|||
} |
|||
|
|||
// Iterate through the request parts (files) |
|||
try { |
|||
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap(); |
|||
for (Map.Entry<String, MultipartFile> entry : fileMap.entrySet()) { |
|||
MultipartFile file = entry.getValue(); |
|||
if (!file.isEmpty()) { |
|||
// It's a file |
|||
System.out.println("file key name :-"+entry.getKey()); |
|||
List<Object> files = formData.getOrDefault("files", new ArrayList<>()); |
|||
files.add(file); |
|||
formData.put(entry.getKey(), files); |
|||
} |
|||
} |
|||
} catch (Exception e) { |
|||
e.printStackTrace(); // Handle the exception according to your needs |
|||
} |
|||
|
|||
for (Map.Entry<String, List<Object>> entry : formData.entrySet()) { |
|||
System.out.println("Key: " + entry.getKey()); |
|||
for (Object value : entry.getValue()) { |
|||
if (value instanceof MultipartFile) { |
|||
MultipartFile file = (MultipartFile) value; |
|||
System.out.println("File Name: " + file.getOriginalFilename()); |
|||
} else { |
|||
System.out.println("Value: " + value); |
|||
} |
|||
} |
|||
} |
|||
|
|||
return ResponseEntity.ok().build(); |
|||
} |
|||
|
|||
|
|||
@PostMapping(path = "/saveTheRequest2", consumes = { "multipart/form-data" }) |
|||
public ResponseEntity<?> saveTheBookingDetails2(HttpServletRequest request) { |
|||
userSession.setUserId(1); |
|||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; |
|||
Map<String,Object> bookingDetails = splitFormData(multipartRequest); |
|||
bookingService.saveBookingDetails(bookingDetails); |
|||
return ResponseEntity.ok().build(); |
|||
} |
|||
|
|||
@GetMapping("/getBooking") |
|||
public ResponseEntity<?> getBookingByID(@RequestParam int bookingId){ |
|||
return ResponseEntity.ok(bookingService.getBookingsById(bookingId)); |
|||
} |
|||
|
|||
public Map<String,Object> splitFormData(MultipartHttpServletRequest multipartRequest){ |
|||
Map<String, Object> formData = new HashMap<>(); |
|||
|
|||
// Iterate through the request parameters |
|||
Enumeration<String> parameterNames = multipartRequest.getParameterNames(); |
|||
while (parameterNames.hasMoreElements()) { |
|||
String paramName = parameterNames.nextElement(); |
|||
String paramValues = multipartRequest.getParameter(paramName); |
|||
formData.put(paramName, paramValues); |
|||
} |
|||
|
|||
// Iterate through the request parts (files) |
|||
try { |
|||
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap(); |
|||
for (Map.Entry<String, MultipartFile> entry : fileMap.entrySet()) { |
|||
MultipartFile file = entry.getValue(); |
|||
if (!file.isEmpty()) { |
|||
formData.put(entry.getKey(), file); |
|||
} |
|||
} |
|||
} catch (Exception e) { |
|||
e.printStackTrace(); // Handle the exception according to your needs |
|||
} |
|||
return formData; |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,13 @@ |
|||
package com.gcc.communityHall.controller; |
|||
|
|||
import org.springframework.stereotype.Controller; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
|
|||
@Controller |
|||
@RequestMapping("/user") |
|||
public class UserController { |
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
package com.gcc.communityHall.dto; |
|||
|
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
public class SaveBooking { |
|||
|
|||
private int hallId; |
|||
private int userId; |
|||
private int reasonId; |
|||
private Map<String,Object> bookingDetails; |
|||
|
|||
private MultipartFile file; |
|||
private Object obj = file; |
|||
public void check(){ |
|||
MultipartFile mf= (MultipartFile) obj; |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
package com.gcc.communityHall.entity; |
|||
|
|||
import jakarta.persistence.Column; |
|||
import jakarta.persistence.GeneratedValue; |
|||
import jakarta.persistence.GenerationType; |
|||
import jakarta.persistence.Id; |
|||
|
|||
import java.util.Date; |
|||
|
|||
public class ApplicationLogs { |
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
private Long logId; |
|||
|
|||
private String logType; |
|||
private int bookingId; |
|||
private int loginId; |
|||
private String comments; |
|||
|
|||
@Column(name = "cdate",nullable = false, columnDefinition = "DATETIME DEFAULT CURRENT_TIMESTAMP") |
|||
private Date cdate = new Date(); |
|||
|
|||
} |
|||
@ -0,0 +1,26 @@ |
|||
package com.gcc.communityHall.entity; |
|||
|
|||
import jakarta.persistence.*; |
|||
|
|||
import java.util.Date; |
|||
|
|||
@Entity |
|||
public class BookingCalendar { |
|||
|
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
private Integer id; |
|||
private Date date; |
|||
private boolean morningSlot; |
|||
private boolean eveningSlot; |
|||
private String bookingId_1; |
|||
private String bookingId_2; |
|||
private boolean is_active; |
|||
private boolean is_delete; |
|||
private int is_booked; |
|||
|
|||
|
|||
private int hallId; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,264 @@ |
|||
package com.gcc.communityHall.entity; |
|||
|
|||
import jakarta.persistence.*; |
|||
|
|||
import java.time.LocalDate; |
|||
import java.util.List; |
|||
|
|||
@Entity |
|||
public class BookingDetails { |
|||
|
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
private int bookingId; |
|||
public enum BookingStatus { |
|||
PENDING, APPROVED, REJECTED,CANCELED,PAYMENT_FAILURE,GCC_BLOCKED |
|||
} |
|||
public enum RefundStatus { |
|||
APPROVED, WAITING, INITIATED |
|||
} |
|||
@Column(name="no_of_days") |
|||
private int noOfDays; |
|||
@Column(name="start_date") |
|||
private String startDate; |
|||
@Column(name="end_date") |
|||
private String endDate; |
|||
@Column(name="starting_slot") |
|||
private int startingSlot; |
|||
@Column(name="ending_slot") |
|||
private int endingSlot; |
|||
@Column(name="booking_date") |
|||
private LocalDate bookingDate; |
|||
@Column(name="booking_status") |
|||
@Enumerated(EnumType.STRING) |
|||
private BookingStatus bookingStatus = BookingStatus.PENDING; |
|||
@Column(name="deposit_amount") |
|||
private double depositAmount; |
|||
@Column(name="hall_amount") |
|||
private double hallAmount; |
|||
@Column(name="amount_received") |
|||
private double amountReceived; |
|||
private double gst; |
|||
@Column(name="approved_by") |
|||
private String approvedBy; |
|||
@Column(name="refund_status") |
|||
@Enumerated(EnumType.STRING) |
|||
private RefundStatus refundStatus; |
|||
@Column(name="updated_date") |
|||
private String updatedDate; |
|||
private String reason; |
|||
@ManyToOne(cascade = CascadeType.ALL,fetch = FetchType.EAGER) |
|||
private Users users; |
|||
@ManyToOne(cascade = CascadeType.ALL,fetch = FetchType.EAGER) |
|||
private HallDetails hallDetails; |
|||
|
|||
@OneToMany(cascade = CascadeType.ALL,fetch = FetchType.LAZY,mappedBy = "bookingDetails") |
|||
List<BookingHistory> bookingHistories; |
|||
@OneToMany(cascade = CascadeType.ALL,fetch = FetchType.LAZY,mappedBy = "bookingDetails") |
|||
List<BookingDocuments> bookingDocumentsList; |
|||
@OneToOne(cascade = CascadeType.ALL,fetch = FetchType.LAZY,mappedBy = "bookingDetails") |
|||
private Settlement settlement; |
|||
@OneToOne(cascade = CascadeType.ALL,fetch = FetchType.LAZY,mappedBy = "bookingDetails") |
|||
private EbDetails ebDetails; |
|||
|
|||
@OneToMany(cascade = CascadeType.ALL,fetch = FetchType.LAZY,mappedBy = "bookingDetails") |
|||
private List<Damage> damageList; |
|||
|
|||
@OneToOne(cascade = CascadeType.ALL,fetch = FetchType.LAZY,mappedBy = "bookingDetails") |
|||
private Payments payments; |
|||
@OneToOne(cascade = CascadeType.ALL,fetch = FetchType.LAZY,mappedBy = "bookingDetails") |
|||
private RefundTransaction refundTransaction; |
|||
|
|||
|
|||
public int getBookingId() { |
|||
return bookingId; |
|||
} |
|||
|
|||
public void setBookingId(int bookingId) { |
|||
this.bookingId = bookingId; |
|||
} |
|||
|
|||
public int getNoOfDays() { |
|||
return noOfDays; |
|||
} |
|||
|
|||
public void setNoOfDays(int noOfDays) { |
|||
this.noOfDays = noOfDays; |
|||
} |
|||
|
|||
public String getStartDate() { |
|||
return startDate; |
|||
} |
|||
|
|||
public void setStartDate(String startDate) { |
|||
this.startDate = startDate; |
|||
} |
|||
|
|||
public String getEndDate() { |
|||
return endDate; |
|||
} |
|||
|
|||
public void setEndDate(String endDate) { |
|||
this.endDate = endDate; |
|||
} |
|||
|
|||
public int getStartingSlot() { |
|||
return startingSlot; |
|||
} |
|||
|
|||
public void setStartingSlot(int startingSlot) { |
|||
this.startingSlot = startingSlot; |
|||
} |
|||
|
|||
public int getEndingSlot() { |
|||
return endingSlot; |
|||
} |
|||
|
|||
public void setEndingSlot(int endingSlot) { |
|||
this.endingSlot = endingSlot; |
|||
} |
|||
|
|||
public LocalDate getBookingDate() { |
|||
return bookingDate; |
|||
} |
|||
|
|||
public void setBookingDate(LocalDate bookingDate) { |
|||
this.bookingDate = bookingDate; |
|||
} |
|||
|
|||
public BookingStatus getBookingStatus() { |
|||
return bookingStatus; |
|||
} |
|||
|
|||
public void setBookingStatus(BookingStatus bookingStatus) { |
|||
this.bookingStatus = bookingStatus; |
|||
} |
|||
|
|||
public double getDepositAmount() { |
|||
return depositAmount; |
|||
} |
|||
|
|||
public void setDepositAmount(double depositAmount) { |
|||
this.depositAmount = depositAmount; |
|||
} |
|||
|
|||
public double getHallAmount() { |
|||
return hallAmount; |
|||
} |
|||
|
|||
public void setHallAmount(double hallAmount) { |
|||
this.hallAmount = hallAmount; |
|||
} |
|||
|
|||
public double getAmountReceived() { |
|||
return amountReceived; |
|||
} |
|||
|
|||
public void setAmountReceived(double amountReceived) { |
|||
this.amountReceived = amountReceived; |
|||
} |
|||
|
|||
public double getGst() { |
|||
return gst; |
|||
} |
|||
|
|||
public void setGst(double gst) { |
|||
this.gst = gst; |
|||
} |
|||
|
|||
public String getApprovedBy() { |
|||
return approvedBy; |
|||
} |
|||
|
|||
public void setApprovedBy(String approvedBy) { |
|||
this.approvedBy = approvedBy; |
|||
} |
|||
|
|||
public RefundStatus getRefundStatus() { |
|||
return refundStatus; |
|||
} |
|||
|
|||
public void setRefundStatus(RefundStatus refundStatus) { |
|||
this.refundStatus = refundStatus; |
|||
} |
|||
|
|||
public String getUpdatedDate() { |
|||
return updatedDate; |
|||
} |
|||
|
|||
public void setUpdatedDate(String updatedDate) { |
|||
this.updatedDate = updatedDate; |
|||
} |
|||
|
|||
public String getReason() { |
|||
return reason; |
|||
} |
|||
|
|||
public void setReason(String reason) { |
|||
this.reason = reason; |
|||
} |
|||
|
|||
public Users getUsers() { |
|||
return users; |
|||
} |
|||
|
|||
public void setUsers(Users users) { |
|||
this.users = users; |
|||
} |
|||
|
|||
public HallDetails getHallDetails() { |
|||
return hallDetails; |
|||
} |
|||
|
|||
public void setHallDetails(HallDetails hallDetails) { |
|||
this.hallDetails = hallDetails; |
|||
} |
|||
|
|||
public List<BookingDocuments> getBookingDocumentsList() { |
|||
return bookingDocumentsList; |
|||
} |
|||
|
|||
public void setBookingDocumentsList(List<BookingDocuments> bookingDocumentsList) { |
|||
this.bookingDocumentsList = bookingDocumentsList; |
|||
} |
|||
|
|||
public Settlement getSettlement() { |
|||
return settlement; |
|||
} |
|||
|
|||
public void setSettlement(Settlement settlement) { |
|||
this.settlement = settlement; |
|||
} |
|||
|
|||
public EbDetails getEbDetails() { |
|||
return ebDetails; |
|||
} |
|||
|
|||
public void setEbDetails(EbDetails ebDetails) { |
|||
this.ebDetails = ebDetails; |
|||
} |
|||
|
|||
public List<Damage> getDamageList() { |
|||
return damageList; |
|||
} |
|||
|
|||
public void setDamageList(List<Damage> damageList) { |
|||
this.damageList = damageList; |
|||
} |
|||
|
|||
public Payments getPayments() { |
|||
return payments; |
|||
} |
|||
|
|||
public void setPayments(Payments payments) { |
|||
this.payments = payments; |
|||
} |
|||
|
|||
public RefundTransaction getRefundTransaction() { |
|||
return refundTransaction; |
|||
} |
|||
|
|||
public void setRefundTransaction(RefundTransaction refundTransaction) { |
|||
this.refundTransaction = refundTransaction; |
|||
} |
|||
} |
|||
@ -0,0 +1,76 @@ |
|||
package com.gcc.communityHall.entity; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import jakarta.persistence.*; |
|||
|
|||
@Entity |
|||
public class BookingDocuments { |
|||
|
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
private int bookingDocId; |
|||
private String bookingDocUrl; |
|||
private String documentName; |
|||
private String documentType; |
|||
private String name; |
|||
private String booking_label; |
|||
@ManyToOne(cascade = CascadeType.ALL,fetch = FetchType.EAGER) |
|||
@JsonIgnore |
|||
private BookingDetails bookingDetails; |
|||
|
|||
public int getBookingDocId() { |
|||
return bookingDocId; |
|||
} |
|||
|
|||
public void setBookingDocId(int bookingDocId) { |
|||
this.bookingDocId = bookingDocId; |
|||
} |
|||
|
|||
public String getBookingDocUrl() { |
|||
return bookingDocUrl; |
|||
} |
|||
|
|||
public void setBookingDocUrl(String bookingDocUrl) { |
|||
this.bookingDocUrl = bookingDocUrl; |
|||
} |
|||
|
|||
public String getDocumentName() { |
|||
return documentName; |
|||
} |
|||
|
|||
public void setDocumentName(String documentName) { |
|||
this.documentName = documentName; |
|||
} |
|||
|
|||
public String getDocumentType() { |
|||
return documentType; |
|||
} |
|||
|
|||
public void setDocumentType(String documentType) { |
|||
this.documentType = documentType; |
|||
} |
|||
|
|||
public String getName() { |
|||
return name; |
|||
} |
|||
|
|||
public void setName(String name) { |
|||
this.name = name; |
|||
} |
|||
|
|||
public String getBooking_label() { |
|||
return booking_label; |
|||
} |
|||
|
|||
public void setBooking_label(String booking_label) { |
|||
this.booking_label = booking_label; |
|||
} |
|||
|
|||
public BookingDetails getBookingDetails() { |
|||
return bookingDetails; |
|||
} |
|||
|
|||
public void setBookingDetails(BookingDetails bookingDetails) { |
|||
this.bookingDetails = bookingDetails; |
|||
} |
|||
} |
|||
@ -0,0 +1,26 @@ |
|||
package com.gcc.communityHall.entity; |
|||
|
|||
import jakarta.persistence.*; |
|||
|
|||
import java.util.Date; |
|||
|
|||
@Entity |
|||
public class BookingHistory { |
|||
|
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
private int HistoryId; |
|||
private Date cdate; |
|||
|
|||
public enum BookingStatus { |
|||
PENDING, APPROVED, REJECTED, CANCELED, PAYMENT_FAILURE,GCC_BLOCKED |
|||
} |
|||
@Column(name="booking_status") |
|||
@Enumerated(EnumType.STRING) |
|||
private BookingDetails.BookingStatus bookingStatus; |
|||
|
|||
private String comments; |
|||
private String updatedBy; |
|||
@ManyToOne(cascade = CascadeType.ALL,fetch = FetchType.EAGER) |
|||
private BookingDetails bookingDetails; |
|||
} |
|||
@ -0,0 +1,32 @@ |
|||
package com.gcc.communityHall.entity; |
|||
|
|||
import jakarta.persistence.*; |
|||
|
|||
import java.time.LocalDate; |
|||
|
|||
@Entity |
|||
public class Damage { |
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
private int damageId; |
|||
|
|||
private LocalDate cdate; |
|||
@Column(name = "asset_name") |
|||
private String assetName; |
|||
private String comments; |
|||
private String damageImageUrl; |
|||
private int quantity; |
|||
private double assetAmount; |
|||
private String updatedBy; |
|||
@ManyToOne(cascade = CascadeType.ALL,fetch = FetchType.LAZY) |
|||
private HallDetails hallDetails; |
|||
@ManyToOne(cascade = CascadeType.ALL,fetch = FetchType.EAGER) |
|||
private BookingDetails bookingDetails; |
|||
|
|||
// @ManyToOne(cascade = CascadeType.ALL,fetch = FetchType.EAGER) |
|||
// private Settlement settlement; |
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
package com.gcc.communityHall.entity; |
|||
|
|||
import jakarta.persistence.*; |
|||
|
|||
import java.util.Date; |
|||
|
|||
@Entity |
|||
public class EbDetails { |
|||
|
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
private int ebId; |
|||
|
|||
@OneToOne(cascade = CascadeType.ALL,fetch = FetchType.LAZY) |
|||
private BookingDetails bookingDetails; |
|||
|
|||
private double startingReading; |
|||
private double endingReading; |
|||
private float usedUnit; |
|||
private double ebAmount; |
|||
|
|||
private Date cdate; |
|||
private Date updatedDate; |
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
package com.gcc.communityHall.entity; |
|||
|
|||
import jakarta.persistence.Entity; |
|||
import jakarta.persistence.GeneratedValue; |
|||
import jakarta.persistence.GenerationType; |
|||
import jakarta.persistence.Id; |
|||
|
|||
import java.time.LocalDateTime; |
|||
import java.util.Date; |
|||
|
|||
@Entity |
|||
public class GccBlockingDate { |
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
private int blockingId; |
|||
private Date startDate; |
|||
private Date endDate; |
|||
private int startingSlot; |
|||
private int endingSlot; |
|||
private Date cdate; |
|||
private String updatedBy; |
|||
private int hallId; |
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,285 @@ |
|||
package com.gcc.communityHall.entity; |
|||
|
|||
import jakarta.persistence.*; |
|||
|
|||
import java.util.Date; |
|||
import java.time.LocalDate; |
|||
import java.util.List; |
|||
|
|||
@Entity |
|||
public class HallDetails { |
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
private int hallId; |
|||
private String hallName; |
|||
private String doorNo; |
|||
private String street; |
|||
private String area; |
|||
private int pinCode; |
|||
private String division; |
|||
private String zone; |
|||
@Column(name="land_mark") |
|||
private String landMark; |
|||
@Column(name="latitude") |
|||
private String latitude; |
|||
@Column(name="longitude") |
|||
private String longitude; |
|||
private float hallArea; |
|||
@Column(name="seating_capacity") |
|||
private int seatingCapacity; |
|||
@Column(name="parking_capacity") |
|||
private String parkingCapacity; |
|||
@OneToMany(cascade = CascadeType.ALL,fetch = FetchType.EAGER,mappedBy = "hallDetails") |
|||
private List<HallImages> hallImagesList; |
|||
|
|||
@Column(name="hall_Incharge_no",nullable=false) |
|||
private long hallInchargeMobno; |
|||
|
|||
@Column(name="hall_Incharge_name",nullable=false) |
|||
private String hallInchargeName; |
|||
|
|||
@Column(name = "deposit_amount", nullable = false) |
|||
private float depositAmount; |
|||
@Column(name="full_day_rent",nullable=false) |
|||
private float fullDayRent; |
|||
@Column(name="half_day_rent",nullable=false) |
|||
private float halfDayRent; |
|||
private float gst; |
|||
public enum HallStatus { |
|||
LIVE('L'), BLOCK('B'), ACTIVE('A'), DEACTIVE('D'); |
|||
private final char code; |
|||
HallStatus(char code) { |
|||
this.code = code; |
|||
} |
|||
public char getCode() { |
|||
return code; |
|||
} |
|||
} |
|||
@Column(name="hall_status") |
|||
@Enumerated(EnumType.STRING) |
|||
private HallDetails.HallStatus hallStatus = HallStatus.ACTIVE; |
|||
@Column(name="c_date") |
|||
private LocalDate createddate; |
|||
@Column(name=" updated_id") |
|||
private String updatedId; |
|||
@Column(name="update_date") |
|||
private Date updatedDate = new Date(); |
|||
private String ebNumber; |
|||
private String city; |
|||
|
|||
public int getHallId() { |
|||
return hallId; |
|||
} |
|||
|
|||
public void setHallId(int hallId) { |
|||
this.hallId = hallId; |
|||
} |
|||
|
|||
public String getHallName() { |
|||
return hallName; |
|||
} |
|||
|
|||
public void setHallName(String hallName) { |
|||
this.hallName = hallName; |
|||
} |
|||
|
|||
public String getDoorNo() { |
|||
return doorNo; |
|||
} |
|||
|
|||
public void setDoorNo(String doorNo) { |
|||
this.doorNo = doorNo; |
|||
} |
|||
|
|||
public String getStreet() { |
|||
return street; |
|||
} |
|||
|
|||
public void setStreet(String street) { |
|||
this.street = street; |
|||
} |
|||
|
|||
public String getArea() { |
|||
return area; |
|||
} |
|||
|
|||
public void setArea(String area) { |
|||
this.area = area; |
|||
} |
|||
|
|||
public int getPinCode() { |
|||
return pinCode; |
|||
} |
|||
|
|||
public void setPinCode(int pinCode) { |
|||
this.pinCode = pinCode; |
|||
} |
|||
|
|||
public String getDivision() { |
|||
return division; |
|||
} |
|||
|
|||
public void setDivision(String division) { |
|||
this.division = division; |
|||
} |
|||
|
|||
public String getZone() { |
|||
return zone; |
|||
} |
|||
|
|||
public void setZone(String zone) { |
|||
this.zone = zone; |
|||
} |
|||
|
|||
public String getLandMark() { |
|||
return landMark; |
|||
} |
|||
|
|||
public void setLankMark(String landMark) { |
|||
this.landMark = landMark; |
|||
} |
|||
|
|||
public String getLatitude() { |
|||
return latitude; |
|||
} |
|||
|
|||
public void setLatitude(String latitude) { |
|||
this.latitude = latitude; |
|||
} |
|||
|
|||
public String getLongitude() { |
|||
return longitude; |
|||
} |
|||
|
|||
public void setLongitude(String longitude) { |
|||
this.longitude = longitude; |
|||
} |
|||
|
|||
public float getHallArea() { |
|||
return hallArea; |
|||
} |
|||
|
|||
public void setHallArea(float hallArea) { |
|||
this.hallArea = hallArea; |
|||
} |
|||
|
|||
public int getSeatingCapacity() { |
|||
return seatingCapacity; |
|||
} |
|||
|
|||
public void setSeatingCapacity(int seatingCapacity) { |
|||
this.seatingCapacity = seatingCapacity; |
|||
} |
|||
|
|||
public String getParkingCapacity() { |
|||
return parkingCapacity; |
|||
} |
|||
|
|||
public void setParkingCapacity(String parkingCapacity) { |
|||
this.parkingCapacity = parkingCapacity; |
|||
} |
|||
|
|||
public List<HallImages> getHallImagesList() { |
|||
return hallImagesList; |
|||
} |
|||
|
|||
public void setHallImagesList(List<HallImages> hallImagesList) { |
|||
this.hallImagesList = hallImagesList; |
|||
} |
|||
|
|||
public long getHallInchargeMobno() { |
|||
return hallInchargeMobno; |
|||
} |
|||
|
|||
public void setHallInchargeMobno(long hallInchargeMobno) { |
|||
this.hallInchargeMobno = hallInchargeMobno; |
|||
} |
|||
|
|||
public String getHallInchargeName() { |
|||
return hallInchargeName; |
|||
} |
|||
|
|||
public void setHallInchargeName(String hallInchargeName) { |
|||
this.hallInchargeName = hallInchargeName; |
|||
} |
|||
|
|||
public float getDepositAmount() { |
|||
return depositAmount; |
|||
} |
|||
|
|||
public void setDepositAmount(float depositAmount) { |
|||
this.depositAmount = depositAmount; |
|||
} |
|||
|
|||
public float getFullDayRent() { |
|||
return fullDayRent; |
|||
} |
|||
|
|||
public void setFullDayRent(float fullDayRent) { |
|||
this.fullDayRent = fullDayRent; |
|||
} |
|||
|
|||
public float getHalfDayRent() { |
|||
return halfDayRent; |
|||
} |
|||
|
|||
public void setHalfDayRent(float halfDayRent) { |
|||
this.halfDayRent = halfDayRent; |
|||
} |
|||
|
|||
public float getGst() { |
|||
return gst; |
|||
} |
|||
|
|||
public void setGst(float gst) { |
|||
this.gst = gst; |
|||
} |
|||
|
|||
public HallStatus getHallStatus() { |
|||
return hallStatus; |
|||
} |
|||
|
|||
public void setHallStatus(HallStatus hallStatus) { |
|||
this.hallStatus = hallStatus; |
|||
} |
|||
|
|||
public LocalDate getCreateddate() { |
|||
return createddate; |
|||
} |
|||
|
|||
public void setCreateddate(LocalDate createddate) { |
|||
this.createddate = createddate; |
|||
} |
|||
|
|||
public String getUpdatedId() { |
|||
return updatedId; |
|||
} |
|||
|
|||
public void setUpdatedId(String updatedId) { |
|||
this.updatedId = updatedId; |
|||
} |
|||
|
|||
public Date getUpdatedDate() { |
|||
return updatedDate; |
|||
} |
|||
|
|||
public void setUpdatedDate(Date updatedDate) { |
|||
this.updatedDate = updatedDate; |
|||
} |
|||
|
|||
public String getEbNumber() { |
|||
return ebNumber; |
|||
} |
|||
|
|||
public void setEbNumber(String ebNumber) { |
|||
this.ebNumber = ebNumber; |
|||
} |
|||
|
|||
public String getCity() { |
|||
return city; |
|||
} |
|||
|
|||
public void setCity(String city) { |
|||
this.city = city; |
|||
} |
|||
} |
|||
@ -0,0 +1,42 @@ |
|||
package com.gcc.communityHall.entity; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import jakarta.persistence.*; |
|||
|
|||
@Entity |
|||
public class HallImages { |
|||
|
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
private int hallImageId; |
|||
|
|||
@Column(name = "hall_Image_url") |
|||
private String hallImage; |
|||
@ManyToOne(cascade = CascadeType.PERSIST,fetch = FetchType.LAZY) |
|||
@JsonIgnore |
|||
private HallDetails hallDetails; |
|||
|
|||
public int getHallImageId() { |
|||
return hallImageId; |
|||
} |
|||
|
|||
public void setHallImageId(int hallImageId) { |
|||
this.hallImageId = hallImageId; |
|||
} |
|||
|
|||
public String getHallImage() { |
|||
return hallImage; |
|||
} |
|||
|
|||
public void setHallImage(String hallImage) { |
|||
this.hallImage = hallImage; |
|||
} |
|||
|
|||
public HallDetails getHallDetails() { |
|||
return hallDetails; |
|||
} |
|||
|
|||
public void setHallDetails(HallDetails hallDetails) { |
|||
this.hallDetails = hallDetails; |
|||
} |
|||
} |
|||
@ -0,0 +1,76 @@ |
|||
package com.gcc.communityHall.entity; |
|||
|
|||
|
|||
import jakarta.persistence.Entity; |
|||
import jakarta.persistence.GeneratedValue; |
|||
import jakarta.persistence.GenerationType; |
|||
import jakarta.persistence.Id; |
|||
|
|||
@Entity |
|||
public class Login { |
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
private int id; |
|||
private int hallId; |
|||
private String name; |
|||
private long mobileNumber; |
|||
private String password; |
|||
private String employeeId; |
|||
private String userType; |
|||
|
|||
public int getId() { |
|||
return id; |
|||
} |
|||
|
|||
public void setId(int id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public int getHallId() { |
|||
return hallId; |
|||
} |
|||
|
|||
public void setHallId(int hallId) { |
|||
this.hallId = hallId; |
|||
} |
|||
|
|||
public String getName() { |
|||
return name; |
|||
} |
|||
|
|||
public void setName(String name) { |
|||
this.name = name; |
|||
} |
|||
|
|||
public long getMobileNumber() { |
|||
return mobileNumber; |
|||
} |
|||
|
|||
public void setMobileNumber(long mobileNumber) { |
|||
this.mobileNumber = mobileNumber; |
|||
} |
|||
|
|||
public String getPassword() { |
|||
return password; |
|||
} |
|||
|
|||
public void setPassword(String password) { |
|||
this.password = password; |
|||
} |
|||
|
|||
public String getEmployeeId() { |
|||
return employeeId; |
|||
} |
|||
|
|||
public void setEmployeeId(String employeeId) { |
|||
this.employeeId = employeeId; |
|||
} |
|||
|
|||
public String getUserType() { |
|||
return userType; |
|||
} |
|||
|
|||
public void setUserType(String userType) { |
|||
this.userType = userType; |
|||
} |
|||
} |
|||
@ -0,0 +1,22 @@ |
|||
package com.gcc.communityHall.entity; |
|||
|
|||
import jakarta.persistence.*; |
|||
|
|||
import java.util.Date; |
|||
|
|||
@Entity |
|||
public class Payments { |
|||
|
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
private int paymentId; |
|||
private double amountReceived; |
|||
private String TransactionId; |
|||
private String paymentType; |
|||
private String paymentStatus; |
|||
private Date cdate; |
|||
@OneToOne(cascade = CascadeType.ALL,fetch = FetchType.EAGER) |
|||
private BookingDetails bookingDetails; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,67 @@ |
|||
package com.gcc.communityHall.entity; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import jakarta.persistence.*; |
|||
|
|||
@Entity |
|||
public class ReasonDocumentMaster { |
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
private int reasonDocId; |
|||
private String fieldName; |
|||
private boolean addTextField; |
|||
private String docFieldName; |
|||
private boolean addDocumentField; |
|||
@ManyToOne(fetch = FetchType.EAGER) |
|||
@JoinColumn(name = "reason_id") |
|||
@JsonIgnore |
|||
private ReasonMaster reasonMaster; |
|||
|
|||
public int getReasonDocId() { |
|||
return reasonDocId; |
|||
} |
|||
|
|||
public void setReasonDocId(int reasonDocId) { |
|||
this.reasonDocId = reasonDocId; |
|||
} |
|||
|
|||
public String getFieldName() { |
|||
return fieldName; |
|||
} |
|||
|
|||
public void setFieldName(String fieldName) { |
|||
this.fieldName = fieldName; |
|||
} |
|||
|
|||
public boolean isAddTextField() { |
|||
return addTextField; |
|||
} |
|||
|
|||
public void setAddTextField(boolean addTextField) { |
|||
this.addTextField = addTextField; |
|||
} |
|||
|
|||
public String getDocFieldName() { |
|||
return docFieldName; |
|||
} |
|||
|
|||
public void setDocFieldName(String docFieldName) { |
|||
this.docFieldName = docFieldName; |
|||
} |
|||
|
|||
public boolean isAddDocumentField() { |
|||
return addDocumentField; |
|||
} |
|||
|
|||
public void setAddDocumentField(boolean addDocumentField) { |
|||
this.addDocumentField = addDocumentField; |
|||
} |
|||
|
|||
public ReasonMaster getReasonMaster() { |
|||
return reasonMaster; |
|||
} |
|||
|
|||
public void setReasonMaster(ReasonMaster reasonMaster) { |
|||
this.reasonMaster = reasonMaster; |
|||
} |
|||
} |
|||
@ -0,0 +1,60 @@ |
|||
package com.gcc.communityHall.entity; |
|||
|
|||
import jakarta.persistence.*; |
|||
|
|||
import java.time.LocalDate; |
|||
import java.util.List; |
|||
|
|||
@Entity |
|||
public class ReasonMaster { |
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
private int reasonId; |
|||
private String reason; |
|||
|
|||
private LocalDate cdate = LocalDate.now(); |
|||
private String updatedBy; |
|||
|
|||
@OneToMany(mappedBy = "reasonMaster",fetch = FetchType.LAZY,cascade = CascadeType.ALL) |
|||
private List<ReasonDocumentMaster> reasonDocumentMasterList; |
|||
|
|||
public int getReasonId() { |
|||
return reasonId; |
|||
} |
|||
|
|||
public void setReasonId(int reasonId) { |
|||
this.reasonId = reasonId; |
|||
} |
|||
|
|||
public String getReason() { |
|||
return reason; |
|||
} |
|||
|
|||
public void setReason(String reason) { |
|||
this.reason = reason; |
|||
} |
|||
|
|||
public LocalDate getCdate() { |
|||
return cdate; |
|||
} |
|||
|
|||
public void setCdate(LocalDate cdate) { |
|||
this.cdate = cdate; |
|||
} |
|||
|
|||
public String getUpdatedBy() { |
|||
return updatedBy; |
|||
} |
|||
|
|||
public void setUpdatedBy(String updatedBy) { |
|||
this.updatedBy = updatedBy; |
|||
} |
|||
|
|||
public List<ReasonDocumentMaster> getReasonDocumentMasterList() { |
|||
return reasonDocumentMasterList; |
|||
} |
|||
|
|||
public void setReasonDocumentMasterList(List<ReasonDocumentMaster> reasonDocumentMasterList) { |
|||
this.reasonDocumentMasterList = reasonDocumentMasterList; |
|||
} |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
package com.gcc.communityHall.entity; |
|||
|
|||
import jakarta.persistence.*; |
|||
|
|||
import java.util.Date; |
|||
|
|||
@Entity |
|||
public class RefundTransaction { |
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
private int refundId; |
|||
private double amountRefunded; |
|||
private String TransactionId; |
|||
private String refundStatus; |
|||
private Date cdate; |
|||
@OneToOne(cascade = CascadeType.ALL,fetch = FetchType.EAGER) |
|||
private BookingDetails bookingDetails; |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
package com.gcc.communityHall.entity; |
|||
|
|||
import jakarta.persistence.*; |
|||
|
|||
import java.time.LocalDate; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
@Entity |
|||
public class Settlement { |
|||
|
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
private int settlementId; |
|||
private String comments; |
|||
private LocalDate cdate; |
|||
private double damageAmount; |
|||
private double ebAmount; |
|||
private double depositAmount; |
|||
private double refundedAmount; |
|||
private Date updatedDate; |
|||
private String updatedId; |
|||
@OneToOne(fetch = FetchType.EAGER,cascade = CascadeType.ALL) |
|||
private BookingDetails bookingDetails; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,64 @@ |
|||
package com.gcc.communityHall.entity; |
|||
|
|||
import jakarta.persistence.*; |
|||
|
|||
import java.util.Date; |
|||
|
|||
@Entity |
|||
public class SmsSender { |
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
private int id; |
|||
|
|||
@Column(name = "phone",nullable = false) |
|||
private Long phone; |
|||
|
|||
@Column(name = "purpose",nullable = false) |
|||
private String purpose; |
|||
@Column(name = "bodyMsg",nullable = false) |
|||
private String bodyMsg; |
|||
@Column(name = "cdate",nullable = false, columnDefinition = "DATETIME DEFAULT CURRENT_TIMESTAMP") |
|||
private Date cdate; |
|||
|
|||
public int getId() { |
|||
return id; |
|||
} |
|||
|
|||
public void setId(int id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
|
|||
|
|||
public Long getPhone() { |
|||
return phone; |
|||
} |
|||
|
|||
public void setPhone(Long phone) { |
|||
this.phone = phone; |
|||
} |
|||
|
|||
public String getPurpose() { |
|||
return purpose; |
|||
} |
|||
|
|||
public void setPurpose(String purpose) { |
|||
this.purpose = purpose; |
|||
} |
|||
|
|||
public String getBodyMsg() { |
|||
return bodyMsg; |
|||
} |
|||
|
|||
public void setBodyMsg(String bodyMsg) { |
|||
this.bodyMsg = bodyMsg; |
|||
} |
|||
|
|||
public Date getCdate() { |
|||
return cdate; |
|||
} |
|||
|
|||
public void setCdate(Date cdate) { |
|||
this.cdate = cdate; |
|||
} |
|||
} |
|||
@ -0,0 +1,74 @@ |
|||
package com.gcc.communityHall.entity; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import jakarta.persistence.*; |
|||
|
|||
import java.util.Date; |
|||
|
|||
@Entity |
|||
public class UserHistory { |
|||
|
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
private int userHisId; |
|||
|
|||
private Date cdate ; |
|||
|
|||
@Column(name="user_status", columnDefinition = "VARCHAR(20) DEFAULT 'APPROVED'") |
|||
@Enumerated(EnumType.STRING) |
|||
private Users.userStatus userstatus = Users.userStatus.APPROVED ; |
|||
|
|||
private String comments; |
|||
private String updatedBy; |
|||
@ManyToOne(cascade = CascadeType.ALL,fetch = FetchType.EAGER) |
|||
@JsonIgnore |
|||
private Users users; |
|||
|
|||
public int getUserHisId() { |
|||
return userHisId; |
|||
} |
|||
|
|||
public void setUserHisId(int userHisId) { |
|||
this.userHisId = userHisId; |
|||
} |
|||
|
|||
public Date getCdate() { |
|||
return cdate; |
|||
} |
|||
|
|||
public void setCdate(Date cdate) { |
|||
this.cdate = cdate; |
|||
} |
|||
|
|||
public Users.userStatus getUserstatus() { |
|||
return userstatus; |
|||
} |
|||
|
|||
public void setUserstatus(Users.userStatus userstatus) { |
|||
this.userstatus = userstatus; |
|||
} |
|||
|
|||
public String getComments() { |
|||
return comments; |
|||
} |
|||
|
|||
public void setComments(String comments) { |
|||
this.comments = comments; |
|||
} |
|||
|
|||
public String getUpdatedBy() { |
|||
return updatedBy; |
|||
} |
|||
|
|||
public void setUpdatedBy(String updatedBy) { |
|||
this.updatedBy = updatedBy; |
|||
} |
|||
|
|||
public Users getUsers() { |
|||
return users; |
|||
} |
|||
|
|||
public void setUsers(Users users) { |
|||
this.users = users; |
|||
} |
|||
} |
|||
@ -0,0 +1,187 @@ |
|||
package com.gcc.communityHall.entity; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import jakarta.persistence.*; |
|||
|
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
@Entity |
|||
public class Users { |
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
private int userId; |
|||
public enum userStatus { |
|||
PENDING, APPROVED, REJECTED |
|||
} |
|||
|
|||
public enum userType { |
|||
PENSIONER, EMPLOYEE, COUNSELLOR,PUBLIC |
|||
} |
|||
|
|||
@Column(name="user_status", columnDefinition = "VARCHAR(20) DEFAULT 'APPROVED'") |
|||
@Enumerated(EnumType.STRING) |
|||
private Users.userStatus userstatus = userStatus.APPROVED ; |
|||
|
|||
@Column(name="usertype", columnDefinition = "VARCHAR(20) DEFAULT 'PUBLIC'") |
|||
@Enumerated(EnumType.STRING) |
|||
private Users.userType usertype = userType.PUBLIC ; |
|||
|
|||
@Column(name = "name", nullable = false) |
|||
private String name; |
|||
@Column(name = "mobile_no", nullable = false) |
|||
private long mobileNo; |
|||
@Column(name = "email", nullable = false) |
|||
private String email; |
|||
@Column(name = "doorno", nullable = false) |
|||
private String doorNo; |
|||
@Column(name = "street", nullable = false) |
|||
private String street; |
|||
@Column(name = "area", nullable = false) |
|||
private String area; |
|||
@Column(name = "location", nullable = false) |
|||
private String location; |
|||
@Column(name = "pin_code", nullable = false) |
|||
private int pinCode; |
|||
|
|||
private String governmentId; |
|||
@Column(nullable = false,columnDefinition = "BOOLEAN DEFAULT true") |
|||
private boolean isActive =true; |
|||
|
|||
@Column(name = "cdate",nullable = false, columnDefinition = "DATETIME DEFAULT CURRENT_TIMESTAMP") |
|||
private Date cdate = new Date(); |
|||
@OneToMany(fetch = FetchType.LAZY,mappedBy = "users") |
|||
@JsonIgnore |
|||
List<BookingDetails> bookingDetailsList; |
|||
|
|||
@OneToMany(fetch = FetchType.LAZY,mappedBy = "users") |
|||
List<UserHistory> userHistories; |
|||
|
|||
public int getUserId() { |
|||
return userId; |
|||
} |
|||
|
|||
public void setUserId(int userId) { |
|||
this.userId = userId; |
|||
} |
|||
|
|||
public userStatus getUserstatus() { |
|||
return userstatus; |
|||
} |
|||
|
|||
public void setUserstatus(userStatus userstatus) { |
|||
this.userstatus = userstatus; |
|||
} |
|||
|
|||
public String getName() { |
|||
return name; |
|||
} |
|||
|
|||
public void setName(String name) { |
|||
this.name = name; |
|||
} |
|||
|
|||
public long getMobileNo() { |
|||
return mobileNo; |
|||
} |
|||
|
|||
public void setMobileNo(long mobileNo) { |
|||
this.mobileNo = mobileNo; |
|||
} |
|||
|
|||
public String getEmail() { |
|||
return email; |
|||
} |
|||
|
|||
public void setEmail(String email) { |
|||
this.email = email; |
|||
} |
|||
|
|||
public String getDoorNo() { |
|||
return doorNo; |
|||
} |
|||
|
|||
public void setDoorNo(String doorNo) { |
|||
this.doorNo = doorNo; |
|||
} |
|||
|
|||
public String getStreet() { |
|||
return street; |
|||
} |
|||
|
|||
public void setStreet(String street) { |
|||
this.street = street; |
|||
} |
|||
|
|||
public String getArea() { |
|||
return area; |
|||
} |
|||
|
|||
public void setArea(String area) { |
|||
this.area = area; |
|||
} |
|||
|
|||
public String getLocation() { |
|||
return location; |
|||
} |
|||
|
|||
public void setLocation(String location) { |
|||
this.location = location; |
|||
} |
|||
|
|||
public int getPinCode() { |
|||
return pinCode; |
|||
} |
|||
|
|||
public void setPinCode(int pinCode) { |
|||
this.pinCode = pinCode; |
|||
} |
|||
|
|||
public userType getUsertype() { |
|||
return usertype; |
|||
} |
|||
|
|||
public void setUsertype(userType usertype) { |
|||
this.usertype = usertype; |
|||
} |
|||
|
|||
public String getGovernmentId() { |
|||
return governmentId; |
|||
} |
|||
|
|||
public void setGovernmentId(String governmentId) { |
|||
this.governmentId = governmentId; |
|||
} |
|||
|
|||
public boolean isActive() { |
|||
return isActive; |
|||
} |
|||
|
|||
public void setActive(boolean active) { |
|||
this.isActive = active; |
|||
} |
|||
|
|||
public Date getCdate() { |
|||
return cdate; |
|||
} |
|||
|
|||
public void setCdate(Date cdate) { |
|||
this.cdate = cdate; |
|||
} |
|||
|
|||
public List<BookingDetails> getBookingDetailsList() { |
|||
return bookingDetailsList; |
|||
} |
|||
|
|||
public void setBookingDetailsList(List<BookingDetails> bookingDetailsList) { |
|||
this.bookingDetailsList = bookingDetailsList; |
|||
} |
|||
|
|||
public List<UserHistory> getUserHistories() { |
|||
return userHistories; |
|||
} |
|||
|
|||
public void setUserHistories(List<UserHistory> userHistories) { |
|||
this.userHistories = userHistories; |
|||
} |
|||
} |
|||
@ -0,0 +1,47 @@ |
|||
package com.gcc.communityHall.others; |
|||
|
|||
import org.springframework.boot.context.properties.ConfigurationProperties; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
@Component |
|||
@ConfigurationProperties(prefix = "app") |
|||
public class AppConfig { |
|||
|
|||
private String title; |
|||
private String baseUrl; |
|||
private String getOtpUrl; |
|||
private String erpUrl; |
|||
|
|||
public String getTitle() { |
|||
return title; |
|||
} |
|||
|
|||
public void setTitle(String title) { |
|||
this.title = title; |
|||
} |
|||
|
|||
public String getBaseUrl() { |
|||
return baseUrl; |
|||
} |
|||
|
|||
public void setBaseUrl(String baseUrl) { |
|||
this.baseUrl = baseUrl; |
|||
} |
|||
|
|||
public String getGetOtpUrl() { |
|||
return getOtpUrl; |
|||
} |
|||
|
|||
public void setGetOtpUrl(String getOtpUrl) { |
|||
this.getOtpUrl = getOtpUrl; |
|||
} |
|||
|
|||
public String getErpUrl() { |
|||
return erpUrl; |
|||
} |
|||
|
|||
public void setErpUrl(String erpUrl) { |
|||
this.erpUrl = erpUrl; |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,50 @@ |
|||
package com.gcc.communityHall.others; |
|||
|
|||
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; |
|||
private Long mobileno; |
|||
|
|||
public Integer getUserId() { |
|||
return userId; |
|||
} |
|||
|
|||
public void setUserId(Integer userId) { |
|||
this.userId = userId; |
|||
} |
|||
|
|||
public String getUserType() { |
|||
return userType; |
|||
} |
|||
|
|||
public void setUserType(String userType) { |
|||
this.userType = userType; |
|||
} |
|||
|
|||
public String getDispayName() { |
|||
return dispayName; |
|||
} |
|||
|
|||
public void setDispayName(String dispayName) { |
|||
this.dispayName = dispayName; |
|||
} |
|||
|
|||
public Long getMobileno() { |
|||
return mobileno; |
|||
} |
|||
|
|||
public void setMobileno(Long mobileno) { |
|||
this.mobileno = mobileno; |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
package com.gcc.communityHall.paymentService.DTO; |
|||
|
|||
import org.springframework.stereotype.Component; |
|||
|
|||
@Component |
|||
public class Merchant { |
|||
|
|||
|
|||
private String identifier; |
|||
|
|||
|
|||
public String getIdentifier() { |
|||
return identifier; |
|||
} |
|||
|
|||
public void setIdentifier(String identifier) { |
|||
this.identifier = identifier; |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
package com.gcc.communityHall.paymentService.DTO; |
|||
|
|||
import java.util.HashMap; |
|||
|
|||
public class RefundRequest { |
|||
|
|||
private HashMap<String, String> merchant; |
|||
private HashMap<String,String> transaction; |
|||
|
|||
public HashMap<String, String> getMerchant() { |
|||
return merchant; |
|||
} |
|||
public void setMerchant(HashMap<String, String> merchant) { |
|||
this.merchant = merchant; |
|||
} |
|||
public HashMap<String, String> getTransaction() { |
|||
return transaction; |
|||
} |
|||
public void setTransaction(HashMap<String, String> transaction) { |
|||
this.transaction = transaction; |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,57 @@ |
|||
package com.gcc.communityHall.paymentService.DTO; |
|||
|
|||
import org.springframework.stereotype.Component; |
|||
|
|||
@Component |
|||
public class Transaction { |
|||
|
|||
private String amount; |
|||
private String identifier; |
|||
private String dateTime; |
|||
private String requestType; |
|||
private String token; |
|||
private String reference; |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
public String getAmount() { |
|||
return amount; |
|||
} |
|||
public void setAmount(String amount) { |
|||
this.amount = amount; |
|||
} |
|||
public String getIdentifier() { |
|||
return identifier; |
|||
} |
|||
public void setIdentifier(String identifier) { |
|||
this.identifier = identifier; |
|||
} |
|||
public String getDateTime() { |
|||
return dateTime; |
|||
} |
|||
public void setDateTime(String dateTime) { |
|||
this.dateTime = dateTime; |
|||
} |
|||
public String getRequestType() { |
|||
return requestType; |
|||
} |
|||
public void setRequestType(String requestType) { |
|||
this.requestType = requestType; |
|||
} |
|||
public String getToken() { |
|||
return token; |
|||
} |
|||
public void setToken(String token) { |
|||
this.token = token; |
|||
} |
|||
public String getReference() { |
|||
return reference; |
|||
} |
|||
public void setReference(String reference) { |
|||
this.reference = reference; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
package com.gcc.communityHall.paymentService.DTO; |
|||
|
|||
public class TransactionData { |
|||
|
|||
private Merchant merchant; |
|||
private Transaction transaction; |
|||
|
|||
public Merchant getMerchant() { |
|||
return merchant; |
|||
} |
|||
public void setMerchant(Merchant merchant) { |
|||
this.merchant = merchant; |
|||
} |
|||
public Transaction getTransaction() { |
|||
return transaction; |
|||
} |
|||
public void setTransaction(Transaction transaction) { |
|||
this.transaction = transaction; |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,100 @@ |
|||
package com.gcc.communityHall.paymentService.config; |
|||
|
|||
import org.springframework.beans.factory.annotation.Value; |
|||
import org.springframework.context.annotation.Configuration; |
|||
import org.springframework.context.annotation.PropertySource; |
|||
|
|||
@Configuration |
|||
@PropertySource("classpath:paymentConfig.properties") |
|||
public class PaymentConfig { |
|||
|
|||
@Value("${payment.worldline.merchantId}") |
|||
private String merchantId; |
|||
|
|||
@Value("${payment.worldline.encryptionKey}") |
|||
private String encryptionKey; |
|||
|
|||
@Value("${payment.worldline.encryptionIV}") |
|||
private String encryptionIV; |
|||
|
|||
@Value("${payment.worldline.schemeCode}") |
|||
private String schemeCode; |
|||
|
|||
@Value("${payment.worldline.merchantName}") |
|||
private String merchantName; |
|||
|
|||
@Value("${payment.worldline.transactionSuccessCode}") |
|||
private String transactionSuccessCode; |
|||
|
|||
@Value("${payment.worldline.refundSuccessCode}") |
|||
private String refundSuccessCode; |
|||
|
|||
|
|||
public String getMerchantId() { |
|||
return merchantId; |
|||
} |
|||
|
|||
public void setMerchantId(String merchantId) { |
|||
this.merchantId = merchantId; |
|||
} |
|||
|
|||
public String getEncryptionKey() { |
|||
return encryptionKey; |
|||
} |
|||
public byte[] getEncryptionKeyByte() { |
|||
return encryptionKey.getBytes(); |
|||
} |
|||
|
|||
public void setEncryptionKey(String encryptionKey) { |
|||
this.encryptionKey = encryptionKey; |
|||
} |
|||
|
|||
public String getEncryptionIV() { |
|||
return encryptionIV; |
|||
} |
|||
|
|||
public byte[] getEncryptionIVByte() { |
|||
return encryptionIV.getBytes(); |
|||
} |
|||
|
|||
public void setEncryptionIV(String encryptionIV) { |
|||
this.encryptionIV = encryptionIV; |
|||
} |
|||
|
|||
public String getSchemeCode() { |
|||
return schemeCode; |
|||
} |
|||
|
|||
public void setSchemeCode(String schemeCode) { |
|||
this.schemeCode = schemeCode; |
|||
} |
|||
|
|||
public String getMerchantName() { |
|||
return merchantName; |
|||
} |
|||
|
|||
public void setMerchantName(String merchantName) { |
|||
this.merchantName = merchantName; |
|||
} |
|||
|
|||
public String getTransactionSuccessCode() { |
|||
return transactionSuccessCode; |
|||
} |
|||
|
|||
public void setTransactionSuccessCode(String transactionSuccessCode) { |
|||
this.transactionSuccessCode = transactionSuccessCode; |
|||
} |
|||
|
|||
public String getRefundSuccessCode() { |
|||
return refundSuccessCode; |
|||
} |
|||
|
|||
public void setRefundSuccessCode(String refundSuccessCode) { |
|||
this.refundSuccessCode = refundSuccessCode; |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,157 @@ |
|||
package com.gcc.communityHall.paymentService.controller; |
|||
|
|||
|
|||
import com.gcc.communityHall.entity.BookingDetails; |
|||
import com.gcc.communityHall.entity.Users; |
|||
import com.gcc.communityHall.paymentService.DTO.Merchant; |
|||
import com.gcc.communityHall.paymentService.DTO.Transaction; |
|||
import com.gcc.communityHall.paymentService.DTO.TransactionData; |
|||
import com.gcc.communityHall.paymentService.config.PaymentConfig; |
|||
import com.gcc.communityHall.paymentService.entity.RefundResponse; |
|||
import com.gcc.communityHall.paymentService.entity.TransactionResponse; |
|||
import com.gcc.communityHall.paymentService.refund.DTO.TransactionRefundResponse; |
|||
import com.gcc.communityHall.paymentService.service.PaymentGatewayService; |
|||
import com.gcc.communityHall.paymentService.service.TransactionNumberGenerator; |
|||
import com.gcc.communityHall.repository.BookingDetailsRepository; |
|||
import com.fasterxml.jackson.databind.ObjectMapper; |
|||
import com.google.gson.Gson; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.http.ResponseEntity; |
|||
import org.springframework.ui.Model; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.web.client.RestTemplate; |
|||
|
|||
import java.security.NoSuchAlgorithmException; |
|||
import java.util.HashMap; |
|||
import java.util.Optional; |
|||
|
|||
|
|||
@RestController |
|||
@RequestMapping("/payment/api") |
|||
public class PaymentAPIController { |
|||
|
|||
@Autowired |
|||
PaymentGatewayService paymentService; |
|||
|
|||
@Autowired |
|||
private PaymentConfig paymentConfig; |
|||
|
|||
@Autowired |
|||
private BookingDetailsRepository bookRepo; |
|||
|
|||
@Autowired |
|||
private TransactionNumberGenerator transactionNumber; |
|||
|
|||
|
|||
@GetMapping(value="/refund") |
|||
public ResponseEntity<?> refundAmount(Model model,@RequestParam int bookingId) throws Exception { |
|||
System.out.println("Refund Api call.......working on it"); |
|||
TransactionResponse transactionRes = this.paymentService.getTransactionResponseByBookingIdAndStatusCode(bookingId,this.paymentConfig.getTransactionSuccessCode()); |
|||
RefundResponse recordRefundResponse = new RefundResponse(); |
|||
|
|||
Merchant merchant = new Merchant(); |
|||
merchant.setIdentifier(this.paymentConfig.getMerchantId()); |
|||
|
|||
Transaction transaction = new Transaction(); |
|||
transaction.setAmount(transactionRes.getAmount());//Amount given here |
|||
transaction.setIdentifier(""); |
|||
transaction.setDateTime(transactionRes.getDate()); //At what date transaction happens |
|||
transaction.setRequestType("R"); |
|||
transaction.setToken(""); |
|||
transaction.setReference(transactionRes.getTpslTxnId()); //tpsl refer number |
|||
|
|||
|
|||
TransactionData transactionData = new TransactionData(); |
|||
transactionData.setMerchant(merchant); |
|||
transactionData.setTransaction(transaction); |
|||
|
|||
// Serialize TransactionData object to JSON string |
|||
Gson gson = new Gson(); |
|||
String json = gson.toJson(transactionData); |
|||
System.out.println(json); |
|||
|
|||
String encryptHxRefund = this.paymentService.encryptHxRefund(json); |
|||
RestTemplate resttemplate = new RestTemplate(); |
|||
String Url ="https://www.tpsl-india.in/PaymentGateway/merchant2.pg/"+this.paymentConfig.getMerchantId(); |
|||
ResponseEntity<String> postForEntity = resttemplate.postForEntity(Url, encryptHxRefund, String.class); |
|||
|
|||
String decryptHxTRefund = this.paymentService.decryptHxTRefund(postForEntity.getBody()); |
|||
recordRefundResponse.setResponse(decryptHxTRefund); |
|||
recordRefundResponse.setUserId("2");//make it dynamic |
|||
recordRefundResponse.setBookingId(bookingId); |
|||
try { |
|||
ObjectMapper objectMapper = new ObjectMapper(); |
|||
|
|||
TransactionRefundResponse myObject = objectMapper.readValue(decryptHxTRefund, TransactionRefundResponse.class); |
|||
System.out.println(myObject.toString()); |
|||
|
|||
if(myObject.getPaymentMethod().getPaymentTransaction().getStatusCode().equals(this.paymentConfig.getRefundSuccessCode())) { |
|||
System.out.println("Refund Process complete........"+bookingId); |
|||
recordRefundResponse.setAmount(myObject.getPaymentMethod().getPaymentTransaction().getAmount()); |
|||
recordRefundResponse.setBalaceAmount(myObject.getPaymentMethod().getPaymentTransaction().getBalanceAmount()); |
|||
} |
|||
recordRefundResponse.setStatusCode(myObject.getPaymentMethod().getPaymentTransaction().getStatusCode()); |
|||
recordRefundResponse.setTxansactionId(myObject.getMerchantTransactionIdentifier()); |
|||
|
|||
this.paymentService.recordRefund(recordRefundResponse); |
|||
return ResponseEntity.ok(myObject); |
|||
|
|||
} catch (Exception e) { |
|||
e.printStackTrace(); |
|||
} |
|||
return ResponseEntity.ok(decryptHxTRefund); |
|||
|
|||
} |
|||
|
|||
@PostMapping(value = {"/payment-request"}) |
|||
public HashMap<String,Object> startPayment(int userId,int bookingId) throws NoSuchAlgorithmException { |
|||
|
|||
System.out.println("I entered payment Service......"+bookingId+ "User Id :- "+userId); |
|||
HashMap<String, Object> hs = new HashMap<>(); |
|||
Optional<BookingDetails> findById = bookRepo.findById(bookingId); |
|||
|
|||
if(findById.isPresent()) { |
|||
System.out.println("Success in finding booking Id"); |
|||
BookingDetails booking = findById.get(); |
|||
Users user = booking.getUsers(); |
|||
int findUserId=user.getUserId(); |
|||
System.out.println("Merchant ID:-"+this.paymentConfig.getMerchantId()); |
|||
|
|||
String txnId="CHB"+transactionNumber.generateTransactionNumber()+String.format("%05d", findUserId); //create transaction Id unique from our side |
|||
String totalAmt = String.valueOf(booking.getAmountReceived()); //Amount of Community Hall from our side |
|||
|
|||
TransactionResponse response = new TransactionResponse(); |
|||
response.setTxansactionId(txnId); |
|||
// response.setBookingId(bookingId);//make it dynamic |
|||
response.setHallId(booking.getHallDetails().getHallId()); |
|||
response.setUserId(String.valueOf(findUserId));//make it dynamic |
|||
response.setStatusCode("temp"); |
|||
response.setBookingId(bookingId); |
|||
this.paymentService.recordResponse(response); |
|||
|
|||
|
|||
String merchantId = this.paymentConfig.getMerchantId(); //This is Test Merchant ID from worldLine |
|||
String consumerId=String.format("%05d", findUserId); // Replace consumer ID in c964634 from our side |
|||
String consumerMobileNo=String.valueOf(user.getMobileNo()); //Replace consumer Mobile no in 9879879870 from our side |
|||
String consumerEmailId=user.getEmail(); //replace consumer email Id |
|||
|
|||
|
|||
String encryptedtoken = this.paymentService.getToken(merchantId+"|", txnId+"|", totalAmt+"|", "|", consumerId+"|", consumerMobileNo+"|", consumerEmailId+"|", "|", "|", "|", "|", "|", "|", "|", "|", "|", this.paymentConfig.getEncryptionKey()); |
|||
|
|||
hs.put("txansactionId",txnId); |
|||
hs.put("token",encryptedtoken); |
|||
hs.put("amount",totalAmt); |
|||
hs.put("merchantId",merchantId); |
|||
hs.put("consumerMobileNo",consumerMobileNo); |
|||
hs.put("consumerEmailId",consumerEmailId); |
|||
hs.put("consumerId",consumerId); |
|||
hs.put("error", false); |
|||
} |
|||
else { |
|||
hs.put("error", true); |
|||
} |
|||
|
|||
return hs; |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,139 @@ |
|||
package com.gcc.communityHall.paymentService.controller; |
|||
|
|||
import com.gcc.communityHall.entity.BookingDetails; |
|||
import com.gcc.communityHall.paymentService.config.PaymentConfig; |
|||
import com.gcc.communityHall.paymentService.entity.TransactionResponse; |
|||
import com.gcc.communityHall.paymentService.repository.TransactionResponseRepository; |
|||
import com.gcc.communityHall.paymentService.service.PaymentGatewayService; |
|||
import com.gcc.communityHall.service.Impl.BookingServiceImpl; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Controller; |
|||
import org.springframework.ui.Model; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RequestParam; |
|||
|
|||
import java.security.NoSuchAlgorithmException; |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
@Controller |
|||
@RequestMapping("/payment") |
|||
public class PaymentController { |
|||
|
|||
@Autowired |
|||
PaymentGatewayService paymentService; |
|||
|
|||
@Autowired |
|||
private PaymentConfig paymentConfig; |
|||
|
|||
@Autowired |
|||
private BookingServiceImpl bookser; |
|||
|
|||
@Autowired |
|||
private TransactionResponseRepository transactionResRepo; |
|||
|
|||
|
|||
@PostMapping(value = "/response") |
|||
public String response(Model model, @RequestParam(required = false) String msg) throws NoSuchAlgorithmException{ |
|||
|
|||
System.out.println("......"); |
|||
String salt = this.paymentConfig.getEncryptionKey(); |
|||
|
|||
String confirmToken=""; |
|||
String status = this.paymentConfig.getTransactionSuccessCode(); |
|||
String s = new String(msg); |
|||
String c = new String(); |
|||
String res[] =s.split("\\|"); |
|||
|
|||
TransactionResponse response = this.paymentService.getTransactionResponseByTxansactionId(res[3],"temp"); |
|||
|
|||
for(int i=0;i<res.length;i++) { |
|||
if(i==res.length-1) { |
|||
c=c+salt; |
|||
confirmToken=res[i]; |
|||
} |
|||
else if(res[i].isEmpty()) { |
|||
c=c+"|"; |
|||
} |
|||
else if(res[i].equals("NA")) { |
|||
c=c+"NA|"; |
|||
}else { |
|||
c=c+res[i]+"|"; |
|||
} |
|||
|
|||
if(i==5) { |
|||
response.setTpslTxnId(res[i]); |
|||
response.setAmount(res[6]); |
|||
response.setTxansactionId(res[3]); |
|||
String[] tDate = res[8].split(" "); |
|||
response.setDate(tDate[0]); |
|||
} |
|||
} |
|||
|
|||
response.setResponse(msg); |
|||
response.setStatusCode(res[0]); |
|||
if(paymentService.generateToken(c).equals(confirmToken) && status.equals(res[0])){ |
|||
int bookingId = response.getBookingId(); |
|||
|
|||
System.out.println("payment confirmed for booking Id:-"+bookingId); |
|||
//set logic here after payment confirmation.. |
|||
BookingDetails bookingsById = bookser.getBookingsById(bookingId); |
|||
|
|||
|
|||
int fromStartingSlot =0; |
|||
int fromEndingSlot=0; |
|||
int toStartingSlot =0; |
|||
int toEndingSlot =0; |
|||
int startingSlot = bookingsById.getStartingSlot(); |
|||
int endingSlot = bookingsById.getEndingSlot(); |
|||
int noOfDays = bookingsById.getNoOfDays(); |
|||
if(startingSlot ==1 && endingSlot ==2 && noOfDays==1){ |
|||
fromStartingSlot =1; |
|||
fromEndingSlot=1; |
|||
} |
|||
else if(startingSlot ==1 && endingSlot ==1 && noOfDays==1){ |
|||
fromStartingSlot=1; |
|||
}else if( startingSlot ==2 && endingSlot ==2 && noOfDays==1){ |
|||
fromEndingSlot=1; |
|||
}else if(noOfDays>1 && startingSlot ==1 && endingSlot ==2 ){ |
|||
fromStartingSlot =1; |
|||
fromEndingSlot=1; |
|||
toStartingSlot =1; |
|||
toEndingSlot =1; |
|||
}else if(noOfDays>1 && startingSlot ==1 && endingSlot==1){ |
|||
fromStartingSlot=1; |
|||
fromEndingSlot=1; |
|||
toStartingSlot =1; |
|||
} |
|||
else if(noOfDays>1 && startingSlot ==2 && endingSlot==1){ |
|||
fromEndingSlot=1; |
|||
toStartingSlot =1; |
|||
} |
|||
else if(noOfDays>1 && startingSlot ==2 && endingSlot==2){ |
|||
fromEndingSlot=1; |
|||
toStartingSlot =1; |
|||
toEndingSlot =1; |
|||
} |
|||
|
|||
String bookingStatus=bookser.confirmTheDateAndSlot(bookingsById.getStartDate(), bookingsById.getEndDate(), noOfDays, fromStartingSlot, fromEndingSlot, toStartingSlot, toEndingSlot, bookingsById.getBookingId(),bookingsById.getUsers().getUserId()); |
|||
System.out.println("booking Status ="+bookingStatus); |
|||
System.out.println(response.getId()); |
|||
System.out.println(response.toString()); |
|||
} |
|||
System.out.println(response.toString()); |
|||
|
|||
TransactionResponse save = transactionResRepo.save(response); |
|||
System.out.println(save.toString()); |
|||
// this.paymentService.recordResponse(response); |
|||
//model.addAttribute("msg",msg); |
|||
return "redirect:/viewhistory"; |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,81 @@ |
|||
package com.gcc.communityHall.paymentService.entity; |
|||
|
|||
import jakarta.persistence.*; |
|||
|
|||
@Entity |
|||
public class RefundResponse { |
|||
|
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
private Integer id; |
|||
private String userId; |
|||
private int bookingId; |
|||
private String txansactionId; |
|||
private String statusCode; |
|||
// private String tpslTxnId; |
|||
@Column(name = "date", columnDefinition = "DATETIME NULL DEFAULT CURRENT_TIMESTAMP") |
|||
private String date; |
|||
|
|||
@Column(length = 5000) |
|||
private String response; |
|||
private String Amount; |
|||
private String balaceAmount; |
|||
|
|||
public Integer getId() { |
|||
return id; |
|||
} |
|||
public void setId(Integer id) { |
|||
this.id = id; |
|||
} |
|||
public String getUserId() { |
|||
return userId; |
|||
} |
|||
public void setUserId(String userId) { |
|||
this.userId = userId; |
|||
} |
|||
public int getBookingId() { |
|||
return bookingId; |
|||
} |
|||
public void setBookingId(int bookingId) { |
|||
this.bookingId = bookingId; |
|||
} |
|||
public String getTxansactionId() { |
|||
return txansactionId; |
|||
} |
|||
public void setTxansactionId(String txansactionId) { |
|||
this.txansactionId = txansactionId; |
|||
} |
|||
public String getStatusCode() { |
|||
return statusCode; |
|||
} |
|||
public void setStatusCode(String statusCode) { |
|||
this.statusCode = statusCode; |
|||
} |
|||
public String getDate() { |
|||
return date; |
|||
} |
|||
public void setDate(String date) { |
|||
this.date = date; |
|||
} |
|||
public String getResponse() { |
|||
return response; |
|||
} |
|||
public void setResponse(String response) { |
|||
this.response = response; |
|||
} |
|||
public String getAmount() { |
|||
return Amount; |
|||
} |
|||
public void setAmount(String amount) { |
|||
Amount = amount; |
|||
} |
|||
public String getBalaceAmount() { |
|||
return balaceAmount; |
|||
} |
|||
public void setBalaceAmount(String balaceAmount) { |
|||
this.balaceAmount = balaceAmount; |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,115 @@ |
|||
package com.gcc.communityHall.paymentService.entity; |
|||
|
|||
import jakarta.persistence.*; |
|||
|
|||
@Entity |
|||
public class TransactionResponse { |
|||
@Id |
|||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
|||
private Integer id; |
|||
private String userId; |
|||
private int bookingId; |
|||
private int hallId; |
|||
|
|||
private String txansactionId; |
|||
private String statusCode; |
|||
private String tpslTxnId; |
|||
private String date; |
|||
|
|||
@Column(length = 5000) |
|||
private String response; |
|||
private String Amount; |
|||
|
|||
public TransactionResponse() { |
|||
|
|||
} |
|||
|
|||
public TransactionResponse(Integer id, String userId, int bookingId,int hallId, String txansactionId, String statusCode, |
|||
String tpslTxnId, String date, String response, String amount) { |
|||
super(); |
|||
this.id = id; |
|||
this.userId = userId; |
|||
this.bookingId = bookingId; |
|||
this.hallId=hallId; |
|||
this.txansactionId = txansactionId; |
|||
this.statusCode = statusCode; |
|||
this.tpslTxnId = tpslTxnId; |
|||
this.date = date; |
|||
this.response = response; |
|||
Amount = amount; |
|||
} |
|||
public Integer getId() { |
|||
return id; |
|||
} |
|||
public void setId(Integer id) { |
|||
this.id = id; |
|||
} |
|||
public String getUserId() { |
|||
return userId; |
|||
} |
|||
public void setUserId(String userId) { |
|||
this.userId = userId; |
|||
} |
|||
public int getBookingId() { |
|||
return bookingId; |
|||
} |
|||
public void setBookingId(int bookingId) { |
|||
this.bookingId = bookingId; |
|||
} |
|||
public String getTxansactionId() { |
|||
return txansactionId; |
|||
} |
|||
public void setTxansactionId(String txansactionId) { |
|||
this.txansactionId = txansactionId; |
|||
} |
|||
public String getStatusCode() { |
|||
return statusCode; |
|||
} |
|||
public void setStatusCode(String statusCode) { |
|||
this.statusCode = statusCode; |
|||
} |
|||
public String getTpslTxnId() { |
|||
return tpslTxnId; |
|||
} |
|||
public void setTpslTxnId(String tpslTxnId) { |
|||
this.tpslTxnId = tpslTxnId; |
|||
} |
|||
public String getDate() { |
|||
return date; |
|||
} |
|||
public void setDate(String date) { |
|||
this.date = date; |
|||
} |
|||
public String getResponse() { |
|||
return response; |
|||
} |
|||
public void setResponse(String response) { |
|||
this.response = response; |
|||
} |
|||
public String getAmount() { |
|||
return Amount; |
|||
} |
|||
public void setAmount(String amount) { |
|||
Amount = amount; |
|||
} |
|||
|
|||
public int getHallId() { |
|||
return hallId; |
|||
} |
|||
|
|||
public void setHallId(int hallId) { |
|||
this.hallId = hallId; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return "TransactionResponse [id=" + id + ", userId=" + userId + ", bookingId=" + bookingId + ", hallId=" |
|||
+ hallId + ", txansactionId=" + txansactionId + ", statusCode=" + statusCode + ", tpslTxnId=" |
|||
+ tpslTxnId + ", date=" + date + ", response=" + response + ", Amount=" + Amount + "]"; |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,31 @@ |
|||
package com.gcc.communityHall.paymentService.refund.DTO; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonProperty; |
|||
|
|||
public class ErrorDetails { |
|||
|
|||
@JsonProperty("code") |
|||
private String errorCode; |
|||
|
|||
@JsonProperty("desc") |
|||
private String errorDescription; |
|||
|
|||
public String getErrorCode() { |
|||
return errorCode; |
|||
} |
|||
|
|||
public void setErrorCode(String errorCode) { |
|||
this.errorCode = errorCode; |
|||
} |
|||
|
|||
public String getErrorDescription() { |
|||
return errorDescription; |
|||
} |
|||
|
|||
public void setErrorDescription(String errorDescription) { |
|||
this.errorDescription = errorDescription; |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,99 @@ |
|||
package com.gcc.communityHall.paymentService.refund.DTO; |
|||
|
|||
public class PaymentMethod { |
|||
|
|||
private String token; |
|||
private String instrumentAliasName; |
|||
private String instrumentToken; |
|||
private String bankSelectionCode; |
|||
private PaymentTransaction paymentTransaction; |
|||
private Object authentication; |
|||
private ErrorDetails error; |
|||
private Object desItc; |
|||
private Object walletDetails; |
|||
|
|||
|
|||
private Object paymentMode; |
|||
private Object aCS; |
|||
private Object oTP; |
|||
|
|||
public String getToken() { |
|||
return token; |
|||
} |
|||
public void setToken(String token) { |
|||
this.token = token; |
|||
} |
|||
public String getInstrumentAliasName() { |
|||
return instrumentAliasName; |
|||
} |
|||
public void setInstrumentAliasName(String instrumentAliasName) { |
|||
this.instrumentAliasName = instrumentAliasName; |
|||
} |
|||
public String getInstrumentToken() { |
|||
return instrumentToken; |
|||
} |
|||
public void setInstrumentToken(String instrumentToken) { |
|||
this.instrumentToken = instrumentToken; |
|||
} |
|||
public String getBankSelectionCode() { |
|||
return bankSelectionCode; |
|||
} |
|||
public void setBankSelectionCode(String bankSelectionCode) { |
|||
this.bankSelectionCode = bankSelectionCode; |
|||
} |
|||
public PaymentTransaction getPaymentTransaction() { |
|||
return paymentTransaction; |
|||
} |
|||
public void setPaymentTransaction(PaymentTransaction paymentTransaction) { |
|||
this.paymentTransaction = paymentTransaction; |
|||
} |
|||
public Object getAuthentication() { |
|||
return authentication; |
|||
} |
|||
public void setAuthentication(Object authentication) { |
|||
this.authentication = authentication; |
|||
} |
|||
public ErrorDetails getError() { |
|||
return error; |
|||
} |
|||
public void setError(ErrorDetails error) { |
|||
this.error = error; |
|||
} |
|||
public Object getDesItc() { |
|||
return desItc; |
|||
} |
|||
public void setDesItc(Object desItc) { |
|||
this.desItc = desItc; |
|||
} |
|||
public Object getWalletDetails() { |
|||
return walletDetails; |
|||
} |
|||
public void setWalletDetails(Object walletDetails) { |
|||
this.walletDetails = walletDetails; |
|||
} |
|||
public Object getPaymentMode() { |
|||
return paymentMode; |
|||
} |
|||
public void setPaymentMode(Object paymentMode) { |
|||
this.paymentMode = paymentMode; |
|||
} |
|||
public Object getaCS() { |
|||
return aCS; |
|||
} |
|||
public void setaCS(Object aCS) { |
|||
this.aCS = aCS; |
|||
} |
|||
public Object getoTP() { |
|||
return oTP; |
|||
} |
|||
public void setoTP(Object oTP) { |
|||
this.oTP = oTP; |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,172 @@ |
|||
package com.gcc.communityHall.paymentService.refund.DTO; |
|||
|
|||
public class PaymentTransaction { |
|||
|
|||
private String amount; |
|||
private String balanceAmount; |
|||
private String bankReferenceIdentifier; |
|||
private String dateTime; |
|||
private String errorMessage; |
|||
private String identifier; |
|||
private String refundIdentifier; |
|||
private String statusCode; |
|||
private String statusMessage; |
|||
|
|||
private Object instruction; |
|||
private String reference; |
|||
private Object refundDdetails; |
|||
private Object otherDetails; |
|||
private Object rrnNumber; |
|||
private Object authCode; |
|||
private Object retTranStatus; |
|||
private Object paymentDate; |
|||
private Object bankName; |
|||
private Object paymentModeCode; |
|||
private Object cardType; |
|||
private Object cardExpiry; |
|||
private Object mandateId; |
|||
private Object cardTokenStatus; |
|||
|
|||
public String getAmount() { |
|||
return amount; |
|||
} |
|||
public void setAmount(String amount) { |
|||
this.amount = amount; |
|||
} |
|||
public String getBalanceAmount() { |
|||
return balanceAmount; |
|||
} |
|||
public void setBalanceAmount(String balanceAmount) { |
|||
this.balanceAmount = balanceAmount; |
|||
} |
|||
public String getBankReferenceIdentifier() { |
|||
return bankReferenceIdentifier; |
|||
} |
|||
public void setBankReferenceIdentifier(String bankReferenceIdentifier) { |
|||
this.bankReferenceIdentifier = bankReferenceIdentifier; |
|||
} |
|||
public String getDateTime() { |
|||
return dateTime; |
|||
} |
|||
public void setDateTime(String dateTime) { |
|||
this.dateTime = dateTime; |
|||
} |
|||
public String getErrorMessage() { |
|||
return errorMessage; |
|||
} |
|||
public void setErrorMessage(String errorMessage) { |
|||
this.errorMessage = errorMessage; |
|||
} |
|||
public String getIdentifier() { |
|||
return identifier; |
|||
} |
|||
public void setIdentifier(String identifier) { |
|||
this.identifier = identifier; |
|||
} |
|||
public String getRefundIdentifier() { |
|||
return refundIdentifier; |
|||
} |
|||
public void setRefundIdentifier(String refundIdentifier) { |
|||
this.refundIdentifier = refundIdentifier; |
|||
} |
|||
public String getStatusCode() { |
|||
return statusCode; |
|||
} |
|||
public void setStatusCode(String statusCode) { |
|||
this.statusCode = statusCode; |
|||
} |
|||
public String getStatusMessage() { |
|||
return statusMessage; |
|||
} |
|||
public void setStatusMessage(String statusMessage) { |
|||
this.statusMessage = statusMessage; |
|||
} |
|||
public Object getInstruction() { |
|||
return instruction; |
|||
} |
|||
public void setInstruction(Object instruction) { |
|||
this.instruction = instruction; |
|||
} |
|||
public String getReference() { |
|||
return reference; |
|||
} |
|||
public void setReference(String reference) { |
|||
this.reference = reference; |
|||
} |
|||
public Object getRefundDdetails() { |
|||
return refundDdetails; |
|||
} |
|||
public void setRefundDdetails(Object refundDdetails) { |
|||
this.refundDdetails = refundDdetails; |
|||
} |
|||
public Object getOtherDetails() { |
|||
return otherDetails; |
|||
} |
|||
public void setOtherDetails(Object otherDetails) { |
|||
this.otherDetails = otherDetails; |
|||
} |
|||
public Object getRrnNumber() { |
|||
return rrnNumber; |
|||
} |
|||
public void setRrnNumber(Object rrnNumber) { |
|||
this.rrnNumber = rrnNumber; |
|||
} |
|||
public Object getAuthCode() { |
|||
return authCode; |
|||
} |
|||
public void setAuthCode(Object authCode) { |
|||
this.authCode = authCode; |
|||
} |
|||
public Object getRetTranStatus() { |
|||
return retTranStatus; |
|||
} |
|||
public void setRetTranStatus(Object retTranStatus) { |
|||
this.retTranStatus = retTranStatus; |
|||
} |
|||
public Object getPaymentDate() { |
|||
return paymentDate; |
|||
} |
|||
public void setPaymentDate(Object paymentDate) { |
|||
this.paymentDate = paymentDate; |
|||
} |
|||
public Object getBankName() { |
|||
return bankName; |
|||
} |
|||
public void setBankName(Object bankName) { |
|||
this.bankName = bankName; |
|||
} |
|||
public Object getPaymentModeCode() { |
|||
return paymentModeCode; |
|||
} |
|||
public void setPaymentModeCode(Object paymentModeCode) { |
|||
this.paymentModeCode = paymentModeCode; |
|||
} |
|||
public Object getCardType() { |
|||
return cardType; |
|||
} |
|||
public void setCardType(Object cardType) { |
|||
this.cardType = cardType; |
|||
} |
|||
public Object getCardExpiry() { |
|||
return cardExpiry; |
|||
} |
|||
public void setCardExpiry(Object cardExpiry) { |
|||
this.cardExpiry = cardExpiry; |
|||
} |
|||
public Object getMandateId() { |
|||
return mandateId; |
|||
} |
|||
public void setMandateId(Object mandateId) { |
|||
this.mandateId = mandateId; |
|||
} |
|||
public Object getCardTokenStatus() { |
|||
return cardTokenStatus; |
|||
} |
|||
public void setCardTokenStatus(Object cardTokenStatus) { |
|||
this.cardTokenStatus = cardTokenStatus; |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,82 @@ |
|||
package com.gcc.communityHall.paymentService.refund.DTO; |
|||
|
|||
public class TransactionRefundResponse { |
|||
|
|||
private String merchantCode; |
|||
private String merchantTransactionIdentifier; |
|||
private String merchantTransactionRequestType; |
|||
private String responseType; |
|||
private String transactionState; |
|||
private PaymentMethod paymentMethod; |
|||
private ErrorDetails error; |
|||
|
|||
// @JsonIgnoreProperties("merchantAdditionalDetails") |
|||
private Object merchantAdditionalDetails; |
|||
|
|||
|
|||
public String getMerchantCode() { |
|||
return merchantCode; |
|||
} |
|||
public void setMerchantCode(String merchantCode) { |
|||
this.merchantCode = merchantCode; |
|||
} |
|||
public String getMerchantTransactionIdentifier() { |
|||
return merchantTransactionIdentifier; |
|||
} |
|||
public void setMerchantTransactionIdentifier(String merchantTransactionIdentifier) { |
|||
this.merchantTransactionIdentifier = merchantTransactionIdentifier; |
|||
} |
|||
public String getMerchantTransactionRequestType() { |
|||
return merchantTransactionRequestType; |
|||
} |
|||
public void setMerchantTransactionRequestType(String merchantTransactionRequestType) { |
|||
this.merchantTransactionRequestType = merchantTransactionRequestType; |
|||
} |
|||
public String getResponseType() { |
|||
return responseType; |
|||
} |
|||
public void setResponseType(String responseType) { |
|||
this.responseType = responseType; |
|||
} |
|||
public String getTransactionState() { |
|||
return transactionState; |
|||
} |
|||
public void setTransactionState(String transactionState) { |
|||
this.transactionState = transactionState; |
|||
} |
|||
public PaymentMethod getPaymentMethod() { |
|||
return paymentMethod; |
|||
} |
|||
public void setPaymentMethod(PaymentMethod paymentMethod) { |
|||
this.paymentMethod = paymentMethod; |
|||
} |
|||
public ErrorDetails getError() { |
|||
return error; |
|||
} |
|||
public void setError(ErrorDetails error) { |
|||
this.error = error; |
|||
} |
|||
|
|||
|
|||
|
|||
public Object getMerchantAdditionalDetails() { |
|||
return merchantAdditionalDetails; |
|||
} |
|||
public void setMerchantAdditionalDetails(Object merchantAdditionalDetails) { |
|||
this.merchantAdditionalDetails = merchantAdditionalDetails; |
|||
} |
|||
@Override |
|||
public String toString() { |
|||
return "MyClass{" + |
|||
"merchantCode='" + merchantCode + '\'' + |
|||
", merchantTransactionIdentifier='" + merchantTransactionIdentifier + '\'' + |
|||
", merchantTransactionRequestType='" + merchantTransactionRequestType + '\'' + |
|||
", responseType='" + responseType + '\'' + |
|||
", transactionState='" + transactionState + '\'' + |
|||
", paymentMethod=" + paymentMethod + |
|||
", error=" + error + |
|||
'}'; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
package com.gcc.communityHall.paymentService.repository; |
|||
|
|||
import com.gcc.communityHall.paymentService.entity.RefundResponse; |
|||
import org.springframework.data.jpa.repository.JpaRepository; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
@Repository |
|||
public interface TransRefundResRepository extends JpaRepository<RefundResponse,Integer>{ |
|||
|
|||
} |
|||
@ -0,0 +1,35 @@ |
|||
package com.gcc.communityHall.paymentService.repository; |
|||
|
|||
import com.gcc.communityHall.paymentService.entity.TransactionResponse; |
|||
import org.springframework.data.jpa.repository.JpaRepository; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
import java.util.Optional; |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
@Repository |
|||
public interface TransactionResponseRepository extends JpaRepository<TransactionResponse,Integer>{ |
|||
|
|||
Optional<TransactionResponse> findByBookingId(int bookingId); |
|||
Optional<TransactionResponse> findByTxansactionId(String txansactionId ); |
|||
|
|||
Optional<TransactionResponse> findByTxansactionIdAndStatusCode(String txansactionId,String statusCode ); |
|||
Optional<TransactionResponse> findByBookingIdAndStatusCode(int bookingId,String statusCode); |
|||
|
|||
// @Transactional |
|||
// @Query (value = "UPDATE transaction_response SET amount = :amount, booking_id =:booking_id , date = :date, hall_id = :hall_id, response = :response, status_code = :status_code, tpsl_txn_id = :tpsl_txn_id, txansaction_id = :txansaction_id, user_id = :user_id WHERE (id = :id)",nativeQuery = true) |
|||
// void updateTransactionResponse ( @Param("id") Integer id, @Param("amount") String amount, @Param("booking_id") int booking_id ,@Param("date" ) String date,@Param("hall_id" ) int hall_id ,@Param("response")String response,@Param("status_code")String status_code,@Param("tpsl_txn_id")String tpsl_txn_id,@Param("txansaction_id")String txansaction_id,@Param("user_id")String user_id ); |
|||
|
|||
// TransactionResponse saveTransactionResponse(Integer id, String amount, int bookingId, String date, int hallId, String response, |
|||
// String statusCode, String tpslTxnId, String txansactionId, String userId); |
|||
|
|||
// @Query(value = "INSERT INTO transaction_response ('id','amount','booking_id','date','hall_id','response','status_code','tpsl_txn_id','txansaction_id','user_id') VALUES (:id, :amount, :booking_id, :date, :hall_id, :response, :status_code, :tpsl_txn_id, :txansaction_id, :user_id)", nativeQuery = true) |
|||
// void saveTransactionResponse(@Param("id") int id, @Param("amount") String amount, @Param("booking_id") int booking_id ,@Param("date" ) String date,@Param("hall_id" ) int hall_id ,@Param("response")String response,@Param("status_code")String status_code,@Param("tpsl_txn_id")String tpsl_txn_id,@Param("txansaction_id")String txansaction_id,@Param("user_id")String user_id ); |
|||
// |
|||
//@Query (value = "UPDATE transaction_response SET 'amount' = :amount, 'booking_id' =:booking_id , 'date' = :date, 'hall_id' = :hall_id, 'response' = :response, 'status_code' = :status_code, 'tpsl_txn_id' = :tpsl_txn_id, 'txansaction_id' = :txansaction_id, 'user_id' = :user_id WHERE ('id' = :id)", nativeQuery = true) |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,38 @@ |
|||
package com.gcc.communityHall.paymentService.service; |
|||
|
|||
import com.gcc.communityHall.paymentService.entity.RefundResponse; |
|||
import com.gcc.communityHall.paymentService.entity.TransactionResponse; |
|||
|
|||
import java.security.NoSuchAlgorithmException; |
|||
|
|||
|
|||
|
|||
|
|||
public interface PaymentGatewayService { |
|||
|
|||
public String getToken(String merchantId, String txnId, String totalAmt, String accountNo, String consumerId, |
|||
String consumerMobileNo, String consumerEmailId, String debitStartDate, String debitEndDate, |
|||
String maxAmount, String amountType, String frequency, String cardNumber, String expMonth, String expYear, |
|||
String cvvCode, String salt |
|||
|
|||
) throws NoSuchAlgorithmException; |
|||
|
|||
public String generateToken(String token)throws NoSuchAlgorithmException; |
|||
public String encryptHxRefund(String text) throws Exception; |
|||
public String ToHexStrRefund(byte[] dataBuf); |
|||
public String decryptHxTRefund(String hxstrr) throws Exception; |
|||
public byte[] FromHexStr (String hxStr); |
|||
|
|||
public TransactionResponse recordResponse(TransactionResponse transactionResponse); |
|||
public RefundResponse recordRefund(RefundResponse refundReponse); |
|||
|
|||
public TransactionResponse getTransactionResponseByBookingId(int bookingId); |
|||
public TransactionResponse getTransactionResponseByTxansactionId(String txansactionId,String statusCode); |
|||
public TransactionResponse getTransactionResponseByBookingIdAndStatusCode(int bookingId,String statusCode); |
|||
|
|||
public String refundTheAmount(int bookingId,int userId) throws Exception; |
|||
|
|||
public String refundTheDepositAmount(int bookingId,int userId,double amount) throws Exception; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,300 @@ |
|||
package com.gcc.communityHall.paymentService.service; |
|||
|
|||
|
|||
import com.gcc.communityHall.paymentService.DTO.Merchant; |
|||
import com.gcc.communityHall.paymentService.DTO.Transaction; |
|||
import com.gcc.communityHall.paymentService.DTO.TransactionData; |
|||
import com.gcc.communityHall.paymentService.config.PaymentConfig; |
|||
import com.gcc.communityHall.paymentService.entity.RefundResponse; |
|||
import com.gcc.communityHall.paymentService.entity.TransactionResponse; |
|||
import com.gcc.communityHall.paymentService.refund.DTO.TransactionRefundResponse; |
|||
import com.gcc.communityHall.paymentService.repository.TransRefundResRepository; |
|||
import com.gcc.communityHall.paymentService.repository.TransactionResponseRepository; |
|||
import com.fasterxml.jackson.databind.ObjectMapper; |
|||
import com.google.gson.Gson; |
|||
import org.apache.commons.codec.binary.Hex; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.http.ResponseEntity; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.web.client.RestTemplate; |
|||
|
|||
import javax.crypto.Cipher; |
|||
import javax.crypto.spec.IvParameterSpec; |
|||
import javax.crypto.spec.SecretKeySpec; |
|||
import java.math.BigInteger; |
|||
import java.security.MessageDigest; |
|||
import java.security.NoSuchAlgorithmException; |
|||
import java.util.Optional; |
|||
|
|||
|
|||
@Service |
|||
public class PaymentGatewayServiceImpl implements PaymentGatewayService { |
|||
|
|||
@Autowired |
|||
private PaymentConfig paymentConfig; |
|||
|
|||
@Autowired |
|||
private TransactionResponseRepository transactionResRepo; |
|||
|
|||
@Autowired |
|||
private TransRefundResRepository refundResRepo; |
|||
|
|||
@Override |
|||
public String generateToken(String token) throws NoSuchAlgorithmException { |
|||
System.out.println("Token:-" + token); |
|||
MessageDigest md = MessageDigest.getInstance("SHA-512"); |
|||
md.update(token.getBytes()); |
|||
|
|||
byte[] bytes = md.digest(); |
|||
|
|||
BigInteger bigInt = new BigInteger(1, bytes); |
|||
String encryptedtoken = bigInt.toString(16); |
|||
|
|||
while (encryptedtoken.length() < 128) { |
|||
encryptedtoken = "0" + encryptedtoken; |
|||
} |
|||
System.out.println("Encryption :- " + encryptedtoken); |
|||
return encryptedtoken; |
|||
} |
|||
|
|||
//The process of encryption for refund API |
|||
@Override |
|||
public String encryptHxRefund(String text) throws Exception { |
|||
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); |
|||
SecretKeySpec keySpec = new SecretKeySpec(this.paymentConfig.getEncryptionKeyByte(), "AES"); |
|||
IvParameterSpec ivSpec = new IvParameterSpec(this.paymentConfig.getEncryptionIVByte()); |
|||
cipher.init(1, keySpec, ivSpec); |
|||
byte[] results = cipher.doFinal(text.getBytes("UTF-8")); |
|||
String hxencstr = ToHexStrRefund(results); |
|||
return hxencstr; |
|||
} |
|||
|
|||
@Override |
|||
public String ToHexStrRefund(byte[] dataBuf) { |
|||
String hxstr = null; |
|||
Hex hx = new Hex(); |
|||
hxstr = new String(hx.encode(dataBuf)); |
|||
return hxstr; |
|||
} |
|||
|
|||
//The process of decryption for refund API |
|||
@Override |
|||
public String decryptHxTRefund(String hxstrr) throws Exception{ |
|||
Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding"); |
|||
|
|||
SecretKeySpec keySpec = new SecretKeySpec(this.paymentConfig.getEncryptionKeyByte(), "AES"); |
|||
IvParameterSpec ivSpec = new IvParameterSpec(this.paymentConfig.getEncryptionIVByte()); |
|||
cipher.init(Cipher.DECRYPT_MODE, keySpec, ivSpec); |
|||
|
|||
byte[] decbytes = FromHexStr(hxstrr); |
|||
|
|||
byte[] results = cipher.doFinal(decbytes); |
|||
return new String(results, "UTF-8").trim(); |
|||
} |
|||
|
|||
@Override |
|||
public byte[] FromHexStr(String hxStr) { |
|||
byte[] charArray = hxStr.getBytes(); |
|||
byte[] bufstr = null; |
|||
Hex hxx = new Hex(); |
|||
|
|||
try { |
|||
bufstr = hxx.decode(charArray); |
|||
} catch (Exception e) { |
|||
e.printStackTrace(); |
|||
} |
|||
|
|||
return bufstr; |
|||
} |
|||
|
|||
@Override |
|||
public TransactionResponse recordResponse( TransactionResponse transactionResponse) { |
|||
// TODO Auto-generated method stub |
|||
System.out.println("====================================="); |
|||
System.out.println(transactionResponse.toString()); |
|||
return transactionResRepo.save(transactionResponse); |
|||
//transactionResRepo.updateTransactionResponse(transactionResponse.getId(), transactionResponse.getAmount(), transactionResponse.getBookingId(), transactionResponse.getDate(), transactionResponse.getHallId(), transactionResponse.getResponse(), transactionResponse.getStatusCode(), transactionResponse.getTpslTxnId(), transactionResponse.getTxansactionId(), transactionResponse.getUserId()); |
|||
//return transactionResponse; |
|||
} |
|||
|
|||
@Override |
|||
public RefundResponse recordRefund(RefundResponse refundReponse) { |
|||
// TODO Auto-generated method stub |
|||
return this.refundResRepo.save(refundReponse); |
|||
} |
|||
|
|||
@Override |
|||
public TransactionResponse getTransactionResponseByBookingId(int bookingId) { |
|||
// TODO Auto-generated method stub |
|||
Optional<TransactionResponse> findByBookingId = this.transactionResRepo.findByBookingId(bookingId); |
|||
if(findByBookingId.isPresent()) { |
|||
return findByBookingId.get(); |
|||
} |
|||
else { |
|||
return new TransactionResponse(); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public TransactionResponse getTransactionResponseByTxansactionId(String txansactionId,String statusCode) { |
|||
// TODO Auto-generated method stub |
|||
Optional<TransactionResponse> findByTxansactionId=this.transactionResRepo.findByTxansactionIdAndStatusCode(txansactionId,statusCode); |
|||
if(findByTxansactionId.isPresent()) { |
|||
return findByTxansactionId.get(); |
|||
} |
|||
else { |
|||
return new TransactionResponse(); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public TransactionResponse getTransactionResponseByBookingIdAndStatusCode(int bookingId, String statusCode) { |
|||
Optional<TransactionResponse> findByTxansactionId=this.transactionResRepo .findByBookingIdAndStatusCode(bookingId,statusCode); |
|||
if(findByTxansactionId.isPresent()) { |
|||
return findByTxansactionId.get(); |
|||
} |
|||
else { |
|||
return new TransactionResponse(); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public String getToken(String merchantId, String txnId, String totalAmt, String accountNo, String consumerId, |
|||
String consumerMobileNo, String consumerEmailId, String debitStartDate, String debitEndDate, |
|||
String maxAmount, String amountType, String frequency, String cardNumber, String expMonth, String expYear, |
|||
String cvvCode, String salt) throws NoSuchAlgorithmException { |
|||
String token=merchantId+txnId+totalAmt+accountNo+consumerId+consumerMobileNo+ |
|||
consumerEmailId+debitStartDate+debitEndDate+maxAmount+amountType+ |
|||
frequency+cardNumber+expMonth+expYear+cvvCode+salt; |
|||
|
|||
return generateToken(token); |
|||
} |
|||
|
|||
@Override |
|||
public String refundTheAmount(int bookingId,int userId) throws Exception { |
|||
System.out.println("Refund Api call.......working on it"); |
|||
TransactionResponse transactionRes = this.getTransactionResponseByBookingIdAndStatusCode(bookingId,this.paymentConfig.getTransactionSuccessCode()); |
|||
RefundResponse recordRefundResponse = new RefundResponse(); |
|||
|
|||
Merchant merchant = new Merchant(); |
|||
merchant.setIdentifier(this.paymentConfig.getMerchantId()); |
|||
|
|||
Transaction transaction = new Transaction(); |
|||
transaction.setAmount(transactionRes.getAmount());//Amount given here |
|||
transaction.setIdentifier(""); |
|||
transaction.setDateTime(transactionRes.getDate()); //At what date transaction happens |
|||
transaction.setRequestType("R"); |
|||
transaction.setToken(""); |
|||
transaction.setReference(transactionRes.getTpslTxnId()); //tpsl refer number |
|||
|
|||
|
|||
TransactionData transactionData = new TransactionData(); |
|||
transactionData.setMerchant(merchant); |
|||
transactionData.setTransaction(transaction); |
|||
|
|||
// Serialize TransactionData object to JSON string |
|||
Gson gson = new Gson(); |
|||
String json = gson.toJson(transactionData); |
|||
System.out.println(json); |
|||
|
|||
String encryptHxRefund = this.encryptHxRefund(json); |
|||
RestTemplate resttemplate = new RestTemplate(); |
|||
String Url ="https://www.tpsl-india.in/PaymentGateway/merchant2.pg/"+this.paymentConfig.getMerchantId(); |
|||
ResponseEntity<String> postForEntity = resttemplate.postForEntity(Url, encryptHxRefund, String.class); |
|||
|
|||
String decryptHxTRefund = this.decryptHxTRefund(postForEntity.getBody()); |
|||
recordRefundResponse.setResponse(decryptHxTRefund); |
|||
recordRefundResponse.setUserId(String.valueOf(userId));//make it dynamic |
|||
recordRefundResponse.setBookingId(bookingId); |
|||
try { |
|||
ObjectMapper objectMapper = new ObjectMapper(); |
|||
|
|||
TransactionRefundResponse myObject = objectMapper.readValue(decryptHxTRefund, TransactionRefundResponse.class); |
|||
System.out.println(myObject.toString()); |
|||
|
|||
// if(myObject.getPaymentMethod().getPaymentTransaction().getStatusCode().equals(this.paymentConfig.getRefundSuccessCode())) { |
|||
// System.out.println("Refund Process complete........"+bookingId); |
|||
// recordRefundResponse.setAmount(myObject.getPaymentMethod().getPaymentTransaction().getAmount()); |
|||
// recordRefundResponse.setBalaceAmount(myObject.getPaymentMethod().getPaymentTransaction().getBalanceAmount()); |
|||
// } |
|||
recordRefundResponse.setStatusCode(myObject.getPaymentMethod().getPaymentTransaction().getStatusCode()); |
|||
recordRefundResponse.setTxansactionId(myObject.getMerchantTransactionIdentifier()); |
|||
if(myObject.getPaymentMethod().getPaymentTransaction().getStatusCode().equals(this.paymentConfig.getRefundSuccessCode())) { |
|||
System.out.println("Refund Process complete........"+bookingId); |
|||
recordRefundResponse.setAmount(myObject.getPaymentMethod().getPaymentTransaction().getAmount()); |
|||
recordRefundResponse.setBalaceAmount(myObject.getPaymentMethod().getPaymentTransaction().getBalanceAmount()); |
|||
this.recordRefund(recordRefundResponse); |
|||
return "Refunded"; |
|||
} |
|||
this.recordRefund(recordRefundResponse); |
|||
return "Error"; |
|||
|
|||
} catch (Exception e) { |
|||
e.printStackTrace(); |
|||
} |
|||
return "Error"; |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public String refundTheDepositAmount(int bookingId, int userId,double amount) throws Exception { |
|||
System.out.println("Refund Api call.......working on it"); |
|||
TransactionResponse transactionRes = this.getTransactionResponseByBookingIdAndStatusCode(bookingId,this.paymentConfig.getTransactionSuccessCode()); |
|||
RefundResponse recordRefundResponse = new RefundResponse(); |
|||
|
|||
Merchant merchant = new Merchant(); |
|||
merchant.setIdentifier(this.paymentConfig.getMerchantId()); |
|||
|
|||
Transaction transaction = new Transaction(); |
|||
transaction.setAmount(String.valueOf(amount));//Amount given here |
|||
transaction.setIdentifier(""); |
|||
transaction.setDateTime(transactionRes.getDate()); //At what date transaction happens |
|||
transaction.setRequestType("R"); |
|||
transaction.setToken(""); |
|||
transaction.setReference(transactionRes.getTpslTxnId()); //tpsl refer number |
|||
|
|||
|
|||
TransactionData transactionData = new TransactionData(); |
|||
transactionData.setMerchant(merchant); |
|||
transactionData.setTransaction(transaction); |
|||
|
|||
// Serialize TransactionData object to JSON string |
|||
Gson gson = new Gson(); |
|||
String json = gson.toJson(transactionData); |
|||
System.out.println(json); |
|||
|
|||
String encryptHxRefund = this.encryptHxRefund(json); |
|||
RestTemplate resttemplate = new RestTemplate(); |
|||
String Url ="https://www.tpsl-india.in/PaymentGateway/merchant2.pg/"+this.paymentConfig.getMerchantId(); |
|||
ResponseEntity<String> postForEntity = resttemplate.postForEntity(Url, encryptHxRefund, String.class); |
|||
|
|||
String decryptHxTRefund = this.decryptHxTRefund(postForEntity.getBody()); |
|||
recordRefundResponse.setResponse(decryptHxTRefund); |
|||
recordRefundResponse.setUserId(String.valueOf(userId));//make it dynamic |
|||
recordRefundResponse.setBookingId(bookingId); |
|||
try { |
|||
ObjectMapper objectMapper = new ObjectMapper(); |
|||
|
|||
TransactionRefundResponse myObject = objectMapper.readValue(decryptHxTRefund, TransactionRefundResponse.class); |
|||
System.out.println(myObject.toString()); |
|||
|
|||
recordRefundResponse.setStatusCode(myObject.getPaymentMethod().getPaymentTransaction().getStatusCode()); |
|||
recordRefundResponse.setTxansactionId(myObject.getMerchantTransactionIdentifier()); |
|||
if(myObject.getPaymentMethod().getPaymentTransaction().getStatusCode().equals(this.paymentConfig.getRefundSuccessCode())) { |
|||
System.out.println("Refund Process complete........"+bookingId); |
|||
recordRefundResponse.setAmount(myObject.getPaymentMethod().getPaymentTransaction().getAmount()); |
|||
recordRefundResponse.setBalaceAmount(myObject.getPaymentMethod().getPaymentTransaction().getBalanceAmount()); |
|||
this.recordRefund(recordRefundResponse); |
|||
return "Refunded"; |
|||
} |
|||
this.recordRefund(recordRefundResponse); |
|||
return "Error"; |
|||
|
|||
} catch (Exception e) { |
|||
e.printStackTrace(); |
|||
} |
|||
return "Error"; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,37 @@ |
|||
package com.gcc.communityHall.paymentService.service; |
|||
|
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.Random; |
|||
|
|||
@Service |
|||
public class TransactionNumberGenerator { |
|||
|
|||
public String generateTransactionNumber() { |
|||
// Define the length of the transaction number |
|||
int length = 12; |
|||
|
|||
// Define characters to be used in the transaction number |
|||
String characters = "0123456789"; |
|||
|
|||
// Create a StringBuilder to store the transaction number |
|||
StringBuilder sb = new StringBuilder(); |
|||
|
|||
// Create an instance of Random class |
|||
Random random = new Random(); |
|||
|
|||
// Generate the transaction number |
|||
for (int i = 0; i < length; i++) { |
|||
// Generate a random index within the range of characters |
|||
int randomIndex = random.nextInt(characters.length()); |
|||
|
|||
// Append the character at the random index to the transaction number |
|||
sb.append(characters.charAt(randomIndex)); |
|||
} |
|||
|
|||
|
|||
// Convert StringBuilder to String and return |
|||
return sb.toString(); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
package com.gcc.communityHall.repository; |
|||
|
|||
import com.gcc.communityHall.entity.BookingCalendar; |
|||
import org.springframework.data.jpa.repository.JpaRepository; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
@Repository |
|||
public interface BookingCalendarRepository extends JpaRepository<BookingCalendar,Integer> { |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
package com.gcc.communityHall.repository; |
|||
|
|||
import com.gcc.communityHall.entity.BookingDetails; |
|||
import org.springframework.data.jpa.repository.JpaRepository; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
@Repository |
|||
public interface BookingDetailsRepository extends JpaRepository<BookingDetails,Integer> { |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
package com.gcc.communityHall.repository; |
|||
|
|||
import com.gcc.communityHall.entity.BookingDocuments; |
|||
import org.springframework.data.jpa.repository.JpaRepository; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
@Repository |
|||
public interface BookingDocumentsRepository extends JpaRepository<BookingDocuments,Integer> { |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
package com.gcc.communityHall.repository; |
|||
|
|||
import com.gcc.communityHall.entity.BookingHistory; |
|||
import org.springframework.data.jpa.repository.JpaRepository; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
@Repository |
|||
public interface BookingHistoryRepository extends JpaRepository<BookingHistory,Integer> { |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
package com.gcc.communityHall.repository; |
|||
|
|||
import com.gcc.communityHall.entity.Damage; |
|||
import org.springframework.data.jpa.repository.JpaRepository; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
@Repository |
|||
public interface DamageRepository extends JpaRepository<Damage,Integer> { |
|||
} |
|||
@ -0,0 +1,10 @@ |
|||
package com.gcc.communityHall.repository; |
|||
|
|||
import com.gcc.communityHall.entity.BookingDocuments; |
|||
import com.gcc.communityHall.entity.EbDetails; |
|||
import org.springframework.data.jpa.repository.JpaRepository; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
@Repository |
|||
public interface EbDetailsRepository extends JpaRepository<EbDetails,Integer> { |
|||
} |
|||
@ -0,0 +1,10 @@ |
|||
package com.gcc.communityHall.repository; |
|||
|
|||
import com.gcc.communityHall.entity.BookingDocuments; |
|||
import com.gcc.communityHall.entity.GccBlockingDate; |
|||
import org.springframework.data.jpa.repository.JpaRepository; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
@Repository |
|||
public interface GccBlockingDateRepository extends JpaRepository<GccBlockingDate,Integer> { |
|||
} |
|||
@ -0,0 +1,10 @@ |
|||
package com.gcc.communityHall.repository; |
|||
|
|||
|
|||
import com.gcc.communityHall.entity.HallDetails; |
|||
import org.springframework.data.jpa.repository.JpaRepository; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
@Repository |
|||
public interface HallDetailsRepository extends JpaRepository<HallDetails,Integer> { |
|||
} |
|||
@ -0,0 +1,10 @@ |
|||
package com.gcc.communityHall.repository; |
|||
|
|||
|
|||
import com.gcc.communityHall.entity.HallImages; |
|||
import org.springframework.data.jpa.repository.JpaRepository; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
@Repository |
|||
public interface HallImagesRepository extends JpaRepository<HallImages,Integer> { |
|||
} |
|||
@ -0,0 +1,10 @@ |
|||
package com.gcc.communityHall.repository; |
|||
|
|||
|
|||
import com.gcc.communityHall.entity.Login; |
|||
import org.springframework.data.jpa.repository.JpaRepository; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
@Repository |
|||
public interface LoginRepository extends JpaRepository<Login,Integer> { |
|||
} |
|||
@ -0,0 +1,10 @@ |
|||
package com.gcc.communityHall.repository; |
|||
|
|||
|
|||
import com.gcc.communityHall.entity.Payments; |
|||
import org.springframework.data.jpa.repository.JpaRepository; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
@Repository |
|||
public interface PaymentsRepository extends JpaRepository<Payments,Integer> { |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
package com.gcc.communityHall.repository; |
|||
|
|||
import com.gcc.communityHall.entity.ReasonDocumentMaster; |
|||
import org.springframework.data.jpa.repository.JpaRepository; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
@Repository |
|||
public interface ReasonDocMasterRepository extends JpaRepository<ReasonDocumentMaster,Integer> { |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
package com.gcc.communityHall.repository; |
|||
|
|||
import com.gcc.communityHall.entity.ReasonMaster; |
|||
import org.springframework.data.jpa.repository.JpaRepository; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
@Repository |
|||
public interface ReasonMasterRepository extends JpaRepository<ReasonMaster,Integer> { |
|||
} |
|||
@ -0,0 +1,10 @@ |
|||
package com.gcc.communityHall.repository; |
|||
|
|||
|
|||
import com.gcc.communityHall.entity.RefundTransaction; |
|||
import org.springframework.data.jpa.repository.JpaRepository; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
@Repository |
|||
public interface RefundTransactionRepository extends JpaRepository<RefundTransaction,Integer> { |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
package com.gcc.communityHall.repository; |
|||
|
|||
import com.gcc.communityHall.entity.Settlement; |
|||
import org.springframework.data.jpa.repository.JpaRepository; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
@Repository |
|||
public interface SettlementRepository extends JpaRepository<Settlement,Integer> { |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
package com.gcc.communityHall.repository; |
|||
|
|||
import com.gcc.communityHall.entity.SmsSender; |
|||
import org.springframework.data.jpa.repository.JpaRepository; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
@Repository |
|||
public interface SmsSenderRepository extends JpaRepository<SmsSender,Integer> { |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
package com.gcc.communityHall.repository; |
|||
|
|||
import com.gcc.communityHall.entity.UserHistory; |
|||
import org.springframework.data.jpa.repository.JpaRepository; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
@Repository |
|||
public interface UserHistoryRepository extends JpaRepository<UserHistory,Integer> { |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
package com.gcc.communityHall.repository; |
|||
|
|||
import com.gcc.communityHall.entity.Users; |
|||
import org.springframework.data.jpa.repository.JpaRepository; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Repository |
|||
public interface UsersRepository extends JpaRepository<Users,Integer> { |
|||
|
|||
List<Users> findByUserstatus(Users.userStatus userStatus); |
|||
List<Users> findByUsertype(Users.userType userType); |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
package com.gcc.communityHall.service; |
|||
|
|||
import com.gcc.communityHall.entity.BookingDetails; |
|||
|
|||
import java.util.Map; |
|||
|
|||
public interface BookingService { |
|||
BookingDetails getBookingsById(int BookingId); |
|||
BookingDetails updateBookingHistory(BookingDetails bd); |
|||
public String confirmTheDateAndSlot(String fromDate, String toDate, int days, int fromStartingSlot, int fromEndingSlot, int toStartingSlot, int toEndingSlot, int bookingId,int userId); |
|||
|
|||
public String saveBookingDetails(Map<String,Object> formData); |
|||
|
|||
} |
|||
@ -0,0 +1,4 @@ |
|||
package com.gcc.communityHall.service; |
|||
|
|||
public interface CalendarService { |
|||
} |
|||
@ -0,0 +1,31 @@ |
|||
package com.gcc.communityHall.service; |
|||
|
|||
import com.gcc.communityHall.entity.HallDetails; |
|||
import org.springframework.web.bind.annotation.RequestParam; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface HallDetailService { |
|||
|
|||
HallDetails saveHallDetails(HallDetails hallDetails, List<MultipartFile> hallImages); |
|||
HallDetails getHallById(int hallId); |
|||
HallDetails deActivateHallById(int hallId); |
|||
|
|||
HallDetails saveHall( |
|||
String hallName, |
|||
float depositAmount, |
|||
float halfDayAmt, float fullDayAmt, |
|||
float gst ,float hallArea, String ebNumber, |
|||
int parkingCapacity, int seatingCapacity, |
|||
String doorNo, String street, |
|||
String area, String zone, |
|||
String division, String landMark, |
|||
String city, |
|||
int pinCode,String latitude, |
|||
String longitude, String hallInchargeName, |
|||
long hallInchargeNo, HallDetails.HallStatus status, |
|||
String updatedId, |
|||
MultipartFile hallImages[] ); |
|||
|
|||
} |
|||
@ -0,0 +1,149 @@ |
|||
package com.gcc.communityHall.service.Impl; |
|||
|
|||
import com.gcc.communityHall.entity.*; |
|||
import com.gcc.communityHall.others.UserSession; |
|||
import com.gcc.communityHall.repository.BookingDetailsRepository; |
|||
import com.gcc.communityHall.repository.BookingDocumentsRepository; |
|||
import com.gcc.communityHall.repository.ReasonDocMasterRepository; |
|||
import com.gcc.communityHall.service.BookingService; |
|||
import com.gcc.communityHall.service.HallDetailService; |
|||
import com.gcc.communityHall.service.ReasonMasterService; |
|||
import com.gcc.communityHall.service.UserService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.beans.factory.annotation.Value; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import java.io.FileOutputStream; |
|||
import java.time.LocalDate; |
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
@Service |
|||
public class BookingServiceImpl implements BookingService { |
|||
|
|||
@Autowired |
|||
private BookingDetailsRepository bookingDetailsRepository; |
|||
@Autowired |
|||
private BookingDocumentsRepository bookingDocumentsRepository; |
|||
|
|||
@Autowired |
|||
private ReasonMasterService reasonMasterService; |
|||
@Autowired |
|||
private HallDetailService hallDetailService; |
|||
|
|||
@Autowired |
|||
private UserService userService; |
|||
|
|||
@Autowired |
|||
private UserSession userSession; |
|||
|
|||
@Value("${file.upload.directory}") |
|||
private String uploadDirectory; |
|||
|
|||
@Value("${file.fullpath}") |
|||
private String serverPath; |
|||
|
|||
|
|||
@Override |
|||
public BookingDetails getBookingsById(int BookingId) { |
|||
return bookingDetailsRepository.findById(BookingId).get(); |
|||
} |
|||
|
|||
@Override |
|||
public BookingDetails updateBookingHistory(BookingDetails bd) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public String confirmTheDateAndSlot(String fromDate, String toDate, int days, int fromStartingSlot, int fromEndingSlot, int toStartingSlot, int toEndingSlot, int bookingId, int userId) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public String saveBookingDetails(Map<String, Object> formData) { |
|||
System.out.println(formData); |
|||
ReasonMaster reasonMaster=reasonMasterService.getReasonById(Integer.parseInt(formData.get("reasonId").toString())); |
|||
HallDetails hallDetails = hallDetailService.getHallById(Integer.parseInt(formData.get("hallId").toString())); |
|||
Users user=userService.getUserById(userSession.getUserId()); |
|||
BookingDetails bookingDetails = new BookingDetails(); |
|||
if(user!=null) { |
|||
bookingDetails.setUsers(user); |
|||
if (hallDetails != null) { |
|||
bookingDetails.setHallDetails(hallDetails); |
|||
bookingDetails.setDepositAmount(hallDetails.getDepositAmount()); |
|||
String startDate =formData.get("startDate").toString(); |
|||
String endDate =formData.get("endDate").toString(); |
|||
int days = Integer.parseInt(formData.get("days").toString()); |
|||
int startingSlot = Integer.parseInt(formData.get("startingSlot").toString()); |
|||
int endingSlot = Integer.parseInt(formData.get("endingSlot").toString()); |
|||
double hallAmount =calcHallAmount(hallDetails,days,startingSlot,endingSlot); |
|||
double gstAmount = (hallAmount*hallDetails.getGst())/100; |
|||
bookingDetails.setHallAmount(hallAmount); |
|||
bookingDetails.setGst(gstAmount); |
|||
bookingDetails.setNoOfDays(days); |
|||
bookingDetails.setStartingSlot(startingSlot); |
|||
bookingDetails.setEndingSlot(endingSlot); |
|||
bookingDetails.setStartDate(startDate); |
|||
bookingDetails.setEndDate(endDate); |
|||
bookingDetails.setBookingDate(LocalDate.now()); |
|||
bookingDetails.setReason(reasonMaster.getReason()); |
|||
bookingDetails = bookingDetailsRepository.save(bookingDetails); |
|||
} |
|||
if (reasonMaster != null) { |
|||
List<ReasonDocumentMaster> reasonDocMaster = reasonMaster.getReasonDocumentMasterList(); |
|||
for (ReasonDocumentMaster rm : reasonDocMaster) { |
|||
BookingDocuments bd = new BookingDocuments(); |
|||
bd.setBookingDetails(bookingDetails); |
|||
if (rm.isAddTextField()) { |
|||
String name= formData.get(rm.getFieldName()).toString(); |
|||
bd.setName(name); |
|||
bd.setBooking_label(rm.getFieldName().toString()); |
|||
} |
|||
if (rm.isAddDocumentField()) { |
|||
MultipartFile file = (MultipartFile)formData.get(rm.getDocFieldName()); |
|||
bd.setBookingDocUrl(serverPath+"images/"+reasonMaster.getReason().toLowerCase()+"/"+bookingDetails.getBookingId()+"_"+file.getOriginalFilename()); |
|||
String filePath =uploadDirectory+"/"+reasonMaster.getReason()+"/"+bookingDetails.getBookingId()+"_"+file.getOriginalFilename(); |
|||
bd.setDocumentName(file.getOriginalFilename()); |
|||
bd.setDocumentType(file.getContentType()); |
|||
try(FileOutputStream fos = new FileOutputStream(filePath)){ |
|||
byte [] bytes = file.getBytes(); |
|||
fos.write(bytes); |
|||
} catch (Exception e) { |
|||
throw new RuntimeException(e); |
|||
} |
|||
bookingDocumentsRepository.save(bd); |
|||
|
|||
|
|||
} |
|||
} |
|||
|
|||
} |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
private double calcHallAmount(HallDetails hallDetails,int days,int startingSlot,int endingSlot){ |
|||
double hallAmount = 0; |
|||
if(days==1 && startingSlot==1 && endingSlot==2){ //full day |
|||
hallAmount =hallDetails.getFullDayRent(); |
|||
|
|||
} else if (days==1 && (startingSlot==1 && endingSlot==1)|| (startingSlot==2 && endingSlot==2) ) { // half day |
|||
hallAmount =hallDetails.getHalfDayRent(); |
|||
} else if (days>1) { |
|||
if(startingSlot==2 && endingSlot==1){ |
|||
hallAmount =hallDetails.getHalfDayRent()*2; |
|||
days=days-2; |
|||
} else if (startingSlot==2 || endingSlot==1) { |
|||
hallAmount =hallDetails.getHalfDayRent(); |
|||
days=days-1; |
|||
} |
|||
for(int i=0;i<days;i++){ |
|||
hallAmount=hallAmount+hallDetails.getFullDayRent(); |
|||
} |
|||
} |
|||
|
|||
return hallAmount; |
|||
} |
|||
} |
|||
@ -0,0 +1,4 @@ |
|||
package com.gcc.communityHall.service.Impl; |
|||
|
|||
public class CalendarServiceImpl { |
|||
} |
|||
@ -0,0 +1,114 @@ |
|||
package com.gcc.communityHall.service.Impl; |
|||
|
|||
import com.gcc.communityHall.entity.HallDetails; |
|||
import com.gcc.communityHall.entity.HallImages; |
|||
import com.gcc.communityHall.repository.HallDetailsRepository; |
|||
import com.gcc.communityHall.repository.HallImagesRepository; |
|||
import com.gcc.communityHall.service.HallDetailService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.beans.factory.annotation.Value; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import java.io.FileOutputStream; |
|||
import java.io.IOException; |
|||
import java.time.LocalDate; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
import java.util.Optional; |
|||
|
|||
@Service |
|||
public class HallDetailServiceImpl implements HallDetailService { |
|||
|
|||
// @Autowired |
|||
private HallDetailsRepository hallDetailsRepository; |
|||
private HallImagesRepository hallImagesRepository; |
|||
private final String hallDirectory; |
|||
private final String hallImageUrl; |
|||
@Autowired |
|||
HallDetailServiceImpl(HallDetailsRepository hallDetailsRepository, HallImagesRepository hallImagesRepository, @Value("${file.hall.upload.directory}") String hallDirectory, @Value("${file.hall.fullpath}") String hallImageUrl){ |
|||
this.hallDetailsRepository=hallDetailsRepository; |
|||
this.hallDirectory=hallDirectory; |
|||
this.hallImageUrl=hallImageUrl; |
|||
this.hallImagesRepository = hallImagesRepository; |
|||
} |
|||
@Override |
|||
public HallDetails saveHallDetails(HallDetails hallDetails, List<MultipartFile> hallImages) { |
|||
if(hallImages.size()>0){ |
|||
|
|||
} |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public HallDetails getHallById(int hallId) { |
|||
Optional<HallDetails> hallDetails = hallDetailsRepository.findById(hallId); |
|||
if(hallDetails.isPresent()){ |
|||
return hallDetails.get(); |
|||
} |
|||
|
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public HallDetails deActivateHallById(int hallId) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public HallDetails saveHall( |
|||
String hallName,float depositAmount, float halfDayAmt, |
|||
float fullDayAmt, float gst,float hallArea, String ebNumber, |
|||
int parkingCapacity, int seatingCapacity, |
|||
String doorNo, String street, String area, String zone, |
|||
String division, String landMark, String city, int pinCode, |
|||
String latitude, String longitude, String hallInchargeName, |
|||
long hallInchargeNo, HallDetails.HallStatus status,String updatedId, MultipartFile[] hallImages) { |
|||
HallDetails hall = new HallDetails(); |
|||
hall.setHallName(hallName); |
|||
hall.setDoorNo(doorNo); |
|||
hall.setHallArea(hallArea); |
|||
hall.setStreet(street); |
|||
hall.setArea(area); |
|||
hall.setCity(city); |
|||
hall.setPinCode(pinCode); |
|||
hall.setDivision(division); |
|||
hall.setZone(zone); |
|||
hall.setEbNumber(ebNumber); |
|||
hall.setFullDayRent(fullDayAmt); |
|||
hall.setHalfDayRent(halfDayAmt); |
|||
hall.setDepositAmount(depositAmount); |
|||
hall.setGst(gst); |
|||
hall.setHallInchargeName(hallInchargeName); |
|||
hall.setHallInchargeMobno(hallInchargeNo); |
|||
hall.setSeatingCapacity(seatingCapacity); |
|||
hall.setHallStatus(status); |
|||
hall.setLatitude(latitude); |
|||
hall.setLongitude(longitude); |
|||
hall.setLankMark(landMark); |
|||
hall.setUpdatedId(updatedId); |
|||
hall.setCreateddate(LocalDate.now()); |
|||
HallDetails hallDetails = hallDetailsRepository.save(hall); |
|||
if(hallImages!=null && hallImages.length>0){ |
|||
for (int i=0;i<hallImages.length;i++) { |
|||
HallImages hallImages1 = new HallImages(); |
|||
String filePath = hallDirectory+"/"+hallImages[i].getOriginalFilename(); |
|||
String imageUrl = hallImageUrl+"hall/"+hallDetails.getHallId()+"_"+hallImages[i].getOriginalFilename(); |
|||
try(FileOutputStream fos = new FileOutputStream(filePath)){ |
|||
byte [] bytes = hallImages[i].getBytes(); |
|||
fos.write(bytes); |
|||
hallImages1.setHallDetails(hallDetails); |
|||
hallImages1.setHallImage(imageUrl); |
|||
hallImagesRepository.save(hallImages1); |
|||
} catch (IOException e) { |
|||
throw new RuntimeException(e); |
|||
} |
|||
} |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
return null; |
|||
} |
|||
} |
|||
@ -0,0 +1,4 @@ |
|||
package com.gcc.communityHall.service.Impl; |
|||
|
|||
public class LoginServiceImpl { |
|||
} |
|||
@ -0,0 +1,43 @@ |
|||
package com.gcc.communityHall.service.Impl; |
|||
|
|||
import com.gcc.communityHall.entity.ReasonDocumentMaster; |
|||
import com.gcc.communityHall.entity.ReasonMaster; |
|||
import com.gcc.communityHall.repository.ReasonDocMasterRepository; |
|||
import com.gcc.communityHall.repository.ReasonMasterRepository; |
|||
import com.gcc.communityHall.service.ReasonMasterService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Service |
|||
public class ReasonMasterImpl implements ReasonMasterService { |
|||
|
|||
@Autowired |
|||
ReasonMasterRepository reasonMasterRepository; |
|||
|
|||
@Autowired |
|||
ReasonDocMasterRepository reasonDocMasterRepository; |
|||
|
|||
@Override |
|||
public String saveTheReason(ReasonMaster reasonMaster) { |
|||
List<ReasonDocumentMaster> reasonDocumentMasterList =reasonMaster.getReasonDocumentMasterList(); |
|||
reasonMaster.setReasonDocumentMasterList(null); |
|||
ReasonMaster resMaster =reasonMasterRepository.save(reasonMaster); |
|||
if(reasonDocumentMasterList!=null) { |
|||
for (int i = 0; i < reasonDocumentMasterList.size(); i++) { |
|||
ReasonDocumentMaster reasonDocMaster = reasonDocumentMasterList.get(i); |
|||
reasonDocMaster.setReasonMaster(resMaster); |
|||
reasonDocMasterRepository.save(reasonDocMaster); |
|||
|
|||
} |
|||
} |
|||
|
|||
return "Success"; |
|||
} |
|||
|
|||
@Override |
|||
public ReasonMaster getReasonById(int reasonId) { |
|||
return reasonMasterRepository.findById(reasonId).get(); |
|||
} |
|||
} |
|||
@ -0,0 +1,4 @@ |
|||
package com.gcc.communityHall.service.Impl; |
|||
|
|||
public class TransactionServiceImpl { |
|||
} |
|||
@ -0,0 +1,80 @@ |
|||
package com.gcc.communityHall.service.Impl; |
|||
|
|||
import com.gcc.communityHall.entity.UserHistory; |
|||
import com.gcc.communityHall.entity.Users; |
|||
import com.gcc.communityHall.repository.UserHistoryRepository; |
|||
import com.gcc.communityHall.repository.UsersRepository; |
|||
import com.gcc.communityHall.service.UserService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.Date; |
|||
import java.util.List; |
|||
import java.util.Optional; |
|||
|
|||
@Service |
|||
public class UserServiceImpl implements UserService { |
|||
|
|||
@Autowired |
|||
UsersRepository usersRepository; |
|||
|
|||
@Autowired |
|||
UserHistoryRepository userHistoryRepository; |
|||
public UserServiceImpl(UsersRepository userRepo){ |
|||
this.usersRepository=userRepo; |
|||
} |
|||
|
|||
public UserServiceImpl(){ |
|||
|
|||
} |
|||
@Override |
|||
public Users user(Users user) { |
|||
System.out.println(user.getUsertype()); |
|||
if(user.getUsertype()==null || !user.getUsertype().equals(Users.userType.PUBLIC)){ |
|||
user.setUserstatus(Users.userStatus.PENDING); |
|||
} |
|||
|
|||
return usersRepository.save(user); |
|||
} |
|||
|
|||
@Override |
|||
public Users getUserById(int userId) { |
|||
Optional<Users> user= usersRepository.findById(userId); |
|||
if(user.isPresent()){ |
|||
return user.get(); |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public List<Users> getUserByStatus(Users.userStatus status) { |
|||
return usersRepository.findByUserstatus(status); |
|||
} |
|||
|
|||
@Override |
|||
public List<Users> getUserByType(Users.userType userType) { |
|||
return usersRepository.findByUsertype(userType); |
|||
} |
|||
|
|||
@Override |
|||
public Users updateUserStatus(int userId, Users.userStatus status, String comments) { |
|||
Optional<Users> user= usersRepository.findById(userId); |
|||
if(user.isPresent()){ |
|||
Users usr = user.get(); |
|||
|
|||
UserHistory userHistory = new UserHistory(); |
|||
userHistory.setUsers(usr); |
|||
userHistory.setUserstatus(status); |
|||
userHistory.setComments(comments); |
|||
userHistory.setCdate(new Date()); |
|||
userHistoryRepository.save(userHistory); |
|||
|
|||
usr.setUserstatus(status); |
|||
Users users = usersRepository.save(usr); |
|||
return users; |
|||
|
|||
|
|||
} |
|||
return null; |
|||
} |
|||
} |
|||
@ -0,0 +1,4 @@ |
|||
package com.gcc.communityHall.service; |
|||
|
|||
public interface LoginService { |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
package com.gcc.communityHall.service; |
|||
|
|||
import com.gcc.communityHall.entity.ReasonMaster; |
|||
|
|||
public interface ReasonMasterService { |
|||
|
|||
String saveTheReason(ReasonMaster reasonMaster); |
|||
ReasonMaster getReasonById(int reasonId); |
|||
} |
|||
@ -0,0 +1,4 @@ |
|||
package com.gcc.communityHall.service; |
|||
|
|||
public interface TransactionService { |
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
package com.gcc.communityHall.service; |
|||
|
|||
import com.gcc.communityHall.entity.Users; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface UserService { |
|||
|
|||
public Users user(Users user); |
|||
public Users getUserById(int userId); |
|||
public List<Users> getUserByStatus(Users.userStatus status); |
|||
public List<Users> getUserByType(Users.userType userType); |
|||
public Users updateUserStatus(int userId,Users.userStatus status,String comments); |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
spring.application.name=communityHall |
|||
|
|||
spring.datasource.url=jdbc:mysql://localhost:3306/communityhall |
|||
spring.datasource.username=root |
|||
spring.datasource.password=root |
|||
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver |
|||
spring.jpa.hibernate.ddl-auto=update |
|||
spring.jpa.properties.hibernate.dialect= org.hibernate.dialect.MySQL8Dialect |
|||
#logging.level.org.hibernate.SQL=DEBUG |
|||
#logging.level.org.hibernate.type=TRACE |
|||
spring.jpa.properties.hibernate.format_sql=true |
|||
|
|||
spring.jpa.driverClassName= com.mysql.cj.jdbc.Driver |
|||
employee.api.url=https://erp.chennaicorporation.gov.in/pgr/external/mobileservice |
|||
|
|||
server.address=0.0.0.0 |
|||
|
|||
#fileHanding |
|||
file.upload.directory=${user.dir}/communityHallDocuments |
|||
file.hall.upload.directory=${user.dir}/communityHallDocuments/hallImages |
|||
|
|||
|
|||
file.fullpath=http://localhost:8080/ |
|||
file.hall.fullpath=http://localhost:8080/images/ |
|||
#file.fullpath=http://117.232.67.158:8067 |
|||
@ -0,0 +1,7 @@ |
|||
payment.worldline.merchantId=T955031 |
|||
payment.worldline.encryptionKey=1025180466GPADTD |
|||
payment.worldline.encryptionIV=3232693456UWOWHC |
|||
payment.worldline.schemeCode=FIRST |
|||
payment.worldline.merchantName=Greater Chennai Corporation |
|||
payment.worldline.transactionSuccessCode=0300 |
|||
payment.worldline.refundSuccessCode=0400 |
|||
@ -0,0 +1,59 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en" xmlns:th="http://www.thymeleaf.org"> |
|||
<head> |
|||
<meta charset="UTF-8"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|||
<title>Community Hall Booking</title> |
|||
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet"> |
|||
<style> |
|||
/* Add your custom styles here */ |
|||
/* For example: |
|||
.loading-overlay { |
|||
position: fixed; |
|||
top: 0; |
|||
left: 0; |
|||
width: 100%; |
|||
height: 100%; |
|||
background-color: rgba(255, 255, 255, 0.7); |
|||
z-index: 9999; |
|||
display: flex; |
|||
justify-content: center; |
|||
align-items: center; |
|||
} |
|||
*/ |
|||
</style> |
|||
</head> |
|||
<body> |
|||
<!-- Loading overlay --> |
|||
<div th:if="${loading}" class="loading-overlay"> |
|||
<div class="spinner-border text-primary" role="status"> |
|||
<span class="sr-only">Loading...</span> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="container mt-5"> |
|||
<h1 class="mb-4">Community Hall Booking</h1> |
|||
<form th:action="@{/book}" method="post"> |
|||
<div class="form-group"> |
|||
<label for="eventName">Event Name</label> |
|||
<input type="text" class="form-control" id="eventName" name="eventName" required> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label for="eventDate">Event Date</label> |
|||
<input type="date" class="form-control" id="eventDate" name="eventDate" required> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label for="eventTime">Event Time</label> |
|||
<input type="time" class="form-control" id="eventTime" name="eventTime" required> |
|||
</div> |
|||
<div class="form-group"> |
|||
<button type="submit" class="btn btn-primary">Submit</button> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
|
|||
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script> |
|||
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.4/dist/umd/popper.min.js"></script> |
|||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script> |
|||
</body> |
|||
</html> |
|||
@ -0,0 +1,13 @@ |
|||
package com.gcc.communityHall; |
|||
|
|||
import org.junit.jupiter.api.Test; |
|||
import org.springframework.boot.test.context.SpringBootTest; |
|||
|
|||
@SpringBootTest |
|||
class CommunityHallApplicationTests { |
|||
|
|||
@Test |
|||
void contextLoads() { |
|||
} |
|||
|
|||
} |
|||