添加完字段注释
This commit is contained in:
commit
da631a40df
|
@ -0,0 +1,2 @@
|
|||
/mvnw text eol=lf
|
||||
*.cmd text eol=crlf
|
|
@ -0,0 +1,33 @@
|
|||
HELP.md
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
|
@ -0,0 +1,19 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
wrapperVersion=3.3.2
|
||||
distributionType=only-script
|
||||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
|
|
@ -0,0 +1,259 @@
|
|||
#!/bin/sh
|
||||
# ----------------------------------------------------------------------------
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Apache Maven Wrapper startup batch script, version 3.3.2
|
||||
#
|
||||
# Optional ENV vars
|
||||
# -----------------
|
||||
# JAVA_HOME - location of a JDK home dir, required when download maven via java source
|
||||
# MVNW_REPOURL - repo url base for downloading maven distribution
|
||||
# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
|
||||
# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
set -euf
|
||||
[ "${MVNW_VERBOSE-}" != debug ] || set -x
|
||||
|
||||
# OS specific support.
|
||||
native_path() { printf %s\\n "$1"; }
|
||||
case "$(uname)" in
|
||||
CYGWIN* | MINGW*)
|
||||
[ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")"
|
||||
native_path() { cygpath --path --windows "$1"; }
|
||||
;;
|
||||
esac
|
||||
|
||||
# set JAVACMD and JAVACCMD
|
||||
set_java_home() {
|
||||
# For Cygwin and MinGW, ensure paths are in Unix format before anything is touched
|
||||
if [ -n "${JAVA_HOME-}" ]; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ]; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
JAVACCMD="$JAVA_HOME/jre/sh/javac"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
JAVACCMD="$JAVA_HOME/bin/javac"
|
||||
|
||||
if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then
|
||||
echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2
|
||||
echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
else
|
||||
JAVACMD="$(
|
||||
'set' +e
|
||||
'unset' -f command 2>/dev/null
|
||||
'command' -v java
|
||||
)" || :
|
||||
JAVACCMD="$(
|
||||
'set' +e
|
||||
'unset' -f command 2>/dev/null
|
||||
'command' -v javac
|
||||
)" || :
|
||||
|
||||
if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then
|
||||
echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# hash string like Java String::hashCode
|
||||
hash_string() {
|
||||
str="${1:-}" h=0
|
||||
while [ -n "$str" ]; do
|
||||
char="${str%"${str#?}"}"
|
||||
h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296))
|
||||
str="${str#?}"
|
||||
done
|
||||
printf %x\\n $h
|
||||
}
|
||||
|
||||
verbose() { :; }
|
||||
[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; }
|
||||
|
||||
die() {
|
||||
printf %s\\n "$1" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
trim() {
|
||||
# MWRAPPER-139:
|
||||
# Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds.
|
||||
# Needed for removing poorly interpreted newline sequences when running in more
|
||||
# exotic environments such as mingw bash on Windows.
|
||||
printf "%s" "${1}" | tr -d '[:space:]'
|
||||
}
|
||||
|
||||
# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties
|
||||
while IFS="=" read -r key value; do
|
||||
case "${key-}" in
|
||||
distributionUrl) distributionUrl=$(trim "${value-}") ;;
|
||||
distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;;
|
||||
esac
|
||||
done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties"
|
||||
[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties"
|
||||
|
||||
case "${distributionUrl##*/}" in
|
||||
maven-mvnd-*bin.*)
|
||||
MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/
|
||||
case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in
|
||||
*AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;;
|
||||
:Darwin*x86_64) distributionPlatform=darwin-amd64 ;;
|
||||
:Darwin*arm64) distributionPlatform=darwin-aarch64 ;;
|
||||
:Linux*x86_64*) distributionPlatform=linux-amd64 ;;
|
||||
*)
|
||||
echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2
|
||||
distributionPlatform=linux-amd64
|
||||
;;
|
||||
esac
|
||||
distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip"
|
||||
;;
|
||||
maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;;
|
||||
*) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;;
|
||||
esac
|
||||
|
||||
# apply MVNW_REPOURL and calculate MAVEN_HOME
|
||||
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
|
||||
[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}"
|
||||
distributionUrlName="${distributionUrl##*/}"
|
||||
distributionUrlNameMain="${distributionUrlName%.*}"
|
||||
distributionUrlNameMain="${distributionUrlNameMain%-bin}"
|
||||
MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}"
|
||||
MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")"
|
||||
|
||||
exec_maven() {
|
||||
unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || :
|
||||
exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD"
|
||||
}
|
||||
|
||||
if [ -d "$MAVEN_HOME" ]; then
|
||||
verbose "found existing MAVEN_HOME at $MAVEN_HOME"
|
||||
exec_maven "$@"
|
||||
fi
|
||||
|
||||
case "${distributionUrl-}" in
|
||||
*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;;
|
||||
*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;;
|
||||
esac
|
||||
|
||||
# prepare tmp dir
|
||||
if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then
|
||||
clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; }
|
||||
trap clean HUP INT TERM EXIT
|
||||
else
|
||||
die "cannot create temp dir"
|
||||
fi
|
||||
|
||||
mkdir -p -- "${MAVEN_HOME%/*}"
|
||||
|
||||
# Download and Install Apache Maven
|
||||
verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
|
||||
verbose "Downloading from: $distributionUrl"
|
||||
verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
|
||||
|
||||
# select .zip or .tar.gz
|
||||
if ! command -v unzip >/dev/null; then
|
||||
distributionUrl="${distributionUrl%.zip}.tar.gz"
|
||||
distributionUrlName="${distributionUrl##*/}"
|
||||
fi
|
||||
|
||||
# verbose opt
|
||||
__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR=''
|
||||
[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v
|
||||
|
||||
# normalize http auth
|
||||
case "${MVNW_PASSWORD:+has-password}" in
|
||||
'') MVNW_USERNAME='' MVNW_PASSWORD='' ;;
|
||||
has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;;
|
||||
esac
|
||||
|
||||
if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then
|
||||
verbose "Found wget ... using wget"
|
||||
wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl"
|
||||
elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then
|
||||
verbose "Found curl ... using curl"
|
||||
curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl"
|
||||
elif set_java_home; then
|
||||
verbose "Falling back to use Java to download"
|
||||
javaSource="$TMP_DOWNLOAD_DIR/Downloader.java"
|
||||
targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName"
|
||||
cat >"$javaSource" <<-END
|
||||
public class Downloader extends java.net.Authenticator
|
||||
{
|
||||
protected java.net.PasswordAuthentication getPasswordAuthentication()
|
||||
{
|
||||
return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() );
|
||||
}
|
||||
public static void main( String[] args ) throws Exception
|
||||
{
|
||||
setDefault( new Downloader() );
|
||||
java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() );
|
||||
}
|
||||
}
|
||||
END
|
||||
# For Cygwin/MinGW, switch paths to Windows format before running javac and java
|
||||
verbose " - Compiling Downloader.java ..."
|
||||
"$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java"
|
||||
verbose " - Running Downloader.java ..."
|
||||
"$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")"
|
||||
fi
|
||||
|
||||
# If specified, validate the SHA-256 sum of the Maven distribution zip file
|
||||
if [ -n "${distributionSha256Sum-}" ]; then
|
||||
distributionSha256Result=false
|
||||
if [ "$MVN_CMD" = mvnd.sh ]; then
|
||||
echo "Checksum validation is not supported for maven-mvnd." >&2
|
||||
echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
|
||||
exit 1
|
||||
elif command -v sha256sum >/dev/null; then
|
||||
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then
|
||||
distributionSha256Result=true
|
||||
fi
|
||||
elif command -v shasum >/dev/null; then
|
||||
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then
|
||||
distributionSha256Result=true
|
||||
fi
|
||||
else
|
||||
echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2
|
||||
echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
|
||||
exit 1
|
||||
fi
|
||||
if [ $distributionSha256Result = false ]; then
|
||||
echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2
|
||||
echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# unzip and move
|
||||
if command -v unzip >/dev/null; then
|
||||
unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip"
|
||||
else
|
||||
tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar"
|
||||
fi
|
||||
printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url"
|
||||
mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME"
|
||||
|
||||
clean || :
|
||||
exec_maven "$@"
|
|
@ -0,0 +1,149 @@
|
|||
<# : batch portion
|
||||
@REM ----------------------------------------------------------------------------
|
||||
@REM Licensed to the Apache Software Foundation (ASF) under one
|
||||
@REM or more contributor license agreements. See the NOTICE file
|
||||
@REM distributed with this work for additional information
|
||||
@REM regarding copyright ownership. The ASF licenses this file
|
||||
@REM to you under the Apache License, Version 2.0 (the
|
||||
@REM "License"); you may not use this file except in compliance
|
||||
@REM with the License. You may obtain a copy of the License at
|
||||
@REM
|
||||
@REM http://www.apache.org/licenses/LICENSE-2.0
|
||||
@REM
|
||||
@REM Unless required by applicable law or agreed to in writing,
|
||||
@REM software distributed under the License is distributed on an
|
||||
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
@REM KIND, either express or implied. See the License for the
|
||||
@REM specific language governing permissions and limitations
|
||||
@REM under the License.
|
||||
@REM ----------------------------------------------------------------------------
|
||||
|
||||
@REM ----------------------------------------------------------------------------
|
||||
@REM Apache Maven Wrapper startup batch script, version 3.3.2
|
||||
@REM
|
||||
@REM Optional ENV vars
|
||||
@REM MVNW_REPOURL - repo url base for downloading maven distribution
|
||||
@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
|
||||
@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output
|
||||
@REM ----------------------------------------------------------------------------
|
||||
|
||||
@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0)
|
||||
@SET __MVNW_CMD__=
|
||||
@SET __MVNW_ERROR__=
|
||||
@SET __MVNW_PSMODULEP_SAVE=%PSModulePath%
|
||||
@SET PSModulePath=
|
||||
@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @(
|
||||
IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B)
|
||||
)
|
||||
@SET PSModulePath=%__MVNW_PSMODULEP_SAVE%
|
||||
@SET __MVNW_PSMODULEP_SAVE=
|
||||
@SET __MVNW_ARG0_NAME__=
|
||||
@SET MVNW_USERNAME=
|
||||
@SET MVNW_PASSWORD=
|
||||
@IF NOT "%__MVNW_CMD__%"=="" (%__MVNW_CMD__% %*)
|
||||
@echo Cannot start maven from wrapper >&2 && exit /b 1
|
||||
@GOTO :EOF
|
||||
: end batch / begin powershell #>
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
if ($env:MVNW_VERBOSE -eq "true") {
|
||||
$VerbosePreference = "Continue"
|
||||
}
|
||||
|
||||
# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties
|
||||
$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl
|
||||
if (!$distributionUrl) {
|
||||
Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties"
|
||||
}
|
||||
|
||||
switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) {
|
||||
"maven-mvnd-*" {
|
||||
$USE_MVND = $true
|
||||
$distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip"
|
||||
$MVN_CMD = "mvnd.cmd"
|
||||
break
|
||||
}
|
||||
default {
|
||||
$USE_MVND = $false
|
||||
$MVN_CMD = $script -replace '^mvnw','mvn'
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
# apply MVNW_REPOURL and calculate MAVEN_HOME
|
||||
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
|
||||
if ($env:MVNW_REPOURL) {
|
||||
$MVNW_REPO_PATTERN = if ($USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" }
|
||||
$distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')"
|
||||
}
|
||||
$distributionUrlName = $distributionUrl -replace '^.*/',''
|
||||
$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$',''
|
||||
$MAVEN_HOME_PARENT = "$HOME/.m2/wrapper/dists/$distributionUrlNameMain"
|
||||
if ($env:MAVEN_USER_HOME) {
|
||||
$MAVEN_HOME_PARENT = "$env:MAVEN_USER_HOME/wrapper/dists/$distributionUrlNameMain"
|
||||
}
|
||||
$MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join ''
|
||||
$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME"
|
||||
|
||||
if (Test-Path -Path "$MAVEN_HOME" -PathType Container) {
|
||||
Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME"
|
||||
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
|
||||
exit $?
|
||||
}
|
||||
|
||||
if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) {
|
||||
Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl"
|
||||
}
|
||||
|
||||
# prepare tmp dir
|
||||
$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile
|
||||
$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir"
|
||||
$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null
|
||||
trap {
|
||||
if ($TMP_DOWNLOAD_DIR.Exists) {
|
||||
try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
|
||||
catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
|
||||
}
|
||||
}
|
||||
|
||||
New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null
|
||||
|
||||
# Download and Install Apache Maven
|
||||
Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
|
||||
Write-Verbose "Downloading from: $distributionUrl"
|
||||
Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
|
||||
|
||||
$webclient = New-Object System.Net.WebClient
|
||||
if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) {
|
||||
$webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD)
|
||||
}
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||
$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null
|
||||
|
||||
# If specified, validate the SHA-256 sum of the Maven distribution zip file
|
||||
$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum
|
||||
if ($distributionSha256Sum) {
|
||||
if ($USE_MVND) {
|
||||
Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties."
|
||||
}
|
||||
Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash
|
||||
if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) {
|
||||
Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property."
|
||||
}
|
||||
}
|
||||
|
||||
# unzip and move
|
||||
Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null
|
||||
Rename-Item -Path "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" -NewName $MAVEN_HOME_NAME | Out-Null
|
||||
try {
|
||||
Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null
|
||||
} catch {
|
||||
if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) {
|
||||
Write-Error "fail to move MAVEN_HOME"
|
||||
}
|
||||
} finally {
|
||||
try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
|
||||
catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
|
||||
}
|
||||
|
||||
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
|
|
@ -0,0 +1,138 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.7.18</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
<groupId>com.dite</groupId>
|
||||
<artifactId>znpt</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<name>znpt</name>
|
||||
<description>Demo project for Spring Boot</description>
|
||||
<properties>
|
||||
<java.version>17</java.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-devtools</artifactId>
|
||||
<scope>runtime</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-crypto</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-aop</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--mybatis-plus 依赖-->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>3.5.11</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-boot-starter</artifactId>
|
||||
<version>3.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-spring-boot-starter</artifactId>
|
||||
<version>3.0.3</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 代码生成器 -->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-generator</artifactId>
|
||||
<version>3.5.11</version>
|
||||
</dependency>
|
||||
<!-- 模板引擎 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.velocity</groupId>
|
||||
<artifactId>velocity-engine-core</artifactId>
|
||||
<version>2.3</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 阿里数据库连接池 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid-spring-boot-starter</artifactId>
|
||||
<version>1.2.22</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-jdbc</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.freemarker</groupId>
|
||||
<artifactId>freemarker</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-tx</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.8.22</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.pagehelper</groupId>
|
||||
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||
<version>1.4.7</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.1</version>
|
||||
<configuration>
|
||||
<source>8</source>
|
||||
<target>8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,18 @@
|
|||
package com.dite.znpt;
|
||||
|
||||
import cn.hutool.extra.spring.EnableSpringUtil;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
||||
@SpringBootApplication
|
||||
@MapperScan("com.dite.znpt.mapper")
|
||||
@EnableSpringUtil
|
||||
public class DiteApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(DiteApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,82 @@
|
|||
package com.dite.znpt.aspect;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.aspectj.lang.annotation.Around;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Before;
|
||||
import org.aspectj.lang.annotation.Pointcut;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* @date 2022/1/4 7:39 上午
|
||||
* @description:
|
||||
*/
|
||||
@Slf4j
|
||||
@Aspect
|
||||
@Component
|
||||
public class HttpLogAspect {
|
||||
|
||||
/**
|
||||
* 换行符
|
||||
*/
|
||||
private static final String LINE_SEPARATOR = System.lineSeparator();
|
||||
|
||||
/**
|
||||
* 自定义切点
|
||||
*/
|
||||
@Pointcut("execution(* com.dite.*.controller.*.*(..)) ")
|
||||
public void log() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 在切点之前织入
|
||||
*
|
||||
* @param joinPoint
|
||||
*/
|
||||
@Before("log()")
|
||||
public void doBefore(JoinPoint joinPoint) throws Exception {
|
||||
|
||||
// 开始打印请求日志
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
HttpServletRequest request = attributes.getRequest();
|
||||
// 打印请求相关参数
|
||||
log.info("\n=============== Start ===================");
|
||||
// 打印请求 url
|
||||
log.info("请求路径 : {}", request.getRequestURL().toString());
|
||||
// 打印 Http method
|
||||
log.info("请求方法 : {}", request.getMethod());
|
||||
// 打印调用 controller 的全路径以及执行方法
|
||||
log.info("调用方法 : {}.{}", joinPoint.getSignature().getDeclaringTypeName(), joinPoint.getSignature().getName());
|
||||
//获取传入目标方法的参数
|
||||
log.info("请求参数 : {}", JSONUtil.toJsonStr(joinPoint.getArgs()));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 环绕
|
||||
*
|
||||
* @param proceedingJoinPoint
|
||||
* @return
|
||||
* @throws Throwable
|
||||
*/
|
||||
@Around("log()")
|
||||
public Object doAround(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
|
||||
long startTime = System.currentTimeMillis();
|
||||
Object result = proceedingJoinPoint.proceed();
|
||||
// 打印出参
|
||||
log.info("响应结果 : {}", JSONUtil.toJsonStr(result));
|
||||
// 执行耗时
|
||||
log.info("请求耗时 : {} ms", System.currentTimeMillis() - startTime);
|
||||
|
||||
log.info("\n=========================================== End ===========================================" + LINE_SEPARATOR);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
package com.dite.znpt.config;
|
||||
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.config.BeanPostProcessor;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.util.ReflectionUtils;
|
||||
import org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping;
|
||||
import springfox.documentation.spring.web.plugins.WebFluxRequestHandlerProvider;
|
||||
import springfox.documentation.spring.web.plugins.WebMvcRequestHandlerProvider;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Configuration
|
||||
public class BeanPostProcessorConfig {
|
||||
|
||||
@Bean
|
||||
public BeanPostProcessor beanPostProcessor() {
|
||||
return new BeanPostProcessor() {
|
||||
@Override
|
||||
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
|
||||
if (bean instanceof WebMvcRequestHandlerProvider || bean instanceof WebFluxRequestHandlerProvider) {
|
||||
handlerMappings(getHandlerMappings(bean));
|
||||
}
|
||||
return bean;
|
||||
}
|
||||
|
||||
private <T extends RequestMappingInfoHandlerMapping> void handlerMappings(List<T> mappings) {
|
||||
List<T> copy = mappings.stream()
|
||||
.filter(mapping -> mapping.getPatternParser() == null)
|
||||
.collect(Collectors.toList());
|
||||
mappings.clear();
|
||||
mappings.addAll(copy);
|
||||
}
|
||||
|
||||
private List<RequestMappingInfoHandlerMapping> getHandlerMappings(Object bean) {
|
||||
try {
|
||||
Field field = ReflectionUtils.findField(bean.getClass(), "handlerMappings");
|
||||
field.setAccessible(true);
|
||||
return (List<RequestMappingInfoHandlerMapping>) field.get(bean);
|
||||
} catch (IllegalArgumentException | IllegalAccessException e) {
|
||||
throw new IllegalStateException(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package com.dite.znpt.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.cors.CorsConfiguration;
|
||||
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
|
||||
import org.springframework.web.filter.CorsFilter;
|
||||
|
||||
|
||||
/**
|
||||
* @date 2023/4/5 11:30
|
||||
* @description: 全局过滤器
|
||||
*/
|
||||
@Configuration
|
||||
public class GlobalCorsConfig {
|
||||
|
||||
@Bean
|
||||
public CorsFilter corsFilter() {
|
||||
CorsConfiguration config = new CorsConfiguration();
|
||||
//允许所有域名进行跨域调用
|
||||
config.addAllowedOriginPattern("*");//替换这个
|
||||
//允许跨越发送cookie
|
||||
config.setAllowCredentials(true);
|
||||
//放行全部原始头信息
|
||||
config.addAllowedHeader("*");
|
||||
//允许所有请求方法跨域调用
|
||||
config.addAllowedMethod("*");
|
||||
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
|
||||
source.registerCorsConfiguration("/**", config);
|
||||
return new CorsFilter(source);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package com.dite.znpt.config;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
|
||||
|
||||
/**
|
||||
* @date 2022/3/20 10:34 上午
|
||||
* @description:
|
||||
*/
|
||||
@Configuration
|
||||
public class JacksonConfig {
|
||||
|
||||
@Bean
|
||||
@Primary
|
||||
@ConditionalOnMissingBean(ObjectMapper.class)
|
||||
public ObjectMapper jacksonObjectMapper(Jackson2ObjectMapperBuilder builder) {
|
||||
ObjectMapper objectMapper = builder.createXmlMapper(false).build();
|
||||
// 全局配置序列化返回 JSON 处理
|
||||
SimpleModule simpleModule = new SimpleModule();
|
||||
//JSON Long ==> String
|
||||
simpleModule.addSerializer(Long.class, ToStringSerializer.instance);
|
||||
objectMapper.registerModule(simpleModule);
|
||||
return objectMapper;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
//package com.dite.znpt.configuration;
|
||||
//
|
||||
//import cn.dev33.satoken.config.SaTokenConfig;
|
||||
//import cn.dev33.satoken.context.SaHolder;
|
||||
//import cn.dev33.satoken.exception.NotLoginException;
|
||||
//import cn.dev33.satoken.filter.SaServletFilter;
|
||||
//import cn.dev33.satoken.interceptor.SaInterceptor;
|
||||
//import cn.dev33.satoken.stp.StpUtil;
|
||||
//import cn.dev33.satoken.util.SaResult;
|
||||
//import cn.hutool.extra.spring.SpringUtil;
|
||||
//import com.gaea.common.common.constants.Constants;
|
||||
//import com.gaea.common.common.enums.CommonEOS;
|
||||
//import com.gaea.data.base.context.UserContext;
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//import org.springframework.beans.factory.annotation.Value;
|
||||
//import org.springframework.context.annotation.Bean;
|
||||
//import org.springframework.context.annotation.Configuration;
|
||||
//import org.springframework.context.annotation.Primary;
|
||||
//import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
//
|
||||
///**
|
||||
// * @description: Sa-Token 权限认证 配置类
|
||||
// */
|
||||
//@Slf4j
|
||||
//@Configuration
|
||||
//public class SaTokenConfigure implements WebMvcConfigurer {
|
||||
//
|
||||
// @Value("${spring.profiles.active}")
|
||||
// private String profile;
|
||||
//
|
||||
// /**
|
||||
// * @author wujinsong
|
||||
// * @date 2021/11/20 9:22 下午
|
||||
// * @description: 注册 Sa-Token 全局过滤器
|
||||
// * @Param []
|
||||
// * @Return cn.dev33.satoken.filter.SaServletFilter
|
||||
// */
|
||||
// @Bean
|
||||
// public SaServletFilter getSaServletFilter() {
|
||||
//
|
||||
// return new SaServletFilter().addInclude("/**").addExclude("/favicon.ico", "/user/login").setAuth(obj -> {
|
||||
// // 校验 Id-Token 身份凭证
|
||||
// if (!Constants.PROFILE_DEV.equals(profile)) {
|
||||
//// StpUtil.checkLogin();
|
||||
// boolean isLogin = SpringUtil.getBean(UserContext.class).checkLogin();
|
||||
// if (!isLogin) {
|
||||
// throw NotLoginException.newInstance(StpUtil.TYPE, NotLoginException.NOT_TOKEN);
|
||||
// }
|
||||
// }
|
||||
// }).setError(e -> {
|
||||
// SaHolder.getResponse().setHeader("Content-Type", "application/json; charset=utf-8");
|
||||
// return SaResult.error(CommonEOS.E25000007.getName());
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// @Bean
|
||||
// @Primary
|
||||
// public SaTokenConfig getSaTokenConfigPrimary() {
|
||||
// SaTokenConfig config = new SaTokenConfig();
|
||||
// config.setTokenName("satoken");
|
||||
// config.setActivityTimeout(6000 * 30);
|
||||
// config.setIsConcurrent(true);
|
||||
// config.setIsShare(true);
|
||||
// config.setTokenStyle("uuid");
|
||||
// config.setIsLog(false);
|
||||
// return config;
|
||||
// }
|
||||
//
|
||||
// // 注册Sa-Token的注解拦截器,打开注解式鉴权功能
|
||||
// @Override
|
||||
// public void addInterceptors(InterceptorRegistry registry) {
|
||||
// // 注册注解拦截器,并排除不需要注解鉴权的接口地址 (与登录拦截器无关)
|
||||
// registry.addInterceptor(new SaInterceptor()).addPathPatterns("/**").excludePathPatterns("/favicon.ico", "/user/login");
|
||||
// }
|
||||
//}
|
|
@ -0,0 +1,53 @@
|
|||
package com.dite.znpt.config;
|
||||
|
||||
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import springfox.documentation.builders.ApiInfoBuilder;
|
||||
import springfox.documentation.builders.PathSelectors;
|
||||
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||
import springfox.documentation.builders.RequestParameterBuilder;
|
||||
import springfox.documentation.oas.annotations.EnableOpenApi;
|
||||
import springfox.documentation.service.ApiInfo;
|
||||
import springfox.documentation.service.ParameterType;
|
||||
import springfox.documentation.service.RequestParameter;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Configuration
|
||||
@EnableOpenApi
|
||||
public class SwaggerConfig {
|
||||
|
||||
@Bean
|
||||
public Docket docket() {
|
||||
RequestParameterBuilder parameterBuilder = new RequestParameterBuilder();
|
||||
List<RequestParameter> parameters = new ArrayList<>();
|
||||
parameterBuilder.name("Authorization")
|
||||
.description("token值")
|
||||
.in(ParameterType.HEADER)
|
||||
// todo 暂时设置为false,后续上登录后需要开启
|
||||
.required(false)
|
||||
.build();
|
||||
parameters.add(parameterBuilder.build());
|
||||
return new Docket(DocumentationType.OAS_30)
|
||||
.apiInfo(apiInfo())
|
||||
.enable(true)//开启Swagger文档
|
||||
.select()
|
||||
.apis(RequestHandlerSelectors.basePackage("com.dite"))
|
||||
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
|
||||
.paths(PathSelectors.any())
|
||||
.build()
|
||||
.globalRequestParameters(parameters);
|
||||
}
|
||||
|
||||
public ApiInfo apiInfo() {
|
||||
return new ApiInfoBuilder()
|
||||
.title("智能平台")
|
||||
.version("1.0")
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.dite.znpt.config;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
|
||||
|
||||
@Configuration
|
||||
public class WebMvcConfig extends WebMvcConfigurationSupport {
|
||||
/**
|
||||
* MVC 加载Swagger静态资源
|
||||
* @param registry
|
||||
*/
|
||||
@Override
|
||||
protected void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||
registry.addResourceHandler("/**")
|
||||
.addResourceLocations("classpath:/static/");
|
||||
registry.addResourceHandler("doc.html")
|
||||
.addResourceLocations("classpath:/META-INF/resources/");
|
||||
registry.addResourceHandler("/webjars/**")
|
||||
.addResourceLocations("classpath:/META-INF/resources/webjars/");
|
||||
registry.addResourceHandler("/swagger-ui/**")
|
||||
.addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/");
|
||||
super.addResourceHandlers(registry);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
package com.dite.znpt.controller;
|
||||
|
||||
|
||||
import com.dite.znpt.domain.vo.CombinedDictListReq;
|
||||
import com.dite.znpt.domain.vo.CombinedDictResp;
|
||||
import com.dite.znpt.domain.entity.CombinedDictEntity;
|
||||
import com.dite.znpt.service.CombinedDictService;
|
||||
import com.dite.znpt.domain.Result;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 14:37
|
||||
*/
|
||||
@Api(tags = "字典")
|
||||
@RestController
|
||||
@RequestMapping("/combined-dict")
|
||||
public class CombinedDictController {
|
||||
@Resource
|
||||
private CombinedDictService combinedDictService;
|
||||
|
||||
@ApiOperation(value = "获取字典列表", httpMethod = "GET")
|
||||
@GetMapping("/list")
|
||||
public Result<PageInfo<CombinedDictResp>> list(CombinedDictListReq combinedDictReq) {
|
||||
PageInfo<CombinedDictResp> page = combinedDictService.selectList(combinedDictReq);
|
||||
return Result.ok(page);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据字典Id获取详细信息", httpMethod = "GET")
|
||||
@GetMapping("/{dictId}")
|
||||
public Result<CombinedDictResp> getInfo(@PathVariable String dictId) {
|
||||
return Result.ok(combinedDictService.selectById(dictId));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增字典", httpMethod = "POST")
|
||||
@PostMapping
|
||||
public Result<Object> add(@RequestBody CombinedDictEntity combinedDict) {
|
||||
combinedDictService.saveData(combinedDict);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改字典", httpMethod = "PUT")
|
||||
@PutMapping
|
||||
public Result<Object> edit(@RequestBody CombinedDictEntity combinedDict) {
|
||||
combinedDictService.updateData(combinedDict);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除字典", httpMethod = "DELETE")
|
||||
@DeleteMapping("/{dictId}")
|
||||
public Result<Object> remove(@PathVariable String dictId) {
|
||||
combinedDictService.deleteById(dictId);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.dite.znpt.controller;
|
||||
|
||||
|
||||
import com.dite.znpt.domain.vo.DefectListReq;
|
||||
import com.dite.znpt.domain.vo.DefectResp;
|
||||
import com.dite.znpt.domain.entity.DefectEntity;
|
||||
import com.dite.znpt.service.DefectService;
|
||||
import com.dite.znpt.domain.Result;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 14:37
|
||||
*/
|
||||
@Api(tags = "缺陷记录")
|
||||
@RestController
|
||||
@RequestMapping("/defect")
|
||||
public class DefectController {
|
||||
@Resource
|
||||
private DefectService defectService;
|
||||
|
||||
@ApiOperation(value = "获取缺陷记录列表", httpMethod = "GET")
|
||||
@GetMapping("/list")
|
||||
public Result<PageInfo<DefectResp>> list(DefectListReq defectReq) {
|
||||
PageInfo<DefectResp> page = defectService.selectList(defectReq);
|
||||
return Result.ok(page);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据缺陷记录Id获取详细信息", httpMethod = "GET")
|
||||
@GetMapping("/{defectId}")
|
||||
public Result<DefectResp> getInfo(@PathVariable String defectId) {
|
||||
return Result.ok(defectService.selectById(defectId));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增缺陷记录", httpMethod = "POST")
|
||||
@PostMapping
|
||||
public Result<Object> add(@RequestBody DefectEntity defect) {
|
||||
defectService.saveData(defect);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改缺陷记录", httpMethod = "PUT")
|
||||
@PutMapping
|
||||
public Result<Object> edit(@RequestBody DefectEntity defect) {
|
||||
defectService.updateData(defect);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除缺陷记录", httpMethod = "DELETE")
|
||||
@DeleteMapping("/{defectId}")
|
||||
public Result<Object> remove(@PathVariable String defectId) {
|
||||
defectService.deleteById(defectId);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.dite.znpt.controller;
|
||||
|
||||
|
||||
import com.dite.znpt.domain.vo.FileInfoListReq;
|
||||
import com.dite.znpt.domain.vo.FileInfoResp;
|
||||
import com.dite.znpt.domain.entity.FileInfoEntity;
|
||||
import com.dite.znpt.service.FileInfoService;
|
||||
import com.dite.znpt.domain.Result;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 14:37
|
||||
*/
|
||||
@Api(tags = "文件信息")
|
||||
@RestController
|
||||
@RequestMapping("/file-info")
|
||||
public class FileInfoController {
|
||||
@Resource
|
||||
private FileInfoService fileInfoService;
|
||||
|
||||
@ApiOperation(value = "获取文件信息列表", httpMethod = "GET")
|
||||
@GetMapping("/list")
|
||||
public Result<PageInfo<FileInfoResp>> list(FileInfoListReq fileInfoReq) {
|
||||
PageInfo<FileInfoResp> page = fileInfoService.selectList(fileInfoReq);
|
||||
return Result.ok(page);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据文件信息Id获取详细信息", httpMethod = "GET")
|
||||
@GetMapping("/{fileId}")
|
||||
public Result<FileInfoResp> getInfo(@PathVariable Long fileId) {
|
||||
return Result.ok(fileInfoService.selectById(fileId));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增文件信息", httpMethod = "POST")
|
||||
@PostMapping
|
||||
public Result<Object> add(@RequestBody FileInfoEntity fileInfo) {
|
||||
fileInfoService.saveData(fileInfo);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改文件信息", httpMethod = "PUT")
|
||||
@PutMapping
|
||||
public Result<Object> edit(@RequestBody FileInfoEntity fileInfo) {
|
||||
fileInfoService.updateData(fileInfo);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除文件信息", httpMethod = "DELETE")
|
||||
@DeleteMapping("/{fileId}")
|
||||
public Result<Object> remove(@PathVariable Long fileId) {
|
||||
fileInfoService.deleteById(fileId);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.dite.znpt.controller;
|
||||
|
||||
|
||||
import com.dite.znpt.domain.vo.PersonnelListReq;
|
||||
import com.dite.znpt.domain.vo.PersonnelResp;
|
||||
import com.dite.znpt.domain.entity.PersonnelEntity;
|
||||
import com.dite.znpt.service.PersonnelService;
|
||||
import com.dite.znpt.domain.Result;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 14:37
|
||||
*/
|
||||
@Api(tags = "人员信息")
|
||||
@RestController
|
||||
@RequestMapping("/personnel")
|
||||
public class PersonnelController {
|
||||
@Resource
|
||||
private PersonnelService personnelService;
|
||||
|
||||
@ApiOperation(value = "获取人员信息列表", httpMethod = "GET")
|
||||
@GetMapping("/list")
|
||||
public Result<PageInfo<PersonnelResp>> list(PersonnelListReq personnelReq) {
|
||||
PageInfo<PersonnelResp> page = personnelService.selectList(personnelReq);
|
||||
return Result.ok(page);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据人员信息Id获取详细信息", httpMethod = "GET")
|
||||
@GetMapping("/{personId}")
|
||||
public Result<PersonnelResp> getInfo(@PathVariable String personId) {
|
||||
return Result.ok(personnelService.selectById(personId));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增人员信息", httpMethod = "POST")
|
||||
@PostMapping
|
||||
public Result<Object> add(@RequestBody PersonnelEntity personnel) {
|
||||
personnelService.saveData(personnel);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改人员信息", httpMethod = "PUT")
|
||||
@PutMapping
|
||||
public Result<Object> edit(@RequestBody PersonnelEntity personnel) {
|
||||
personnelService.updateData(personnel);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除人员信息", httpMethod = "DELETE")
|
||||
@DeleteMapping("/{personId}")
|
||||
public Result<Object> remove(@PathVariable String personId) {
|
||||
personnelService.deleteById(personId);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.dite.znpt.controller;
|
||||
|
||||
|
||||
import com.dite.znpt.domain.vo.ProjectCompanyListReq;
|
||||
import com.dite.znpt.domain.vo.ProjectCompanyResp;
|
||||
import com.dite.znpt.domain.entity.ProjectCompanyEntity;
|
||||
import com.dite.znpt.service.ProjectCompanyService;
|
||||
import com.dite.znpt.domain.Result;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 14:37
|
||||
*/
|
||||
@Api(tags = "项目-公司关联信息")
|
||||
@RestController
|
||||
@RequestMapping("/project-company")
|
||||
public class ProjectCompanyController {
|
||||
@Resource
|
||||
private ProjectCompanyService projectCompanyService;
|
||||
|
||||
@ApiOperation(value = "获取项目-公司关联信息列表", httpMethod = "GET")
|
||||
@GetMapping("/list")
|
||||
public Result<PageInfo<ProjectCompanyResp>> list(ProjectCompanyListReq projectCompanyReq) {
|
||||
PageInfo<ProjectCompanyResp> page = projectCompanyService.selectList(projectCompanyReq);
|
||||
return Result.ok(page);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据项目-公司关联信息Id获取详细信息", httpMethod = "GET")
|
||||
@GetMapping("/{projectId}")
|
||||
public Result<ProjectCompanyResp> getInfo(@PathVariable String projectId) {
|
||||
return Result.ok(projectCompanyService.selectById(projectId));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增项目-公司关联信息", httpMethod = "POST")
|
||||
@PostMapping
|
||||
public Result<Object> add(@RequestBody ProjectCompanyEntity projectCompany) {
|
||||
projectCompanyService.saveData(projectCompany);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改项目-公司关联信息", httpMethod = "PUT")
|
||||
@PutMapping
|
||||
public Result<Object> edit(@RequestBody ProjectCompanyEntity projectCompany) {
|
||||
projectCompanyService.updateData(projectCompany);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除项目-公司关联信息", httpMethod = "DELETE")
|
||||
@DeleteMapping("/{projectId}")
|
||||
public Result<Object> remove(@PathVariable String projectId) {
|
||||
projectCompanyService.deleteById(projectId);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.dite.znpt.controller;
|
||||
|
||||
|
||||
import com.dite.znpt.domain.vo.ProjectListReq;
|
||||
import com.dite.znpt.domain.vo.ProjectResp;
|
||||
import com.dite.znpt.domain.entity.ProjectEntity;
|
||||
import com.dite.znpt.service.ProjectService;
|
||||
import com.dite.znpt.domain.Result;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 14:37
|
||||
*/
|
||||
@Api(tags = "项目信息")
|
||||
@RestController
|
||||
@RequestMapping("/project")
|
||||
public class ProjectController {
|
||||
@Resource
|
||||
private ProjectService projectService;
|
||||
|
||||
@ApiOperation(value = "获取项目信息列表", httpMethod = "GET")
|
||||
@GetMapping("/list")
|
||||
public Result<PageInfo<ProjectResp>> list(ProjectListReq projectReq) {
|
||||
PageInfo<ProjectResp> page = projectService.selectList(projectReq);
|
||||
return Result.ok(page);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据项目信息Id获取详细信息", httpMethod = "GET")
|
||||
@GetMapping("/{projectId}")
|
||||
public Result<ProjectResp> getInfo(@PathVariable String projectId) {
|
||||
return Result.ok(projectService.selectById(projectId));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增项目信息", httpMethod = "POST")
|
||||
@PostMapping
|
||||
public Result<Object> add(@RequestBody ProjectEntity project) {
|
||||
projectService.saveData(project);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改项目信息", httpMethod = "PUT")
|
||||
@PutMapping
|
||||
public Result<Object> edit(@RequestBody ProjectEntity project) {
|
||||
projectService.updateData(project);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除项目信息", httpMethod = "DELETE")
|
||||
@DeleteMapping("/{projectId}")
|
||||
public Result<Object> remove(@PathVariable String projectId) {
|
||||
projectService.deleteById(projectId);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.dite.znpt.controller;
|
||||
|
||||
|
||||
import com.dite.znpt.domain.vo.TCompanyListReq;
|
||||
import com.dite.znpt.domain.vo.TCompanyResp;
|
||||
import com.dite.znpt.domain.entity.TCompanyEntity;
|
||||
import com.dite.znpt.service.TCompanyService;
|
||||
import com.dite.znpt.domain.Result;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 14:37
|
||||
*/
|
||||
@Api(tags = "公司信息")
|
||||
@RestController
|
||||
@RequestMapping("/t-company")
|
||||
public class TCompanyController {
|
||||
@Resource
|
||||
private TCompanyService tCompanyService;
|
||||
|
||||
@ApiOperation(value = "获取公司信息列表", httpMethod = "GET")
|
||||
@GetMapping("/list")
|
||||
public Result<PageInfo<TCompanyResp>> list(TCompanyListReq tCompanyReq) {
|
||||
PageInfo<TCompanyResp> page = tCompanyService.selectList(tCompanyReq);
|
||||
return Result.ok(page);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据公司信息Id获取详细信息", httpMethod = "GET")
|
||||
@GetMapping("/{companyId}")
|
||||
public Result<TCompanyResp> getInfo(@PathVariable String companyId) {
|
||||
return Result.ok(tCompanyService.selectById(companyId));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增公司信息", httpMethod = "POST")
|
||||
@PostMapping
|
||||
public Result<Object> add(@RequestBody TCompanyEntity tCompany) {
|
||||
tCompanyService.saveData(tCompany);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改公司信息", httpMethod = "PUT")
|
||||
@PutMapping
|
||||
public Result<Object> edit(@RequestBody TCompanyEntity tCompany) {
|
||||
tCompanyService.updateData(tCompany);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除公司信息", httpMethod = "DELETE")
|
||||
@DeleteMapping("/{companyId}")
|
||||
public Result<Object> remove(@PathVariable String companyId) {
|
||||
tCompanyService.deleteById(companyId);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.dite.znpt.controller;
|
||||
|
||||
|
||||
import com.dite.znpt.domain.vo.TConstructionListReq;
|
||||
import com.dite.znpt.domain.vo.TConstructionResp;
|
||||
import com.dite.znpt.domain.entity.TConstructionEntity;
|
||||
import com.dite.znpt.service.TConstructionService;
|
||||
import com.dite.znpt.domain.Result;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 14:37
|
||||
*/
|
||||
@Api(tags = "施工信息")
|
||||
@RestController
|
||||
@RequestMapping("/t-construction")
|
||||
public class TConstructionController {
|
||||
@Resource
|
||||
private TConstructionService tConstructionService;
|
||||
|
||||
@ApiOperation(value = "获取施工信息列表", httpMethod = "GET")
|
||||
@GetMapping("/list")
|
||||
public Result<PageInfo<TConstructionResp>> list(TConstructionListReq tConstructionReq) {
|
||||
PageInfo<TConstructionResp> page = tConstructionService.selectList(tConstructionReq);
|
||||
return Result.ok(page);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据施工信息Id获取详细信息", httpMethod = "GET")
|
||||
@GetMapping("/{constructionId}")
|
||||
public Result<TConstructionResp> getInfo(@PathVariable String constructionId) {
|
||||
return Result.ok(tConstructionService.selectById(constructionId));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增施工信息", httpMethod = "POST")
|
||||
@PostMapping
|
||||
public Result<Object> add(@RequestBody TConstructionEntity tConstruction) {
|
||||
tConstructionService.saveData(tConstruction);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改施工信息", httpMethod = "PUT")
|
||||
@PutMapping
|
||||
public Result<Object> edit(@RequestBody TConstructionEntity tConstruction) {
|
||||
tConstructionService.updateData(tConstruction);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除施工信息", httpMethod = "DELETE")
|
||||
@DeleteMapping("/{constructionId}")
|
||||
public Result<Object> remove(@PathVariable String constructionId) {
|
||||
tConstructionService.deleteById(constructionId);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.dite.znpt.controller;
|
||||
|
||||
|
||||
import com.dite.znpt.domain.vo.TurbineListReq;
|
||||
import com.dite.znpt.domain.vo.TurbineResp;
|
||||
import com.dite.znpt.domain.entity.TurbineEntity;
|
||||
import com.dite.znpt.service.TurbineService;
|
||||
import com.dite.znpt.domain.Result;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 14:37
|
||||
*/
|
||||
@Api(tags = "机组-项目关联")
|
||||
@RestController
|
||||
@RequestMapping("/turbine")
|
||||
public class TurbineController {
|
||||
@Resource
|
||||
private TurbineService turbineService;
|
||||
|
||||
@ApiOperation(value = "获取机组-项目关联列表", httpMethod = "GET")
|
||||
@GetMapping("/list")
|
||||
public Result<PageInfo<TurbineResp>> list(TurbineListReq turbineReq) {
|
||||
PageInfo<TurbineResp> page = turbineService.selectList(turbineReq);
|
||||
return Result.ok(page);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据机组-项目关联Id获取详细信息", httpMethod = "GET")
|
||||
@GetMapping("/{turbineCode}")
|
||||
public Result<TurbineResp> getInfo(@PathVariable String turbineCode) {
|
||||
return Result.ok(turbineService.selectById(turbineCode));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增机组-项目关联", httpMethod = "POST")
|
||||
@PostMapping
|
||||
public Result<Object> add(@RequestBody TurbineEntity turbine) {
|
||||
turbineService.saveData(turbine);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改机组-项目关联", httpMethod = "PUT")
|
||||
@PutMapping
|
||||
public Result<Object> edit(@RequestBody TurbineEntity turbine) {
|
||||
turbineService.updateData(turbine);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除机组-项目关联", httpMethod = "DELETE")
|
||||
@DeleteMapping("/{turbineCode}")
|
||||
public Result<Object> remove(@PathVariable String turbineCode) {
|
||||
turbineService.deleteById(turbineCode);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.dite.znpt.controller;
|
||||
|
||||
|
||||
import com.dite.znpt.domain.vo.WeatherTypeListReq;
|
||||
import com.dite.znpt.domain.vo.WeatherTypeResp;
|
||||
import com.dite.znpt.domain.entity.WeatherTypeEntity;
|
||||
import com.dite.znpt.service.WeatherTypeService;
|
||||
import com.dite.znpt.domain.Result;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 14:37
|
||||
*/
|
||||
@Api(tags = "天气类型")
|
||||
@RestController
|
||||
@RequestMapping("/weather-type")
|
||||
public class WeatherTypeController {
|
||||
@Resource
|
||||
private WeatherTypeService weatherTypeService;
|
||||
|
||||
@ApiOperation(value = "获取天气类型列表", httpMethod = "GET")
|
||||
@GetMapping("/list")
|
||||
public Result<PageInfo<WeatherTypeResp>> list(WeatherTypeListReq weatherTypeReq) {
|
||||
PageInfo<WeatherTypeResp> page = weatherTypeService.selectList(weatherTypeReq);
|
||||
return Result.ok(page);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据天气类型Id获取详细信息", httpMethod = "GET")
|
||||
@GetMapping("/{weatherCode}")
|
||||
public Result<WeatherTypeResp> getInfo(@PathVariable String weatherCode) {
|
||||
return Result.ok(weatherTypeService.selectById(weatherCode));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增天气类型", httpMethod = "POST")
|
||||
@PostMapping
|
||||
public Result<Object> add(@RequestBody WeatherTypeEntity weatherType) {
|
||||
weatherTypeService.saveData(weatherType);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改天气类型", httpMethod = "PUT")
|
||||
@PutMapping
|
||||
public Result<Object> edit(@RequestBody WeatherTypeEntity weatherType) {
|
||||
weatherTypeService.updateData(weatherType);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除天气类型", httpMethod = "DELETE")
|
||||
@DeleteMapping("/{weatherCode}")
|
||||
public Result<Object> remove(@PathVariable String weatherCode) {
|
||||
weatherTypeService.deleteById(weatherCode);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
package com.dite.znpt.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description: 统一定义顶层Entity实体审计 基类
|
||||
* 基类统一定义id的属性名称、数据类型、列名映射及生成策略.
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@SuperBuilder(toBuilder = true)
|
||||
public class AuditableEntity implements Serializable {
|
||||
private static final long serialVersionUID = 141481953116476081L;
|
||||
|
||||
// @ApiParam(hidden = true)
|
||||
// private String createBy;
|
||||
//
|
||||
// @ApiParam(hidden = true)
|
||||
// private String updateBy;
|
||||
//
|
||||
// @ApiModelProperty(value = "创建时间", example = "2022-01-22", notes = "创建时间", hidden = true)
|
||||
// private Date createTime;
|
||||
//
|
||||
// @ApiModelProperty(hidden = true)
|
||||
// private Date updateTime;
|
||||
|
||||
@ApiModelProperty(value = "id集合", example = "[]", notes = "id集合")
|
||||
private List<String> idList;
|
||||
|
||||
@ApiModelProperty(value = "当前页", example = "1", notes = "0")
|
||||
int page = 1;
|
||||
|
||||
@ApiModelProperty(value = "页大小", example = "10", notes = "10")
|
||||
int pageSize = 10;
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.dite.znpt.domain;
|
||||
|
||||
/**
|
||||
* @description: 常量
|
||||
*/
|
||||
public class Constants {
|
||||
|
||||
/**
|
||||
* 系统异常
|
||||
*/
|
||||
public static final String SYSTEM_EXCEPTION = "000001";
|
||||
|
||||
/**
|
||||
* 服务异常
|
||||
*/
|
||||
public static final String SERVICE_EXCEPTION = "000003";
|
||||
|
||||
public static final String SERVICE_EXCEPTION_MESSAGE = "服务开小差,请稍后再试!";
|
||||
|
||||
/**
|
||||
* 参数异常
|
||||
*/
|
||||
public static final String PARAMETER_EXCEPTION = "000004";
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
package com.dite.znpt.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @description: 返回结果
|
||||
*/
|
||||
@Data
|
||||
public class Result<T> implements Serializable {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(Result.class);
|
||||
private static final String SUCCESS = "success";
|
||||
private static final Integer SUCCESS_CODE = 200;
|
||||
|
||||
private int status;
|
||||
|
||||
private T data;
|
||||
|
||||
private String msg;
|
||||
|
||||
private Integer code;
|
||||
|
||||
public Result(HttpStatus status, T data, Integer code, String msg) {
|
||||
this.status = status.value();
|
||||
this.data = data;
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public boolean isSuccess() {
|
||||
return this.getCode().equals(SUCCESS_CODE);
|
||||
}
|
||||
|
||||
public static <T> Result<T> okM(String msg) {
|
||||
return new Result<>(HttpStatus.OK, null, SUCCESS_CODE, msg);
|
||||
}
|
||||
|
||||
public static <T> Result<T> ok() {
|
||||
return new Result<>(HttpStatus.OK, null, SUCCESS_CODE, StringUtils.EMPTY);
|
||||
}
|
||||
|
||||
public static <T> Result<T> okM(T t, String msg) {
|
||||
return new Result<>(HttpStatus.OK, t, SUCCESS_CODE, msg);
|
||||
}
|
||||
|
||||
public static <T> Result<T> ok(T t) {
|
||||
return new Result<>(HttpStatus.OK, t, SUCCESS_CODE, StringUtils.EMPTY);
|
||||
}
|
||||
|
||||
public static Result<Boolean> okTrue() {
|
||||
return new Result<Boolean>(HttpStatus.OK, Boolean.TRUE, SUCCESS_CODE, StringUtils.EMPTY);
|
||||
}
|
||||
|
||||
public static Result<Boolean> okFalse() {
|
||||
return new Result<Boolean>(HttpStatus.OK, Boolean.FALSE, SUCCESS_CODE, StringUtils.EMPTY);
|
||||
}
|
||||
|
||||
public static <T> Result<T> warn(String code, String msg) {
|
||||
return new Result<T>(HttpStatus.INTERNAL_SERVER_ERROR, null, Integer.parseInt(code), msg);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
package com.dite.znpt.domain.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.dite.znpt.domain.AuditableEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 14:39
|
||||
* @Description: 字典表实体类
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("combined_dict")
|
||||
@ApiModel(value="CombinedDictEntity对象", description="字典表")
|
||||
public class CombinedDictEntity extends AuditableEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -40324154726527318L;
|
||||
|
||||
@ApiModelProperty("字典id")
|
||||
@TableId(value = "dict_id", type = IdType.ASSIGN_ID)
|
||||
private String dictId;
|
||||
|
||||
@ApiModelProperty("字典类型")
|
||||
@TableField("dict_type")
|
||||
private String dictType;
|
||||
|
||||
@ApiModelProperty("字典名称")
|
||||
@TableField("dict_name")
|
||||
private String dictName;
|
||||
|
||||
@ApiModelProperty("父级id")
|
||||
@TableField("parent_id")
|
||||
private Long parentId;
|
||||
|
||||
@ApiModelProperty("字典排序")
|
||||
@TableField("sort_order")
|
||||
private Integer sortOrder;
|
||||
|
||||
@ApiModelProperty("是否字典终值")
|
||||
@TableField("final_state")
|
||||
private Integer finalState;
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
package com.dite.znpt.domain.entity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.dite.znpt.domain.AuditableEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 14:39
|
||||
* @Description: 缺陷记录表实体类
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("defect")
|
||||
@ApiModel(value="DefectEntity对象", description="缺陷记录表")
|
||||
public class DefectEntity extends AuditableEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -74938532938992308L;
|
||||
|
||||
@ApiModelProperty("缺陷id")
|
||||
@TableId(value = "defect_id", type = IdType.ASSIGN_ID)
|
||||
private String defectId;
|
||||
|
||||
@ApiModelProperty("机组id")
|
||||
@TableField("turbine_code")
|
||||
private String turbineCode;
|
||||
|
||||
@ApiModelProperty("叶片号")
|
||||
@TableField("blade_code")
|
||||
private String bladeCode;
|
||||
|
||||
@ApiModelProperty("损伤面,字典surface_type")
|
||||
@TableField("surface_type")
|
||||
private String surfaceType;
|
||||
|
||||
@ApiModelProperty("缺陷类型,字典defect_type")
|
||||
@TableField("defect_type")
|
||||
private String defectType;
|
||||
|
||||
@ApiModelProperty("危重等级,字典defect_level")
|
||||
@TableField("defect_level")
|
||||
private String defectLevel;
|
||||
|
||||
@ApiModelProperty("轴向长度(mm)")
|
||||
@TableField("axial_length")
|
||||
private BigDecimal axialLength;
|
||||
|
||||
@ApiModelProperty("弦向长度(mm)")
|
||||
@TableField("chord_length")
|
||||
private BigDecimal chordLength;
|
||||
|
||||
@ApiModelProperty("处理建议")
|
||||
@TableField("image_path")
|
||||
private String imagePath;
|
||||
|
||||
@ApiModelProperty("图片详情")
|
||||
@TableField("image_hash")
|
||||
private String imageHash;
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package com.dite.znpt.domain.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.dite.znpt.domain.AuditableEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 14:39
|
||||
* @Description: 文件信息表实体类
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("file_info")
|
||||
@ApiModel(value="FileInfoEntity对象", description="文件信息表")
|
||||
public class FileInfoEntity extends AuditableEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 102386713213268589L;
|
||||
|
||||
@ApiModelProperty("文件id")
|
||||
@TableId(value = "file_id", type = IdType.ASSIGN_ID)
|
||||
private Long fileId;
|
||||
|
||||
@ApiModelProperty("业务id")
|
||||
@TableField("business_id")
|
||||
private String businessId;
|
||||
|
||||
@ApiModelProperty("minio相对路径")
|
||||
@TableField("minio_path")
|
||||
private String minioPath;
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
package com.dite.znpt.domain.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.dite.znpt.domain.AuditableEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 14:39
|
||||
* @Description: 人员信息表实体类
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("personnel")
|
||||
@ApiModel(value="PersonnelEntity对象", description="人员信息表")
|
||||
public class PersonnelEntity extends AuditableEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 351217700568175283L;
|
||||
|
||||
@ApiModelProperty("用户名")
|
||||
@TableId(value = "person_id", type = IdType.ASSIGN_ID)
|
||||
private String personId;
|
||||
|
||||
@ApiModelProperty("姓名")
|
||||
@TableField("name")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("角色类型,字典role_type")
|
||||
@TableField("role_type")
|
||||
private String roleType;
|
||||
|
||||
@ApiModelProperty("公司id")
|
||||
@TableField("company_id")
|
||||
private String companyId;
|
||||
|
||||
@ApiModelProperty("密码")
|
||||
@TableField("password")
|
||||
private String password;
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
package com.dite.znpt.domain.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.dite.znpt.domain.AuditableEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author sakura
|
||||
* @date 2025/04/10 13:42
|
||||
* @Description: 项目-公司关联信息表实体类
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("project_company")
|
||||
@ApiModel(value="ProjectCompanyEntity对象", description="项目-公司关联信息表")
|
||||
public class ProjectCompanyEntity extends AuditableEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 128834719624205451L;
|
||||
|
||||
@ApiModelProperty("项目id")
|
||||
@TableId(value = "project_id", type = IdType.ASSIGN_ID)
|
||||
private String projectId;
|
||||
|
||||
@ApiModelProperty("公司id")
|
||||
@TableField("company_id")
|
||||
private String companyId;
|
||||
|
||||
@ApiModelProperty("单位类型(检查/委托)")
|
||||
@TableField("relation_type")
|
||||
private String relationType;
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
package com.dite.znpt.domain.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.dite.znpt.domain.AuditableEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author sakura
|
||||
* @date 2025/04/10 13:31
|
||||
* @Description: 项目信息表实体类
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("project")
|
||||
@ApiModel(value="ProjectEntity对象", description="项目信息表")
|
||||
public class ProjectEntity extends AuditableEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 676511262353737882L;
|
||||
|
||||
@ApiModelProperty("项目id")
|
||||
@TableId(value = "project_id", type = IdType.ASSIGN_ID)
|
||||
private String projectId;
|
||||
|
||||
@ApiModelProperty("项目名称")
|
||||
@TableField("project_name")
|
||||
private String projectName;
|
||||
|
||||
@ApiModelProperty("风场名称")
|
||||
@TableField("farm_name")
|
||||
private String farmName;
|
||||
|
||||
@ApiModelProperty("风场地址")
|
||||
@TableField("farm_address")
|
||||
private String farmAddress;
|
||||
|
||||
@ApiModelProperty("委托单位")
|
||||
@TableField("client_id")
|
||||
private String clientId;
|
||||
|
||||
@ApiModelProperty("检查方式,字典method_id")
|
||||
@TableField("method_id")
|
||||
private String methodId;
|
||||
|
||||
@ApiModelProperty("项目规模")
|
||||
@TableField("scale")
|
||||
private String scale;
|
||||
|
||||
@ApiModelProperty("风机型号")
|
||||
@TableField("turbine_model")
|
||||
private String turbineModel;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package com.dite.znpt.domain.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.dite.znpt.domain.AuditableEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 14:39
|
||||
* @Description: 公司信息表实体类
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("t_company")
|
||||
@ApiModel(value="TCompanyEntity对象", description="公司信息表")
|
||||
public class TCompanyEntity extends AuditableEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -72804777209522073L;
|
||||
|
||||
@ApiModelProperty("公司id")
|
||||
@TableId(value = "company_id", type = IdType.ASSIGN_ID)
|
||||
private String companyId;
|
||||
|
||||
@ApiModelProperty("公司名称")
|
||||
@TableField("company_name")
|
||||
private String companyName;
|
||||
|
||||
@ApiModelProperty("公司地址")
|
||||
@TableField("address")
|
||||
private String address;
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
package com.dite.znpt.domain.entity;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.dite.znpt.domain.AuditableEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author sakura
|
||||
* @date 2025/04/10 13:35
|
||||
* @Description: 施工信息表实体类
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("t_construction")
|
||||
@ApiModel(value="TConstructionEntity对象", description="施工信息表")
|
||||
public class TConstructionEntity extends AuditableEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 295094962841990277L;
|
||||
|
||||
@ApiModelProperty("施工id")
|
||||
@TableId(value = "construction_id", type = IdType.ASSIGN_ID)
|
||||
private String constructionId;
|
||||
|
||||
@ApiModelProperty("项目id")
|
||||
@TableField("project_id")
|
||||
private String projectId;
|
||||
|
||||
@ApiModelProperty("机组id")
|
||||
@TableField("turbine_code")
|
||||
private String turbineCode;
|
||||
|
||||
@ApiModelProperty("作业开始时间")
|
||||
@TableField("start_time")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@ApiModelProperty("作业结束时间")
|
||||
@TableField("end_time")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
@ApiModelProperty("温度(℃)")
|
||||
@TableField("temperature")
|
||||
private Double temperature;
|
||||
|
||||
@ApiModelProperty("风速(m/s)")
|
||||
@TableField("wind_speed")
|
||||
private Double windSpeed;
|
||||
|
||||
@ApiModelProperty("采集图片数量")
|
||||
@TableField("image_count")
|
||||
private Integer imageCount;
|
||||
|
||||
@ApiModelProperty("天气id")
|
||||
@TableField("weather_code")
|
||||
private String weatherCode;
|
||||
|
||||
@ApiModelProperty("施工状态")
|
||||
@TableField("status_id")
|
||||
private String statusId;
|
||||
|
||||
@ApiModelProperty("当前时间")
|
||||
@TableField("created_at")
|
||||
private LocalDateTime createdAt;
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package com.dite.znpt.domain.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.dite.znpt.domain.AuditableEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 14:39
|
||||
* @Description: 机组-项目关联表实体类
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("turbine")
|
||||
@ApiModel(value="TurbineEntity对象", description="机组-项目关联表")
|
||||
public class TurbineEntity extends AuditableEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -38088185643803512L;
|
||||
|
||||
@ApiModelProperty("机组号")
|
||||
@TableId(value = "turbine_code", type = IdType.ASSIGN_ID)
|
||||
private String turbineCode;
|
||||
|
||||
@ApiModelProperty("项目id")
|
||||
@TableField("project_id")
|
||||
private String projectId;
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package com.dite.znpt.domain.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.dite.znpt.domain.AuditableEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 14:39
|
||||
* @Description: 天气类型表实体类
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("weather_type")
|
||||
@ApiModel(value="WeatherTypeEntity对象", description="天气类型表")
|
||||
public class WeatherTypeEntity extends AuditableEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 736371527640486906L;
|
||||
|
||||
@ApiModelProperty("天气类型id")
|
||||
@TableId(value = "weather_code", type = IdType.ASSIGN_ID)
|
||||
private String weatherCode;
|
||||
|
||||
@ApiModelProperty("天气类型中文描述")
|
||||
@TableField("chinese_name")
|
||||
private String chineseName;
|
||||
|
||||
@ApiModelProperty("对施工进度的影响系数")
|
||||
@TableField("impact_factor")
|
||||
private Double impactFactor;
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
package com.dite.znpt.domain.page;
|
||||
|
||||
import cn.hutool.core.util.BooleanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 分页数据
|
||||
*
|
||||
* @author kyland
|
||||
*/
|
||||
@Data
|
||||
public class PageDomain {
|
||||
/**
|
||||
* 当前记录起始索引
|
||||
*/
|
||||
private Integer pageNum;
|
||||
|
||||
/**
|
||||
* 每页显示记录数
|
||||
*/
|
||||
private Integer pageSize;
|
||||
|
||||
/**
|
||||
* 排序列
|
||||
*/
|
||||
private String orderByColumn;
|
||||
|
||||
/**
|
||||
* 排序的方向desc或者asc
|
||||
*/
|
||||
private String isAsc = "asc";
|
||||
|
||||
/**
|
||||
* 分页参数合理化
|
||||
*/
|
||||
private Boolean reasonable = true;
|
||||
|
||||
public String getOrderBy() {
|
||||
if (StrUtil.isEmpty(orderByColumn)) {
|
||||
return "";
|
||||
}
|
||||
return StrUtil.toUnderlineCase(orderByColumn) + " " + isAsc;
|
||||
}
|
||||
|
||||
public void setIsAsc(String isAsc) {
|
||||
if (StrUtil.isNotEmpty(isAsc)) {
|
||||
// 兼容前端排序类型
|
||||
if ("ascending".equals(isAsc)) {
|
||||
isAsc = "asc";
|
||||
} else if ("descending".equals(isAsc)) {
|
||||
isAsc = "desc";
|
||||
}
|
||||
this.isAsc = isAsc;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean getReasonable() {
|
||||
return BooleanUtil.isTrue(reasonable)|| Objects.isNull(reasonable);
|
||||
}
|
||||
|
||||
public void setReasonable(Boolean reasonable) {
|
||||
this.reasonable = reasonable;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
package com.dite.znpt.domain.page;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import org.springframework.web.context.request.RequestAttributes;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 表格数据处理
|
||||
*
|
||||
* @author kyland
|
||||
*/
|
||||
public class TableSupport {
|
||||
/**
|
||||
* 当前记录起始索引
|
||||
*/
|
||||
public static final String PAGE_NUM = "pageNum";
|
||||
|
||||
/**
|
||||
* 每页显示记录数
|
||||
*/
|
||||
public static final String PAGE_SIZE = "pageSize";
|
||||
|
||||
/**
|
||||
* 排序列
|
||||
*/
|
||||
public static final String ORDER_BY_COLUMN = "orderByColumn";
|
||||
|
||||
/**
|
||||
* 排序的方向 "desc" 或者 "asc".
|
||||
*/
|
||||
public static final String IS_ASC = "isAsc";
|
||||
|
||||
/**
|
||||
* 分页参数合理化
|
||||
*/
|
||||
public static final String REASONABLE = "reasonable";
|
||||
|
||||
/**
|
||||
* 封装分页对象
|
||||
*/
|
||||
public static PageDomain getPageDomain() {
|
||||
PageDomain pageDomain = new PageDomain();
|
||||
pageDomain.setPageNum(Convert.toInt(getRequest().getParameter(PAGE_NUM), 1));
|
||||
pageDomain.setPageSize(Convert.toInt(getRequest().getParameter(PAGE_SIZE), 10));
|
||||
pageDomain.setOrderByColumn(getRequest().getParameter(ORDER_BY_COLUMN));
|
||||
pageDomain.setIsAsc(getRequest().getParameter(IS_ASC));
|
||||
pageDomain.setReasonable(Convert.toBool(getRequest().getParameter(REASONABLE)));
|
||||
return pageDomain;
|
||||
}
|
||||
|
||||
public static PageDomain buildPageRequest() {
|
||||
return getPageDomain();
|
||||
}
|
||||
|
||||
public static ServletRequestAttributes getRequestAttributes() {
|
||||
try {
|
||||
RequestAttributes attributes = RequestContextHolder.getRequestAttributes();
|
||||
return (ServletRequestAttributes)attributes;
|
||||
} catch (Exception var1) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static HttpServletRequest getRequest() {
|
||||
try {
|
||||
return getRequestAttributes().getRequest();
|
||||
} catch (Exception var1) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 14:39
|
||||
* @Description: 字典请求实体
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("字典列表请求实体")
|
||||
public class CombinedDictListReq implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 194796910937180049L;
|
||||
|
||||
@ApiModelProperty("查询关键字")
|
||||
private String keyword;
|
||||
|
||||
@ApiModelProperty("字典Id")
|
||||
private String dictId;
|
||||
|
||||
@ApiModelProperty("字典类型")
|
||||
private String dictType;
|
||||
|
||||
@ApiModelProperty("字典名称")
|
||||
private String dictName;
|
||||
|
||||
@ApiModelProperty("父级id")
|
||||
private Long parentId;
|
||||
|
||||
@ApiModelProperty("字典排序")
|
||||
private Integer sortOrder;
|
||||
|
||||
@ApiModelProperty("是否字典终值")
|
||||
private Integer finalState;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.dite.znpt.domain.entity.CombinedDictEntity;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 14:39
|
||||
* @Description: 字典响应实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("字典响应实体")
|
||||
public class CombinedDictResp extends CombinedDictEntity {
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 14:39
|
||||
* @Description: 缺陷记录请求实体
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("缺陷记录列表请求实体")
|
||||
public class DefectListReq implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 692832532969251285L;
|
||||
|
||||
@ApiModelProperty("查询关键字")
|
||||
private String keyword;
|
||||
|
||||
@ApiModelProperty("缺陷记录Id")
|
||||
private String defectId;
|
||||
|
||||
@ApiModelProperty("机组id")
|
||||
private String turbineCode;
|
||||
|
||||
@ApiModelProperty("叶片号")
|
||||
private String bladeCode;
|
||||
|
||||
@ApiModelProperty("损伤面,字典surface_type")
|
||||
private String surfaceType;
|
||||
|
||||
@ApiModelProperty("缺陷类型,字典defect_type")
|
||||
private String defectType;
|
||||
|
||||
@ApiModelProperty("危重等级,字典defect_level")
|
||||
private String defectLevel;
|
||||
|
||||
@ApiModelProperty("轴向长度(mm)")
|
||||
private BigDecimal axialLength;
|
||||
|
||||
@ApiModelProperty("弦向长度(mm)")
|
||||
private BigDecimal chordLength;
|
||||
|
||||
@ApiModelProperty("处理建议")
|
||||
private String imagePath;
|
||||
|
||||
@ApiModelProperty("图片详情")
|
||||
private String imageHash;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.dite.znpt.domain.entity.DefectEntity;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 14:39
|
||||
* @Description: 缺陷记录响应实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("缺陷记录响应实体")
|
||||
public class DefectResp extends DefectEntity {
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 14:39
|
||||
* @Description: 文件信息请求实体
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("文件信息列表请求实体")
|
||||
public class FileInfoListReq implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -78389740283645796L;
|
||||
|
||||
@ApiModelProperty("查询关键字")
|
||||
private String keyword;
|
||||
|
||||
@ApiModelProperty("文件信息Id")
|
||||
private Long fileId;
|
||||
|
||||
@ApiModelProperty("业务id")
|
||||
private String businessId;
|
||||
|
||||
@ApiModelProperty("minio相对路径")
|
||||
private String minioPath;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.dite.znpt.domain.entity.FileInfoEntity;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 14:39
|
||||
* @Description: 文件信息响应实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("文件信息响应实体")
|
||||
public class FileInfoResp extends FileInfoEntity {
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 14:39
|
||||
* @Description: 人员信息请求实体
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("人员信息列表请求实体")
|
||||
public class PersonnelListReq implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -82418737525015596L;
|
||||
|
||||
@ApiModelProperty("查询关键字")
|
||||
private String keyword;
|
||||
|
||||
@ApiModelProperty("人员信息Id")
|
||||
private String personId;
|
||||
|
||||
@ApiModelProperty("姓名")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("角色类型,字典role_type")
|
||||
private String roleType;
|
||||
|
||||
@ApiModelProperty("公司id")
|
||||
private String companyId;
|
||||
|
||||
@ApiModelProperty("密码")
|
||||
private String password;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.dite.znpt.domain.entity.PersonnelEntity;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 14:39
|
||||
* @Description: 人员信息响应实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("人员信息响应实体")
|
||||
public class PersonnelResp extends PersonnelEntity {
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 14:39
|
||||
* @Description: 项目-公司关联信息请求实体
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("项目-公司关联信息列表请求实体")
|
||||
public class ProjectCompanyListReq implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -62483123283940291L;
|
||||
|
||||
@ApiModelProperty("查询关键字")
|
||||
private String keyword;
|
||||
|
||||
@ApiModelProperty("项目-公司关联信息Id")
|
||||
private String projectId;
|
||||
|
||||
@ApiModelProperty("公司id")
|
||||
private String companyId;
|
||||
|
||||
@ApiModelProperty("关联类型")
|
||||
private String relationType;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.dite.znpt.domain.entity.ProjectCompanyEntity;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 14:39
|
||||
* @Description: 项目-公司关联信息响应实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("项目-公司关联信息响应实体")
|
||||
public class ProjectCompanyResp extends ProjectCompanyEntity {
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 14:39
|
||||
* @Description: 项目信息请求实体
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("项目信息列表请求实体")
|
||||
public class ProjectListReq implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -18175772339033037L;
|
||||
|
||||
@ApiModelProperty("查询关键字")
|
||||
private String keyword;
|
||||
|
||||
@ApiModelProperty("项目信息Id")
|
||||
private String projectId;
|
||||
|
||||
@ApiModelProperty("项目名称")
|
||||
private String projectName;
|
||||
|
||||
@ApiModelProperty("风场名称")
|
||||
private String farmName;
|
||||
|
||||
@ApiModelProperty("风场地址")
|
||||
private String farmAddress;
|
||||
|
||||
@ApiModelProperty("${column.comment}")
|
||||
private String clientId;
|
||||
|
||||
@ApiModelProperty("xx,字典xx")
|
||||
private String methodId;
|
||||
|
||||
@ApiModelProperty("项目规模")
|
||||
private String scale;
|
||||
|
||||
@ApiModelProperty("风机型号")
|
||||
private String turbineModel;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.dite.znpt.domain.entity.ProjectEntity;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 14:39
|
||||
* @Description: 项目信息响应实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("项目信息响应实体")
|
||||
public class ProjectResp extends ProjectEntity {
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 14:39
|
||||
* @Description: 公司信息请求实体
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("公司信息列表请求实体")
|
||||
public class TCompanyListReq implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 948606394919949641L;
|
||||
|
||||
@ApiModelProperty("查询关键字")
|
||||
private String keyword;
|
||||
|
||||
@ApiModelProperty("公司信息Id")
|
||||
private String companyId;
|
||||
|
||||
@ApiModelProperty("公司名称")
|
||||
private String companyName;
|
||||
|
||||
@ApiModelProperty("公司地址")
|
||||
private String address;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.dite.znpt.domain.entity.TCompanyEntity;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 14:39
|
||||
* @Description: 公司信息响应实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("公司信息响应实体")
|
||||
public class TCompanyResp extends TCompanyEntity {
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 14:39
|
||||
* @Description: 施工信息请求实体
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("施工信息列表请求实体")
|
||||
public class TConstructionListReq implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -21906313443453398L;
|
||||
|
||||
@ApiModelProperty("查询关键字")
|
||||
private String keyword;
|
||||
|
||||
@ApiModelProperty("施工信息Id")
|
||||
private String constructionId;
|
||||
|
||||
@ApiModelProperty("项目id")
|
||||
private String projectId;
|
||||
|
||||
@ApiModelProperty("机组id")
|
||||
private String turbineCode;
|
||||
|
||||
@ApiModelProperty("作业开始时间")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@ApiModelProperty("作业结束时间")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
@ApiModelProperty("温度(℃)")
|
||||
private Double temperature;
|
||||
|
||||
@ApiModelProperty("风速(m/s)")
|
||||
private Double windSpeed;
|
||||
|
||||
@ApiModelProperty("采集图片数量")
|
||||
private Integer imageCount;
|
||||
|
||||
@ApiModelProperty("天气id")
|
||||
private String weatherCode;
|
||||
|
||||
@ApiModelProperty("${column.comment}")
|
||||
private String statusId;
|
||||
|
||||
@ApiModelProperty("${column.comment}")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.dite.znpt.domain.entity.TConstructionEntity;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 14:39
|
||||
* @Description: 施工信息响应实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("施工信息响应实体")
|
||||
public class TConstructionResp extends TConstructionEntity {
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 14:39
|
||||
* @Description: 机组-项目关联请求实体
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("机组-项目关联列表请求实体")
|
||||
public class TurbineListReq implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -35973498612681953L;
|
||||
|
||||
@ApiModelProperty("查询关键字")
|
||||
private String keyword;
|
||||
|
||||
@ApiModelProperty("机组-项目关联Id")
|
||||
private String turbineCode;
|
||||
|
||||
@ApiModelProperty("项目id")
|
||||
private String projectId;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.dite.znpt.domain.entity.TurbineEntity;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 14:39
|
||||
* @Description: 机组-项目关联响应实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("机组-项目关联响应实体")
|
||||
public class TurbineResp extends TurbineEntity {
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 14:39
|
||||
* @Description: 天气类型请求实体
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("天气类型列表请求实体")
|
||||
public class WeatherTypeListReq implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 959320839630572326L;
|
||||
|
||||
@ApiModelProperty("查询关键字")
|
||||
private String keyword;
|
||||
|
||||
@ApiModelProperty("天气类型Id")
|
||||
private String weatherCode;
|
||||
|
||||
@ApiModelProperty("天气类型中文描述")
|
||||
private String chineseName;
|
||||
|
||||
@ApiModelProperty("对施工进度的影响系数")
|
||||
private Double impactFactor;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.dite.znpt.domain.entity.WeatherTypeEntity;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 14:39
|
||||
* @Description: 天气类型响应实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("天气类型响应实体")
|
||||
public class WeatherTypeResp extends WeatherTypeEntity {
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
package com.dite.znpt.exception;
|
||||
|
||||
import com.dite.znpt.domain.Constants;
|
||||
import com.dite.znpt.domain.Result;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.MethodArgumentNotValidException;
|
||||
import org.springframework.web.bind.annotation.ControllerAdvice;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @description: 全局异常处理
|
||||
*/
|
||||
@ControllerAdvice
|
||||
@RestController
|
||||
public class RestResponseEntityExceptionHandler {
|
||||
private static final Logger logger = LoggerFactory.getLogger(RestResponseEntityExceptionHandler.class);
|
||||
|
||||
@ExceptionHandler(Exception.class)
|
||||
public final Result<?> handler(Exception e) {
|
||||
logger.error("出现系统异常:{},异常类型:{},详细堆栈:", e.getMessage(), e.getClass(), e);
|
||||
return Result.warn(Constants.SYSTEM_EXCEPTION, Constants.SERVICE_EXCEPTION_MESSAGE);
|
||||
}
|
||||
|
||||
@ExceptionHandler(ServiceException.class)
|
||||
public final Result<?> handler(ServiceException e) {
|
||||
logger.error("出现服务异常:{},异常类型:{},详细堆栈:", e.getMessage(), e.getClass(), e);
|
||||
return Result.warn(Constants.SERVICE_EXCEPTION, e.getMessage());
|
||||
}
|
||||
|
||||
/**
|
||||
* @author wujinsong
|
||||
* @date 2021/10/9 1:28 下午
|
||||
* @description: 数据效验的异常处理
|
||||
* @Param [e]
|
||||
* @Return R
|
||||
*/
|
||||
@ExceptionHandler(value = MethodArgumentNotValidException.class)
|
||||
public Result<?> handleValidException(MethodArgumentNotValidException e) {
|
||||
logger.error("数据效验出现了异常:{},异常类型:{},详细堆栈:", e.getMessage(), e.getClass(), e);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
BindingResult bindingResult = e.getBindingResult();
|
||||
bindingResult.getFieldErrors().forEach((fieldError) -> {
|
||||
sb.append(fieldError.getField()).append(fieldError.getDefaultMessage()).append(";");
|
||||
});
|
||||
|
||||
return Result.warn(Constants.PARAMETER_EXCEPTION, sb.toString());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.dite.znpt.exception;
|
||||
|
||||
/**
|
||||
* @description: 服务异常
|
||||
*/
|
||||
public class ServiceException extends RuntimeException {
|
||||
private Integer code;
|
||||
|
||||
public ServiceException() {
|
||||
}
|
||||
|
||||
public ServiceException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.dite.znpt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.dite.znpt.domain.entity.CombinedDictEntity;
|
||||
import com.dite.znpt.domain.vo.CombinedDictListReq;
|
||||
import com.dite.znpt.domain.vo.CombinedDictResp;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
* @Description: 字典表数据库访问层
|
||||
*/
|
||||
public interface CombinedDictMapper extends BaseMapper<CombinedDictEntity> {
|
||||
List<CombinedDictResp> queryBySelective(CombinedDictListReq combinedDictReq);
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.dite.znpt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.dite.znpt.domain.entity.DefectEntity;
|
||||
import com.dite.znpt.domain.vo.DefectListReq;
|
||||
import com.dite.znpt.domain.vo.DefectResp;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
* @Description: 缺陷记录表数据库访问层
|
||||
*/
|
||||
public interface DefectMapper extends BaseMapper<DefectEntity> {
|
||||
List<DefectResp> queryBySelective(DefectListReq defectReq);
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.dite.znpt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.dite.znpt.domain.entity.FileInfoEntity;
|
||||
import com.dite.znpt.domain.vo.FileInfoListReq;
|
||||
import com.dite.znpt.domain.vo.FileInfoResp;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
* @Description: 文件信息表数据库访问层
|
||||
*/
|
||||
public interface FileInfoMapper extends BaseMapper<FileInfoEntity> {
|
||||
List<FileInfoResp> queryBySelective(FileInfoListReq fileInfoReq);
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.dite.znpt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.dite.znpt.domain.entity.PersonnelEntity;
|
||||
import com.dite.znpt.domain.vo.PersonnelListReq;
|
||||
import com.dite.znpt.domain.vo.PersonnelResp;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
* @Description: 人员信息表数据库访问层
|
||||
*/
|
||||
public interface PersonnelMapper extends BaseMapper<PersonnelEntity> {
|
||||
List<PersonnelResp> queryBySelective(PersonnelListReq personnelReq);
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.dite.znpt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.dite.znpt.domain.entity.ProjectCompanyEntity;
|
||||
import com.dite.znpt.domain.vo.ProjectCompanyListReq;
|
||||
import com.dite.znpt.domain.vo.ProjectCompanyResp;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
* @Description: 项目-公司关联信息表数据库访问层
|
||||
*/
|
||||
public interface ProjectCompanyMapper extends BaseMapper<ProjectCompanyEntity> {
|
||||
List<ProjectCompanyResp> queryBySelective(ProjectCompanyListReq projectCompanyReq);
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.dite.znpt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.dite.znpt.domain.entity.ProjectEntity;
|
||||
import com.dite.znpt.domain.vo.ProjectListReq;
|
||||
import com.dite.znpt.domain.vo.ProjectResp;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
* @Description: 项目信息表数据库访问层
|
||||
*/
|
||||
public interface ProjectMapper extends BaseMapper<ProjectEntity> {
|
||||
List<ProjectResp> queryBySelective(ProjectListReq projectReq);
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.dite.znpt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.dite.znpt.domain.entity.TCompanyEntity;
|
||||
import com.dite.znpt.domain.vo.TCompanyListReq;
|
||||
import com.dite.znpt.domain.vo.TCompanyResp;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
* @Description: 公司信息表数据库访问层
|
||||
*/
|
||||
public interface TCompanyMapper extends BaseMapper<TCompanyEntity> {
|
||||
List<TCompanyResp> queryBySelective(TCompanyListReq tCompanyReq);
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.dite.znpt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.dite.znpt.domain.entity.TConstructionEntity;
|
||||
import com.dite.znpt.domain.vo.TConstructionListReq;
|
||||
import com.dite.znpt.domain.vo.TConstructionResp;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
* @Description: 施工信息表数据库访问层
|
||||
*/
|
||||
public interface TConstructionMapper extends BaseMapper<TConstructionEntity> {
|
||||
List<TConstructionResp> queryBySelective(TConstructionListReq tConstructionReq);
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.dite.znpt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.dite.znpt.domain.entity.TurbineEntity;
|
||||
import com.dite.znpt.domain.vo.TurbineListReq;
|
||||
import com.dite.znpt.domain.vo.TurbineResp;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
* @Description: 机组-项目关联表数据库访问层
|
||||
*/
|
||||
public interface TurbineMapper extends BaseMapper<TurbineEntity> {
|
||||
List<TurbineResp> queryBySelective(TurbineListReq turbineReq);
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.dite.znpt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.dite.znpt.domain.entity.WeatherTypeEntity;
|
||||
import com.dite.znpt.domain.vo.WeatherTypeListReq;
|
||||
import com.dite.znpt.domain.vo.WeatherTypeResp;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
* @Description: 天气类型表数据库访问层
|
||||
*/
|
||||
public interface WeatherTypeMapper extends BaseMapper<WeatherTypeEntity> {
|
||||
List<WeatherTypeResp> queryBySelective(WeatherTypeListReq weatherTypeReq);
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package com.dite.znpt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dite.znpt.domain.entity.CombinedDictEntity;
|
||||
import com.dite.znpt.domain.vo.CombinedDictListReq;
|
||||
import com.dite.znpt.domain.vo.CombinedDictResp;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
* @Description: 字典表服务接口
|
||||
*/
|
||||
public interface CombinedDictService extends IService<CombinedDictEntity> {
|
||||
|
||||
/**
|
||||
* 功能描述:查询字典列表
|
||||
*
|
||||
* @param combinedDictReq 字典
|
||||
* @return {@link List }<{@link CombinedDictEntity }>
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
PageInfo<CombinedDictResp> selectList(CombinedDictListReq combinedDictReq);
|
||||
|
||||
/**
|
||||
* 功能描述:查询单条字典
|
||||
*
|
||||
* @param dictId 字典Id
|
||||
* @return {@link CombinedDictResp }
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
CombinedDictResp selectById(String dictId);
|
||||
|
||||
/**
|
||||
* 功能描述:新增字典
|
||||
*
|
||||
* @param combinedDict 字典
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
void saveData(CombinedDictEntity combinedDict);
|
||||
|
||||
/**
|
||||
* 功能描述:更新字典
|
||||
*
|
||||
* @param combinedDict 字典
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
void updateData(CombinedDictEntity combinedDict);
|
||||
|
||||
/**
|
||||
* 功能描述:删除字典
|
||||
*
|
||||
* @param dictId 字典Id
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
void deleteById(String dictId);
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package com.dite.znpt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dite.znpt.domain.entity.DefectEntity;
|
||||
import com.dite.znpt.domain.vo.DefectListReq;
|
||||
import com.dite.znpt.domain.vo.DefectResp;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
* @Description: 缺陷记录表服务接口
|
||||
*/
|
||||
public interface DefectService extends IService<DefectEntity> {
|
||||
|
||||
/**
|
||||
* 功能描述:查询缺陷记录列表
|
||||
*
|
||||
* @param defectReq 缺陷记录
|
||||
* @return {@link List }<{@link DefectEntity }>
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
PageInfo<DefectResp> selectList(DefectListReq defectReq);
|
||||
|
||||
/**
|
||||
* 功能描述:查询单条缺陷记录
|
||||
*
|
||||
* @param defectId 缺陷记录Id
|
||||
* @return {@link DefectResp }
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
DefectResp selectById(String defectId);
|
||||
|
||||
/**
|
||||
* 功能描述:新增缺陷记录
|
||||
*
|
||||
* @param defect 缺陷记录
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
void saveData(DefectEntity defect);
|
||||
|
||||
/**
|
||||
* 功能描述:更新缺陷记录
|
||||
*
|
||||
* @param defect 缺陷记录
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
void updateData(DefectEntity defect);
|
||||
|
||||
/**
|
||||
* 功能描述:删除缺陷记录
|
||||
*
|
||||
* @param defectId 缺陷记录Id
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
void deleteById(String defectId);
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package com.dite.znpt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dite.znpt.domain.entity.FileInfoEntity;
|
||||
import com.dite.znpt.domain.vo.FileInfoListReq;
|
||||
import com.dite.znpt.domain.vo.FileInfoResp;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
* @Description: 文件信息表服务接口
|
||||
*/
|
||||
public interface FileInfoService extends IService<FileInfoEntity> {
|
||||
|
||||
/**
|
||||
* 功能描述:查询文件信息列表
|
||||
*
|
||||
* @param fileInfoReq 文件信息
|
||||
* @return {@link List }<{@link FileInfoEntity }>
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
PageInfo<FileInfoResp> selectList(FileInfoListReq fileInfoReq);
|
||||
|
||||
/**
|
||||
* 功能描述:查询单条文件信息
|
||||
*
|
||||
* @param fileId 文件信息Id
|
||||
* @return {@link FileInfoResp }
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
FileInfoResp selectById(Long fileId);
|
||||
|
||||
/**
|
||||
* 功能描述:新增文件信息
|
||||
*
|
||||
* @param fileInfo 文件信息
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
void saveData(FileInfoEntity fileInfo);
|
||||
|
||||
/**
|
||||
* 功能描述:更新文件信息
|
||||
*
|
||||
* @param fileInfo 文件信息
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
void updateData(FileInfoEntity fileInfo);
|
||||
|
||||
/**
|
||||
* 功能描述:删除文件信息
|
||||
*
|
||||
* @param fileId 文件信息Id
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
void deleteById(Long fileId);
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package com.dite.znpt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dite.znpt.domain.entity.PersonnelEntity;
|
||||
import com.dite.znpt.domain.vo.PersonnelListReq;
|
||||
import com.dite.znpt.domain.vo.PersonnelResp;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
* @Description: 人员信息表服务接口
|
||||
*/
|
||||
public interface PersonnelService extends IService<PersonnelEntity> {
|
||||
|
||||
/**
|
||||
* 功能描述:查询人员信息列表
|
||||
*
|
||||
* @param personnelReq 人员信息
|
||||
* @return {@link List }<{@link PersonnelEntity }>
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
PageInfo<PersonnelResp> selectList(PersonnelListReq personnelReq);
|
||||
|
||||
/**
|
||||
* 功能描述:查询单条人员信息
|
||||
*
|
||||
* @param personId 人员信息Id
|
||||
* @return {@link PersonnelResp }
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
PersonnelResp selectById(String personId);
|
||||
|
||||
/**
|
||||
* 功能描述:新增人员信息
|
||||
*
|
||||
* @param personnel 人员信息
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
void saveData(PersonnelEntity personnel);
|
||||
|
||||
/**
|
||||
* 功能描述:更新人员信息
|
||||
*
|
||||
* @param personnel 人员信息
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
void updateData(PersonnelEntity personnel);
|
||||
|
||||
/**
|
||||
* 功能描述:删除人员信息
|
||||
*
|
||||
* @param personId 人员信息Id
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
void deleteById(String personId);
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package com.dite.znpt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dite.znpt.domain.entity.ProjectCompanyEntity;
|
||||
import com.dite.znpt.domain.vo.ProjectCompanyListReq;
|
||||
import com.dite.znpt.domain.vo.ProjectCompanyResp;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
* @Description: 项目-公司关联信息表服务接口
|
||||
*/
|
||||
public interface ProjectCompanyService extends IService<ProjectCompanyEntity> {
|
||||
|
||||
/**
|
||||
* 功能描述:查询项目-公司关联信息列表
|
||||
*
|
||||
* @param projectCompanyReq 项目-公司关联信息
|
||||
* @return {@link List }<{@link ProjectCompanyEntity }>
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
PageInfo<ProjectCompanyResp> selectList(ProjectCompanyListReq projectCompanyReq);
|
||||
|
||||
/**
|
||||
* 功能描述:查询单条项目-公司关联信息
|
||||
*
|
||||
* @param projectId 项目-公司关联信息Id
|
||||
* @return {@link ProjectCompanyResp }
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
ProjectCompanyResp selectById(String projectId);
|
||||
|
||||
/**
|
||||
* 功能描述:新增项目-公司关联信息
|
||||
*
|
||||
* @param projectCompany 项目-公司关联信息
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
void saveData(ProjectCompanyEntity projectCompany);
|
||||
|
||||
/**
|
||||
* 功能描述:更新项目-公司关联信息
|
||||
*
|
||||
* @param projectCompany 项目-公司关联信息
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
void updateData(ProjectCompanyEntity projectCompany);
|
||||
|
||||
/**
|
||||
* 功能描述:删除项目-公司关联信息
|
||||
*
|
||||
* @param projectId 项目-公司关联信息Id
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
void deleteById(String projectId);
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package com.dite.znpt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dite.znpt.domain.entity.ProjectEntity;
|
||||
import com.dite.znpt.domain.vo.ProjectListReq;
|
||||
import com.dite.znpt.domain.vo.ProjectResp;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
* @Description: 项目信息表服务接口
|
||||
*/
|
||||
public interface ProjectService extends IService<ProjectEntity> {
|
||||
|
||||
/**
|
||||
* 功能描述:查询项目信息列表
|
||||
*
|
||||
* @param projectReq 项目信息
|
||||
* @return {@link List }<{@link ProjectEntity }>
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
PageInfo<ProjectResp> selectList(ProjectListReq projectReq);
|
||||
|
||||
/**
|
||||
* 功能描述:查询单条项目信息
|
||||
*
|
||||
* @param projectId 项目信息Id
|
||||
* @return {@link ProjectResp }
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
ProjectResp selectById(String projectId);
|
||||
|
||||
/**
|
||||
* 功能描述:新增项目信息
|
||||
*
|
||||
* @param project 项目信息
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
void saveData(ProjectEntity project);
|
||||
|
||||
/**
|
||||
* 功能描述:更新项目信息
|
||||
*
|
||||
* @param project 项目信息
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
void updateData(ProjectEntity project);
|
||||
|
||||
/**
|
||||
* 功能描述:删除项目信息
|
||||
*
|
||||
* @param projectId 项目信息Id
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
void deleteById(String projectId);
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package com.dite.znpt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dite.znpt.domain.entity.TCompanyEntity;
|
||||
import com.dite.znpt.domain.vo.TCompanyListReq;
|
||||
import com.dite.znpt.domain.vo.TCompanyResp;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
* @Description: 公司信息表服务接口
|
||||
*/
|
||||
public interface TCompanyService extends IService<TCompanyEntity> {
|
||||
|
||||
/**
|
||||
* 功能描述:查询公司信息列表
|
||||
*
|
||||
* @param tCompanyReq 公司信息
|
||||
* @return {@link List }<{@link TCompanyEntity }>
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
PageInfo<TCompanyResp> selectList(TCompanyListReq tCompanyReq);
|
||||
|
||||
/**
|
||||
* 功能描述:查询单条公司信息
|
||||
*
|
||||
* @param companyId 公司信息Id
|
||||
* @return {@link TCompanyResp }
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
TCompanyResp selectById(String companyId);
|
||||
|
||||
/**
|
||||
* 功能描述:新增公司信息
|
||||
*
|
||||
* @param tCompany 公司信息
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
void saveData(TCompanyEntity tCompany);
|
||||
|
||||
/**
|
||||
* 功能描述:更新公司信息
|
||||
*
|
||||
* @param tCompany 公司信息
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
void updateData(TCompanyEntity tCompany);
|
||||
|
||||
/**
|
||||
* 功能描述:删除公司信息
|
||||
*
|
||||
* @param companyId 公司信息Id
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
void deleteById(String companyId);
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package com.dite.znpt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dite.znpt.domain.entity.TConstructionEntity;
|
||||
import com.dite.znpt.domain.vo.TConstructionListReq;
|
||||
import com.dite.znpt.domain.vo.TConstructionResp;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
* @Description: 施工信息表服务接口
|
||||
*/
|
||||
public interface TConstructionService extends IService<TConstructionEntity> {
|
||||
|
||||
/**
|
||||
* 功能描述:查询施工信息列表
|
||||
*
|
||||
* @param tConstructionReq 施工信息
|
||||
* @return {@link List }<{@link TConstructionEntity }>
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
PageInfo<TConstructionResp> selectList(TConstructionListReq tConstructionReq);
|
||||
|
||||
/**
|
||||
* 功能描述:查询单条施工信息
|
||||
*
|
||||
* @param constructionId 施工信息Id
|
||||
* @return {@link TConstructionResp }
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
TConstructionResp selectById(String constructionId);
|
||||
|
||||
/**
|
||||
* 功能描述:新增施工信息
|
||||
*
|
||||
* @param tConstruction 施工信息
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
void saveData(TConstructionEntity tConstruction);
|
||||
|
||||
/**
|
||||
* 功能描述:更新施工信息
|
||||
*
|
||||
* @param tConstruction 施工信息
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
void updateData(TConstructionEntity tConstruction);
|
||||
|
||||
/**
|
||||
* 功能描述:删除施工信息
|
||||
*
|
||||
* @param constructionId 施工信息Id
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
void deleteById(String constructionId);
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package com.dite.znpt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dite.znpt.domain.entity.TurbineEntity;
|
||||
import com.dite.znpt.domain.vo.TurbineListReq;
|
||||
import com.dite.znpt.domain.vo.TurbineResp;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
* @Description: 机组-项目关联表服务接口
|
||||
*/
|
||||
public interface TurbineService extends IService<TurbineEntity> {
|
||||
|
||||
/**
|
||||
* 功能描述:查询机组-项目关联列表
|
||||
*
|
||||
* @param turbineReq 机组-项目关联
|
||||
* @return {@link List }<{@link TurbineEntity }>
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
PageInfo<TurbineResp> selectList(TurbineListReq turbineReq);
|
||||
|
||||
/**
|
||||
* 功能描述:查询单条机组-项目关联
|
||||
*
|
||||
* @param turbineCode 机组-项目关联Id
|
||||
* @return {@link TurbineResp }
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
TurbineResp selectById(String turbineCode);
|
||||
|
||||
/**
|
||||
* 功能描述:新增机组-项目关联
|
||||
*
|
||||
* @param turbine 机组-项目关联
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
void saveData(TurbineEntity turbine);
|
||||
|
||||
/**
|
||||
* 功能描述:更新机组-项目关联
|
||||
*
|
||||
* @param turbine 机组-项目关联
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
void updateData(TurbineEntity turbine);
|
||||
|
||||
/**
|
||||
* 功能描述:删除机组-项目关联
|
||||
*
|
||||
* @param turbineCode 机组-项目关联Id
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
void deleteById(String turbineCode);
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package com.dite.znpt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dite.znpt.domain.entity.WeatherTypeEntity;
|
||||
import com.dite.znpt.domain.vo.WeatherTypeListReq;
|
||||
import com.dite.znpt.domain.vo.WeatherTypeResp;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
* @Description: 天气类型表服务接口
|
||||
*/
|
||||
public interface WeatherTypeService extends IService<WeatherTypeEntity> {
|
||||
|
||||
/**
|
||||
* 功能描述:查询天气类型列表
|
||||
*
|
||||
* @param weatherTypeReq 天气类型
|
||||
* @return {@link List }<{@link WeatherTypeEntity }>
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
PageInfo<WeatherTypeResp> selectList(WeatherTypeListReq weatherTypeReq);
|
||||
|
||||
/**
|
||||
* 功能描述:查询单条天气类型
|
||||
*
|
||||
* @param weatherCode 天气类型Id
|
||||
* @return {@link WeatherTypeResp }
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
WeatherTypeResp selectById(String weatherCode);
|
||||
|
||||
/**
|
||||
* 功能描述:新增天气类型
|
||||
*
|
||||
* @param weatherType 天气类型
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
void saveData(WeatherTypeEntity weatherType);
|
||||
|
||||
/**
|
||||
* 功能描述:更新天气类型
|
||||
*
|
||||
* @param weatherType 天气类型
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
void updateData(WeatherTypeEntity weatherType);
|
||||
|
||||
/**
|
||||
* 功能描述:删除天气类型
|
||||
*
|
||||
* @param weatherCode 天气类型Id
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
void deleteById(String weatherCode);
|
||||
}
|
||||
|
|
@ -0,0 +1,100 @@
|
|||
package com.dite.znpt.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.dite.znpt.domain.entity.CombinedDictEntity;
|
||||
import com.dite.znpt.domain.vo.CombinedDictListReq;
|
||||
import com.dite.znpt.domain.vo.CombinedDictResp;
|
||||
import com.dite.znpt.service.CombinedDictService;
|
||||
import com.dite.znpt.mapper.CombinedDictMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import com.dite.znpt.util.PageUtil;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
* @Description: 字典表服务实现类
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class CombinedDictServiceImpl extends ServiceImpl<CombinedDictMapper, CombinedDictEntity> implements CombinedDictService {
|
||||
|
||||
/**
|
||||
* 功能描述:查询字典列表
|
||||
*
|
||||
* @param combinedDictReq 字典信息
|
||||
* @return {@link PageInfo }<{@link CombinedDictResp }>
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public PageInfo<CombinedDictResp> selectList(CombinedDictListReq combinedDictReq) {
|
||||
PageUtil.startPage();
|
||||
List<CombinedDictResp> combinedDictList= this.baseMapper.queryBySelective(combinedDictReq);
|
||||
combinedDictList.forEach(resp -> {
|
||||
|
||||
});
|
||||
return new PageInfo<>(combinedDictList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:查询单条字典
|
||||
*
|
||||
* @param dictId 字典Id
|
||||
* @return {@link CombinedDictResp }
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public CombinedDictResp selectById(String dictId) {
|
||||
CombinedDictListReq combinedDictReq = new CombinedDictListReq();
|
||||
combinedDictReq.setDictId(dictId);
|
||||
|
||||
PageInfo<CombinedDictResp> page = selectList(combinedDictReq);
|
||||
return page.hasContent() ? CollUtil.getFirst(page.getList()) : new CombinedDictResp();
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:新增字典
|
||||
*
|
||||
* @param combinedDict 字典
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public void saveData(CombinedDictEntity combinedDict) {
|
||||
// todo 校验
|
||||
save(combinedDict);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:更新字典
|
||||
*
|
||||
* @param combinedDict 字典
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public void updateData(CombinedDictEntity combinedDict) {
|
||||
// todo 校验
|
||||
updateById(combinedDict);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:删除字典
|
||||
*
|
||||
* @param dictId 字典Id
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public void deleteById(String dictId) {
|
||||
// todo 校验
|
||||
removeById(dictId);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,100 @@
|
|||
package com.dite.znpt.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.dite.znpt.domain.entity.DefectEntity;
|
||||
import com.dite.znpt.domain.vo.DefectListReq;
|
||||
import com.dite.znpt.domain.vo.DefectResp;
|
||||
import com.dite.znpt.service.DefectService;
|
||||
import com.dite.znpt.mapper.DefectMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import com.dite.znpt.util.PageUtil;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
* @Description: 缺陷记录表服务实现类
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class DefectServiceImpl extends ServiceImpl<DefectMapper, DefectEntity> implements DefectService {
|
||||
|
||||
/**
|
||||
* 功能描述:查询缺陷记录列表
|
||||
*
|
||||
* @param defectReq 缺陷记录信息
|
||||
* @return {@link PageInfo }<{@link DefectResp }>
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public PageInfo<DefectResp> selectList(DefectListReq defectReq) {
|
||||
PageUtil.startPage();
|
||||
List<DefectResp> defectList= this.baseMapper.queryBySelective(defectReq);
|
||||
defectList.forEach(resp -> {
|
||||
|
||||
});
|
||||
return new PageInfo<>(defectList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:查询单条缺陷记录
|
||||
*
|
||||
* @param defectId 缺陷记录Id
|
||||
* @return {@link DefectResp }
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public DefectResp selectById(String defectId) {
|
||||
DefectListReq defectReq = new DefectListReq();
|
||||
defectReq.setDefectId(defectId);
|
||||
|
||||
PageInfo<DefectResp> page = selectList(defectReq);
|
||||
return page.hasContent() ? CollUtil.getFirst(page.getList()) : new DefectResp();
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:新增缺陷记录
|
||||
*
|
||||
* @param defect 缺陷记录
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public void saveData(DefectEntity defect) {
|
||||
// todo 校验
|
||||
save(defect);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:更新缺陷记录
|
||||
*
|
||||
* @param defect 缺陷记录
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public void updateData(DefectEntity defect) {
|
||||
// todo 校验
|
||||
updateById(defect);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:删除缺陷记录
|
||||
*
|
||||
* @param defectId 缺陷记录Id
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public void deleteById(String defectId) {
|
||||
// todo 校验
|
||||
removeById(defectId);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,100 @@
|
|||
package com.dite.znpt.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.dite.znpt.domain.entity.FileInfoEntity;
|
||||
import com.dite.znpt.domain.vo.FileInfoListReq;
|
||||
import com.dite.znpt.domain.vo.FileInfoResp;
|
||||
import com.dite.znpt.service.FileInfoService;
|
||||
import com.dite.znpt.mapper.FileInfoMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import com.dite.znpt.util.PageUtil;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
* @Description: 文件信息表服务实现类
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class FileInfoServiceImpl extends ServiceImpl<FileInfoMapper, FileInfoEntity> implements FileInfoService {
|
||||
|
||||
/**
|
||||
* 功能描述:查询文件信息列表
|
||||
*
|
||||
* @param fileInfoReq 文件信息信息
|
||||
* @return {@link PageInfo }<{@link FileInfoResp }>
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public PageInfo<FileInfoResp> selectList(FileInfoListReq fileInfoReq) {
|
||||
PageUtil.startPage();
|
||||
List<FileInfoResp> fileInfoList= this.baseMapper.queryBySelective(fileInfoReq);
|
||||
fileInfoList.forEach(resp -> {
|
||||
|
||||
});
|
||||
return new PageInfo<>(fileInfoList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:查询单条文件信息
|
||||
*
|
||||
* @param fileId 文件信息Id
|
||||
* @return {@link FileInfoResp }
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public FileInfoResp selectById(Long fileId) {
|
||||
FileInfoListReq fileInfoReq = new FileInfoListReq();
|
||||
fileInfoReq.setFileId(fileId);
|
||||
|
||||
PageInfo<FileInfoResp> page = selectList(fileInfoReq);
|
||||
return page.hasContent() ? CollUtil.getFirst(page.getList()) : new FileInfoResp();
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:新增文件信息
|
||||
*
|
||||
* @param fileInfo 文件信息
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public void saveData(FileInfoEntity fileInfo) {
|
||||
// todo 校验
|
||||
save(fileInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:更新文件信息
|
||||
*
|
||||
* @param fileInfo 文件信息
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public void updateData(FileInfoEntity fileInfo) {
|
||||
// todo 校验
|
||||
updateById(fileInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:删除文件信息
|
||||
*
|
||||
* @param fileId 文件信息Id
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public void deleteById(Long fileId) {
|
||||
// todo 校验
|
||||
removeById(fileId);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,100 @@
|
|||
package com.dite.znpt.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.dite.znpt.domain.entity.PersonnelEntity;
|
||||
import com.dite.znpt.domain.vo.PersonnelListReq;
|
||||
import com.dite.znpt.domain.vo.PersonnelResp;
|
||||
import com.dite.znpt.service.PersonnelService;
|
||||
import com.dite.znpt.mapper.PersonnelMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import com.dite.znpt.util.PageUtil;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
* @Description: 人员信息表服务实现类
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class PersonnelServiceImpl extends ServiceImpl<PersonnelMapper, PersonnelEntity> implements PersonnelService {
|
||||
|
||||
/**
|
||||
* 功能描述:查询人员信息列表
|
||||
*
|
||||
* @param personnelReq 人员信息信息
|
||||
* @return {@link PageInfo }<{@link PersonnelResp }>
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public PageInfo<PersonnelResp> selectList(PersonnelListReq personnelReq) {
|
||||
PageUtil.startPage();
|
||||
List<PersonnelResp> personnelList= this.baseMapper.queryBySelective(personnelReq);
|
||||
personnelList.forEach(resp -> {
|
||||
|
||||
});
|
||||
return new PageInfo<>(personnelList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:查询单条人员信息
|
||||
*
|
||||
* @param personId 人员信息Id
|
||||
* @return {@link PersonnelResp }
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public PersonnelResp selectById(String personId) {
|
||||
PersonnelListReq personnelReq = new PersonnelListReq();
|
||||
personnelReq.setPersonId(personId);
|
||||
|
||||
PageInfo<PersonnelResp> page = selectList(personnelReq);
|
||||
return page.hasContent() ? CollUtil.getFirst(page.getList()) : new PersonnelResp();
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:新增人员信息
|
||||
*
|
||||
* @param personnel 人员信息
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public void saveData(PersonnelEntity personnel) {
|
||||
// todo 校验
|
||||
save(personnel);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:更新人员信息
|
||||
*
|
||||
* @param personnel 人员信息
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public void updateData(PersonnelEntity personnel) {
|
||||
// todo 校验
|
||||
updateById(personnel);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:删除人员信息
|
||||
*
|
||||
* @param personId 人员信息Id
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public void deleteById(String personId) {
|
||||
// todo 校验
|
||||
removeById(personId);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,100 @@
|
|||
package com.dite.znpt.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.dite.znpt.domain.entity.ProjectCompanyEntity;
|
||||
import com.dite.znpt.domain.vo.ProjectCompanyListReq;
|
||||
import com.dite.znpt.domain.vo.ProjectCompanyResp;
|
||||
import com.dite.znpt.service.ProjectCompanyService;
|
||||
import com.dite.znpt.mapper.ProjectCompanyMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import com.dite.znpt.util.PageUtil;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
* @Description: 项目-公司关联信息表服务实现类
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class ProjectCompanyServiceImpl extends ServiceImpl<ProjectCompanyMapper, ProjectCompanyEntity> implements ProjectCompanyService {
|
||||
|
||||
/**
|
||||
* 功能描述:查询项目-公司关联信息列表
|
||||
*
|
||||
* @param projectCompanyReq 项目-公司关联信息信息
|
||||
* @return {@link PageInfo }<{@link ProjectCompanyResp }>
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public PageInfo<ProjectCompanyResp> selectList(ProjectCompanyListReq projectCompanyReq) {
|
||||
PageUtil.startPage();
|
||||
List<ProjectCompanyResp> projectCompanyList= this.baseMapper.queryBySelective(projectCompanyReq);
|
||||
projectCompanyList.forEach(resp -> {
|
||||
|
||||
});
|
||||
return new PageInfo<>(projectCompanyList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:查询单条项目-公司关联信息
|
||||
*
|
||||
* @param projectId 项目-公司关联信息Id
|
||||
* @return {@link ProjectCompanyResp }
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public ProjectCompanyResp selectById(String projectId) {
|
||||
ProjectCompanyListReq projectCompanyReq = new ProjectCompanyListReq();
|
||||
projectCompanyReq.setProjectId(projectId);
|
||||
|
||||
PageInfo<ProjectCompanyResp> page = selectList(projectCompanyReq);
|
||||
return page.hasContent() ? CollUtil.getFirst(page.getList()) : new ProjectCompanyResp();
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:新增项目-公司关联信息
|
||||
*
|
||||
* @param projectCompany 项目-公司关联信息
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public void saveData(ProjectCompanyEntity projectCompany) {
|
||||
// todo 校验
|
||||
save(projectCompany);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:更新项目-公司关联信息
|
||||
*
|
||||
* @param projectCompany 项目-公司关联信息
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public void updateData(ProjectCompanyEntity projectCompany) {
|
||||
// todo 校验
|
||||
updateById(projectCompany);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:删除项目-公司关联信息
|
||||
*
|
||||
* @param projectId 项目-公司关联信息Id
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public void deleteById(String projectId) {
|
||||
// todo 校验
|
||||
removeById(projectId);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,100 @@
|
|||
package com.dite.znpt.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.dite.znpt.domain.entity.ProjectEntity;
|
||||
import com.dite.znpt.domain.vo.ProjectListReq;
|
||||
import com.dite.znpt.domain.vo.ProjectResp;
|
||||
import com.dite.znpt.service.ProjectService;
|
||||
import com.dite.znpt.mapper.ProjectMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import com.dite.znpt.util.PageUtil;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
* @Description: 项目信息表服务实现类
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, ProjectEntity> implements ProjectService {
|
||||
|
||||
/**
|
||||
* 功能描述:查询项目信息列表
|
||||
*
|
||||
* @param projectReq 项目信息信息
|
||||
* @return {@link PageInfo }<{@link ProjectResp }>
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public PageInfo<ProjectResp> selectList(ProjectListReq projectReq) {
|
||||
PageUtil.startPage();
|
||||
List<ProjectResp> projectList= this.baseMapper.queryBySelective(projectReq);
|
||||
projectList.forEach(resp -> {
|
||||
|
||||
});
|
||||
return new PageInfo<>(projectList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:查询单条项目信息
|
||||
*
|
||||
* @param projectId 项目信息Id
|
||||
* @return {@link ProjectResp }
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public ProjectResp selectById(String projectId) {
|
||||
ProjectListReq projectReq = new ProjectListReq();
|
||||
projectReq.setProjectId(projectId);
|
||||
|
||||
PageInfo<ProjectResp> page = selectList(projectReq);
|
||||
return page.hasContent() ? CollUtil.getFirst(page.getList()) : new ProjectResp();
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:新增项目信息
|
||||
*
|
||||
* @param project 项目信息
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public void saveData(ProjectEntity project) {
|
||||
// todo 校验
|
||||
save(project);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:更新项目信息
|
||||
*
|
||||
* @param project 项目信息
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public void updateData(ProjectEntity project) {
|
||||
// todo 校验
|
||||
updateById(project);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:删除项目信息
|
||||
*
|
||||
* @param projectId 项目信息Id
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public void deleteById(String projectId) {
|
||||
// todo 校验
|
||||
removeById(projectId);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,100 @@
|
|||
package com.dite.znpt.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.dite.znpt.domain.entity.TCompanyEntity;
|
||||
import com.dite.znpt.domain.vo.TCompanyListReq;
|
||||
import com.dite.znpt.domain.vo.TCompanyResp;
|
||||
import com.dite.znpt.service.TCompanyService;
|
||||
import com.dite.znpt.mapper.TCompanyMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import com.dite.znpt.util.PageUtil;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
* @Description: 公司信息表服务实现类
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class TCompanyServiceImpl extends ServiceImpl<TCompanyMapper, TCompanyEntity> implements TCompanyService {
|
||||
|
||||
/**
|
||||
* 功能描述:查询公司信息列表
|
||||
*
|
||||
* @param tCompanyReq 公司信息信息
|
||||
* @return {@link PageInfo }<{@link TCompanyResp }>
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public PageInfo<TCompanyResp> selectList(TCompanyListReq tCompanyReq) {
|
||||
PageUtil.startPage();
|
||||
List<TCompanyResp> tCompanyList= this.baseMapper.queryBySelective(tCompanyReq);
|
||||
tCompanyList.forEach(resp -> {
|
||||
|
||||
});
|
||||
return new PageInfo<>(tCompanyList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:查询单条公司信息
|
||||
*
|
||||
* @param companyId 公司信息Id
|
||||
* @return {@link TCompanyResp }
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public TCompanyResp selectById(String companyId) {
|
||||
TCompanyListReq tCompanyReq = new TCompanyListReq();
|
||||
tCompanyReq.setCompanyId(companyId);
|
||||
|
||||
PageInfo<TCompanyResp> page = selectList(tCompanyReq);
|
||||
return page.hasContent() ? CollUtil.getFirst(page.getList()) : new TCompanyResp();
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:新增公司信息
|
||||
*
|
||||
* @param tCompany 公司信息
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public void saveData(TCompanyEntity tCompany) {
|
||||
// todo 校验
|
||||
save(tCompany);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:更新公司信息
|
||||
*
|
||||
* @param tCompany 公司信息
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public void updateData(TCompanyEntity tCompany) {
|
||||
// todo 校验
|
||||
updateById(tCompany);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:删除公司信息
|
||||
*
|
||||
* @param companyId 公司信息Id
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public void deleteById(String companyId) {
|
||||
// todo 校验
|
||||
removeById(companyId);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,100 @@
|
|||
package com.dite.znpt.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.dite.znpt.domain.entity.TConstructionEntity;
|
||||
import com.dite.znpt.domain.vo.TConstructionListReq;
|
||||
import com.dite.znpt.domain.vo.TConstructionResp;
|
||||
import com.dite.znpt.service.TConstructionService;
|
||||
import com.dite.znpt.mapper.TConstructionMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import com.dite.znpt.util.PageUtil;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
* @Description: 施工信息表服务实现类
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class TConstructionServiceImpl extends ServiceImpl<TConstructionMapper, TConstructionEntity> implements TConstructionService {
|
||||
|
||||
/**
|
||||
* 功能描述:查询施工信息列表
|
||||
*
|
||||
* @param tConstructionReq 施工信息信息
|
||||
* @return {@link PageInfo }<{@link TConstructionResp }>
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public PageInfo<TConstructionResp> selectList(TConstructionListReq tConstructionReq) {
|
||||
PageUtil.startPage();
|
||||
List<TConstructionResp> tConstructionList= this.baseMapper.queryBySelective(tConstructionReq);
|
||||
tConstructionList.forEach(resp -> {
|
||||
|
||||
});
|
||||
return new PageInfo<>(tConstructionList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:查询单条施工信息
|
||||
*
|
||||
* @param constructionId 施工信息Id
|
||||
* @return {@link TConstructionResp }
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public TConstructionResp selectById(String constructionId) {
|
||||
TConstructionListReq tConstructionReq = new TConstructionListReq();
|
||||
tConstructionReq.setConstructionId(constructionId);
|
||||
|
||||
PageInfo<TConstructionResp> page = selectList(tConstructionReq);
|
||||
return page.hasContent() ? CollUtil.getFirst(page.getList()) : new TConstructionResp();
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:新增施工信息
|
||||
*
|
||||
* @param tConstruction 施工信息
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public void saveData(TConstructionEntity tConstruction) {
|
||||
// todo 校验
|
||||
save(tConstruction);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:更新施工信息
|
||||
*
|
||||
* @param tConstruction 施工信息
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public void updateData(TConstructionEntity tConstruction) {
|
||||
// todo 校验
|
||||
updateById(tConstruction);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:删除施工信息
|
||||
*
|
||||
* @param constructionId 施工信息Id
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public void deleteById(String constructionId) {
|
||||
// todo 校验
|
||||
removeById(constructionId);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,100 @@
|
|||
package com.dite.znpt.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.dite.znpt.domain.entity.TurbineEntity;
|
||||
import com.dite.znpt.domain.vo.TurbineListReq;
|
||||
import com.dite.znpt.domain.vo.TurbineResp;
|
||||
import com.dite.znpt.service.TurbineService;
|
||||
import com.dite.znpt.mapper.TurbineMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import com.dite.znpt.util.PageUtil;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
* @Description: 机组-项目关联表服务实现类
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class TurbineServiceImpl extends ServiceImpl<TurbineMapper, TurbineEntity> implements TurbineService {
|
||||
|
||||
/**
|
||||
* 功能描述:查询机组-项目关联列表
|
||||
*
|
||||
* @param turbineReq 机组-项目关联信息
|
||||
* @return {@link PageInfo }<{@link TurbineResp }>
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public PageInfo<TurbineResp> selectList(TurbineListReq turbineReq) {
|
||||
PageUtil.startPage();
|
||||
List<TurbineResp> turbineList= this.baseMapper.queryBySelective(turbineReq);
|
||||
turbineList.forEach(resp -> {
|
||||
|
||||
});
|
||||
return new PageInfo<>(turbineList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:查询单条机组-项目关联
|
||||
*
|
||||
* @param turbineCode 机组-项目关联Id
|
||||
* @return {@link TurbineResp }
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public TurbineResp selectById(String turbineCode) {
|
||||
TurbineListReq turbineReq = new TurbineListReq();
|
||||
turbineReq.setTurbineCode(turbineCode);
|
||||
|
||||
PageInfo<TurbineResp> page = selectList(turbineReq);
|
||||
return page.hasContent() ? CollUtil.getFirst(page.getList()) : new TurbineResp();
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:新增机组-项目关联
|
||||
*
|
||||
* @param turbine 机组-项目关联
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public void saveData(TurbineEntity turbine) {
|
||||
// todo 校验
|
||||
save(turbine);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:更新机组-项目关联
|
||||
*
|
||||
* @param turbine 机组-项目关联
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public void updateData(TurbineEntity turbine) {
|
||||
// todo 校验
|
||||
updateById(turbine);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:删除机组-项目关联
|
||||
*
|
||||
* @param turbineCode 机组-项目关联Id
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public void deleteById(String turbineCode) {
|
||||
// todo 校验
|
||||
removeById(turbineCode);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,100 @@
|
|||
package com.dite.znpt.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.dite.znpt.domain.entity.WeatherTypeEntity;
|
||||
import com.dite.znpt.domain.vo.WeatherTypeListReq;
|
||||
import com.dite.znpt.domain.vo.WeatherTypeResp;
|
||||
import com.dite.znpt.service.WeatherTypeService;
|
||||
import com.dite.znpt.mapper.WeatherTypeMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import com.dite.znpt.util.PageUtil;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
* @Description: 天气类型表服务实现类
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class WeatherTypeServiceImpl extends ServiceImpl<WeatherTypeMapper, WeatherTypeEntity> implements WeatherTypeService {
|
||||
|
||||
/**
|
||||
* 功能描述:查询天气类型列表
|
||||
*
|
||||
* @param weatherTypeReq 天气类型信息
|
||||
* @return {@link PageInfo }<{@link WeatherTypeResp }>
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public PageInfo<WeatherTypeResp> selectList(WeatherTypeListReq weatherTypeReq) {
|
||||
PageUtil.startPage();
|
||||
List<WeatherTypeResp> weatherTypeList= this.baseMapper.queryBySelective(weatherTypeReq);
|
||||
weatherTypeList.forEach(resp -> {
|
||||
|
||||
});
|
||||
return new PageInfo<>(weatherTypeList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:查询单条天气类型
|
||||
*
|
||||
* @param weatherCode 天气类型Id
|
||||
* @return {@link WeatherTypeResp }
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public WeatherTypeResp selectById(String weatherCode) {
|
||||
WeatherTypeListReq weatherTypeReq = new WeatherTypeListReq();
|
||||
weatherTypeReq.setWeatherCode(weatherCode);
|
||||
|
||||
PageInfo<WeatherTypeResp> page = selectList(weatherTypeReq);
|
||||
return page.hasContent() ? CollUtil.getFirst(page.getList()) : new WeatherTypeResp();
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:新增天气类型
|
||||
*
|
||||
* @param weatherType 天气类型
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public void saveData(WeatherTypeEntity weatherType) {
|
||||
// todo 校验
|
||||
save(weatherType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:更新天气类型
|
||||
*
|
||||
* @param weatherType 天气类型
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public void updateData(WeatherTypeEntity weatherType) {
|
||||
// todo 校验
|
||||
updateById(weatherType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:删除天气类型
|
||||
*
|
||||
* @param weatherCode 天气类型Id
|
||||
* @author huise23
|
||||
* @date 2025/04/09 11:48
|
||||
**/
|
||||
@Override
|
||||
public void deleteById(String weatherCode) {
|
||||
// todo 校验
|
||||
removeById(weatherCode);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.dite.znpt.util;
|
||||
|
||||
import com.dite.znpt.domain.page.PageDomain;
|
||||
import com.dite.znpt.domain.page.TableSupport;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
|
||||
/**
|
||||
* @author cuizhibin
|
||||
*/
|
||||
public class PageUtil extends PageHelper {
|
||||
|
||||
public static void startPage() {
|
||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||
Integer pageNum = pageDomain.getPageNum();
|
||||
Integer pageSize = pageDomain.getPageSize();
|
||||
String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
|
||||
Boolean reasonable = pageDomain.getReasonable();
|
||||
PageHelper.startPage(pageNum, pageSize, orderBy).setReasonable(reasonable);
|
||||
}
|
||||
|
||||
public static void clearPage() {
|
||||
PageHelper.clearPage();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.dite.znpt.util;
|
||||
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
|
||||
public class PasswordUtil {
|
||||
private static final PasswordEncoder encoder = new BCryptPasswordEncoder();
|
||||
|
||||
public static String encrypt(String rawPassword) {
|
||||
return encoder.encode(rawPassword);
|
||||
}
|
||||
|
||||
public static boolean matches(String rawPassword, String encodedPassword) {
|
||||
return encoder.matches(rawPassword, encodedPassword);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package com.dite.znpt.util;
|
||||
|
||||
import cn.hutool.core.exceptions.UtilException;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
public class SqlUtil {
|
||||
public static String SQL_REGEX = "select |insert |delete |update |drop |count |exec |chr |mid |master |truncate |char |and |declare ";
|
||||
public static String SQL_PATTERN = "[a-zA-Z0-9_ ,.]+";
|
||||
|
||||
public static String escapeOrderBySql(String value) {
|
||||
if (StringUtils.isNotEmpty(value) && !isValidOrderBySql(value)) {
|
||||
throw new UtilException("参数不符合规范,不能进行查询");
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isValidOrderBySql(String value) {
|
||||
return value.matches(SQL_PATTERN);
|
||||
}
|
||||
|
||||
public static void filterKeyword(String value) {
|
||||
if (!StringUtils.isEmpty(value)) {
|
||||
String[] sqlKeywords = StringUtils.split(SQL_REGEX, "\\|");
|
||||
int var3 = sqlKeywords.length;
|
||||
|
||||
for(int var4 = 0; var4 < var3; ++var4) {
|
||||
String sqlKeyword = sqlKeywords[var4];
|
||||
if (StringUtils.indexOfIgnoreCase(value, sqlKeyword) > -1) {
|
||||
throw new UtilException("参数存在SQL注入风险");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,89 @@
|
|||
# 开发环境配置
|
||||
server:
|
||||
# 服务器的HTTP端口,默认为8080
|
||||
port: 8080
|
||||
|
||||
# 数据源配置
|
||||
spring:
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://39.99.201.243:3306/test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: h67&E98HS8^6
|
||||
druid:
|
||||
# 初始连接数
|
||||
initialSize: 5
|
||||
# 最小连接池数量
|
||||
minIdle: 10
|
||||
# 最大连接池数量
|
||||
maxActive: 50
|
||||
# 配置获取连接等待超时的时间
|
||||
maxWait: 60000
|
||||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||
timeBetweenEvictionRunsMillis: 60000
|
||||
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||
minEvictableIdleTimeMillis: 300000
|
||||
# 配置一个连接在池中最大生存的时间,单位是毫秒
|
||||
maxEvictableIdleTimeMillis: 900000
|
||||
# 配置检测连接是否有效
|
||||
validationQuery: SELECT 1 FROM DUAL
|
||||
testWhileIdle: true
|
||||
testOnBorrow: false
|
||||
testOnReturn: false
|
||||
webStatFilter:
|
||||
enabled: true
|
||||
statViewServlet:
|
||||
enabled: true
|
||||
# 设置白名单,不填则允许所有访问
|
||||
allow:
|
||||
url-pattern: /druid/*
|
||||
# 控制台管理用户名和密码
|
||||
login-username: iotplatform
|
||||
login-password: 123456
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
# 慢SQL记录
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 1000
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
# redis 配置
|
||||
# redis:
|
||||
# # 地址
|
||||
# host: 10.20.32.11
|
||||
# # 端口,默认为6379
|
||||
# port: 1179
|
||||
# # 数据库索引
|
||||
# database: 3
|
||||
# # 密码
|
||||
# password: 123456
|
||||
# # 连接超时时间
|
||||
# timeout: 10s
|
||||
# lettuce:
|
||||
# pool:
|
||||
# # 连接池中的最小空闲连接
|
||||
# min-idle: 0
|
||||
# # 连接池中的最大空闲连接
|
||||
# max-idle: 8
|
||||
# # 连接池的最大数据库连接数
|
||||
# max-active: 8
|
||||
# # #连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
# max-wait: -1ms
|
||||
#
|
||||
## MINIO配置
|
||||
#minio:
|
||||
# url: http://10.20.32.11:9000
|
||||
# accessKey: minio
|
||||
# secretKey: minio@321
|
||||
# private:
|
||||
# bucket: pri
|
||||
# domain:
|
||||
# prefix: /minio-pri/
|
||||
# public:
|
||||
# bucket: pub
|
||||
# domain:
|
||||
# prefix: /minio/
|
|
@ -0,0 +1,20 @@
|
|||
# Spring配置
|
||||
spring:
|
||||
# 资源信息
|
||||
messages:
|
||||
# 国际化资源文件路径
|
||||
basename: i18n/messages
|
||||
profiles:
|
||||
active: dev
|
||||
# 文件上传
|
||||
servlet:
|
||||
multipart:
|
||||
# 单个文件大小
|
||||
max-file-size: 100MB
|
||||
# 设置总上传的文件大小
|
||||
max-request-size: 200MB
|
||||
application:
|
||||
name: znpt
|
||||
mvc:
|
||||
pathmatch:
|
||||
matching-strategy: ant_path_matcher
|
|
@ -0,0 +1,39 @@
|
|||
<?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.dite.znpt.mapper.CombinedDictMapper">
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
a.dict_id, a.dict_type, a.dict_name, a.parent_id,
|
||||
a.sort_order, a.final_state
|
||||
</sql>
|
||||
|
||||
<select id="queryBySelective" resultType="com.dite.znpt.domain.vo.CombinedDictResp">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from combined_dict a
|
||||
<where>
|
||||
<if test="keyword != null and keyword != ''">
|
||||
# and (a.TODO like concat('%', #{keyword,jdbcType=VARCHAR}, '%') or a.TODO like concat('%', #{keyword,jdbcType=VARCHAR}, '%'))
|
||||
</if>
|
||||
<if test="dictId != null and dictId != ''">
|
||||
and a.dict_id like concat ('%', #{dictId}, '%')
|
||||
</if>
|
||||
<if test="dictType != null and dictType != ''">
|
||||
and a.dict_type like concat ('%', #{dictType}, '%')
|
||||
</if>
|
||||
<if test="dictName != null and dictName != ''">
|
||||
and a.dict_name like concat ('%', #{dictName}, '%')
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
and a.parent_id = #{parentId}
|
||||
</if>
|
||||
<if test="sortOrder != null">
|
||||
and a.sort_order = #{sortOrder}
|
||||
</if>
|
||||
<if test="finalState != null">
|
||||
and a.final_state = #{finalState}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
<?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.dite.znpt.mapper.DefectMapper">
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
a.defect_id, a.turbine_code, a.blade_code, a.surface_type,
|
||||
a.defect_type, a.defect_level, a.axial_length, a.chord_length,
|
||||
a.image_path, a.image_hash
|
||||
</sql>
|
||||
|
||||
<select id="queryBySelective" resultType="com.dite.znpt.domain.vo.DefectResp">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from defect a
|
||||
<where>
|
||||
<if test="keyword != null and keyword != ''">
|
||||
# and (a.TODO like concat('%', #{keyword,jdbcType=VARCHAR}, '%') or a.TODO like concat('%', #{keyword,jdbcType=VARCHAR}, '%'))
|
||||
</if>
|
||||
<if test="defectId != null and defectId != ''">
|
||||
and a.defect_id like concat ('%', #{defectId}, '%')
|
||||
</if>
|
||||
<if test="turbineCode != null and turbineCode != ''">
|
||||
and a.turbine_code like concat ('%', #{turbineCode}, '%')
|
||||
</if>
|
||||
<if test="bladeCode != null and bladeCode != ''">
|
||||
and a.blade_code like concat ('%', #{bladeCode}, '%')
|
||||
</if>
|
||||
<if test="surfaceType != null and surfaceType != ''">
|
||||
and a.surface_type like concat ('%', #{surfaceType}, '%')
|
||||
</if>
|
||||
<if test="defectType != null and defectType != ''">
|
||||
and a.defect_type like concat ('%', #{defectType}, '%')
|
||||
</if>
|
||||
<if test="defectLevel != null and defectLevel != ''">
|
||||
and a.defect_level like concat ('%', #{defectLevel}, '%')
|
||||
</if>
|
||||
<if test="axialLength != null">
|
||||
and a.axial_length = #{axialLength}
|
||||
</if>
|
||||
<if test="chordLength != null">
|
||||
and a.chord_length = #{chordLength}
|
||||
</if>
|
||||
<if test="imagePath != null and imagePath != ''">
|
||||
and a.image_path like concat ('%', #{imagePath}, '%')
|
||||
</if>
|
||||
<if test="imageHash != null and imageHash != ''">
|
||||
and a.image_hash like concat ('%', #{imageHash}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
<?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.dite.znpt.mapper.FileInfoMapper">
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
a.file_id, a.business_id, a.minio_path
|
||||
</sql>
|
||||
|
||||
<select id="queryBySelective" resultType="com.dite.znpt.domain.vo.FileInfoResp">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from file_info a
|
||||
<where>
|
||||
<if test="keyword != null and keyword != ''">
|
||||
# and (a.TODO like concat('%', #{keyword,jdbcType=VARCHAR}, '%') or a.TODO like concat('%', #{keyword,jdbcType=VARCHAR}, '%'))
|
||||
</if>
|
||||
<if test="fileId != null">
|
||||
and a.file_id = #{fileId}
|
||||
</if>
|
||||
<if test="businessId != null and businessId != ''">
|
||||
and a.business_id like concat ('%', #{businessId}, '%')
|
||||
</if>
|
||||
<if test="minioPath != null and minioPath != ''">
|
||||
and a.minio_path like concat ('%', #{minioPath}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<?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.dite.znpt.mapper.PersonnelMapper">
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
a.person_id, a.name, a.role_type, a.company_id,
|
||||
a.password
|
||||
</sql>
|
||||
|
||||
<select id="queryBySelective" resultType="com.dite.znpt.domain.vo.PersonnelResp">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from personnel a
|
||||
<where>
|
||||
<if test="keyword != null and keyword != ''">
|
||||
# and (a.TODO like concat('%', #{keyword,jdbcType=VARCHAR}, '%') or a.TODO like concat('%', #{keyword,jdbcType=VARCHAR}, '%'))
|
||||
</if>
|
||||
<if test="personId != null and personId != ''">
|
||||
and a.person_id like concat ('%', #{personId}, '%')
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
and a.name like concat ('%', #{name}, '%')
|
||||
</if>
|
||||
<if test="roleType != null and roleType != ''">
|
||||
and a.role_type like concat ('%', #{roleType}, '%')
|
||||
</if>
|
||||
<if test="companyId != null and companyId != ''">
|
||||
and a.company_id like concat ('%', #{companyId}, '%')
|
||||
</if>
|
||||
<if test="password != null and password != ''">
|
||||
and a.password like concat ('%', #{password}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue