commit e9ae9ebb0dafbbcdd042c243d44b220be602c393 Author: admin Date: Sun Apr 27 16:49:30 2025 +0800 first add diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..3b41682 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +/mvnw text eol=lf +*.cmd text eol=crlf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..549e00a --- /dev/null +++ b/.gitignore @@ -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/ diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 0000000..d58dfb7 --- /dev/null +++ b/.mvn/wrapper/maven-wrapper.properties @@ -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 diff --git a/mvnw b/mvnw new file mode 100644 index 0000000..19529dd --- /dev/null +++ b/mvnw @@ -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-,maven-mvnd--}/ +[ -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 "$@" diff --git a/mvnw.cmd b/mvnw.cmd new file mode 100644 index 0000000..249bdf3 --- /dev/null +++ b/mvnw.cmd @@ -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-,maven-mvnd--}/ +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" diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..94ef0c4 --- /dev/null +++ b/pom.xml @@ -0,0 +1,211 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 3.4.5 + + + com.jdc + JdcProject + 0.0.1-SNAPSHOT + JdcProject + JdcProject + + + + + + + + + + + + + + + 17 + 1.18.4 + 8.0.33 + 1.2.19 + 3.5.8 + 3.5.8 + 2.3 + 4.5.13 + 4.4.9 + 2.6 + 9.3.7.v20160115 + 0.11.2 + 3.0.1 + 2.17.0 + 4.5.0 + + + + + + + + org.projectlombok + lombok + ${lombok.version} + + + + + mysql + mysql-connector-java + ${mysql.version} + + + + com.alibaba + druid + ${druid.version} + + + + com.baomidou + mybatis-plus-spring-boot3-starter + ${mybatis-plus.version} + + + + com.baomidou + mybatis-plus-generator + ${mybatis-plus-generator.version} + + + + org.apache.httpcomponents + httpclient + ${httpclient.version} + + + + org.apache.httpcomponents + httpcore + ${httpcore.version} + + + + + com.google.code.gson + gson + + + + commons-lang + commons-lang + ${commons-lang.version} + + + + org.eclipse.jetty + jetty-util + ${jetty-util.version} + + + + io.jsonwebtoken + jjwt-api + ${jjwt.version} + + + + + javax.servlet + javax.servlet-api + 3.0.1 + ${servlet-api.version} + + + + io.jsonwebtoken + jjwt-impl + ${jjwt.version} + + + + io.jsonwebtoken + jjwt-jackson + ${jjwt.version} + + + + org.apache.velocity + velocity-engine-core + ${velocity.version} + + + + + commons-io + commons-io + ${common-io.version} + + + + com.github.xiaoymin + knife4j-openapi3-jakarta-spring-boot-starter + ${swagger3.version} + + + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-test + test + + + + junit + junit + test + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + src/main/java + + **/*.yml + **/*.properties + **/*.xml + + false + + + src/main/resources + + **/*.yml + **/*.properties + **/*.xml + + false + + + + + diff --git a/src/main/java/com/jdc/jdcproject/JdcProjectApplication.java b/src/main/java/com/jdc/jdcproject/JdcProjectApplication.java new file mode 100644 index 0000000..53c80bc --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/JdcProjectApplication.java @@ -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); + } + +} diff --git a/src/main/java/com/jdc/jdcproject/config/MybatisPlusConfig.java b/src/main/java/com/jdc/jdcproject/config/MybatisPlusConfig.java new file mode 100644 index 0000000..80c9c17 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/config/MybatisPlusConfig.java @@ -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; + } + + +} \ No newline at end of file diff --git a/src/main/java/com/jdc/jdcproject/config/WebConfig.java b/src/main/java/com/jdc/jdcproject/config/WebConfig.java new file mode 100644 index 0000000..2fdd0aa --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/config/WebConfig.java @@ -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); // 缓存预检请求的结果的时间 + } +} diff --git a/src/main/java/com/jdc/jdcproject/controller/DicekeMininglossController.java b/src/main/java/com/jdc/jdcproject/controller/DicekeMininglossController.java new file mode 100644 index 0000000..35b4b7f --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/controller/DicekeMininglossController.java @@ -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; + +/** + *

+ * 采剥与贫损表; 前端控制器 + *

+ * + * @author haoyanlu + * @since 2025-04-26 + */ +@RestController +@RequestMapping("/dicekeMiningloss") +public class DicekeMininglossController { + +} diff --git a/src/main/java/com/jdc/jdcproject/controller/DicekeMiningrecordController.java b/src/main/java/com/jdc/jdcproject/controller/DicekeMiningrecordController.java new file mode 100644 index 0000000..4c93f8d --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/controller/DicekeMiningrecordController.java @@ -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; + +/** + *

+ * 采矿记录表; 前端控制器 + *

+ * + * @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 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(); + } + } +} diff --git a/src/main/java/com/jdc/jdcproject/controller/DicekePlateareaController.java b/src/main/java/com/jdc/jdcproject/controller/DicekePlateareaController.java new file mode 100644 index 0000000..01aa3d7 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/controller/DicekePlateareaController.java @@ -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; + +/** + *

+ * 平盘 前端控制器 + *

+ * + * @author haoyanlu + * @since 2025-04-26 + */ +@RestController +@RequestMapping("/dicekePlatearea") +public class DicekePlateareaController { + + @Autowired + private IDicekePlateareaService dicekePlateareaService; + + + @Operation(summary = "查询所有平盘") + @GetMapping("findAllPlateArea") + public Result findAllPlateArea() { + List 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(); + } + } + + + + +} diff --git a/src/main/java/com/jdc/jdcproject/controller/DicekePrecipitationController.java b/src/main/java/com/jdc/jdcproject/controller/DicekePrecipitationController.java new file mode 100644 index 0000000..5e770fa --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/controller/DicekePrecipitationController.java @@ -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; + +/** + *

+ * 降水量表; 前端控制器 + *

+ * + * @author haoyanlu + * @since 2025-04-26 + */ +@RestController +@RequestMapping("/dicekePrecipitation") +public class DicekePrecipitationController { + +} diff --git a/src/main/java/com/jdc/jdcproject/controller/DicekeShovelController.java b/src/main/java/com/jdc/jdcproject/controller/DicekeShovelController.java new file mode 100644 index 0000000..dac1010 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/controller/DicekeShovelController.java @@ -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; + +/** + *

+ * 电铲 前端控制器 + *

+ * + * @author haoyanlu + * @since 2025-04-26 + */ +@RestController +@RequestMapping("/dicekeShovel") +public class DicekeShovelController { + + @Autowired + private IDicekeShovelService dicekeShovelService; + + + @Operation(summary = "查询所有电铲") + @GetMapping("findAllShovel") + public Result findAllShovel() { + List 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(); + } + } + +} diff --git a/src/main/java/com/jdc/jdcproject/controller/RenyuanjiegouController.java b/src/main/java/com/jdc/jdcproject/controller/RenyuanjiegouController.java new file mode 100644 index 0000000..fa7db85 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/controller/RenyuanjiegouController.java @@ -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; + +/** + *

+ * 前端控制器 + *

+ * + * @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 renyuanjiegouList = renyuanjiegouService.list(); + + Map stringRenyuanjiegouMap = RenYuanUtil.renyuanSum(renyuanjiegouList); + + //将所有厂区及部门数据整合方便前端增加数据时回显 + Map> changqubumenMap = new HashMap<>(); + for (Renyuanjiegou renyuan : renyuanjiegouList) { + if (changqubumenMap.containsKey(renyuan.getChangQu())) { + changqubumenMap.get(renyuan.getChangQu()).add(renyuan.getBuMen()); + } else { + // 如果没有该 ChangQu 的记录,则直接加入 + List 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 queryWrapper = new QueryWrapper<>(); + if (!StringUtils.isEmpty(renyuanjiegou.getStrMonth())) { + queryWrapper.like("strMonth", renyuanjiegou.getStrMonth()); + } + + List renyuanjiegouList = renyuanjiegouService.list(queryWrapper); + + + + //数据整合 + Map 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(); + } + } +} diff --git a/src/main/java/com/jdc/jdcproject/controller/RenyuanjiegouLaowuController.java b/src/main/java/com/jdc/jdcproject/controller/RenyuanjiegouLaowuController.java new file mode 100644 index 0000000..5b4a009 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/controller/RenyuanjiegouLaowuController.java @@ -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; + +/** + *

+ * 前端控制器 + *

+ * + * @author haoyanlu + * @since 2025-04-26 + */ +@RestController +@RequestMapping("/renyuanjiegouLaowu") +public class RenyuanjiegouLaowuController { + +} diff --git a/src/main/java/com/jdc/jdcproject/controller/UsersController.java b/src/main/java/com/jdc/jdcproject/controller/UsersController.java new file mode 100644 index 0000000..69f54dd --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/controller/UsersController.java @@ -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; + +/** + *

+ * 前端控制器 + *

+ * + * @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"); + } + +} diff --git a/src/main/java/com/jdc/jdcproject/entity/DicekeMiningloss.java b/src/main/java/com/jdc/jdcproject/entity/DicekeMiningloss.java new file mode 100644 index 0000000..f2ae5dd --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/entity/DicekeMiningloss.java @@ -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; + +/** + *

+ * 采剥与贫损表; + *

+ * + * @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 + + "}"; + } +} diff --git a/src/main/java/com/jdc/jdcproject/entity/DicekeMiningrecord.java b/src/main/java/com/jdc/jdcproject/entity/DicekeMiningrecord.java new file mode 100644 index 0000000..4fc8099 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/entity/DicekeMiningrecord.java @@ -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; + +/** + *

+ * 采矿记录表; + *

+ * + * @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 + + "}"; + } +} diff --git a/src/main/java/com/jdc/jdcproject/entity/DicekePlatearea.java b/src/main/java/com/jdc/jdcproject/entity/DicekePlatearea.java new file mode 100644 index 0000000..5c32e41 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/entity/DicekePlatearea.java @@ -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; + +/** + *

+ * 平盘 + *

+ * + * @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 + + "}"; + } +} diff --git a/src/main/java/com/jdc/jdcproject/entity/DicekePrecipitation.java b/src/main/java/com/jdc/jdcproject/entity/DicekePrecipitation.java new file mode 100644 index 0000000..c3a747e --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/entity/DicekePrecipitation.java @@ -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; + +/** + *

+ * 降水量表; + *

+ * + * @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 + + "}"; + } +} diff --git a/src/main/java/com/jdc/jdcproject/entity/DicekeShovel.java b/src/main/java/com/jdc/jdcproject/entity/DicekeShovel.java new file mode 100644 index 0000000..8992366 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/entity/DicekeShovel.java @@ -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; + +/** + *

+ * 电铲 + *

+ * + * @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 + + "}"; + } +} diff --git a/src/main/java/com/jdc/jdcproject/entity/Renyuanjiegou.java b/src/main/java/com/jdc/jdcproject/entity/Renyuanjiegou.java new file mode 100644 index 0000000..88631ad --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/entity/Renyuanjiegou.java @@ -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; + +/** + *

+ * + *

+ * + * @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 + + "}"; + } +} diff --git a/src/main/java/com/jdc/jdcproject/entity/RenyuanjiegouLaowu.java b/src/main/java/com/jdc/jdcproject/entity/RenyuanjiegouLaowu.java new file mode 100644 index 0000000..1d93875 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/entity/RenyuanjiegouLaowu.java @@ -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; + +/** + *

+ * + *

+ * + * @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 + + "}"; + } +} diff --git a/src/main/java/com/jdc/jdcproject/entity/Users.java b/src/main/java/com/jdc/jdcproject/entity/Users.java new file mode 100644 index 0000000..1651b05 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/entity/Users.java @@ -0,0 +1,84 @@ +package com.jdc.jdcproject.entity; + +import java.io.Serializable; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + *

+ * + *

+ * + * @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 + + "}"; + } +} diff --git a/src/main/java/com/jdc/jdcproject/entity/VO/DicekeMiningrecordVo.java b/src/main/java/com/jdc/jdcproject/entity/VO/DicekeMiningrecordVo.java new file mode 100644 index 0000000..b0e67bf --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/entity/VO/DicekeMiningrecordVo.java @@ -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 + + "}"; + } +} diff --git a/src/main/java/com/jdc/jdcproject/exceptionhandler/JdcException.java b/src/main/java/com/jdc/jdcproject/exceptionhandler/JdcException.java new file mode 100644 index 0000000..d489fc4 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/exceptionhandler/JdcException.java @@ -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;//异常信息 + +} \ No newline at end of file diff --git a/src/main/java/com/jdc/jdcproject/mapper/DicekeMininglossMapper.java b/src/main/java/com/jdc/jdcproject/mapper/DicekeMininglossMapper.java new file mode 100644 index 0000000..942a284 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/mapper/DicekeMininglossMapper.java @@ -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; + +/** + *

+ * 采剥与贫损表; Mapper 接口 + *

+ * + * @author haoyanlu + * @since 2025-04-26 + */ +@Mapper +public interface DicekeMininglossMapper extends BaseMapper { + +} diff --git a/src/main/java/com/jdc/jdcproject/mapper/DicekeMiningrecordMapper.java b/src/main/java/com/jdc/jdcproject/mapper/DicekeMiningrecordMapper.java new file mode 100644 index 0000000..24f4b90 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/mapper/DicekeMiningrecordMapper.java @@ -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; + +/** + *

+ * 采矿记录表; Mapper 接口 + *

+ * + * @author haoyanlu + * @since 2025-04-26 + */ +@Mapper +public interface DicekeMiningrecordMapper extends BaseMapper { + + List findAll(); +} diff --git a/src/main/java/com/jdc/jdcproject/mapper/DicekePlateareaMapper.java b/src/main/java/com/jdc/jdcproject/mapper/DicekePlateareaMapper.java new file mode 100644 index 0000000..98a7a4b --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/mapper/DicekePlateareaMapper.java @@ -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; + +/** + *

+ * 平盘 Mapper 接口 + *

+ * + * @author haoyanlu + * @since 2025-04-26 + */ +@Mapper +public interface DicekePlateareaMapper extends BaseMapper { + +} diff --git a/src/main/java/com/jdc/jdcproject/mapper/DicekePrecipitationMapper.java b/src/main/java/com/jdc/jdcproject/mapper/DicekePrecipitationMapper.java new file mode 100644 index 0000000..845e12b --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/mapper/DicekePrecipitationMapper.java @@ -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; + +/** + *

+ * 降水量表; Mapper 接口 + *

+ * + * @author haoyanlu + * @since 2025-04-26 + */ +@Mapper +public interface DicekePrecipitationMapper extends BaseMapper { + +} diff --git a/src/main/java/com/jdc/jdcproject/mapper/DicekeShovelMapper.java b/src/main/java/com/jdc/jdcproject/mapper/DicekeShovelMapper.java new file mode 100644 index 0000000..ce014e7 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/mapper/DicekeShovelMapper.java @@ -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; + +/** + *

+ * 电铲 Mapper 接口 + *

+ * + * @author haoyanlu + * @since 2025-04-26 + */ +@Mapper +public interface DicekeShovelMapper extends BaseMapper { + +} diff --git a/src/main/java/com/jdc/jdcproject/mapper/RenyuanjiegouLaowuMapper.java b/src/main/java/com/jdc/jdcproject/mapper/RenyuanjiegouLaowuMapper.java new file mode 100644 index 0000000..f71166b --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/mapper/RenyuanjiegouLaowuMapper.java @@ -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; + +/** + *

+ * Mapper 接口 + *

+ * + * @author haoyanlu + * @since 2025-04-26 + */ +@Mapper +public interface RenyuanjiegouLaowuMapper extends BaseMapper { + +} diff --git a/src/main/java/com/jdc/jdcproject/mapper/RenyuanjiegouMapper.java b/src/main/java/com/jdc/jdcproject/mapper/RenyuanjiegouMapper.java new file mode 100644 index 0000000..68da6e5 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/mapper/RenyuanjiegouMapper.java @@ -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; + +/** + *

+ * Mapper 接口 + *

+ * + * @author haoyanlu + * @since 2025-04-26 + */ +@Mapper +public interface RenyuanjiegouMapper extends BaseMapper { + +} diff --git a/src/main/java/com/jdc/jdcproject/mapper/UsersMapper.java b/src/main/java/com/jdc/jdcproject/mapper/UsersMapper.java new file mode 100644 index 0000000..4949939 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/mapper/UsersMapper.java @@ -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; + +/** + *

+ * Mapper 接口 + *

+ * + * @author haoyanlu + * @since 2025-04-26 + */ +@Mapper +public interface UsersMapper extends BaseMapper { + +} diff --git a/src/main/java/com/jdc/jdcproject/mapper/xml/DicekeMininglossMapper.xml b/src/main/java/com/jdc/jdcproject/mapper/xml/DicekeMininglossMapper.xml new file mode 100644 index 0000000..25854fa --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/mapper/xml/DicekeMininglossMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/java/com/jdc/jdcproject/mapper/xml/DicekeMiningrecordMapper.xml b/src/main/java/com/jdc/jdcproject/mapper/xml/DicekeMiningrecordMapper.xml new file mode 100644 index 0000000..a3571ea --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/mapper/xml/DicekeMiningrecordMapper.xml @@ -0,0 +1,24 @@ + + + + + + + + diff --git a/src/main/java/com/jdc/jdcproject/mapper/xml/DicekePlateareaMapper.xml b/src/main/java/com/jdc/jdcproject/mapper/xml/DicekePlateareaMapper.xml new file mode 100644 index 0000000..41c71a9 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/mapper/xml/DicekePlateareaMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/java/com/jdc/jdcproject/mapper/xml/DicekePrecipitationMapper.xml b/src/main/java/com/jdc/jdcproject/mapper/xml/DicekePrecipitationMapper.xml new file mode 100644 index 0000000..0d4096b --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/mapper/xml/DicekePrecipitationMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/java/com/jdc/jdcproject/mapper/xml/DicekeShovelMapper.xml b/src/main/java/com/jdc/jdcproject/mapper/xml/DicekeShovelMapper.xml new file mode 100644 index 0000000..bfa943b --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/mapper/xml/DicekeShovelMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/java/com/jdc/jdcproject/mapper/xml/RenyuanjiegouLaowuMapper.xml b/src/main/java/com/jdc/jdcproject/mapper/xml/RenyuanjiegouLaowuMapper.xml new file mode 100644 index 0000000..605a931 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/mapper/xml/RenyuanjiegouLaowuMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/java/com/jdc/jdcproject/mapper/xml/RenyuanjiegouMapper.xml b/src/main/java/com/jdc/jdcproject/mapper/xml/RenyuanjiegouMapper.xml new file mode 100644 index 0000000..d8c884a --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/mapper/xml/RenyuanjiegouMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/java/com/jdc/jdcproject/mapper/xml/UsersMapper.xml b/src/main/java/com/jdc/jdcproject/mapper/xml/UsersMapper.xml new file mode 100644 index 0000000..026e71f --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/mapper/xml/UsersMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/java/com/jdc/jdcproject/service/IDicekeMininglossService.java b/src/main/java/com/jdc/jdcproject/service/IDicekeMininglossService.java new file mode 100644 index 0000000..292891a --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/service/IDicekeMininglossService.java @@ -0,0 +1,16 @@ +package com.jdc.jdcproject.service; + +import com.jdc.jdcproject.entity.DicekeMiningloss; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 采剥与贫损表; 服务类 + *

