Compare commits
1 Commits
feature_de
...
feature_de
Author | SHA1 | Date |
---|---|---|
|
7225c43e89 |
|
@ -0,0 +1,2 @@
|
|||
/mvnw text eol=lf
|
||||
*.cmd text eol=crlf
|
|
@ -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,19 @@
|
|||
# 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
|
||||
#
|
||||
# http://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.
|
||||
wrapperVersion=3.3.2
|
||||
distributionType=only-script
|
||||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
|
|
@ -0,0 +1,259 @@
|
|||
#!/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
|
||||
#
|
||||
# http://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.3.2
|
||||
#
|
||||
# Optional ENV vars
|
||||
# -----------------
|
||||
# JAVA_HOME - location of a JDK home dir, required when download maven via java source
|
||||
# MVNW_REPOURL - repo url base for downloading maven distribution
|
||||
# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
|
||||
# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
set -euf
|
||||
[ "${MVNW_VERBOSE-}" != debug ] || set -x
|
||||
|
||||
# OS specific support.
|
||||
native_path() { printf %s\\n "$1"; }
|
||||
case "$(uname)" in
|
||||
CYGWIN* | MINGW*)
|
||||
[ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")"
|
||||
native_path() { cygpath --path --windows "$1"; }
|
||||
;;
|
||||
esac
|
||||
|
||||
# set JAVACMD and JAVACCMD
|
||||
set_java_home() {
|
||||
# For Cygwin and MinGW, ensure paths are in Unix format before anything is touched
|
||||
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"
|
||||
JAVACCMD="$JAVA_HOME/jre/sh/javac"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
JAVACCMD="$JAVA_HOME/bin/javac"
|
||||
|
||||
if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then
|
||||
echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2
|
||||
echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
else
|
||||
JAVACMD="$(
|
||||
'set' +e
|
||||
'unset' -f command 2>/dev/null
|
||||
'command' -v java
|
||||
)" || :
|
||||
JAVACCMD="$(
|
||||
'set' +e
|
||||
'unset' -f command 2>/dev/null
|
||||
'command' -v javac
|
||||
)" || :
|
||||
|
||||
if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then
|
||||
echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# hash string like Java String::hashCode
|
||||
hash_string() {
|
||||
str="${1:-}" h=0
|
||||
while [ -n "$str" ]; do
|
||||
char="${str%"${str#?}"}"
|
||||
h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296))
|
||||
str="${str#?}"
|
||||
done
|
||||
printf %x\\n $h
|
||||
}
|
||||
|
||||
verbose() { :; }
|
||||
[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; }
|
||||
|
||||
die() {
|
||||
printf %s\\n "$1" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
trim() {
|
||||
# MWRAPPER-139:
|
||||
# Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds.
|
||||
# Needed for removing poorly interpreted newline sequences when running in more
|
||||
# exotic environments such as mingw bash on Windows.
|
||||
printf "%s" "${1}" | tr -d '[:space:]'
|
||||
}
|
||||
|
||||
# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties
|
||||
while IFS="=" read -r key value; do
|
||||
case "${key-}" in
|
||||
distributionUrl) distributionUrl=$(trim "${value-}") ;;
|
||||
distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;;
|
||||
esac
|
||||
done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties"
|
||||
[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties"
|
||||
|
||||
case "${distributionUrl##*/}" in
|
||||
maven-mvnd-*bin.*)
|
||||
MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/
|
||||
case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in
|
||||
*AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;;
|
||||
:Darwin*x86_64) distributionPlatform=darwin-amd64 ;;
|
||||
:Darwin*arm64) distributionPlatform=darwin-aarch64 ;;
|
||||
:Linux*x86_64*) distributionPlatform=linux-amd64 ;;
|
||||
*)
|
||||
echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2
|
||||
distributionPlatform=linux-amd64
|
||||
;;
|
||||
esac
|
||||
distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip"
|
||||
;;
|
||||
maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;;
|
||||
*) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;;
|
||||
esac
|
||||
|
||||
# apply MVNW_REPOURL and calculate MAVEN_HOME
|
||||
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
|
||||
[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}"
|
||||
distributionUrlName="${distributionUrl##*/}"
|
||||
distributionUrlNameMain="${distributionUrlName%.*}"
|
||||
distributionUrlNameMain="${distributionUrlNameMain%-bin}"
|
||||
MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}"
|
||||
MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")"
|
||||
|
||||
exec_maven() {
|
||||
unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || :
|
||||
exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD"
|
||||
}
|
||||
|
||||
if [ -d "$MAVEN_HOME" ]; then
|
||||
verbose "found existing MAVEN_HOME at $MAVEN_HOME"
|
||||
exec_maven "$@"
|
||||
fi
|
||||
|
||||
case "${distributionUrl-}" in
|
||||
*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;;
|
||||
*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;;
|
||||
esac
|
||||
|
||||
# prepare tmp dir
|
||||
if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then
|
||||
clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; }
|
||||
trap clean HUP INT TERM EXIT
|
||||
else
|
||||
die "cannot create temp dir"
|
||||
fi
|
||||
|
||||
mkdir -p -- "${MAVEN_HOME%/*}"
|
||||
|
||||
# Download and Install Apache Maven
|
||||
verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
|
||||
verbose "Downloading from: $distributionUrl"
|
||||
verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
|
||||
|
||||
# select .zip or .tar.gz
|
||||
if ! command -v unzip >/dev/null; then
|
||||
distributionUrl="${distributionUrl%.zip}.tar.gz"
|
||||
distributionUrlName="${distributionUrl##*/}"
|
||||
fi
|
||||
|
||||
# verbose opt
|
||||
__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR=''
|
||||
[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v
|
||||
|
||||
# normalize http auth
|
||||
case "${MVNW_PASSWORD:+has-password}" in
|
||||
'') MVNW_USERNAME='' MVNW_PASSWORD='' ;;
|
||||
has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;;
|
||||
esac
|
||||
|
||||
if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then
|
||||
verbose "Found wget ... using wget"
|
||||
wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl"
|
||||
elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then
|
||||
verbose "Found curl ... using curl"
|
||||
curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl"
|
||||
elif set_java_home; then
|
||||
verbose "Falling back to use Java to download"
|
||||
javaSource="$TMP_DOWNLOAD_DIR/Downloader.java"
|
||||
targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName"
|
||||
cat >"$javaSource" <<-END
|
||||
public class Downloader extends java.net.Authenticator
|
||||
{
|
||||
protected java.net.PasswordAuthentication getPasswordAuthentication()
|
||||
{
|
||||
return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() );
|
||||
}
|
||||
public static void main( String[] args ) throws Exception
|
||||
{
|
||||
setDefault( new Downloader() );
|
||||
java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() );
|
||||
}
|
||||
}
|
||||
END
|
||||
# For Cygwin/MinGW, switch paths to Windows format before running javac and java
|
||||
verbose " - Compiling Downloader.java ..."
|
||||
"$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java"
|
||||
verbose " - Running Downloader.java ..."
|
||||
"$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")"
|
||||
fi
|
||||
|
||||
# If specified, validate the SHA-256 sum of the Maven distribution zip file
|
||||
if [ -n "${distributionSha256Sum-}" ]; then
|
||||
distributionSha256Result=false
|
||||
if [ "$MVN_CMD" = mvnd.sh ]; then
|
||||
echo "Checksum validation is not supported for maven-mvnd." >&2
|
||||
echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
|
||||
exit 1
|
||||
elif command -v sha256sum >/dev/null; then
|
||||
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then
|
||||
distributionSha256Result=true
|
||||
fi
|
||||
elif command -v shasum >/dev/null; then
|
||||
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then
|
||||
distributionSha256Result=true
|
||||
fi
|
||||
else
|
||||
echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2
|
||||
echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
|
||||
exit 1
|
||||
fi
|
||||
if [ $distributionSha256Result = false ]; then
|
||||
echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2
|
||||
echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# unzip and move
|
||||
if command -v unzip >/dev/null; then
|
||||
unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip"
|
||||
else
|
||||
tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar"
|
||||
fi
|
||||
printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url"
|
||||
mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME"
|
||||
|
||||
clean || :
|
||||
exec_maven "$@"
|
|
@ -0,0 +1,149 @@
|
|||
<# : batch portion
|
||||
@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 http://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.3.2
|
||||
@REM
|
||||
@REM Optional ENV vars
|
||||
@REM MVNW_REPOURL - repo url base for downloading maven distribution
|
||||
@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
|
||||
@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output
|
||||
@REM ----------------------------------------------------------------------------
|
||||
|
||||
@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0)
|
||||
@SET __MVNW_CMD__=
|
||||
@SET __MVNW_ERROR__=
|
||||
@SET __MVNW_PSMODULEP_SAVE=%PSModulePath%
|
||||
@SET PSModulePath=
|
||||
@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @(
|
||||
IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B)
|
||||
)
|
||||
@SET PSModulePath=%__MVNW_PSMODULEP_SAVE%
|
||||
@SET __MVNW_PSMODULEP_SAVE=
|
||||
@SET __MVNW_ARG0_NAME__=
|
||||
@SET MVNW_USERNAME=
|
||||
@SET MVNW_PASSWORD=
|
||||
@IF NOT "%__MVNW_CMD__%"=="" (%__MVNW_CMD__% %*)
|
||||
@echo Cannot start maven from wrapper >&2 && exit /b 1
|
||||
@GOTO :EOF
|
||||
: end batch / begin powershell #>
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
if ($env:MVNW_VERBOSE -eq "true") {
|
||||
$VerbosePreference = "Continue"
|
||||
}
|
||||
|
||||
# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties
|
||||
$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl
|
||||
if (!$distributionUrl) {
|
||||
Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties"
|
||||
}
|
||||
|
||||
switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) {
|
||||
"maven-mvnd-*" {
|
||||
$USE_MVND = $true
|
||||
$distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip"
|
||||
$MVN_CMD = "mvnd.cmd"
|
||||
break
|
||||
}
|
||||
default {
|
||||
$USE_MVND = $false
|
||||
$MVN_CMD = $script -replace '^mvnw','mvn'
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
# apply MVNW_REPOURL and calculate MAVEN_HOME
|
||||
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
|
||||
if ($env:MVNW_REPOURL) {
|
||||
$MVNW_REPO_PATTERN = if ($USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" }
|
||||
$distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')"
|
||||
}
|
||||
$distributionUrlName = $distributionUrl -replace '^.*/',''
|
||||
$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$',''
|
||||
$MAVEN_HOME_PARENT = "$HOME/.m2/wrapper/dists/$distributionUrlNameMain"
|
||||
if ($env:MAVEN_USER_HOME) {
|
||||
$MAVEN_HOME_PARENT = "$env:MAVEN_USER_HOME/wrapper/dists/$distributionUrlNameMain"
|
||||
}
|
||||
$MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join ''
|
||||
$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME"
|
||||
|
||||
if (Test-Path -Path "$MAVEN_HOME" -PathType Container) {
|
||||
Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME"
|
||||
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
|
||||
exit $?
|
||||
}
|
||||
|
||||
if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) {
|
||||
Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl"
|
||||
}
|
||||
|
||||
# prepare tmp dir
|
||||
$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile
|
||||
$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir"
|
||||
$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null
|
||||
trap {
|
||||
if ($TMP_DOWNLOAD_DIR.Exists) {
|
||||
try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
|
||||
catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
|
||||
}
|
||||
}
|
||||
|
||||
New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null
|
||||
|
||||
# Download and Install Apache Maven
|
||||
Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
|
||||
Write-Verbose "Downloading from: $distributionUrl"
|
||||
Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
|
||||
|
||||
$webclient = New-Object System.Net.WebClient
|
||||
if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) {
|
||||
$webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD)
|
||||
}
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||
$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null
|
||||
|
||||
# If specified, validate the SHA-256 sum of the Maven distribution zip file
|
||||
$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum
|
||||
if ($distributionSha256Sum) {
|
||||
if ($USE_MVND) {
|
||||
Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties."
|
||||
}
|
||||
Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash
|
||||
if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) {
|
||||
Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property."
|
||||
}
|
||||
}
|
||||
|
||||
# unzip and move
|
||||
Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null
|
||||
Rename-Item -Path "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" -NewName $MAVEN_HOME_NAME | Out-Null
|
||||
try {
|
||||
Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null
|
||||
} catch {
|
||||
if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) {
|
||||
Write-Error "fail to move MAVEN_HOME"
|
||||
}
|
||||
} finally {
|
||||
try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
|
||||
catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
|
||||
}
|
||||
|
||||
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
|
|
@ -0,0 +1,106 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.7.17</version>
|
||||
<relativePath /> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>com.sahyog.app.inbound</groupId>
|
||||
<artifactId>inbound-masterdata-service</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<name>inbound-masterdata-service</name>
|
||||
<packaging>jar</packaging>
|
||||
<description>project for masterdata management services in Spring Boot</description>
|
||||
|
||||
<properties>
|
||||
<java.version>17</java.version>
|
||||
<spring-cloud.version>2021.0.3</spring-cloud.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<!-- START - Local dependency added 2021.0.3 -->
|
||||
<dependency>
|
||||
<groupId>com.sahyog.app.inbound</groupId>
|
||||
<artifactId>inbound-common-lib</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<!-- END - Local dependency -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-devtools</artifactId>
|
||||
<scope>runtime</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.sf.dozer</groupId>
|
||||
<artifactId>dozer</artifactId>
|
||||
<version>5.5.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.validation</groupId>
|
||||
<artifactId>validation-api</artifactId> <!-- Latest version for javax.validation -->
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-dependencies</artifactId>
|
||||
<version>${spring-cloud.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<image>
|
||||
<builder>paketobuildpacks/builder-jammy-base:latest</builder>
|
||||
</image>
|
||||
<excludes>
|
||||
<exclude>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,13 @@
|
|||
package com.sahyog.app.inbound.masterdata;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class InboundMasterdataServiceApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(InboundMasterdataServiceApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
package com.sahyog.app.inbound.masterdata.config;
|
||||
|
||||
import javax.persistence.EntityManagerFactory;
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||
import org.springframework.orm.jpa.JpaTransactionManager;
|
||||
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
|
||||
|
||||
@Configuration
|
||||
@EnableTransactionManagement
|
||||
@EnableJpaRepositories(entityManagerFactoryRef = "entityManagerFactory", transactionManagerRef = "transactionManager", basePackages = {
|
||||
"com.sahyog.app.inbound.masterdata.repository" })
|
||||
public class RDSDataSourceConfig {
|
||||
|
||||
@Bean(name = "dataSourceProp")
|
||||
@Primary
|
||||
@ConfigurationProperties(prefix = "spring.datasource")
|
||||
public DataSourceProperties dbDataSourceProperties() {
|
||||
return new DataSourceProperties();
|
||||
}
|
||||
|
||||
|
||||
@Bean(name = "dataSource")
|
||||
@Primary
|
||||
@ConfigurationProperties(prefix = "spring.datasource.hikari")
|
||||
public DataSource primaryDataSource() {
|
||||
return dbDataSourceProperties().initializeDataSourceBuilder().build();
|
||||
}
|
||||
|
||||
@Primary
|
||||
@Bean(name = "entityManagerFactory")
|
||||
public LocalContainerEntityManagerFactoryBean entityManagerFactory(EntityManagerFactoryBuilder builder,
|
||||
@Qualifier("dataSource") DataSource dataSource) {
|
||||
return builder.dataSource(dataSource).packages("com.sahyog.app.inbound.masterdata.model").build();
|
||||
}
|
||||
|
||||
@Primary
|
||||
@Bean(name = "transactionManager")
|
||||
public PlatformTransactionManager transactionManager(
|
||||
@Qualifier("entityManagerFactory") EntityManagerFactory entityManagerFactory) {
|
||||
return new JpaTransactionManager(entityManagerFactory);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,179 @@
|
|||
package com.sahyog.app.inbound.masterdata.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.sahyog.app.inbound.masterdata.dto.CodeMasterDTO;
|
||||
import com.sahyog.app.inbound.masterdata.dto.PlantMasterDTO;
|
||||
import com.sahyog.app.inbound.masterdata.dto.MaterialMasterDTO;
|
||||
import com.sahyog.app.inbound.masterdata.dto.TransporterMasterDTO;
|
||||
import com.sahyog.app.inbound.masterdata.dto.TZoneMasterDTO;
|
||||
import com.sahyog.app.inbound.masterdata.service.CodeMasterService;
|
||||
import com.sahyog.app.inbound.masterdata.service.PlantMasterService;
|
||||
import com.sahyog.app.inbound.masterdata.service.MaterialMasterService;
|
||||
import com.sahyog.app.inbound.masterdata.service.TransporterMasterService;
|
||||
import com.shayog.app.inbound.common.dto.ResponseDTO;
|
||||
import com.sahyog.app.inbound.masterdata.service.TZoneMasterService;
|
||||
|
||||
import org.springframework.http.MediaType;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/master")
|
||||
@Validated
|
||||
@Slf4j
|
||||
public class MasterController {
|
||||
|
||||
@Autowired
|
||||
private CodeMasterService userService;
|
||||
|
||||
@Autowired
|
||||
private PlantMasterService plantService;
|
||||
|
||||
@Autowired
|
||||
private MaterialMasterService materialService;
|
||||
|
||||
@Autowired
|
||||
private TransporterMasterService transporterService;
|
||||
|
||||
@Autowired
|
||||
private TZoneMasterService tzoneService;
|
||||
|
||||
@GetMapping("/getCodebyKey")
|
||||
public ResponseEntity<CodeMasterDTO> getCodebyKey(@RequestParam String strType, @RequestParam String strCode) {
|
||||
try {
|
||||
log.info("Received request to get Code by key: {}", strType + " " + strCode);
|
||||
|
||||
CodeMasterDTO cmDTO = userService.getCodebyKey(strType, strCode);
|
||||
|
||||
log.info("Key Code fetched successfully.");
|
||||
|
||||
return ResponseEntity.status(HttpStatus.CREATED).body(cmDTO);
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
log.error("Unexpected error occurred: {}", e.getMessage(), e);
|
||||
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/getByPlantCode")
|
||||
public ResponseEntity<PlantMasterDTO> getByPlantCode(@RequestParam String plantCode) {
|
||||
try {
|
||||
log.info("Received request to get Code by key: {}", plantCode);
|
||||
|
||||
PlantMasterDTO pmDTO = plantService.getByPlantCode(plantCode);
|
||||
|
||||
log.info("Plant fetched successfully.");
|
||||
|
||||
return ResponseEntity.status(HttpStatus.CREATED).body(pmDTO);
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
log.error("Unexpected error occurred: {}", e.getMessage(), e);
|
||||
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/getByMaterialCode")
|
||||
public ResponseEntity<MaterialMasterDTO> getByMaterialCode(@RequestParam String material, @RequestParam int plant) {
|
||||
try {
|
||||
log.info("Received request to get Code by key: {}", material + " " + plant);
|
||||
|
||||
MaterialMasterDTO mmDTO = materialService.getByMaterialCode(material, plant);
|
||||
|
||||
log.info("Material fetched successfully.");
|
||||
|
||||
return ResponseEntity.status(HttpStatus.CREATED).body(mmDTO);
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
log.error("Unexpected error occurred: {}", e.getMessage(), e);
|
||||
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/getByTransporterCode")
|
||||
public ResponseEntity<TransporterMasterDTO> getByTransporterCode(@RequestParam String transporterCode) {
|
||||
try {
|
||||
log.info("Received request to get Code by key: {}", transporterCode);
|
||||
|
||||
TransporterMasterDTO tmDTO = transporterService.getByTransporterCode(transporterCode);
|
||||
|
||||
log.info("Transporter fetched successfully.");
|
||||
|
||||
return ResponseEntity.status(HttpStatus.CREATED).body(tmDTO);
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
log.error("Unexpected error occurred: {}", e.getMessage(), e);
|
||||
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/getByTZoneCode")
|
||||
public ResponseEntity<TZoneMasterDTO> getByTZoneCode(@RequestParam String tzoneCode, @RequestParam String fromLocation) {
|
||||
try {
|
||||
log.info("Received request to get Code by key: {}", tzoneCode);
|
||||
|
||||
TZoneMasterDTO tmDTO = tzoneService.getByTZoneCode(tzoneCode, fromLocation);
|
||||
|
||||
log.info("TZone fetched successfully.");
|
||||
|
||||
return ResponseEntity.status(HttpStatus.CREATED).body(tmDTO);
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
log.error("Unexpected error occurred: {}", e.getMessage(), e);
|
||||
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping(value = "/addTZoneDetail", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<TZoneMasterDTO> addTZoneDetail(@RequestBody TZoneMasterDTO tzoneDTO) {
|
||||
try {
|
||||
log.info("Received request to get Code by key: {}", tzoneDTO);
|
||||
|
||||
TZoneMasterDTO tzDTO = tzoneService.addTZoneDetail(tzoneDTO);
|
||||
|
||||
log.info("TZone added successfully.");
|
||||
|
||||
return ResponseEntity.status(HttpStatus.CREATED).body(tzDTO);
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
log.error("Unexpected error occurred in TZone addition: {}", e.getMessage(), e);
|
||||
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
|
||||
}
|
||||
}
|
||||
|
||||
// getByMaterialCode(String materialCode, String plantCode)
|
||||
// @PostMapping(value = "updateUser", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
// public ResponseEntity<String> createUpdateUser(@Valid @RequestBody UserDTO userDTO) {
|
||||
// try {
|
||||
// log.info("Received request to Add User(s): {}", userDTO.toString());
|
||||
// userService.saveGRN(userDTO);
|
||||
// log.info("User processed successfully.");
|
||||
// return ResponseEntity.status(HttpStatus.CREATED).body("User Added Successfully");
|
||||
// } catch (Exception e) {
|
||||
// log.error("Unexpected error occurred: {}", e.getMessage(), e);
|
||||
// return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("Unexpected error occurred.");
|
||||
// }
|
||||
// }
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package com.sahyog.app.inbound.masterdata.dto;
|
||||
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* DTO for UserDTO
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class CodeMasterDTO {
|
||||
|
||||
private int code_id;
|
||||
|
||||
private String code_type;
|
||||
|
||||
private String code_value;
|
||||
|
||||
private String status;
|
||||
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package com.sahyog.app.inbound.masterdata.dto;
|
||||
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* DTO for UserDTO
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class MaterialMasterDTO {
|
||||
|
||||
private int material_id;
|
||||
|
||||
private String material_code;
|
||||
|
||||
private String material_description;
|
||||
|
||||
private String material_group;
|
||||
|
||||
private String material_group_desc;
|
||||
|
||||
private int plant_id;
|
||||
|
||||
private String status;
|
||||
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package com.sahyog.app.inbound.masterdata.dto;
|
||||
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* DTO for UserDTO
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class PlantMasterDTO {
|
||||
|
||||
private int plant_id;
|
||||
|
||||
private String plant_code;
|
||||
|
||||
private String plant_desc;
|
||||
|
||||
private String plant_pan;
|
||||
|
||||
private String plant_gst;
|
||||
|
||||
private double plant_gst_rate;
|
||||
|
||||
private String status;
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package com.sahyog.app.inbound.masterdata.dto;
|
||||
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* DTO for UserDTO
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class TZoneMasterDTO {
|
||||
|
||||
private int tzone_id;
|
||||
|
||||
private String tzone_code;
|
||||
|
||||
private String from_location;
|
||||
|
||||
private String status;
|
||||
|
||||
private int created_by;
|
||||
|
||||
private int last_updated_by;
|
||||
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
package com.sahyog.app.inbound.masterdata.dto;
|
||||
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* DTO for UserDTO
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class TransporterMasterDTO {
|
||||
|
||||
private int transporter_id;
|
||||
private int user_id;
|
||||
private String supplier_code;
|
||||
private int plant_id;
|
||||
private String plant_code;
|
||||
private String supplier_account_group;
|
||||
private String transporter_code;
|
||||
private String transporter_name;
|
||||
private String transporter_fname;
|
||||
private String transporter_mname;
|
||||
private String transporter_lname;
|
||||
private String legal_entity;
|
||||
private String permanent_account_number;
|
||||
private String house_number;
|
||||
private String street;
|
||||
private String district;
|
||||
private String city;
|
||||
private String state;
|
||||
private String country;
|
||||
private String postal_code;
|
||||
private String mobile_number;
|
||||
private String email_id;
|
||||
private String gstn;
|
||||
private String tax_regime;
|
||||
private String short_code;
|
||||
private String created_date;
|
||||
private String updation_date;
|
||||
private String tax_code_desc;
|
||||
private Integer tax_rate;
|
||||
private String status;
|
||||
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
package com.sahyog.app.inbound.masterdata.enums;
|
||||
|
||||
public class masterEnums {
|
||||
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package com.sahyog.app.inbound.masterdata.model;
|
||||
|
||||
//import jakarta.persistence.*;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Entity
|
||||
@ToString
|
||||
@Table(name = "codemaster", catalog = "master_service")
|
||||
public class CodeMasterMod {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "code_id")
|
||||
private int code_id;
|
||||
|
||||
@Column(name = "code_type")
|
||||
private String code_type;
|
||||
|
||||
@Column(name = "code_value")
|
||||
private String code_value;
|
||||
|
||||
@Column(name = "status")
|
||||
private String status;
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package com.sahyog.app.inbound.masterdata.model;
|
||||
|
||||
//import jakarta.persistence.*;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Entity
|
||||
@ToString
|
||||
@Table(name = "materialmaster", catalog = "master_service")
|
||||
public class MaterialMasterMod {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "material_id")
|
||||
private int material_id;
|
||||
|
||||
@Column(name = "material_code")
|
||||
private String material_code;
|
||||
|
||||
@Column(name = "material_description")
|
||||
private String material_description;
|
||||
|
||||
@Column(name = "material_group")
|
||||
private String material_group;
|
||||
|
||||
@Column(name = "material_group_desc")
|
||||
private String material_group_desc;
|
||||
|
||||
@Column(name = "plant_id")
|
||||
private int plant_id;
|
||||
|
||||
@Column(name = "status")
|
||||
private String status;
|
||||
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package com.sahyog.app.inbound.masterdata.model;
|
||||
|
||||
//import jakarta.persistence.*;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Entity
|
||||
@ToString
|
||||
@Table(name = "plantmaster", catalog = "master_service")
|
||||
public class PlantMasterMod {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "plant_id")
|
||||
private int plant_id;
|
||||
|
||||
@Column(name = "plant_code")
|
||||
private String plant_code;
|
||||
|
||||
@Column(name = "plant_desc")
|
||||
private String plant_desc;
|
||||
|
||||
@Column(name = "plant_pan")
|
||||
private String plant_pan;
|
||||
|
||||
@Column(name = "plant_gst")
|
||||
private String plant_gst;
|
||||
|
||||
@Column(name = "plant_gst_rate")
|
||||
private double plant_gst_rate;
|
||||
|
||||
@Column(name = "status")
|
||||
private String status;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package com.sahyog.app.inbound.masterdata.model;
|
||||
|
||||
//import jakarta.persistence.*;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Entity
|
||||
@ToString
|
||||
@Table(name = "tzonemaster", catalog = "master_service")
|
||||
public class TZoneMasterMod {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "tzone_id")
|
||||
private int tzone_id;
|
||||
|
||||
@Column(name = "tzone_code")
|
||||
private String tzone_code;
|
||||
|
||||
@Column(name = "from_location")
|
||||
private String from_location;
|
||||
|
||||
@Column(name = "status")
|
||||
private String status;
|
||||
|
||||
@Column(name = "created_by")
|
||||
private int created_by;
|
||||
|
||||
@Column(name = "last_updated_by")
|
||||
private int last_updated_by;
|
||||
|
||||
}
|
|
@ -0,0 +1,135 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package com.sahyog.app.inbound.masterdata.model;
|
||||
|
||||
//import jakarta.persistence.*;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Entity
|
||||
@ToString
|
||||
@Table(name = "transportermaster", catalog = "master_service")
|
||||
public class TransporterMasterMod {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "transporter_id")
|
||||
private int transporter_id;
|
||||
|
||||
@Column(name = "user_id")
|
||||
private int user_id;
|
||||
|
||||
@Column(name = "supplier_code")
|
||||
private String supplier_code;
|
||||
|
||||
@Column(name = "plant_id")
|
||||
private int plant_id;
|
||||
|
||||
@Column(name = "plant_code")
|
||||
private String plant_code;
|
||||
|
||||
@Column(name = "supplier_account_group")
|
||||
private String supplier_account_group;
|
||||
|
||||
@Column(name = "transporter_code")
|
||||
private String transporter_code;
|
||||
|
||||
@Column(name = "transporter_name")
|
||||
private String transporter_name;
|
||||
|
||||
@Column(name = "transporter_fname")
|
||||
private String transporter_fname;
|
||||
|
||||
@Column(name = "transporter_mname")
|
||||
private String transporter_mname;
|
||||
|
||||
@Column(name = "transporter_lname")
|
||||
private String transporter_lname;
|
||||
|
||||
@Column(name = "legal_entity")
|
||||
private String legal_entity;
|
||||
|
||||
@Column(name = "permanent_account_number")
|
||||
private String permanent_account_number;
|
||||
|
||||
@Column(name = "house_number")
|
||||
private String house_number;
|
||||
|
||||
@Column(name = "street")
|
||||
private String street;
|
||||
|
||||
@Column(name = "district")
|
||||
private String district;
|
||||
|
||||
@Column(name = "city")
|
||||
private String city;
|
||||
|
||||
@Column(name = "state")
|
||||
private String state;
|
||||
|
||||
@Column(name = "country")
|
||||
private String country;
|
||||
|
||||
@Column(name = "postal_code")
|
||||
private String postal_code;
|
||||
|
||||
@Column(name = "mobile_number")
|
||||
private String mobile_number;
|
||||
|
||||
@Column(name = "email_id")
|
||||
private String email_id;
|
||||
|
||||
@Column(name = "gstn")
|
||||
private String gstn;
|
||||
|
||||
@Column(name = "tax_regime")
|
||||
private String tax_regime;
|
||||
|
||||
@Column(name = "short_code")
|
||||
private String short_code;
|
||||
|
||||
@Column(name = "created_date")
|
||||
private LocalDate created_date;
|
||||
|
||||
@Column(name = "updation_date")
|
||||
private LocalDate updation_date;
|
||||
|
||||
@Column(name = "tax_code_desc")
|
||||
private String tax_code_desc;
|
||||
|
||||
@Column(name = "tax_rate")
|
||||
private Integer tax_rate;
|
||||
|
||||
@Column(name = "status")
|
||||
private String status;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.sahyog.app.inbound.masterdata.repository;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
|
||||
import com.sahyog.app.inbound.masterdata.model.CodeMasterMod;
|
||||
|
||||
public interface CodeMasterRepository extends JpaRepository<CodeMasterMod, Integer> {
|
||||
|
||||
|
||||
// @Query(value="SELECT code_id, code_type, code_value, status FROM CodeMaster c WHERE c.code_type = 'GRN_TYPE' and c.code_value = :code_value", nativeQuery = true)
|
||||
// CodeMasterMod findByCodeValue(String code_value);
|
||||
@Query(value="SELECT code_id, code_type, code_value, status FROM CodeMaster c " +
|
||||
"WHERE c.status = 'A' and c.code_type = :code_type and c.code_value = :code_value", nativeQuery = true)
|
||||
CodeMasterMod findByCodeValue(String code_type, String code_value);
|
||||
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.sahyog.app.inbound.masterdata.repository;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
|
||||
import com.sahyog.app.inbound.masterdata.model.MaterialMasterMod;
|
||||
|
||||
public interface MaterialMasterRepository extends JpaRepository<MaterialMasterMod, Integer> {
|
||||
|
||||
@Query(value="SELECT material_id, material_code, material_description, material_group, " +
|
||||
"material_group_desc, plant_id, status FROM MaterialMaster m WHERE m.status = 'A' and " +
|
||||
"m.material_code = :material_code and m.plant_id = :plant_id", nativeQuery = true)
|
||||
MaterialMasterMod getByMaterialCode(String material_code, int plant_id);
|
||||
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.sahyog.app.inbound.masterdata.repository;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
|
||||
import com.sahyog.app.inbound.masterdata.model.PlantMasterMod;
|
||||
|
||||
public interface PlantMasterRepository extends JpaRepository<PlantMasterMod, Integer> {
|
||||
|
||||
@Query(value="SELECT plant_id, plant_code, plant_desc, plant_pan, plant_gst, plant_gst_rate, " +
|
||||
"status FROM PlantMaster p WHERE p.status = 'A' and p.plant_code = :plant_code", nativeQuery = true)
|
||||
PlantMasterMod getByPlantCode(String plant_code);
|
||||
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.sahyog.app.inbound.masterdata.repository;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
|
||||
import com.sahyog.app.inbound.masterdata.model.TZoneMasterMod;
|
||||
|
||||
public interface TZoneMasterRepository extends JpaRepository<TZoneMasterMod, Integer> {
|
||||
|
||||
@Query(value="SELECT tzone_id, tzone_code, from_location, status, created_by, last_updated_by " +
|
||||
"FROM TzoneMaster t WHERE t.status = 'A' and t.tzone_code = :tzone_code and t.from_location = :from_location", nativeQuery = true)
|
||||
TZoneMasterMod getByTZoneCode(String tzone_code, String from_location);
|
||||
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.sahyog.app.inbound.masterdata.repository;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
|
||||
import com.sahyog.app.inbound.masterdata.model.TransporterMasterMod;
|
||||
|
||||
public interface TransporterMasterRepository extends JpaRepository<TransporterMasterMod, Integer> {
|
||||
|
||||
@Query(value="SELECT transporter_id, user_id, supplier_code, plant_id, plant_code, supplier_account_group, " +
|
||||
"transporter_code, transporter_name, transporter_fname, transporter_mname, transporter_lname, " +
|
||||
"legal_entity, permanent_account_number, house_number, street, district, city, state, country, " +
|
||||
"postal_code, mobile_number, email_id, gstn, tax_regime, short_code, created_date, " +
|
||||
"updation_date, tax_code_desc, tax_rate, status " +
|
||||
"FROM TransporterMaster t WHERE t.status = 'A' and t.transporter_code = :transporter_code", nativeQuery = true)
|
||||
TransporterMasterMod getByTransporterCode(String transporter_code);
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package com.sahyog.app.inbound.masterdata.service;
|
||||
|
||||
import com.sahyog.app.inbound.masterdata.dto.CodeMasterDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
//import com.shayog.app.inbound.common.dto;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public interface CodeMasterService {
|
||||
/**
|
||||
* Retrieves Code based on Key passed.
|
||||
*/
|
||||
CodeMasterDTO getCodebyKey(String CodeType, String CodeKey);
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package com.sahyog.app.inbound.masterdata.service;
|
||||
|
||||
import com.sahyog.app.inbound.masterdata.dto.MaterialMasterDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
//import com.shayog.app.inbound.common.dto;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public interface MaterialMasterService {
|
||||
/**
|
||||
* Retrieves Code based on Key passed.
|
||||
*/
|
||||
MaterialMasterDTO getByMaterialCode(String materialCode, int plantId);
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package com.sahyog.app.inbound.masterdata.service;
|
||||
|
||||
import com.sahyog.app.inbound.masterdata.dto.PlantMasterDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
//import com.shayog.app.inbound.common.dto;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public interface PlantMasterService {
|
||||
/**
|
||||
* Retrieves Code based on Key passed.
|
||||
*/
|
||||
PlantMasterDTO getByPlantCode(String plantCode);
|
||||
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package com.sahyog.app.inbound.masterdata.service;
|
||||
|
||||
import com.sahyog.app.inbound.masterdata.dto.TZoneMasterDTO;
|
||||
import com.sahyog.app.inbound.masterdata.model.TZoneMasterMod;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
//import com.shayog.app.inbound.common.dto;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public interface TZoneMasterService {
|
||||
/**
|
||||
* Retrieves Code based on Key passed.
|
||||
*/
|
||||
TZoneMasterDTO getByTZoneCode(String tzoneCode, String fromLocation);
|
||||
/**
|
||||
* Add TZone details.
|
||||
*/
|
||||
TZoneMasterDTO addTZoneDetail(TZoneMasterDTO tzoneMasterDTO);
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package com.sahyog.app.inbound.masterdata.service;
|
||||
|
||||
import com.sahyog.app.inbound.masterdata.dto.TransporterMasterDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
//import com.shayog.app.inbound.common.dto;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public interface TransporterMasterService {
|
||||
/**
|
||||
* Retrieves Code based on Key passed.
|
||||
*/
|
||||
TransporterMasterDTO getByTransporterCode(String transporterCode);
|
||||
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
package com.sahyog.app.inbound.masterdata.serviceImpl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.sahyog.app.inbound.masterdata.dto.CodeMasterDTO;
|
||||
import com.sahyog.app.inbound.masterdata.model.CodeMasterMod;
|
||||
import com.sahyog.app.inbound.masterdata.repository.CodeMasterRepository;
|
||||
import com.sahyog.app.inbound.masterdata.service.CodeMasterService;
|
||||
import com.shayog.app.inbound.common.dto.ResponseDTO;
|
||||
|
||||
|
||||
@Service
|
||||
public class CodeMasterServiceImpl implements CodeMasterService {
|
||||
|
||||
@Autowired
|
||||
private CodeMasterRepository CodeMasterRepo;
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(CodeMasterServiceImpl.class);
|
||||
|
||||
@Override
|
||||
public CodeMasterDTO getCodebyKey(String CodeType, String CodeKey) {
|
||||
// TODO Auto-generated method stub
|
||||
CodeMasterDTO cmDTO = new CodeMasterDTO();
|
||||
try {
|
||||
// fetch CodeMaster object
|
||||
CodeMasterMod cmEntity = CodeMasterRepo.findByCodeValue(CodeType, CodeKey);
|
||||
if (null != cmEntity) {
|
||||
BeanUtils.copyProperties(cmEntity, cmDTO);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("Unexpected error occurred: {}", e.getMessage(), e);
|
||||
}
|
||||
|
||||
return cmDTO;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
package com.sahyog.app.inbound.masterdata.serviceImpl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.sahyog.app.inbound.masterdata.dto.MaterialMasterDTO;
|
||||
import com.sahyog.app.inbound.masterdata.model.MaterialMasterMod;
|
||||
import com.sahyog.app.inbound.masterdata.repository.MaterialMasterRepository;
|
||||
import com.sahyog.app.inbound.masterdata.service.MaterialMasterService;
|
||||
import com.shayog.app.inbound.common.dto.ResponseDTO;
|
||||
|
||||
|
||||
@Service
|
||||
public class MaterialMasterServiceImpl implements MaterialMasterService {
|
||||
|
||||
@Autowired
|
||||
private MaterialMasterRepository MaterialMasterRepo;
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MaterialMasterServiceImpl.class);
|
||||
|
||||
@Override
|
||||
public MaterialMasterDTO getByMaterialCode(String materialCode, int plantId) {
|
||||
// TODO Auto-generated method stub
|
||||
MaterialMasterDTO mmDTO = new MaterialMasterDTO();
|
||||
try {
|
||||
// fetch CodeMaster object
|
||||
MaterialMasterMod mmEntity = MaterialMasterRepo.getByMaterialCode(materialCode, plantId);
|
||||
if (null != mmEntity) {
|
||||
BeanUtils.copyProperties(mmEntity, mmDTO);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("Unexpected error occurred: {}", e.getMessage(), e);
|
||||
}
|
||||
|
||||
return mmDTO;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package com.sahyog.app.inbound.masterdata.serviceImpl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.sahyog.app.inbound.masterdata.dto.PlantMasterDTO;
|
||||
import com.sahyog.app.inbound.masterdata.model.PlantMasterMod;
|
||||
import com.sahyog.app.inbound.masterdata.repository.PlantMasterRepository;
|
||||
import com.sahyog.app.inbound.masterdata.service.PlantMasterService;
|
||||
import com.shayog.app.inbound.common.dto.ResponseDTO;
|
||||
|
||||
@Service
|
||||
public class PlantMasterServiceImpl implements PlantMasterService {
|
||||
|
||||
@Autowired
|
||||
private PlantMasterRepository PlantMasterRepo;
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(PlantMasterServiceImpl.class);
|
||||
|
||||
@Override
|
||||
public PlantMasterDTO getByPlantCode(String plantCode) {
|
||||
// TODO Auto-generated method stub
|
||||
PlantMasterDTO pmDTO = new PlantMasterDTO();
|
||||
try {
|
||||
// fetch CodeMaster object
|
||||
PlantMasterMod pmEntity = PlantMasterRepo.getByPlantCode(plantCode);
|
||||
if (null != pmEntity) {
|
||||
BeanUtils.copyProperties(pmEntity, pmDTO);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("Unexpected error occurred: {}", e.getMessage(), e);
|
||||
}
|
||||
|
||||
return pmDTO;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
package com.sahyog.app.inbound.masterdata.serviceImpl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.sahyog.app.inbound.masterdata.dto.TZoneMasterDTO;
|
||||
import com.sahyog.app.inbound.masterdata.model.TZoneMasterMod;
|
||||
import com.sahyog.app.inbound.masterdata.repository.TZoneMasterRepository;
|
||||
import com.sahyog.app.inbound.masterdata.service.TZoneMasterService;
|
||||
import com.shayog.app.inbound.common.dto.ResponseDTO;
|
||||
|
||||
@Service
|
||||
public class TZoneMasterServiceImpl implements TZoneMasterService {
|
||||
|
||||
@Autowired
|
||||
private TZoneMasterRepository tzoneMasterRepo;
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(TZoneMasterServiceImpl.class);
|
||||
|
||||
@Override
|
||||
public TZoneMasterDTO getByTZoneCode(String tzoneCode, String fromLocation) {
|
||||
// TODO Auto-generated method stub
|
||||
TZoneMasterDTO pmDTO = new TZoneMasterDTO();
|
||||
try {
|
||||
// fetch CodeMaster object
|
||||
TZoneMasterMod pmEntity = tzoneMasterRepo.getByTZoneCode(tzoneCode, fromLocation);
|
||||
if (null != pmEntity) {
|
||||
BeanUtils.copyProperties(pmEntity, pmDTO);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("Unexpected error occurred: {}", e.getMessage(), e);
|
||||
}
|
||||
|
||||
return pmDTO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TZoneMasterDTO addTZoneDetail(TZoneMasterDTO tzoneMasterDTO) {
|
||||
TZoneMasterMod tzoneEntity = new TZoneMasterMod();
|
||||
TZoneMasterDTO tzoneDTO = new TZoneMasterDTO();
|
||||
try {
|
||||
// Create and save TZONE
|
||||
BeanUtils.copyProperties(tzoneMasterDTO, tzoneEntity);
|
||||
tzoneEntity = tzoneMasterRepo.save(tzoneEntity);
|
||||
BeanUtils.copyProperties(tzoneEntity, tzoneDTO);
|
||||
} catch (Exception e) {
|
||||
log.error("Unexpected error occurred: {}", e.getMessage(), e);
|
||||
}
|
||||
return tzoneDTO;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package com.sahyog.app.inbound.masterdata.serviceImpl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.sahyog.app.inbound.masterdata.dto.TransporterMasterDTO;
|
||||
import com.sahyog.app.inbound.masterdata.model.TransporterMasterMod;
|
||||
import com.sahyog.app.inbound.masterdata.repository.TransporterMasterRepository;
|
||||
import com.sahyog.app.inbound.masterdata.service.TransporterMasterService;
|
||||
import com.shayog.app.inbound.common.dto.ResponseDTO;
|
||||
|
||||
@Service
|
||||
public class TransporterMasterServiceImpl implements TransporterMasterService {
|
||||
|
||||
@Autowired
|
||||
private TransporterMasterRepository transporterMasterRepo;
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(TransporterMasterServiceImpl.class);
|
||||
|
||||
@Override
|
||||
public TransporterMasterDTO getByTransporterCode(String transporterCode) {
|
||||
// TODO Auto-generated method stub
|
||||
TransporterMasterDTO tmDTO = new TransporterMasterDTO();
|
||||
try {
|
||||
// fetch CodeMaster object
|
||||
TransporterMasterMod tmEntity = transporterMasterRepo.getByTransporterCode(transporterCode);
|
||||
if (null != tmEntity) {
|
||||
BeanUtils.copyProperties(tmEntity, tmDTO);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("Unexpected error occurred: {}", e.getMessage(), e);
|
||||
}
|
||||
|
||||
return tmDTO;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
spring:
|
||||
application:
|
||||
name: inbound-masterdata-service
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: ${RDS_HOST:jdbc:mysql://46.28.44.130:3306/master_service?useSSL=false&serverTimezone=UTC}
|
||||
username: ${RDS_USERNAME:inter}
|
||||
password: ${RDS_PASSWORD:Interwork@2025}
|
||||
# url: ${RDS_HOST:jdbc:mysql://localhost:3306/master_service?useSSL=false&serverTimezone=UTC}
|
||||
# username: ${RDS_USERNAME:root}
|
||||
# password: ${RDS_PASSWORD:Grassisgreen123!}
|
||||
hikari:
|
||||
connection-timeout: 300000
|
||||
minimum-idle: 5
|
||||
maximum-pool-size: 40
|
||||
pool-name: RDSHikariPool
|
||||
idle-timeout: 120000
|
||||
max-lifetime: 600000
|
||||
leak-detection-threshold: 300000
|
||||
jpa:
|
||||
hibernate:
|
||||
ddl-auto: update
|
||||
properties:
|
||||
hibernate:
|
||||
format_sql: true
|
||||
use_sql_comments: true
|
||||
dialect: org.hibernate.dialect.MySQL5Dialect
|
||||
show-sql: true
|
||||
open-in-view: false
|
||||
|
||||
sap:
|
||||
api:
|
||||
url: ${SAP_API_URL:https://dev-cpi-001-785gayb0.it-cpi012-rt.cfapps.ap21.hana.ondemand.com/http/dilinkwithtokendatafrombiddingsystemtos4hana}
|
||||
username: ${SAP_API_USERNAME:sb-d201b47e-5383-4f8e-8860-1e9c75280861!b7292|it-rt-dev-cpi-001-785gayb0!b114}
|
||||
password: ${SAP_API_PASSWORD:1c26e84d-03f9-4d46-b8df-564c44d0facd$U6e84pi3YRueZpmc8ntz6LDKSK5eZ71CzTM60cm4zV0=}
|
||||
timeout: ${SAP_API_TIMEOUT:15000}
|
||||
|
||||
server:
|
||||
port: ${SERVER_PORT:9091}
|
||||
error:
|
||||
whitelabel:
|
||||
enabled: false
|
||||
|
||||
management:
|
||||
security:
|
||||
enabled: false
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: '*'
|
||||
base-path: /
|
||||
|
||||
logging:
|
||||
level:
|
||||
root: INFO
|
||||
org.springframework.web: INFO
|
||||
com.sahyog.app.bidding: ${APPLICATION_LOG_LEVEL:INFO}
|
|
@ -0,0 +1,13 @@
|
|||
package com.sahyog.app.inbound.masterdata;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
@SpringBootTest
|
||||
class InboundMasterdataServiceApplicationTests {
|
||||
|
||||
@Test
|
||||
void contextLoads() {
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue