first add
This commit is contained in:
commit
e9ae9ebb0d
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
/mvnw text eol=lf
|
||||
*.cmd text eol=crlf
|
33
.gitignore
vendored
Normal file
33
.gitignore
vendored
Normal file
@ -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/
|
19
.mvn/wrapper/maven-wrapper.properties
vendored
Normal file
19
.mvn/wrapper/maven-wrapper.properties
vendored
Normal file
@ -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
|
259
mvnw
vendored
Normal file
259
mvnw
vendored
Normal file
@ -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 "$@"
|
149
mvnw.cmd
vendored
Normal file
149
mvnw.cmd
vendored
Normal file
@ -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"
|
211
pom.xml
Normal file
211
pom.xml
Normal file
@ -0,0 +1,211 @@
|
||||
<?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.4.5</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>com.jdc</groupId>
|
||||
<artifactId>JdcProject</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<name>JdcProject</name>
|
||||
<description>JdcProject</description>
|
||||
<url/>
|
||||
<licenses>
|
||||
<license/>
|
||||
</licenses>
|
||||
<developers>
|
||||
<developer/>
|
||||
</developers>
|
||||
<scm>
|
||||
<connection/>
|
||||
<developerConnection/>
|
||||
<tag/>
|
||||
<url/>
|
||||
</scm>
|
||||
<properties>
|
||||
<java.version>17</java.version>
|
||||
<lombok.version>1.18.4</lombok.version>
|
||||
<mysql.version>8.0.33</mysql.version>
|
||||
<druid.version>1.2.19</druid.version>
|
||||
<mybatis-plus.version>3.5.8</mybatis-plus.version>
|
||||
<mybatis-plus-generator.version>3.5.8</mybatis-plus-generator.version>
|
||||
<velocity.version>2.3</velocity.version>
|
||||
<httpclient.version>4.5.13</httpclient.version>
|
||||
<httpcore.version>4.4.9</httpcore.version>
|
||||
<commons-lang.version>2.6</commons-lang.version>
|
||||
<jetty-util.version>9.3.7.v20160115</jetty-util.version>
|
||||
<jjwt.version>0.11.2</jjwt.version>
|
||||
<servlet-api.version>3.0.1</servlet-api.version>
|
||||
<common-io.version>2.17.0</common-io.version>
|
||||
<swagger3.version>4.5.0</swagger3.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- <dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-security</artifactId>
|
||||
</dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>${lombok.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!--mysql-->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>${mysql.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid</artifactId>
|
||||
<version>${druid.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-spring-boot3-starter</artifactId>
|
||||
<version>${mybatis-plus.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-generator</artifactId>
|
||||
<version>${mybatis-plus-generator.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>${httpclient.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpcore</artifactId>
|
||||
<version>${httpcore.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!--gson-->
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang</artifactId>
|
||||
<version>${commons-lang.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-util</artifactId>
|
||||
<version>${jetty-util.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
<artifactId>jjwt-api</artifactId>
|
||||
<version>${jjwt.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<scope>${servlet-api.version}</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
<artifactId>jjwt-impl</artifactId>
|
||||
<version>${jjwt.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
<artifactId>jjwt-jackson</artifactId>
|
||||
<version>${jjwt.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.velocity</groupId>
|
||||
<artifactId>velocity-engine-core</artifactId>
|
||||
<version>${velocity.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!--commons-io-->
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>${common-io.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-openapi3-jakarta-spring-boot-starter</artifactId>
|
||||
<version>${swagger3.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<!-- 如果不添加此节点mybatis的mapper.xml文件都会被漏掉。 -->
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/java</directory>
|
||||
<includes>
|
||||
<include>**/*.yml</include>
|
||||
<include>**/*.properties</include>
|
||||
<include>**/*.xml</include>
|
||||
</includes>
|
||||
<filtering>false</filtering>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>**/*.yml</include>
|
||||
<include>**/*.properties</include>
|
||||
<include>**/*.xml</include>
|
||||
</includes>
|
||||
<filtering>false</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
|
||||
</project>
|
17
src/main/java/com/jdc/jdcproject/JdcProjectApplication.java
Normal file
17
src/main/java/com/jdc/jdcproject/JdcProjectApplication.java
Normal file
@ -0,0 +1,17 @@
|
||||
package com.jdc.jdcproject;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
||||
@SpringBootApplication()
|
||||
@ComponentScan({"com.jdc"})
|
||||
public class JdcProjectApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(JdcProjectApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.jdc.jdcproject.config;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.DbType;
|
||||
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@MapperScan("com.jdc.jdcproject.mapper")
|
||||
public class MybatisPlusConfig {
|
||||
|
||||
/**
|
||||
* 添加分页插件
|
||||
*/
|
||||
@Bean
|
||||
public MybatisPlusInterceptor mybatisPlusInterceptor() {
|
||||
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
||||
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); // 如果配置多个插件, 切记分页最后添加
|
||||
// 如果有多数据源可以不配具体类型, 否则都建议配上具体的 DbType
|
||||
return interceptor;
|
||||
}
|
||||
|
||||
|
||||
}
|
18
src/main/java/com/jdc/jdcproject/config/WebConfig.java
Normal file
18
src/main/java/com/jdc/jdcproject/config/WebConfig.java
Normal file
@ -0,0 +1,18 @@
|
||||
package com.jdc.jdcproject.config;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
@Configuration
|
||||
public class WebConfig implements WebMvcConfigurer {
|
||||
@Override
|
||||
public void addCorsMappings(CorsRegistry registry) {
|
||||
registry.addMapping("/**")
|
||||
.allowedOrigins("http://localhost:3333") // 前端应用的 URL
|
||||
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
|
||||
.allowedHeaders("*") // 允许所有请求头
|
||||
.allowCredentials(true)
|
||||
.maxAge(3600); // 缓存预检请求的结果的时间
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.jdc.jdcproject.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 采剥与贫损表; 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/dicekeMiningloss")
|
||||
public class DicekeMininglossController {
|
||||
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package com.jdc.jdcproject.controller;
|
||||
|
||||
import com.jdc.jdcproject.entity.DicekeMiningrecord;
|
||||
import com.jdc.jdcproject.entity.DicekePlatearea;
|
||||
import com.jdc.jdcproject.entity.VO.DicekeMiningrecordVo;
|
||||
import com.jdc.jdcproject.service.IDicekeMiningrecordService;
|
||||
import com.jdc.jdcproject.utils.Result;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 采矿记录表; 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/dicekeMiningrecord")
|
||||
public class DicekeMiningrecordController {
|
||||
|
||||
@Autowired
|
||||
private IDicekeMiningrecordService dicekeMiningrecordService;
|
||||
|
||||
@Operation(summary = "查询mo品味报表")
|
||||
@GetMapping("findAll")
|
||||
public Result findAll() {
|
||||
List<DicekeMiningrecordVo> dicekeMiningrecordVoList = dicekeMiningrecordService.findAll();
|
||||
return Result.successResult().data("dicekeMiningrecordVoList", dicekeMiningrecordVoList);
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "修改Mo品味信息")
|
||||
@PostMapping("updatedicekeMiningrecord")
|
||||
public Result updatePlateArea(@RequestBody DicekeMiningrecord dicekeMiningrecord) {
|
||||
boolean updateflag = dicekeMiningrecordService.updateById(dicekeMiningrecord);
|
||||
if (updateflag) {
|
||||
return Result.successResult();
|
||||
} else {
|
||||
return Result.errorResult();
|
||||
}
|
||||
}
|
||||
|
||||
@Operation(summary = "删除Mo品味信息")
|
||||
@DeleteMapping("deletedicekeMiningrecord/{recordID}")
|
||||
public Result deletedicekeMiningrecord(@PathVariable String recordID) {
|
||||
boolean updateflag = dicekeMiningrecordService.removeById(recordID);
|
||||
if (updateflag) {
|
||||
return Result.successResult();
|
||||
} else {
|
||||
return Result.errorResult();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,80 @@
|
||||
package com.jdc.jdcproject.controller;
|
||||
|
||||
import com.jdc.jdcproject.entity.DicekePlatearea;
|
||||
import com.jdc.jdcproject.service.IDicekePlateareaService;
|
||||
import com.jdc.jdcproject.utils.Result;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 平盘 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/dicekePlatearea")
|
||||
public class DicekePlateareaController {
|
||||
|
||||
@Autowired
|
||||
private IDicekePlateareaService dicekePlateareaService;
|
||||
|
||||
|
||||
@Operation(summary = "查询所有平盘")
|
||||
@GetMapping("findAllPlateArea")
|
||||
public Result findAllPlateArea() {
|
||||
List<DicekePlatearea> platearealist = dicekePlateareaService.list();
|
||||
return Result.successResult().data("plateArea",platearealist);
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询平盘信息")
|
||||
@GetMapping("findPlateAreaById/{id}")
|
||||
public Result updatePlateArea(@PathVariable String id) {
|
||||
DicekePlatearea dicekePlatearea = dicekePlateareaService.getById(id);
|
||||
return Result.successResult().data("dicekePlatearea",dicekePlatearea);
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "修改平盘信息")
|
||||
@PostMapping("updatePlateArea")
|
||||
public Result updatePlateArea(@RequestBody DicekePlatearea platearea) {
|
||||
boolean updateflag = dicekePlateareaService.updateById(platearea);
|
||||
if (updateflag) {
|
||||
return Result.successResult();
|
||||
} else {
|
||||
return Result.errorResult();
|
||||
}
|
||||
}
|
||||
|
||||
@Operation(summary = "删除平盘信息")
|
||||
@DeleteMapping("deletePlateArea/{id}")
|
||||
public Result deletePlateArea(@PathVariable String id) {
|
||||
boolean updateflag = dicekePlateareaService.removeById(id);
|
||||
if (updateflag) {
|
||||
return Result.successResult();
|
||||
} else {
|
||||
return Result.errorResult();
|
||||
}
|
||||
}
|
||||
|
||||
@Operation(summary = "新增平盘信息")
|
||||
@PostMapping("addPlateArea")
|
||||
public Result addPlateArea(@RequestBody DicekePlatearea platearea) {
|
||||
boolean updateflag = dicekePlateareaService.save(platearea);
|
||||
if (updateflag) {
|
||||
return Result.successResult();
|
||||
} else {
|
||||
return Result.errorResult();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.jdc.jdcproject.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 降水量表; 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/dicekePrecipitation")
|
||||
public class DicekePrecipitationController {
|
||||
|
||||
}
|
@ -0,0 +1,79 @@
|
||||
package com.jdc.jdcproject.controller;
|
||||
|
||||
import com.jdc.jdcproject.entity.DicekePlatearea;
|
||||
import com.jdc.jdcproject.entity.DicekeShovel;
|
||||
import com.jdc.jdcproject.service.IDicekePlateareaService;
|
||||
import com.jdc.jdcproject.service.IDicekeShovelService;
|
||||
import com.jdc.jdcproject.utils.Result;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 电铲 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/dicekeShovel")
|
||||
public class DicekeShovelController {
|
||||
|
||||
@Autowired
|
||||
private IDicekeShovelService dicekeShovelService;
|
||||
|
||||
|
||||
@Operation(summary = "查询所有电铲")
|
||||
@GetMapping("findAllShovel")
|
||||
public Result findAllShovel() {
|
||||
List<DicekeShovel> shovelList = dicekeShovelService.list();
|
||||
return Result.successResult().data("shovel", shovelList);
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询电铲信息")
|
||||
@GetMapping("findShovelById/{id}")
|
||||
public Result findShovelById(@PathVariable String id) {
|
||||
DicekeShovel dicekeShovel = dicekeShovelService.getById(id);
|
||||
return Result.successResult().data("dicekeShovel", dicekeShovel);
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "修改电铲信息")
|
||||
@PostMapping("updateShovel")
|
||||
public Result updatePlateArea(@RequestBody DicekeShovel shovel) {
|
||||
boolean updateflag = dicekeShovelService.updateById(shovel);
|
||||
if (updateflag) {
|
||||
return Result.successResult();
|
||||
} else {
|
||||
return Result.errorResult();
|
||||
}
|
||||
}
|
||||
|
||||
@Operation(summary = "删除电铲信息")
|
||||
@DeleteMapping("deleteShovel/{id}")
|
||||
public Result deletePlateArea(@PathVariable String id) {
|
||||
boolean updateflag = dicekeShovelService.removeById(id);
|
||||
if (updateflag) {
|
||||
return Result.successResult();
|
||||
} else {
|
||||
return Result.errorResult();
|
||||
}
|
||||
}
|
||||
|
||||
@Operation(summary = "新增电铲信息")
|
||||
@PostMapping("addShovel")
|
||||
public Result addShovel(@RequestBody DicekeShovel shovel) {
|
||||
boolean updateflag = dicekeShovelService.save(shovel);
|
||||
if (updateflag) {
|
||||
return Result.successResult();
|
||||
} else {
|
||||
return Result.errorResult();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.jdc.jdcproject.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jdc.jdcproject.entity.Renyuanjiegou;
|
||||
import com.jdc.jdcproject.service.IRenyuanjiegouService;
|
||||
import com.jdc.jdcproject.utils.RenYuanUtil;
|
||||
import com.jdc.jdcproject.utils.Result;
|
||||
import io.swagger.v3.oas.annotations.Hidden;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/renyuanjiegou")
|
||||
public class RenyuanjiegouController {
|
||||
|
||||
@Autowired
|
||||
private IRenyuanjiegouService renyuanjiegouService;
|
||||
|
||||
//查询全部
|
||||
@Operation(summary = "查询所有人员")
|
||||
@GetMapping("findAll")
|
||||
public Result findAll() {
|
||||
|
||||
//调用service实现查询
|
||||
List<Renyuanjiegou> renyuanjiegouList = renyuanjiegouService.list();
|
||||
|
||||
Map<String, Renyuanjiegou> stringRenyuanjiegouMap = RenYuanUtil.renyuanSum(renyuanjiegouList);
|
||||
|
||||
//将所有厂区及部门数据整合方便前端增加数据时回显
|
||||
Map<String,List<String>> changqubumenMap = new HashMap<>();
|
||||
for (Renyuanjiegou renyuan : renyuanjiegouList) {
|
||||
if (changqubumenMap.containsKey(renyuan.getChangQu())) {
|
||||
changqubumenMap.get(renyuan.getChangQu()).add(renyuan.getBuMen());
|
||||
} else {
|
||||
// 如果没有该 ChangQu 的记录,则直接加入
|
||||
List<String> bumenList = new ArrayList<>();
|
||||
bumenList.add(renyuan.getBuMen());
|
||||
changqubumenMap.put(renyuan.getChangQu(), bumenList);
|
||||
}
|
||||
}
|
||||
return Result.successResult().data("bumenChangqujilu", changqubumenMap).data("renyuanjiegou", renyuanjiegouList).data("renyuanSum",stringRenyuanjiegouMap);
|
||||
}
|
||||
|
||||
/**todo
|
||||
* 目前只存在按月分查询人员
|
||||
* 后续可新增其他条件查询条件
|
||||
*/
|
||||
//按月份查询人员
|
||||
@Operation(summary = "按月份进行查询")
|
||||
@PostMapping("findforMoth")
|
||||
public Result findforMoth(@RequestBody(required = false) Renyuanjiegou renyuanjiegou) {
|
||||
QueryWrapper<Renyuanjiegou> queryWrapper = new QueryWrapper<>();
|
||||
if (!StringUtils.isEmpty(renyuanjiegou.getStrMonth())) {
|
||||
queryWrapper.like("strMonth", renyuanjiegou.getStrMonth());
|
||||
}
|
||||
|
||||
List<Renyuanjiegou> renyuanjiegouList = renyuanjiegouService.list(queryWrapper);
|
||||
|
||||
|
||||
|
||||
//数据整合
|
||||
Map<String, Renyuanjiegou> stringRenyuanjiegouMap = RenYuanUtil.renyuanSum(renyuanjiegouList);
|
||||
|
||||
return Result.successResult().data("renyuanjiegou", renyuanjiegouList).data("renyuanSum",stringRenyuanjiegouMap);
|
||||
}
|
||||
|
||||
//新增数据
|
||||
@Operation(summary = "新增数据")
|
||||
@PostMapping("addRy")
|
||||
public Result addTeacher(@RequestBody Renyuanjiegou renyuanjiegou) {
|
||||
boolean saveFlag = renyuanjiegouService.save(renyuanjiegou);
|
||||
if (saveFlag) {
|
||||
return Result.successResult();
|
||||
} else {
|
||||
return Result.errorResult();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.jdc.jdcproject.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/renyuanjiegouLaowu")
|
||||
public class RenyuanjiegouLaowuController {
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.jdc.jdcproject.controller;
|
||||
|
||||
import com.jdc.jdcproject.entity.Users;
|
||||
import com.jdc.jdcproject.service.IUsersService;
|
||||
import com.jdc.jdcproject.utils.Result;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/users")
|
||||
public class UsersController {
|
||||
@Autowired
|
||||
private IUsersService usersService;
|
||||
|
||||
@GetMapping("captcha")
|
||||
public String captcha() {
|
||||
return "captcha";
|
||||
}
|
||||
|
||||
@PostMapping("/login")
|
||||
public Result login(@RequestBody Users user) {
|
||||
String token = usersService.login(user);
|
||||
return Result.successResult().data("token",token);
|
||||
}
|
||||
|
||||
@GetMapping("/me")
|
||||
public Result me() {
|
||||
return Result.successResult().data("data","1234567");
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
package com.jdc.jdcproject.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 采剥与贫损表;
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
@TableName("diceke_miningloss")
|
||||
@Schema(name = "DicekeMiningloss", description = "采剥与贫损表;")
|
||||
@Data
|
||||
public class DicekeMiningloss implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "主键")
|
||||
@TableId("LossID")
|
||||
private String lossID;
|
||||
|
||||
@Schema(description = "外键关联平盘表")
|
||||
private String plateID;
|
||||
|
||||
@Schema(description = "外键关联铲号表")
|
||||
private String shovelID;
|
||||
|
||||
@Schema(description = "月份")
|
||||
private LocalDate month;
|
||||
|
||||
@Schema(description = "剥离量(吨)")
|
||||
private Double strippingTon;
|
||||
|
||||
@Schema(description = "采剥总量(吨)")
|
||||
private Double strippingAndTotalMiningTon;
|
||||
|
||||
@Schema(description = "采下废石(吨)")
|
||||
private Double wasteRockTon;
|
||||
|
||||
@Schema(description = "贫化率(%)")
|
||||
private Double dilutionRate;
|
||||
|
||||
@Schema(description = "损失率(%)")
|
||||
private Double lossRate;
|
||||
|
||||
@Schema(description = "配矿配矿量(吨)")
|
||||
private Double allocationTon;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DicekeMiningloss{" +
|
||||
"lossID = " + lossID +
|
||||
", plateID = " + plateID +
|
||||
", shovelID = " + shovelID +
|
||||
", month = " + month +
|
||||
", strippingTon = " + strippingTon +
|
||||
", strippingAndTotalMiningTon = " + strippingAndTotalMiningTon +
|
||||
", wasteRockTon = " + wasteRockTon +
|
||||
", dilutionRate = " + dilutionRate +
|
||||
", lossRate = " + lossRate +
|
||||
", allocationTon = " + allocationTon +
|
||||
"}";
|
||||
}
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
package com.jdc.jdcproject.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 采矿记录表;
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
@TableName("diceke_miningrecord")
|
||||
@Schema(name = "DicekeMiningrecord", description = "采矿记录表;")
|
||||
@Data
|
||||
public class DicekeMiningrecord implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "主键")
|
||||
@TableId("RecordID")
|
||||
private String recordID;
|
||||
|
||||
@Schema(description = "外键关联平盘表")
|
||||
private String plateID;
|
||||
|
||||
@Schema(description = "外键关联铲号表")
|
||||
private String shovelID;
|
||||
|
||||
@Schema(description = "月份")
|
||||
private LocalDate month;
|
||||
|
||||
@Schema(description = "采矿量/出矿量/实采总量(单位:吨)")
|
||||
private Double totalMiningTon;
|
||||
|
||||
@Schema(description = "金属量(仅铝品位报表需要)")
|
||||
private Double metalTon;
|
||||
|
||||
@Schema(description = "块段采矿品位(%)")
|
||||
private Double miningGrade;
|
||||
|
||||
@Schema(description = "块段氧化率(%)")
|
||||
private Double oxidationRate;
|
||||
|
||||
@Schema(description = "全月平均品位(%)")
|
||||
private Double avgGrade;
|
||||
|
||||
@Schema(description = "选矿平均品位(%)")
|
||||
private Double dressingGrade;
|
||||
|
||||
@Schema(description = "全月平均氧化率(%)")
|
||||
private Double avgOxidationRate;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String beizhu;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DicekeMiningrecord{" +
|
||||
"recordID = " + recordID +
|
||||
", plateID = " + plateID +
|
||||
", shovelID = " + shovelID +
|
||||
", month = " + month +
|
||||
", totalMiningTon = " + totalMiningTon +
|
||||
", metalTon = " + metalTon +
|
||||
", miningGrade = " + miningGrade +
|
||||
", oxidationRate = " + oxidationRate +
|
||||
", avgGrade = " + avgGrade +
|
||||
", dressingGrade = " + dressingGrade +
|
||||
", avgOxidationRate = " + avgOxidationRate +
|
||||
"}";
|
||||
}
|
||||
}
|
40
src/main/java/com/jdc/jdcproject/entity/DicekePlatearea.java
Normal file
40
src/main/java/com/jdc/jdcproject/entity/DicekePlatearea.java
Normal file
@ -0,0 +1,40 @@
|
||||
package com.jdc.jdcproject.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 平盘
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
@TableName("diceke_platearea")
|
||||
@Schema(name = "DicekePlatearea", description = "平盘")
|
||||
@Data
|
||||
public class DicekePlatearea implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "平盘ID")
|
||||
@TableId("PlateID")
|
||||
private String plateID;
|
||||
|
||||
@Schema(description = "平盘号")
|
||||
private String plateRange;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DicekePlatearea{" +
|
||||
"plateID = " + plateID +
|
||||
", plateRange = " + plateRange +
|
||||
"}";
|
||||
}
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
package com.jdc.jdcproject.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 降水量表;
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
@TableName("diceke_precipitation")
|
||||
@Schema(name = "DicekePrecipitation", description = "降水量表;")
|
||||
public class DicekePrecipitation implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "主键")
|
||||
@TableId("PrecipID")
|
||||
private String precipID;
|
||||
|
||||
@Schema(description = "降水量数值(毫米)")
|
||||
private String amount;
|
||||
|
||||
@Schema(description = "计量单位(固定为“毫米”)")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "日期")
|
||||
private LocalDateTime monthDate;
|
||||
|
||||
public String getPrecipID() {
|
||||
return precipID;
|
||||
}
|
||||
|
||||
public void setPrecipID(String precipID) {
|
||||
this.precipID = precipID;
|
||||
}
|
||||
|
||||
public String getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public void setAmount(String amount) {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public String getUnit() {
|
||||
return unit;
|
||||
}
|
||||
|
||||
public void setUnit(String unit) {
|
||||
this.unit = unit;
|
||||
}
|
||||
|
||||
public LocalDateTime getMonthDate() {
|
||||
return monthDate;
|
||||
}
|
||||
|
||||
public void setMonthDate(LocalDateTime monthDate) {
|
||||
this.monthDate = monthDate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DicekePrecipitation{" +
|
||||
"precipID = " + precipID +
|
||||
", amount = " + amount +
|
||||
", unit = " + unit +
|
||||
", monthDate = " + monthDate +
|
||||
"}";
|
||||
}
|
||||
}
|
64
src/main/java/com/jdc/jdcproject/entity/DicekeShovel.java
Normal file
64
src/main/java/com/jdc/jdcproject/entity/DicekeShovel.java
Normal file
@ -0,0 +1,64 @@
|
||||
package com.jdc.jdcproject.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 电铲
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
@TableName("diceke_shovel")
|
||||
@Schema(name = "DicekeShovel", description = "电铲")
|
||||
public class DicekeShovel implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "电铲ID")
|
||||
@TableId("ShovelID")
|
||||
private String shovelID;
|
||||
|
||||
@Schema(description = "电铲名称(如 08#、挖机)")
|
||||
private String shovelCode;
|
||||
|
||||
@Schema(description = "属性(是自营还是外委)")
|
||||
private byte[] attribute;
|
||||
|
||||
public String getShovelID() {
|
||||
return shovelID;
|
||||
}
|
||||
|
||||
public void setShovelID(String shovelID) {
|
||||
this.shovelID = shovelID;
|
||||
}
|
||||
|
||||
public String getShovelCode() {
|
||||
return shovelCode;
|
||||
}
|
||||
|
||||
public void setShovelCode(String shovelCode) {
|
||||
this.shovelCode = shovelCode;
|
||||
}
|
||||
|
||||
public byte[] getAttribute() {
|
||||
return attribute;
|
||||
}
|
||||
|
||||
public void setAttribute(byte[] attribute) {
|
||||
this.attribute = attribute;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DicekeShovel{" +
|
||||
"shovelID = " + shovelID +
|
||||
", shovelCode = " + shovelCode +
|
||||
", attribute = " + attribute +
|
||||
"}";
|
||||
}
|
||||
}
|
168
src/main/java/com/jdc/jdcproject/entity/Renyuanjiegou.java
Normal file
168
src/main/java/com/jdc/jdcproject/entity/Renyuanjiegou.java
Normal file
@ -0,0 +1,168 @@
|
||||
package com.jdc.jdcproject.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
@Schema(name = "Renyuanjiegou", description = "")
|
||||
public class Renyuanjiegou implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer id;
|
||||
|
||||
private String changQu;
|
||||
|
||||
private String buMen;
|
||||
|
||||
private Integer zongRenShu;
|
||||
|
||||
private Integer guanLiRY;
|
||||
|
||||
private Integer zhuanYeJishuRY;
|
||||
|
||||
private Integer shenChanFZRY;
|
||||
|
||||
private Integer fuWuRY;
|
||||
|
||||
private Integer laoWuRY;
|
||||
|
||||
private LocalDateTime dt;
|
||||
|
||||
private String strMonth;
|
||||
|
||||
private String beiZhu;
|
||||
|
||||
private Integer xuHao;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getChangQu() {
|
||||
return changQu;
|
||||
}
|
||||
|
||||
public void setChangQu(String changQu) {
|
||||
this.changQu = changQu;
|
||||
}
|
||||
|
||||
public String getBuMen() {
|
||||
return buMen;
|
||||
}
|
||||
|
||||
public void setBuMen(String buMen) {
|
||||
this.buMen = buMen;
|
||||
}
|
||||
|
||||
public Integer getZongRenShu() {
|
||||
return zongRenShu;
|
||||
}
|
||||
|
||||
public void setZongRenShu(Integer zongRenShu) {
|
||||
this.zongRenShu = zongRenShu;
|
||||
}
|
||||
|
||||
public Integer getGuanLiRY() {
|
||||
return guanLiRY;
|
||||
}
|
||||
|
||||
public void setGuanLiRY(Integer guanLiRY) {
|
||||
this.guanLiRY = guanLiRY;
|
||||
}
|
||||
|
||||
public Integer getZhuanYeJishuRY() {
|
||||
return zhuanYeJishuRY;
|
||||
}
|
||||
|
||||
public void setZhuanYeJishuRY(Integer zhuanYeJishuRY) {
|
||||
this.zhuanYeJishuRY = zhuanYeJishuRY;
|
||||
}
|
||||
|
||||
public Integer getShenChanFZRY() {
|
||||
return shenChanFZRY;
|
||||
}
|
||||
|
||||
public void setShenChanFZRY(Integer shenChanFZRY) {
|
||||
this.shenChanFZRY = shenChanFZRY;
|
||||
}
|
||||
|
||||
public Integer getFuWuRY() {
|
||||
return fuWuRY;
|
||||
}
|
||||
|
||||
public void setFuWuRY(Integer fuWuRY) {
|
||||
this.fuWuRY = fuWuRY;
|
||||
}
|
||||
|
||||
public Integer getLaoWuRY() {
|
||||
return laoWuRY;
|
||||
}
|
||||
|
||||
public void setLaoWuRY(Integer laoWuRY) {
|
||||
this.laoWuRY = laoWuRY;
|
||||
}
|
||||
|
||||
public LocalDateTime getDt() {
|
||||
return dt;
|
||||
}
|
||||
|
||||
public void setDt(LocalDateTime dt) {
|
||||
this.dt = dt;
|
||||
}
|
||||
|
||||
public String getStrMonth() {
|
||||
return strMonth;
|
||||
}
|
||||
|
||||
public void setStrMonth(String strMonth) {
|
||||
this.strMonth = strMonth;
|
||||
}
|
||||
|
||||
public String getBeiZhu() {
|
||||
return beiZhu;
|
||||
}
|
||||
|
||||
public void setBeiZhu(String beiZhu) {
|
||||
this.beiZhu = beiZhu;
|
||||
}
|
||||
|
||||
public Integer getXuHao() {
|
||||
return xuHao;
|
||||
}
|
||||
|
||||
public void setXuHao(Integer xuHao) {
|
||||
this.xuHao = xuHao;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Renyuanjiegou{" +
|
||||
"id = " + id +
|
||||
", changQu = " + changQu +
|
||||
", buMen = " + buMen +
|
||||
", zongRenShu = " + zongRenShu +
|
||||
", guanLiRY = " + guanLiRY +
|
||||
", zhuanYeJishuRY = " + zhuanYeJishuRY +
|
||||
", shenChanFZRY = " + shenChanFZRY +
|
||||
", fuWuRY = " + fuWuRY +
|
||||
", laoWuRY = " + laoWuRY +
|
||||
", dt = " + dt +
|
||||
", strMonth = " + strMonth +
|
||||
", beiZhu = " + beiZhu +
|
||||
", xuHao = " + xuHao +
|
||||
"}";
|
||||
}
|
||||
}
|
148
src/main/java/com/jdc/jdcproject/entity/RenyuanjiegouLaowu.java
Normal file
148
src/main/java/com/jdc/jdcproject/entity/RenyuanjiegouLaowu.java
Normal file
@ -0,0 +1,148 @@
|
||||
package com.jdc.jdcproject.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
@TableName("renyuanjiegou_laowu")
|
||||
@Schema(name = "RenyuanjiegouLaowu", description = "")
|
||||
public class RenyuanjiegouLaowu implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer id;
|
||||
|
||||
private String changQu;
|
||||
|
||||
private String buMen;
|
||||
|
||||
private Integer zongRenShu;
|
||||
|
||||
private Integer guanLiRY;
|
||||
|
||||
private Integer zhuanYeJishuRY;
|
||||
|
||||
private Integer shenChanFZRY;
|
||||
|
||||
private Integer fuWuRY;
|
||||
|
||||
private Integer laoWuRY;
|
||||
|
||||
private LocalDateTime dt;
|
||||
|
||||
private String strMonth;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getChangQu() {
|
||||
return changQu;
|
||||
}
|
||||
|
||||
public void setChangQu(String changQu) {
|
||||
this.changQu = changQu;
|
||||
}
|
||||
|
||||
public String getBuMen() {
|
||||
return buMen;
|
||||
}
|
||||
|
||||
public void setBuMen(String buMen) {
|
||||
this.buMen = buMen;
|
||||
}
|
||||
|
||||
public Integer getZongRenShu() {
|
||||
return zongRenShu;
|
||||
}
|
||||
|
||||
public void setZongRenShu(Integer zongRenShu) {
|
||||
this.zongRenShu = zongRenShu;
|
||||
}
|
||||
|
||||
public Integer getGuanLiRY() {
|
||||
return guanLiRY;
|
||||
}
|
||||
|
||||
public void setGuanLiRY(Integer guanLiRY) {
|
||||
this.guanLiRY = guanLiRY;
|
||||
}
|
||||
|
||||
public Integer getZhuanYeJishuRY() {
|
||||
return zhuanYeJishuRY;
|
||||
}
|
||||
|
||||
public void setZhuanYeJishuRY(Integer zhuanYeJishuRY) {
|
||||
this.zhuanYeJishuRY = zhuanYeJishuRY;
|
||||
}
|
||||
|
||||
public Integer getShenChanFZRY() {
|
||||
return shenChanFZRY;
|
||||
}
|
||||
|
||||
public void setShenChanFZRY(Integer shenChanFZRY) {
|
||||
this.shenChanFZRY = shenChanFZRY;
|
||||
}
|
||||
|
||||
public Integer getFuWuRY() {
|
||||
return fuWuRY;
|
||||
}
|
||||
|
||||
public void setFuWuRY(Integer fuWuRY) {
|
||||
this.fuWuRY = fuWuRY;
|
||||
}
|
||||
|
||||
public Integer getLaoWuRY() {
|
||||
return laoWuRY;
|
||||
}
|
||||
|
||||
public void setLaoWuRY(Integer laoWuRY) {
|
||||
this.laoWuRY = laoWuRY;
|
||||
}
|
||||
|
||||
public LocalDateTime getDt() {
|
||||
return dt;
|
||||
}
|
||||
|
||||
public void setDt(LocalDateTime dt) {
|
||||
this.dt = dt;
|
||||
}
|
||||
|
||||
public String getStrMonth() {
|
||||
return strMonth;
|
||||
}
|
||||
|
||||
public void setStrMonth(String strMonth) {
|
||||
this.strMonth = strMonth;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "RenyuanjiegouLaowu{" +
|
||||
"id = " + id +
|
||||
", changQu = " + changQu +
|
||||
", buMen = " + buMen +
|
||||
", zongRenShu = " + zongRenShu +
|
||||
", guanLiRY = " + guanLiRY +
|
||||
", zhuanYeJishuRY = " + zhuanYeJishuRY +
|
||||
", shenChanFZRY = " + shenChanFZRY +
|
||||
", fuWuRY = " + fuWuRY +
|
||||
", laoWuRY = " + laoWuRY +
|
||||
", dt = " + dt +
|
||||
", strMonth = " + strMonth +
|
||||
"}";
|
||||
}
|
||||
}
|
84
src/main/java/com/jdc/jdcproject/entity/Users.java
Normal file
84
src/main/java/com/jdc/jdcproject/entity/Users.java
Normal file
@ -0,0 +1,84 @@
|
||||
package com.jdc.jdcproject.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
@Schema(name = "Users", description = "")
|
||||
public class Users implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "用户id")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "用户名")
|
||||
private String username;
|
||||
|
||||
@Schema(description = "密码")
|
||||
private String password;
|
||||
|
||||
@Schema(description = "头像")
|
||||
private String salt;
|
||||
|
||||
@Schema(description = "手机号")
|
||||
private String tel;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getSalt() {
|
||||
return salt;
|
||||
}
|
||||
|
||||
public void setSalt(String salt) {
|
||||
this.salt = salt;
|
||||
}
|
||||
|
||||
public String getTel() {
|
||||
return tel;
|
||||
}
|
||||
|
||||
public void setTel(String tel) {
|
||||
this.tel = tel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Users{" +
|
||||
"id = " + id +
|
||||
", username = " + username +
|
||||
", password = " + password +
|
||||
", salt = " + salt +
|
||||
", tel = " + tel +
|
||||
"}";
|
||||
}
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package com.jdc.jdcproject.entity.VO;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
@Data
|
||||
public class DicekeMiningrecordVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "主键")
|
||||
@TableId("RecordID")
|
||||
private String recordID;
|
||||
|
||||
@Schema(description = "平盘名称")
|
||||
private String plateRange;
|
||||
|
||||
@Schema(description = "铲号")
|
||||
private String shovelCoed;
|
||||
|
||||
@Schema(description = "月份")
|
||||
private LocalDate month;
|
||||
|
||||
@Schema(description = "采矿量/出矿量/实采总量(单位:吨)")
|
||||
private Double totalMiningTon;
|
||||
|
||||
@Schema(description = "金属量(仅铝品位报表需要)")
|
||||
private Double metalTon;
|
||||
|
||||
@Schema(description = "块段采矿品位(%)")
|
||||
private Double miningGrade;
|
||||
|
||||
@Schema(description = "块段氧化率(%)")
|
||||
private Double oxidationRate;
|
||||
|
||||
@Schema(description = "全月平均品位(%)")
|
||||
private Double avgGrade;
|
||||
|
||||
@Schema(description = "选矿平均品位(%)")
|
||||
private Double dressingGrade;
|
||||
|
||||
@Schema(description = "全月平均氧化率(%)")
|
||||
private Double avgOxidationRate;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String beizhu;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DicekeMiningrecord{" +
|
||||
"recordID = " + recordID +
|
||||
", plateID = " + plateRange +
|
||||
", shovelID = " + shovelCoed +
|
||||
", month = " + month +
|
||||
", totalMiningTon = " + totalMiningTon +
|
||||
", metalTon = " + metalTon +
|
||||
", miningGrade = " + miningGrade +
|
||||
", oxidationRate = " + oxidationRate +
|
||||
", avgGrade = " + avgGrade +
|
||||
", dressingGrade = " + dressingGrade +
|
||||
", avgOxidationRate = " + avgOxidationRate +
|
||||
", beizhu = " + beizhu +
|
||||
"}";
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.jdc.jdcproject.exceptionhandler;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class JdcException extends RuntimeException {
|
||||
|
||||
private Integer code;//状态码
|
||||
|
||||
private String msg;//异常信息
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.jdc.jdcproject.mapper;
|
||||
|
||||
import com.jdc.jdcproject.entity.DicekeMiningloss;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 采剥与贫损表; Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
@Mapper
|
||||
public interface DicekeMininglossMapper extends BaseMapper<DicekeMiningloss> {
|
||||
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.jdc.jdcproject.mapper;
|
||||
|
||||
import com.jdc.jdcproject.entity.DicekeMiningrecord;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jdc.jdcproject.entity.VO.DicekeMiningrecordVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 采矿记录表; Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
@Mapper
|
||||
public interface DicekeMiningrecordMapper extends BaseMapper<DicekeMiningrecord> {
|
||||
|
||||
List<DicekeMiningrecordVo> findAll();
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.jdc.jdcproject.mapper;
|
||||
|
||||
import com.jdc.jdcproject.entity.DicekePlatearea;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 平盘 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
@Mapper
|
||||
public interface DicekePlateareaMapper extends BaseMapper<DicekePlatearea> {
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.jdc.jdcproject.mapper;
|
||||
|
||||
import com.jdc.jdcproject.entity.DicekePrecipitation;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 降水量表; Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
@Mapper
|
||||
public interface DicekePrecipitationMapper extends BaseMapper<DicekePrecipitation> {
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.jdc.jdcproject.mapper;
|
||||
|
||||
import com.jdc.jdcproject.entity.DicekeShovel;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 电铲 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
@Mapper
|
||||
public interface DicekeShovelMapper extends BaseMapper<DicekeShovel> {
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.jdc.jdcproject.mapper;
|
||||
|
||||
import com.jdc.jdcproject.entity.RenyuanjiegouLaowu;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
@Mapper
|
||||
public interface RenyuanjiegouLaowuMapper extends BaseMapper<RenyuanjiegouLaowu> {
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.jdc.jdcproject.mapper;
|
||||
|
||||
import com.jdc.jdcproject.entity.Renyuanjiegou;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
@Mapper
|
||||
public interface RenyuanjiegouMapper extends BaseMapper<Renyuanjiegou> {
|
||||
|
||||
}
|
18
src/main/java/com/jdc/jdcproject/mapper/UsersMapper.java
Normal file
18
src/main/java/com/jdc/jdcproject/mapper/UsersMapper.java
Normal file
@ -0,0 +1,18 @@
|
||||
package com.jdc.jdcproject.mapper;
|
||||
|
||||
import com.jdc.jdcproject.entity.Users;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
@Mapper
|
||||
public interface UsersMapper extends BaseMapper<Users> {
|
||||
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jdc.jdcproject.mapper.DicekeMininglossMapper">
|
||||
|
||||
</mapper>
|
@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jdc.jdcproject.mapper.DicekeMiningrecordMapper">
|
||||
|
||||
<!-- 表结构 平盘-电铲号-金属量-块段采矿品味-块段氧化率-全月平均位-选矿平均位-全月均氧化率-备注-月份 -->
|
||||
<select id="findAll" resultType="com.jdc.jdcproject.entity.VO.DicekeMiningrecordVo">
|
||||
select dm.RecordID,
|
||||
dp.PlateRange,
|
||||
ds.ShovelCode,
|
||||
dm.TotalMiningTon,
|
||||
dm.MetalTon,
|
||||
dm.MiningGrade,
|
||||
dm.OxidationRate,
|
||||
dm.AvgGrade,
|
||||
dm.DressingGrade,
|
||||
dm.AvgOxidationRate,
|
||||
dm.Month,
|
||||
dm.beizhu
|
||||
FROM diceke_miningrecord dm
|
||||
LEFT JOIN diceke_shovel ds ON dm.ShovelID = ds.ShovelID
|
||||
LEFT JOIN diceke_platearea dp ON dm.PlateID = dp.PlateID
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jdc.jdcproject.mapper.DicekePlateareaMapper">
|
||||
|
||||
</mapper>
|
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jdc.jdcproject.mapper.DicekePrecipitationMapper">
|
||||
|
||||
</mapper>
|
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jdc.jdcproject.mapper.DicekeShovelMapper">
|
||||
|
||||
</mapper>
|
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jdc.jdcproject.mapper.RenyuanjiegouLaowuMapper">
|
||||
|
||||
</mapper>
|
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jdc.jdcproject.mapper.RenyuanjiegouMapper">
|
||||
|
||||
</mapper>
|
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jdc.jdcproject.mapper.UsersMapper">
|
||||
|
||||
</mapper>
|
@ -0,0 +1,16 @@
|
||||
package com.jdc.jdcproject.service;
|
||||
|
||||
import com.jdc.jdcproject.entity.DicekeMiningloss;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 采剥与贫损表; 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
public interface IDicekeMininglossService extends IService<DicekeMiningloss> {
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.jdc.jdcproject.service;
|
||||
|
||||
import com.jdc.jdcproject.entity.DicekeMiningrecord;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jdc.jdcproject.entity.VO.DicekeMiningrecordVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 采矿记录表; 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
public interface IDicekeMiningrecordService extends IService<DicekeMiningrecord> {
|
||||
|
||||
List<DicekeMiningrecordVo> findAll();
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.jdc.jdcproject.service;
|
||||
|
||||
import com.jdc.jdcproject.entity.DicekePlatearea;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 平盘 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
public interface IDicekePlateareaService extends IService<DicekePlatearea> {
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.jdc.jdcproject.service;
|
||||
|
||||
import com.jdc.jdcproject.entity.DicekePrecipitation;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 降水量表; 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
public interface IDicekePrecipitationService extends IService<DicekePrecipitation> {
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.jdc.jdcproject.service;
|
||||
|
||||
import com.jdc.jdcproject.entity.DicekeShovel;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 电铲 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
public interface IDicekeShovelService extends IService<DicekeShovel> {
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.jdc.jdcproject.service;
|
||||
|
||||
import com.jdc.jdcproject.entity.RenyuanjiegouLaowu;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
public interface IRenyuanjiegouLaowuService extends IService<RenyuanjiegouLaowu> {
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.jdc.jdcproject.service;
|
||||
|
||||
import com.jdc.jdcproject.entity.Renyuanjiegou;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
public interface IRenyuanjiegouService extends IService<Renyuanjiegou> {
|
||||
|
||||
}
|
17
src/main/java/com/jdc/jdcproject/service/IUsersService.java
Normal file
17
src/main/java/com/jdc/jdcproject/service/IUsersService.java
Normal file
@ -0,0 +1,17 @@
|
||||
package com.jdc.jdcproject.service;
|
||||
|
||||
import com.jdc.jdcproject.entity.Users;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
public interface IUsersService extends IService<Users> {
|
||||
|
||||
String login(Users user);
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.jdc.jdcproject.service.impl;
|
||||
|
||||
import com.jdc.jdcproject.entity.DicekeMiningloss;
|
||||
import com.jdc.jdcproject.mapper.DicekeMininglossMapper;
|
||||
import com.jdc.jdcproject.service.IDicekeMininglossService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 采剥与贫损表; 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
@Service
|
||||
public class DicekeMininglossServiceImpl extends ServiceImpl<DicekeMininglossMapper, DicekeMiningloss> implements IDicekeMininglossService {
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.jdc.jdcproject.service.impl;
|
||||
|
||||
import com.jdc.jdcproject.entity.DicekeMiningrecord;
|
||||
import com.jdc.jdcproject.entity.VO.DicekeMiningrecordVo;
|
||||
import com.jdc.jdcproject.mapper.DicekeMiningrecordMapper;
|
||||
import com.jdc.jdcproject.service.IDicekeMiningrecordService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 采矿记录表; 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
@Service
|
||||
public class DicekeMiningrecordServiceImpl extends ServiceImpl<DicekeMiningrecordMapper, DicekeMiningrecord> implements IDicekeMiningrecordService {
|
||||
|
||||
|
||||
@Override
|
||||
public List<DicekeMiningrecordVo> findAll() {
|
||||
return baseMapper.findAll();
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.jdc.jdcproject.service.impl;
|
||||
|
||||
import com.jdc.jdcproject.entity.DicekePlatearea;
|
||||
import com.jdc.jdcproject.mapper.DicekePlateareaMapper;
|
||||
import com.jdc.jdcproject.service.IDicekePlateareaService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 平盘 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
@Service
|
||||
public class DicekePlateareaServiceImpl extends ServiceImpl<DicekePlateareaMapper, DicekePlatearea> implements IDicekePlateareaService {
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.jdc.jdcproject.service.impl;
|
||||
|
||||
import com.jdc.jdcproject.entity.DicekePrecipitation;
|
||||
import com.jdc.jdcproject.mapper.DicekePrecipitationMapper;
|
||||
import com.jdc.jdcproject.service.IDicekePrecipitationService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 降水量表; 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
@Service
|
||||
public class DicekePrecipitationServiceImpl extends ServiceImpl<DicekePrecipitationMapper, DicekePrecipitation> implements IDicekePrecipitationService {
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.jdc.jdcproject.service.impl;
|
||||
|
||||
import com.jdc.jdcproject.entity.DicekeShovel;
|
||||
import com.jdc.jdcproject.mapper.DicekeShovelMapper;
|
||||
import com.jdc.jdcproject.service.IDicekeShovelService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 电铲 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
@Service
|
||||
public class DicekeShovelServiceImpl extends ServiceImpl<DicekeShovelMapper, DicekeShovel> implements IDicekeShovelService {
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.jdc.jdcproject.service.impl;
|
||||
|
||||
import com.jdc.jdcproject.entity.RenyuanjiegouLaowu;
|
||||
import com.jdc.jdcproject.mapper.RenyuanjiegouLaowuMapper;
|
||||
import com.jdc.jdcproject.service.IRenyuanjiegouLaowuService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
@Service
|
||||
public class RenyuanjiegouLaowuServiceImpl extends ServiceImpl<RenyuanjiegouLaowuMapper, RenyuanjiegouLaowu> implements IRenyuanjiegouLaowuService {
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.jdc.jdcproject.service.impl;
|
||||
|
||||
import com.jdc.jdcproject.entity.Renyuanjiegou;
|
||||
import com.jdc.jdcproject.mapper.RenyuanjiegouMapper;
|
||||
import com.jdc.jdcproject.service.IRenyuanjiegouService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
@Service
|
||||
public class RenyuanjiegouServiceImpl extends ServiceImpl<RenyuanjiegouMapper, Renyuanjiegou> implements IRenyuanjiegouService {
|
||||
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
package com.jdc.jdcproject.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jdc.jdcproject.entity.Users;
|
||||
import com.jdc.jdcproject.exceptionhandler.JdcException;
|
||||
import com.jdc.jdcproject.mapper.UsersMapper;
|
||||
import com.jdc.jdcproject.service.IUsersService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jdc.jdcproject.utils.JwtUtils;
|
||||
import com.jdc.jdcproject.utils.MD5;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author haoyanlu
|
||||
* @since 2025-04-26
|
||||
*/
|
||||
@Service
|
||||
public class UsersServiceImpl extends ServiceImpl<UsersMapper, Users> implements IUsersService {
|
||||
|
||||
@Override
|
||||
public String login(Users user) {
|
||||
|
||||
System.out.println(user.toString());
|
||||
String password = user.getPassword();
|
||||
String name = user.getUsername();
|
||||
String phone = user.getUsername();
|
||||
if (user.getUsername().matches("^\\d{11}$")){
|
||||
phone = user.getUsername();
|
||||
}else {
|
||||
name = user.getUsername();
|
||||
}
|
||||
|
||||
System.out.println(user.toString());
|
||||
|
||||
if ((StringUtils.isEmpty(phone) ^ StringUtils.isEmpty(name)) || StringUtils.isEmpty(password)) {
|
||||
throw new JdcException(20001, "登陆失败");
|
||||
}
|
||||
QueryWrapper<Users> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("username", name).or().eq("tel", phone);
|
||||
Users users = baseMapper.selectOne(wrapper);
|
||||
|
||||
if (users == null) {
|
||||
throw new JdcException(20001, "登陆失败");
|
||||
}
|
||||
System.out.println(MD5.encrypt(password));
|
||||
if (!MD5.encrypt(password).equals(users.getPassword())) {
|
||||
throw new JdcException(20001, "登陆失败");
|
||||
}
|
||||
String token = JwtUtils.getJwtToken(users.getId(), users.getUsername());
|
||||
return token;
|
||||
}
|
||||
}
|
70
src/main/java/com/jdc/jdcproject/utils/JwtUtils.java
Normal file
70
src/main/java/com/jdc/jdcproject/utils/JwtUtils.java
Normal file
@ -0,0 +1,70 @@
|
||||
package com.jdc.jdcproject.utils;
|
||||
|
||||
import io.jsonwebtoken.Jwts;
|
||||
import io.jsonwebtoken.SignatureAlgorithm;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author helen
|
||||
* @since 2019/10/16
|
||||
*/
|
||||
public class JwtUtils {
|
||||
|
||||
public static final long EXPIRE = 1000 * 60 * 60 * 24;//token的过期时间
|
||||
public static final String APP_SECRET = "ceshitestcesgutestceshitestceshitestceshitestceshitest";//密钥
|
||||
|
||||
public static String getJwtToken(String id, String nickname){
|
||||
|
||||
String JwtToken = Jwts.builder()
|
||||
.setHeaderParam("typ", "JWT")
|
||||
.setHeaderParam("alg", "HS256")
|
||||
|
||||
.setSubject("wddlhyss-user")
|
||||
.setIssuedAt(new Date())
|
||||
.setExpiration(new Date(System.currentTimeMillis() + EXPIRE))
|
||||
|
||||
.claim("id", id)//设置token的主体部分
|
||||
.claim("nickname", nickname)
|
||||
|
||||
.signWith(SignatureAlgorithm.HS256, APP_SECRET)//签名哈希
|
||||
.compact();
|
||||
|
||||
return JwtToken;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断token是否存在与有效
|
||||
* @param jwtToken
|
||||
* @return
|
||||
*/
|
||||
public static boolean checkToken(String jwtToken) {
|
||||
if(StringUtils.isEmpty(jwtToken)) return false;
|
||||
try {
|
||||
Jwts.parser().setSigningKey(APP_SECRET).parseClaimsJws(jwtToken);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断token是否存在与有效
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
public static boolean checkToken(HttpServletRequest request) {
|
||||
try {
|
||||
String jwtToken = request.getHeader("token");
|
||||
if(StringUtils.isEmpty(jwtToken)) return false;
|
||||
Jwts.parser().setSigningKey(APP_SECRET).parseClaimsJws(jwtToken);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
36
src/main/java/com/jdc/jdcproject/utils/MD5.java
Normal file
36
src/main/java/com/jdc/jdcproject/utils/MD5.java
Normal file
@ -0,0 +1,36 @@
|
||||
package com.jdc.jdcproject.utils;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
|
||||
public final class MD5 {
|
||||
|
||||
public static String encrypt(String strSrc) {
|
||||
try {
|
||||
char hexChars[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8',
|
||||
'9', 'a', 'b', 'c', 'd', 'e', 'f' };
|
||||
byte[] bytes = strSrc.getBytes();
|
||||
MessageDigest md = MessageDigest.getInstance("MD5");
|
||||
md.update(bytes);
|
||||
bytes = md.digest();
|
||||
int j = bytes.length;
|
||||
char[] chars = new char[j * 2];
|
||||
int k = 0;
|
||||
for (int i = 0; i < bytes.length; i++) {
|
||||
byte b = bytes[i];
|
||||
chars[k++] = hexChars[b >>> 4 & 0xf];
|
||||
chars[k++] = hexChars[b & 0xf];
|
||||
}
|
||||
return new String(chars);
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException("MD5加密出错!!+" + e);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(MD5.encrypt("111111"));
|
||||
}
|
||||
|
||||
}
|
41
src/main/java/com/jdc/jdcproject/utils/RenYuanUtil.java
Normal file
41
src/main/java/com/jdc/jdcproject/utils/RenYuanUtil.java
Normal file
@ -0,0 +1,41 @@
|
||||
package com.jdc.jdcproject.utils;
|
||||
|
||||
|
||||
|
||||
import com.jdc.jdcproject.entity.Renyuanjiegou;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class RenYuanUtil {
|
||||
|
||||
public static Map<String, Renyuanjiegou> renyuanSum(List<Renyuanjiegou> renyuanjiegouList) {
|
||||
Map<String, Renyuanjiegou> result = new HashMap<>();
|
||||
for (Renyuanjiegou renyuan : renyuanjiegouList) {
|
||||
String changQuKey = renyuan.getChangQu() + "合计";
|
||||
if (result.containsKey(changQuKey)) {
|
||||
// 如果已有该 ChangQu 的记录,则累加各项
|
||||
Renyuanjiegou existing = result.get(changQuKey);
|
||||
existing.setZongRenShu(existing.getZongRenShu() + renyuan.getZongRenShu());
|
||||
existing.setGuanLiRY(existing.getGuanLiRY() + renyuan.getGuanLiRY());
|
||||
existing.setZhuanYeJishuRY(existing.getZhuanYeJishuRY() + renyuan.getZhuanYeJishuRY());
|
||||
existing.setShenChanFZRY(existing.getShenChanFZRY() + renyuan.getShenChanFZRY());
|
||||
existing.setFuWuRY(existing.getFuWuRY() + renyuan.getFuWuRY());
|
||||
existing.setLaoWuRY(existing.getLaoWuRY() + renyuan.getLaoWuRY());
|
||||
} else {
|
||||
// 如果没有该厂区的合计记录,则直接插入当前厂区的合计行
|
||||
Renyuanjiegou totalRenyuan = new Renyuanjiegou();
|
||||
totalRenyuan.setChangQu(renyuan.getChangQu() + "合计");
|
||||
totalRenyuan.setZongRenShu(renyuan.getZongRenShu());
|
||||
totalRenyuan.setGuanLiRY(renyuan.getGuanLiRY());
|
||||
totalRenyuan.setZhuanYeJishuRY(renyuan.getZhuanYeJishuRY());
|
||||
totalRenyuan.setShenChanFZRY(renyuan.getShenChanFZRY());
|
||||
totalRenyuan.setFuWuRY(renyuan.getFuWuRY());
|
||||
totalRenyuan.setLaoWuRY(renyuan.getLaoWuRY());
|
||||
result.put(changQuKey, totalRenyuan);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
74
src/main/java/com/jdc/jdcproject/utils/Result.java
Normal file
74
src/main/java/com/jdc/jdcproject/utils/Result.java
Normal file
@ -0,0 +1,74 @@
|
||||
package com.jdc.jdcproject.utils;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*同一返回结果
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class Result {
|
||||
|
||||
|
||||
private Boolean success;
|
||||
|
||||
|
||||
private Integer code;
|
||||
|
||||
|
||||
private String message;
|
||||
|
||||
|
||||
private Map<String, Object> data = new HashMap<String, Object>();
|
||||
|
||||
|
||||
//私有化构造方法
|
||||
private Result(){}
|
||||
|
||||
//成功
|
||||
public static Result successResult(){
|
||||
Result result = new Result();
|
||||
result.setSuccess(true);
|
||||
result.setCode(ResultCode.SUCCESS);
|
||||
result.setMessage("成功");
|
||||
return result;
|
||||
}
|
||||
|
||||
//失败
|
||||
public static Result errorResult(){
|
||||
Result result = new Result();
|
||||
result.setSuccess(false);
|
||||
result.setCode(ResultCode.ERROR);
|
||||
result.setMessage("失败");
|
||||
return result;
|
||||
}
|
||||
|
||||
public Result success(Boolean success){
|
||||
this.setSuccess(success);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Result message(String message){
|
||||
this.setMessage(message);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Result code(Integer code){
|
||||
this.setCode(code);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Result data(String key, Object value){
|
||||
this.data.put(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Result data(Map<String, Object> map){
|
||||
this.setData(map);
|
||||
return this;
|
||||
}
|
||||
}
|
8
src/main/java/com/jdc/jdcproject/utils/ResultCode.java
Normal file
8
src/main/java/com/jdc/jdcproject/utils/ResultCode.java
Normal file
@ -0,0 +1,8 @@
|
||||
package com.jdc.jdcproject.utils;
|
||||
|
||||
public interface ResultCode {
|
||||
|
||||
public static Integer SUCCESS = 20000;//操作成功
|
||||
|
||||
public static Integer ERROR = 20001;//操作失败
|
||||
}
|
33
src/main/resources/application.yml
Normal file
33
src/main/resources/application.yml
Normal file
@ -0,0 +1,33 @@
|
||||
spring:
|
||||
application:
|
||||
name: jdcProject
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://localhost:3306/kszy?serverTimezone=GMT%2B8
|
||||
password: 11235813
|
||||
username: root
|
||||
|
||||
mybatis-plus:
|
||||
configuration:
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
map-underscore-to-camel-case: false
|
||||
mapper-locations: classpath:com/jdc/jdcproject/mapper/xml/*.xml
|
||||
|
||||
server:
|
||||
port: 8000
|
||||
springdoc:
|
||||
swagger-ui:
|
||||
path: /swagger-ui.html
|
||||
tags-sorter: alpha
|
||||
operations-sorter: alpha
|
||||
api-docs:
|
||||
path: /v3/api-docs
|
||||
group-configs:
|
||||
- group: 'default'
|
||||
paths-to-match: '/**'
|
||||
packages-to-scan: com.jdc.jdcproject.controller # controller
|
||||
# knife4j
|
||||
knife4j:
|
||||
enable: true
|
||||
setting:
|
||||
language: zh_cn
|
@ -0,0 +1,22 @@
|
||||
package com.jdc.jdcproject;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
@SpringBootTest
|
||||
class JdcProjectApplicationTests {
|
||||
|
||||
@Test
|
||||
void contextLoads() {
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
|
||||
int month = calendar.get(Calendar.MONTH) + 1;
|
||||
System.out.println(month);
|
||||
}
|
||||
|
||||
}
|
44
src/test/java/com/jdc/jdcproject/MybatisPlusGenerator.java
Normal file
44
src/test/java/com/jdc/jdcproject/MybatisPlusGenerator.java
Normal file
@ -0,0 +1,44 @@
|
||||
package com.jdc.jdcproject;
|
||||
|
||||
import com.baomidou.mybatisplus.generator.FastAutoGenerator;
|
||||
import com.baomidou.mybatisplus.generator.config.OutputFile;
|
||||
import com.baomidou.mybatisplus.generator.config.rules.DbColumnType;
|
||||
import org.junit.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
import java.sql.Types;
|
||||
import java.util.Collections;
|
||||
|
||||
@SpringBootTest
|
||||
public class MybatisPlusGenerator {
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
FastAutoGenerator.create("jdbc:mysql://localhost:3306/kszy?serverTimezone=GMT%2B8", "root", "11235813")
|
||||
.globalConfig(builder -> {
|
||||
builder.author("haoyanlu") // 设置作者
|
||||
.enableSwagger() // 开启 swagger 模式
|
||||
.outputDir(System.getProperty("user.dir")+ "/src/main/java")
|
||||
.disableOpenDir().enableSpringdoc();// 指定输出目录
|
||||
})
|
||||
.dataSourceConfig(builder ->
|
||||
builder.typeConvertHandler((globalConfig, typeRegistry, metaInfo) -> {
|
||||
int typeCode = metaInfo.getJdbcType().TYPE_CODE;
|
||||
if (typeCode == Types.SMALLINT) {
|
||||
// 自定义类型转换
|
||||
return DbColumnType.INTEGER;
|
||||
}
|
||||
return typeRegistry.getColumnType(metaInfo);
|
||||
})
|
||||
)
|
||||
.packageConfig(builder ->
|
||||
builder.parent("com.jdc.jdcproject") // 设置父包名
|
||||
.controller("controller").mapper("mapper").xml("mapper.xml")
|
||||
//.pathInfo(Collections.singletonMap(OutputFile.xml, System.getProperty("user.dir") + "/src/main/java")) // 设置mapperXml生成路径
|
||||
)
|
||||
.strategyConfig(builder ->
|
||||
builder.addInclude("DiCeKe_MiningLoss","users","renyuanjiegou","renyuanjiegou_laowu","diceke_miningrecord","diceke_platearea","diceke_precipitation","diceke_shovel") // 设置需要生成的表名
|
||||
)
|
||||
.execute();
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user