+ * + * @author haoyanlu + * @since 2025-04-26 + */ +public interface IDicekeMininglossService extends IService { + +} diff --git a/src/main/java/com/jdc/jdcproject/service/IDicekeMiningrecordService.java b/src/main/java/com/jdc/jdcproject/service/IDicekeMiningrecordService.java new file mode 100644 index 0000000..cb9f455 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/service/IDicekeMiningrecordService.java @@ -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; + +/** + *

+ * 采矿记录表; 服务类 + *

+ * + * @author haoyanlu + * @since 2025-04-26 + */ +public interface IDicekeMiningrecordService extends IService { + + List findAll(); +} diff --git a/src/main/java/com/jdc/jdcproject/service/IDicekePlateareaService.java b/src/main/java/com/jdc/jdcproject/service/IDicekePlateareaService.java new file mode 100644 index 0000000..c966f07 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/service/IDicekePlateareaService.java @@ -0,0 +1,16 @@ +package com.jdc.jdcproject.service; + +import com.jdc.jdcproject.entity.DicekePlatearea; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 平盘 服务类 + *

+ * + * @author haoyanlu + * @since 2025-04-26 + */ +public interface IDicekePlateareaService extends IService { + +} diff --git a/src/main/java/com/jdc/jdcproject/service/IDicekePrecipitationService.java b/src/main/java/com/jdc/jdcproject/service/IDicekePrecipitationService.java new file mode 100644 index 0000000..f95a6e2 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/service/IDicekePrecipitationService.java @@ -0,0 +1,16 @@ +package com.jdc.jdcproject.service; + +import com.jdc.jdcproject.entity.DicekePrecipitation; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 降水量表; 服务类 + *

+ * + * @author haoyanlu + * @since 2025-04-26 + */ +public interface IDicekePrecipitationService extends IService { + +} diff --git a/src/main/java/com/jdc/jdcproject/service/IDicekeShovelService.java b/src/main/java/com/jdc/jdcproject/service/IDicekeShovelService.java new file mode 100644 index 0000000..f76120f --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/service/IDicekeShovelService.java @@ -0,0 +1,16 @@ +package com.jdc.jdcproject.service; + +import com.jdc.jdcproject.entity.DicekeShovel; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 电铲 服务类 + *

+ * + * @author haoyanlu + * @since 2025-04-26 + */ +public interface IDicekeShovelService extends IService { + +} diff --git a/src/main/java/com/jdc/jdcproject/service/IRenyuanjiegouLaowuService.java b/src/main/java/com/jdc/jdcproject/service/IRenyuanjiegouLaowuService.java new file mode 100644 index 0000000..cf0625e --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/service/IRenyuanjiegouLaowuService.java @@ -0,0 +1,16 @@ +package com.jdc.jdcproject.service; + +import com.jdc.jdcproject.entity.RenyuanjiegouLaowu; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author haoyanlu + * @since 2025-04-26 + */ +public interface IRenyuanjiegouLaowuService extends IService { + +} diff --git a/src/main/java/com/jdc/jdcproject/service/IRenyuanjiegouService.java b/src/main/java/com/jdc/jdcproject/service/IRenyuanjiegouService.java new file mode 100644 index 0000000..d511456 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/service/IRenyuanjiegouService.java @@ -0,0 +1,16 @@ +package com.jdc.jdcproject.service; + +import com.jdc.jdcproject.entity.Renyuanjiegou; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author haoyanlu + * @since 2025-04-26 + */ +public interface IRenyuanjiegouService extends IService { + +} diff --git a/src/main/java/com/jdc/jdcproject/service/IUsersService.java b/src/main/java/com/jdc/jdcproject/service/IUsersService.java new file mode 100644 index 0000000..aae9716 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/service/IUsersService.java @@ -0,0 +1,17 @@ +package com.jdc.jdcproject.service; + +import com.jdc.jdcproject.entity.Users; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author haoyanlu + * @since 2025-04-26 + */ +public interface IUsersService extends IService { + + String login(Users user); +} diff --git a/src/main/java/com/jdc/jdcproject/service/impl/DicekeMininglossServiceImpl.java b/src/main/java/com/jdc/jdcproject/service/impl/DicekeMininglossServiceImpl.java new file mode 100644 index 0000000..cc873b9 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/service/impl/DicekeMininglossServiceImpl.java @@ -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; + +/** + *

+ * 采剥与贫损表; 服务实现类 + *

+ * + * @author haoyanlu + * @since 2025-04-26 + */ +@Service +public class DicekeMininglossServiceImpl extends ServiceImpl implements IDicekeMininglossService { + +} diff --git a/src/main/java/com/jdc/jdcproject/service/impl/DicekeMiningrecordServiceImpl.java b/src/main/java/com/jdc/jdcproject/service/impl/DicekeMiningrecordServiceImpl.java new file mode 100644 index 0000000..ce62ae3 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/service/impl/DicekeMiningrecordServiceImpl.java @@ -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; + +/** + *

+ * 采矿记录表; 服务实现类 + *

+ * + * @author haoyanlu + * @since 2025-04-26 + */ +@Service +public class DicekeMiningrecordServiceImpl extends ServiceImpl implements IDicekeMiningrecordService { + + + @Override + public List findAll() { + return baseMapper.findAll(); + } +} diff --git a/src/main/java/com/jdc/jdcproject/service/impl/DicekePlateareaServiceImpl.java b/src/main/java/com/jdc/jdcproject/service/impl/DicekePlateareaServiceImpl.java new file mode 100644 index 0000000..8ed6b50 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/service/impl/DicekePlateareaServiceImpl.java @@ -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; + +/** + *

+ * 平盘 服务实现类 + *

+ * + * @author haoyanlu + * @since 2025-04-26 + */ +@Service +public class DicekePlateareaServiceImpl extends ServiceImpl implements IDicekePlateareaService { + +} diff --git a/src/main/java/com/jdc/jdcproject/service/impl/DicekePrecipitationServiceImpl.java b/src/main/java/com/jdc/jdcproject/service/impl/DicekePrecipitationServiceImpl.java new file mode 100644 index 0000000..743cc09 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/service/impl/DicekePrecipitationServiceImpl.java @@ -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; + +/** + *

+ * 降水量表; 服务实现类 + *

+ * + * @author haoyanlu + * @since 2025-04-26 + */ +@Service +public class DicekePrecipitationServiceImpl extends ServiceImpl implements IDicekePrecipitationService { + +} diff --git a/src/main/java/com/jdc/jdcproject/service/impl/DicekeShovelServiceImpl.java b/src/main/java/com/jdc/jdcproject/service/impl/DicekeShovelServiceImpl.java new file mode 100644 index 0000000..ee37a9d --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/service/impl/DicekeShovelServiceImpl.java @@ -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; + +/** + *

+ * 电铲 服务实现类 + *

+ * + * @author haoyanlu + * @since 2025-04-26 + */ +@Service +public class DicekeShovelServiceImpl extends ServiceImpl implements IDicekeShovelService { + +} diff --git a/src/main/java/com/jdc/jdcproject/service/impl/RenyuanjiegouLaowuServiceImpl.java b/src/main/java/com/jdc/jdcproject/service/impl/RenyuanjiegouLaowuServiceImpl.java new file mode 100644 index 0000000..a915531 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/service/impl/RenyuanjiegouLaowuServiceImpl.java @@ -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; + +/** + *

+ * 服务实现类 + *

+ * + * @author haoyanlu + * @since 2025-04-26 + */ +@Service +public class RenyuanjiegouLaowuServiceImpl extends ServiceImpl implements IRenyuanjiegouLaowuService { + +} diff --git a/src/main/java/com/jdc/jdcproject/service/impl/RenyuanjiegouServiceImpl.java b/src/main/java/com/jdc/jdcproject/service/impl/RenyuanjiegouServiceImpl.java new file mode 100644 index 0000000..23f77bb --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/service/impl/RenyuanjiegouServiceImpl.java @@ -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; + +/** + *

+ * 服务实现类 + *

+ * + * @author haoyanlu + * @since 2025-04-26 + */ +@Service +public class RenyuanjiegouServiceImpl extends ServiceImpl implements IRenyuanjiegouService { + +} diff --git a/src/main/java/com/jdc/jdcproject/service/impl/UsersServiceImpl.java b/src/main/java/com/jdc/jdcproject/service/impl/UsersServiceImpl.java new file mode 100644 index 0000000..0da5b26 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/service/impl/UsersServiceImpl.java @@ -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; + +/** + *

+ * 服务实现类 + *

+ * + * @author haoyanlu + * @since 2025-04-26 + */ +@Service +public class UsersServiceImpl extends ServiceImpl 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 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; + } +} diff --git a/src/main/java/com/jdc/jdcproject/utils/JwtUtils.java b/src/main/java/com/jdc/jdcproject/utils/JwtUtils.java new file mode 100644 index 0000000..371cd0f --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/utils/JwtUtils.java @@ -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; + } +} \ No newline at end of file diff --git a/src/main/java/com/jdc/jdcproject/utils/MD5.java b/src/main/java/com/jdc/jdcproject/utils/MD5.java new file mode 100644 index 0000000..eb1311c --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/utils/MD5.java @@ -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")); + } + +} \ No newline at end of file diff --git a/src/main/java/com/jdc/jdcproject/utils/RenYuanUtil.java b/src/main/java/com/jdc/jdcproject/utils/RenYuanUtil.java new file mode 100644 index 0000000..c01947b --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/utils/RenYuanUtil.java @@ -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 renyuanSum(List renyuanjiegouList) { + Map 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; + } +} diff --git a/src/main/java/com/jdc/jdcproject/utils/Result.java b/src/main/java/com/jdc/jdcproject/utils/Result.java new file mode 100644 index 0000000..7bae9a7 --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/utils/Result.java @@ -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 data = new HashMap(); + + + //私有化构造方法 + 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 map){ + this.setData(map); + return this; + } +} \ No newline at end of file diff --git a/src/main/java/com/jdc/jdcproject/utils/ResultCode.java b/src/main/java/com/jdc/jdcproject/utils/ResultCode.java new file mode 100644 index 0000000..f5083ee --- /dev/null +++ b/src/main/java/com/jdc/jdcproject/utils/ResultCode.java @@ -0,0 +1,8 @@ +package com.jdc.jdcproject.utils; + +public interface ResultCode { + + public static Integer SUCCESS = 20000;//操作成功 + + public static Integer ERROR = 20001;//操作失败 +} \ No newline at end of file diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml new file mode 100644 index 0000000..c8b32a4 --- /dev/null +++ b/src/main/resources/application.yml @@ -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 diff --git a/src/test/java/com/jdc/jdcproject/JdcProjectApplicationTests.java b/src/test/java/com/jdc/jdcproject/JdcProjectApplicationTests.java new file mode 100644 index 0000000..a978b74 --- /dev/null +++ b/src/test/java/com/jdc/jdcproject/JdcProjectApplicationTests.java @@ -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); + } + +} diff --git a/src/test/java/com/jdc/jdcproject/MybatisPlusGenerator.java b/src/test/java/com/jdc/jdcproject/MybatisPlusGenerator.java new file mode 100644 index 0000000..f590a06 --- /dev/null +++ b/src/test/java/com/jdc/jdcproject/MybatisPlusGenerator.java @@ -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(); + } +}