Browse Source

2411011956

main
wxc 1 year ago
commit
2aadc94bd4
  1. 33
      .gitignore
  2. 19
      .mvn/wrapper/maven-wrapper.properties
  3. 5
      README.md
  4. 1978
      demo.json
  5. 259
      mvnw
  6. 149
      mvnw.cmd
  7. 219
      pom.xml
  8. 2
      sql/0911.sql
  9. 115
      sql/1008.sql
  10. 5
      sql/1011.sql
  11. 9
      sql/1014.sql
  12. 21
      sql/1027.sql
  13. 83
      sql/data.sql
  14. 25
      sql/dict.sql
  15. 8
      sql/file_class.sql
  16. 548
      sql/negative_0904.sql
  17. 8
      sql/negative_mark.sql
  18. 89
      sql/open-platform_0904.sql
  19. 4
      sql/truncate.sql
  20. 1
      sql/update-data.sql
  21. 15
      src/main/java/com/biutag/supervision/SupervisionApplication.java
  22. 34
      src/main/java/com/biutag/supervision/common/UserContextHolder.java
  23. 20
      src/main/java/com/biutag/supervision/config/FastDFSConfig.java
  24. 62
      src/main/java/com/biutag/supervision/config/GlobalExceptionHandler.java
  25. 73
      src/main/java/com/biutag/supervision/config/InterceptorConfig.java
  26. 22
      src/main/java/com/biutag/supervision/config/MybatisPlusConfig.java
  27. 22
      src/main/java/com/biutag/supervision/config/ScheduledConfig.java
  28. 28
      src/main/java/com/biutag/supervision/config/SwaggerConfig.java
  29. 28
      src/main/java/com/biutag/supervision/constants/AppConstants.java
  30. 6
      src/main/java/com/biutag/supervision/constants/RedisKeyConstants.java
  31. 17
      src/main/java/com/biutag/supervision/constants/enums/ApprovalFlowEnum.java
  32. 7
      src/main/java/com/biutag/supervision/constants/enums/ApproveStateEnum.java
  33. 39
      src/main/java/com/biutag/supervision/constants/enums/BusinessTypeEnum.java
  34. 19
      src/main/java/com/biutag/supervision/constants/enums/CaseVerifProblemNatureEnum.java
  35. 9
      src/main/java/com/biutag/supervision/constants/enums/DataUpdateMethodEnum.java
  36. 20
      src/main/java/com/biutag/supervision/constants/enums/DepartGroupEnum.java
  37. 16
      src/main/java/com/biutag/supervision/constants/enums/DepartLevelEnum.java
  38. 10
      src/main/java/com/biutag/supervision/constants/enums/DistributionCycleEnum.java
  39. 17
      src/main/java/com/biutag/supervision/constants/enums/DistributionFlowEnum.java
  40. 23
      src/main/java/com/biutag/supervision/constants/enums/DistributionMethodEnum.java
  41. 22
      src/main/java/com/biutag/supervision/constants/enums/DistributionStateEnum.java
  42. 19
      src/main/java/com/biutag/supervision/constants/enums/FlowActionEnum.java
  43. 41
      src/main/java/com/biutag/supervision/constants/enums/FlowNodeEnum.java
  44. 15
      src/main/java/com/biutag/supervision/constants/enums/HostLevelEnums.java
  45. 38
      src/main/java/com/biutag/supervision/constants/enums/InitialPetition.java
  46. 28
      src/main/java/com/biutag/supervision/constants/enums/InspectCaseEnum.java
  47. 16
      src/main/java/com/biutag/supervision/constants/enums/IsRectifyEnum.java
  48. 17
      src/main/java/com/biutag/supervision/constants/enums/MenuEnum.java
  49. 13
      src/main/java/com/biutag/supervision/constants/enums/NegativeTaskCategoryEnum.java
  50. 14
      src/main/java/com/biutag/supervision/constants/enums/NegativeTaskStatusEnum.java
  51. 21
      src/main/java/com/biutag/supervision/constants/enums/PersonTypeEnum.java
  52. 46
      src/main/java/com/biutag/supervision/constants/enums/ProblemSourcesEnum.java
  53. 26
      src/main/java/com/biutag/supervision/constants/enums/ProcessingStatusEnum.java
  54. 18
      src/main/java/com/biutag/supervision/constants/enums/RepeatEnum.java
  55. 17
      src/main/java/com/biutag/supervision/constants/enums/RoleCodeEnum.java
  56. 15
      src/main/java/com/biutag/supervision/constants/enums/StatusEnum.java
  57. 38
      src/main/java/com/biutag/supervision/constants/enums/TimeLimitEnum.java
  58. 7
      src/main/java/com/biutag/supervision/constants/enums/WorkStateEnum.java
  59. 7
      src/main/java/com/biutag/supervision/constants/enums/WorkStatusEnum.java
  60. 79
      src/main/java/com/biutag/supervision/controller/AuthController.java
  61. 46
      src/main/java/com/biutag/supervision/controller/FileController.java
  62. 64
      src/main/java/com/biutag/supervision/controller/LoginController.java
  63. 156
      src/main/java/com/biutag/supervision/controller/StatisticsController.java
  64. 49
      src/main/java/com/biutag/supervision/controller/api/jwdc/NegativeApiController.java
  65. 30
      src/main/java/com/biutag/supervision/controller/api/plugin/PetitionComplainApiController.java
  66. 23
      src/main/java/com/biutag/supervision/controller/baseData/BusinessDepartController.java
  67. 24
      src/main/java/com/biutag/supervision/controller/baseData/BusinessPoliceController.java
  68. 119
      src/main/java/com/biutag/supervision/controller/data/DataCaseVerifController.java
  69. 134
      src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaintController.java
  70. 79
      src/main/java/com/biutag/supervision/controller/datav/DataPetitionComplaintViewController.java
  71. 78
      src/main/java/com/biutag/supervision/controller/datav/DataVCaseVerifController.java
  72. 54
      src/main/java/com/biutag/supervision/controller/datav/DatavRightsComfortController.java
  73. 26
      src/main/java/com/biutag/supervision/controller/sensitivePerception/ModelClassController.java
  74. 58
      src/main/java/com/biutag/supervision/controller/sensitivePerception/ModelClueController.java
  75. 37
      src/main/java/com/biutag/supervision/controller/sensitivePerception/ModelClueRecordController.java
  76. 38
      src/main/java/com/biutag/supervision/controller/sensitivePerception/ModelClueTaskController.java
  77. 75
      src/main/java/com/biutag/supervision/controller/sensitivePerception/ModelController.java
  78. 81
      src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfileDepartController.java
  79. 100
      src/main/java/com/biutag/supervision/controller/system/DepartController.java
  80. 52
      src/main/java/com/biutag/supervision/controller/system/DictContentController.java
  81. 104
      src/main/java/com/biutag/supervision/controller/system/DictController.java
  82. 71
      src/main/java/com/biutag/supervision/controller/system/HolidayController.java
  83. 51
      src/main/java/com/biutag/supervision/controller/system/MenuController.java
  84. 249
      src/main/java/com/biutag/supervision/controller/system/PoliceController.java
  85. 60
      src/main/java/com/biutag/supervision/controller/system/RoleController.java
  86. 30
      src/main/java/com/biutag/supervision/controller/system/UserController.java
  87. 25
      src/main/java/com/biutag/supervision/controller/work/FlowNodeController.java
  88. 68
      src/main/java/com/biutag/supervision/controller/work/NegativeController.java
  89. 43
      src/main/java/com/biutag/supervision/controller/work/NegativeFavController.java
  90. 26
      src/main/java/com/biutag/supervision/controller/work/NegativeTaskController.java
  91. 31
      src/main/java/com/biutag/supervision/controller/work/WorkController.java
  92. 4
      src/main/java/com/biutag/supervision/exception/AuthException.java
  93. 53
      src/main/java/com/biutag/supervision/flow/FlowService.java
  94. 9
      src/main/java/com/biutag/supervision/flow/action/Action.java
  95. 182
      src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java
  96. 108
      src/main/java/com/biutag/supervision/flow/action/ApplyExtensionAction.java
  97. 77
      src/main/java/com/biutag/supervision/flow/action/FirstApproveAction.java
  98. 89
      src/main/java/com/biutag/supervision/flow/action/FirstApproveReturnAction.java
  99. 114
      src/main/java/com/biutag/supervision/flow/action/FirstDistributeAction.java
  100. 82
      src/main/java/com/biutag/supervision/flow/action/FirstExtensionApproveAction.java
  101. Some files were not shown because too many files have changed in this diff Show More

33
.gitignore vendored

@ -0,0 +1,33 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/

19
.mvn/wrapper/maven-wrapper.properties vendored

@ -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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
wrapperVersion=3.3.2
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.7/apache-maven-3.9.7-bin.zip

5
README.md

@ -0,0 +1,5 @@
# 数字督察一体化平台
## 技术栈
- JDK17
- SpringBoot 3
- MySQL

1978
demo.json

File diff suppressed because it is too large Load Diff

259
mvnw vendored

@ -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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Apache Maven Wrapper startup batch script, version 3.3.2
#
# Optional ENV vars
# -----------------
# JAVA_HOME - location of a JDK home dir, required when download maven via java source
# MVNW_REPOURL - repo url base for downloading maven distribution
# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output
# ----------------------------------------------------------------------------
set -euf
[ "${MVNW_VERBOSE-}" != debug ] || set -x
# OS specific support.
native_path() { printf %s\\n "$1"; }
case "$(uname)" in
CYGWIN* | MINGW*)
[ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")"
native_path() { cygpath --path --windows "$1"; }
;;
esac
# set JAVACMD and JAVACCMD
set_java_home() {
# For Cygwin and MinGW, ensure paths are in Unix format before anything is touched
if [ -n "${JAVA_HOME-}" ]; then
if [ -x "$JAVA_HOME/jre/sh/java" ]; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
JAVACCMD="$JAVA_HOME/jre/sh/javac"
else
JAVACMD="$JAVA_HOME/bin/java"
JAVACCMD="$JAVA_HOME/bin/javac"
if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then
echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2
echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2
return 1
fi
fi
else
JAVACMD="$(
'set' +e
'unset' -f command 2>/dev/null
'command' -v java
)" || :
JAVACCMD="$(
'set' +e
'unset' -f command 2>/dev/null
'command' -v javac
)" || :
if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then
echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2
return 1
fi
fi
}
# hash string like Java String::hashCode
hash_string() {
str="${1:-}" h=0
while [ -n "$str" ]; do
char="${str%"${str#?}"}"
h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296))
str="${str#?}"
done
printf %x\\n $h
}
verbose() { :; }
[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; }
die() {
printf %s\\n "$1" >&2
exit 1
}
trim() {
# MWRAPPER-139:
# Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds.
# Needed for removing poorly interpreted newline sequences when running in more
# exotic environments such as mingw bash on Windows.
printf "%s" "${1}" | tr -d '[:space:]'
}
# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties
while IFS="=" read -r key value; do
case "${key-}" in
distributionUrl) distributionUrl=$(trim "${value-}") ;;
distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;;
esac
done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties"
[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties"
case "${distributionUrl##*/}" in
maven-mvnd-*bin.*)
MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/
case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in
*AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;;
:Darwin*x86_64) distributionPlatform=darwin-amd64 ;;
:Darwin*arm64) distributionPlatform=darwin-aarch64 ;;
:Linux*x86_64*) distributionPlatform=linux-amd64 ;;
*)
echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2
distributionPlatform=linux-amd64
;;
esac
distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip"
;;
maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;;
*) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;;
esac
# apply MVNW_REPOURL and calculate MAVEN_HOME
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}"
distributionUrlName="${distributionUrl##*/}"
distributionUrlNameMain="${distributionUrlName%.*}"
distributionUrlNameMain="${distributionUrlNameMain%-bin}"
MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}"
MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")"
exec_maven() {
unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || :
exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD"
}
if [ -d "$MAVEN_HOME" ]; then
verbose "found existing MAVEN_HOME at $MAVEN_HOME"
exec_maven "$@"
fi
case "${distributionUrl-}" in
*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;;
*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;;
esac
# prepare tmp dir
if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then
clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; }
trap clean HUP INT TERM EXIT
else
die "cannot create temp dir"
fi
mkdir -p -- "${MAVEN_HOME%/*}"
# Download and Install Apache Maven
verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
verbose "Downloading from: $distributionUrl"
verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
# select .zip or .tar.gz
if ! command -v unzip >/dev/null; then
distributionUrl="${distributionUrl%.zip}.tar.gz"
distributionUrlName="${distributionUrl##*/}"
fi
# verbose opt
__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR=''
[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v
# normalize http auth
case "${MVNW_PASSWORD:+has-password}" in
'') MVNW_USERNAME='' MVNW_PASSWORD='' ;;
has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;;
esac
if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then
verbose "Found wget ... using wget"
wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl"
elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then
verbose "Found curl ... using curl"
curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl"
elif set_java_home; then
verbose "Falling back to use Java to download"
javaSource="$TMP_DOWNLOAD_DIR/Downloader.java"
targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName"
cat >"$javaSource" <<-END
public class Downloader extends java.net.Authenticator
{
protected java.net.PasswordAuthentication getPasswordAuthentication()
{
return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() );
}
public static void main( String[] args ) throws Exception
{
setDefault( new Downloader() );
java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() );
}
}
END
# For Cygwin/MinGW, switch paths to Windows format before running javac and java
verbose " - Compiling Downloader.java ..."
"$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java"
verbose " - Running Downloader.java ..."
"$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")"
fi
# If specified, validate the SHA-256 sum of the Maven distribution zip file
if [ -n "${distributionSha256Sum-}" ]; then
distributionSha256Result=false
if [ "$MVN_CMD" = mvnd.sh ]; then
echo "Checksum validation is not supported for maven-mvnd." >&2
echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
exit 1
elif command -v sha256sum >/dev/null; then
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then
distributionSha256Result=true
fi
elif command -v shasum >/dev/null; then
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then
distributionSha256Result=true
fi
else
echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2
echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
exit 1
fi
if [ $distributionSha256Result = false ]; then
echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2
echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2
exit 1
fi
fi
# unzip and move
if command -v unzip >/dev/null; then
unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip"
else
tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar"
fi
printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url"
mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME"
clean || :
exec_maven "$@"

149
mvnw.cmd vendored

@ -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 https://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Apache Maven Wrapper startup batch script, version 3.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"

219
pom.xml

@ -0,0 +1,219 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.3.2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.biutag</groupId>
<artifactId>supervision</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>supervision</name>
<description>长沙公安数据督察</description>
<url/>
<licenses>
<license/>
</licenses>
<developers>
<developer/>
</developers>
<scm>
<connection/>
<developerConnection/>
<tag/>
<url/>
</scm>
<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-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis-reactive</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.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>io.projectreactor</groupId>
<artifactId>reactor-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-spring-boot3-starter</artifactId>
<version>3.5.7</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.17.0</version>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-core</artifactId>
<version>5.8.29</version>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-http</artifactId>
<version>5.8.29</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>dynamic-datasource-spring-boot3-starter</artifactId>
<version>4.3.1</version>
</dependency>
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.32</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-crypto</artifactId>
</dependency>
<dependency>
<groupId>com.github.tobato</groupId>
<artifactId>fastdfs-client</artifactId>
<version>1.27.2</version>
</dependency>
<!--knife4j-->
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-openapi3-jakarta-spring-boot-starter</artifactId>
<version>4.1.0</version>
</dependency>
<dependency>
<groupId>com.gbase</groupId>
<artifactId>gbase-jdbc</artifactId>
<scope>system</scope>
<version>8.3.81.53-build55.2.1-bin</version>
<systemPath>${project.basedir}/src/main/resources/lib/gbase-connector-java-8.3.81.53-build52.8-bin.jar</systemPath>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.2.22</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>2.0.53</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>application.yml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
<finalName>supervision</finalName>
</build>
<profiles>
<profile>
<id>local</id>
<properties>
<!-- 环境标识,需要与配置文件的名称相对应 -->
<profiles.active>local</profiles.active>
</properties>
<activation>
<!-- 默认环境 -->
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<profile>
<id>dev</id>
<properties>
<!-- 环境标识,需要与配置文件的名称相对应 -->
<profiles.active>dev</profiles.active>
</properties>
</profile>
<profile>
<id>prod</id>
<properties>
<profiles.active>prod</profiles.active>
</properties>
</profile>
</profiles>
</project>

2
sql/0911.sql

@ -0,0 +1,2 @@
ALTER TABLE `negative`.`negative`
ADD COLUMN `case_number` varchar(255) NULL COMMENT '涉及案件/警情编号' AFTER `handle_three_depart_name`;

115
sql/1008.sql

@ -0,0 +1,115 @@
ALTER TABLE `negative`.`negative_problem_relation`
ADD COLUMN `threeLevelCode` varchar(255) NULL AFTER `twoLevelContent`,
ADD COLUMN `threeLevelContent` varchar(255) NULL AFTER `threeLevelCode`;
ALTER TABLE `negative`.`sup_police`
ADD COLUMN `position` varchar(255);
update sup_police set position = '正职' where job like '%正职%';
update sup_police set position = '副职' where job like '%副职%';
INSERT INTO `sup_dict_problem_type` VALUES (1, '内务管理', '1', '-1', '0', '内务管理', '', 1, 1, NULL, '', '', '', '', '2020-08-13 14:47:51', '521677655146233856', 'oumyye', '127.0.0.1');
INSERT INTO `sup_dict_problem_type` VALUES (2, '服务群众', '2', '-1', '0', '服务群众', '', 1, 2, NULL, '', '', '', '', '2020-08-13 14:48:21', '521677655146233856', 'oumyye', '127.0.0.1');
INSERT INTO `sup_dict_problem_type` VALUES (3, '服务基层', '3', '-1', '0', NULL, NULL, 1, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (4, '纪律作风', '4', '-1', '0', NULL, NULL, 1, 4, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (5, '执法办案', '5', '-1', '0', NULL, NULL, 1, 5, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (6, '安保维稳', '6', '-1', '0', NULL, NULL, 1, 6, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (7, '专项工作', '7', '-1', '0', NULL, NULL, 1, 7, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (8, '“二十个不准”', '8', '-1', '0', NULL, NULL, 1, 8, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (9, '钉钉使用弄虚作假。', '9', '1', '0', NULL, '/1/', 2, 9, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (10, '未按规定请示报告。', '10', '1', '0', NULL, '/1/', 2, 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (11, '迟到、早退、脱岗、旷工等。', '11', '1', '0', NULL, '/1/', 2, 11, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (12, '值班装备配备、使用不规范。', '12', '1', '0', NULL, '/1/', 2, 12, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (13, '内务卫生不整洁', '13', '1', '0', NULL, '/1/', 2, 13, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (14, '违反着装管理规定', '14', '1', '0', NULL, '/1/', 2, 14, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (15, '枪支保管使用不规范', '15', '1', '0', NULL, '/1/', 2, 15, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (16, '公车管理使用不规范', '16', '1', '0', NULL, '/1/', 2, 16, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (17, '办公备勤用房违规', '17', '1', '0', NULL, '/1/', 2, 17, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (18, '内部安全防范不到位', '18', '1', '0', NULL, '/1/', 2, 18, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (19, '会风会纪差', '19', '1', '0', NULL, '/1/', 2, 19, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (20, '违反保密管理规定', '20', '1', '0', NULL, '/1/', 2, 20, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (21, '泄露警务秘密', '21', '1', '0', NULL, '/1/', 2, 21, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (22, '违反宣传纪律', '22', '1', '0', NULL, '/1/', 2, 22, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (23, '其他', '23', '1', '0', NULL, '/1/', 2, 23, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (24, '态度不好', '24', '2', '0', NULL, '/2/', 2, 24, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (26, '办事推诿、拖拉', '26', '2', '0', NULL, '/2/', 2, 26, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (27, '违规办理', '27', '2', '0', NULL, '/2/', 2, 27, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (28, '吃拿卡要', '28', '2', '0', NULL, '/2/', 2, 28, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (29, '其他', '29', '2', '0', NULL, '/2/', 2, 29, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (30, '测评满意率低', '30', '3', '0', NULL, '/3/', 2, 30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (31, '办事推诿、拖拉', '31', '3', '0', NULL, '/3/', 2, 31, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (32, '违规摊派任务', '32', '3', '0', NULL, '/3/', 2, 32, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (33, '办理不满意', '33', '3', '0', NULL, '/3/', 2, 33, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (34, '拒不整改问题', '34', '3', '0', NULL, '/3/', 2, 34, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (35, '形式主义、官僚主义', '35', '3', '0', NULL, '/3/', 2, 35, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (36, '其他', '36', '3', '0', NULL, '/3/', 2, 36, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (37, '违反规定饮酒。', '37', '4', '0', NULL, '/4/', 2, 37, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (38, '酒后驾驶机动车。', '38', '4', '0', NULL, '/4/', 2, 38, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (39, '在公共场所酗酒滋事。', '39', '4', '0', NULL, '/4/', 2, 39, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (40, '携带枪支饮酒。', '40', '4', '0', NULL, '/4/', 2, 40, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (41, '吸食、注射毒品。', '41', '4', '0', NULL, '/4/', 2, 41, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (42, '贪污受贿', '42', '4', '0', NULL, '/4/', 2, 42, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (43, '其他违反政治纪律的行为', '43', '4', '0', NULL, '/4/', 2, 43, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (44, '其他违反组织纪律的行为', '44', '4', '0', NULL, '/4/', 2, 44, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (45, '其他违反廉洁纪律的行为', '45', '4', '0', NULL, '/4/', 2, 45, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (46, '其他违反群众纪律的行为', '46', '4', '0', NULL, '/4/', 2, 46, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (47, '其他违反工作纪律的行为', '47', '4', '0', NULL, '/4/', 2, 47, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (48, '其他违反生活纪律的行为', '48', '4', '0', NULL, '/4/', 2, 48, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (49, '其他违法犯罪行为', '49', '4', '0', NULL, '/4/', 2, 49, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (50, '其他', '50', '4', '0', NULL, '/4/', 2, 50, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (51, '接处警不及时。', '51', '5', '0', NULL, '/5/', 2, 51, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (52, '现场处置不文明、不规范。', '52', '5', '0', NULL, '/5/', 2, 52, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (53, '不如实、及时受立案', '53', '5', '0', NULL, '/5/', 2, 53, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (54, '调查取证不及时', '54', '5', '0', NULL, '/5/', 2, 54, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (55, '未按规定使用执法记录仪', '55', '5', '0', NULL, '/5/', 2, 55, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (56, '违反执法办案场所相关规定', '56', '5', '0', NULL, '/5/', 2, 56, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (57, '违反规定采取强制措施', '57', '5', '0', NULL, '/5/', 2, 57, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (58, '违规处理案件,执法不公、不严。', '58', '5', '0', NULL, '/5/', 2, 58, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (59, '执行不到位', '59', '5', '0', NULL, '/5/', 2, 59, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (60, '违规介入经济纠纷', '60', '5', '0', NULL, '/5/', 2, 60, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (61, '违规查封、扣押、冻结,影响营商环境', '61', '5', '0', NULL, '/5/', 2, 61, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (62, '涉案财物、随身物品管理违规', '62', '5', '0', NULL, '/5/', 2, 62, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (63, '违反法定程序办案。', '63', '5', '0', NULL, '/5/', 2, 63, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (64, '指供、诱供、刑讯逼供。', '64', '5', '0', NULL, '/5/', 2, 64, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (65, '办人情案、关系案、金钱案。', '65', '5', '0', NULL, '/5/', 2, 65, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (66, '充当违法犯罪保护伞。', '66', '5', '0', NULL, '/5/', 2, 66, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (67, '向违法犯罪嫌疑人通风报信', '67', '5', '0', NULL, '/5/', 2, 67, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (68, '违规安排会见,私自传递物品、信件。', '68', '5', '0', NULL, '/5/', 2, 68, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (69, '体罚、虐待被监管人员。', '69', '5', '0', NULL, '/5/', 2, 69, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (70, '违反监所安全管理规定。', '70', '5', '0', NULL, '/5/', 2, 70, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (71, '失职渎职导致发生执法安全事故', '71', '5', '0', NULL, '/5/', 2, 71, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (72, '处置不当引发负面舆情', '72', '5', '0', NULL, '/5/', 2, 72, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (73, '其他', '73', '5', '0', NULL, '/5/', 2, 73, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (74, '未按时到岗、脱岗', '74', '6', '0', NULL, '/6/', 2, 74, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (75, '履职不认真', '75', '6', '0', NULL, '/6/', 2, 75, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (76, '不按规定佩戴装备', '76', '6', '0', NULL, '/6/', 2, 76, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (77, '警容不整及不文明行为', '77', '6', '0', NULL, '/6/', 2, 77, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (78, '处置不规范', '78', '6', '0', NULL, '/6/', 2, 78, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (79, '失职渎职', '79', '6', '0', NULL, '/6/', 2, 79, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (80, '其他', '80', '6', '0', NULL, '/6/', 2, 80, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (81, '部署推进不力', '81', '7', '0', NULL, '/7/', 2, 81, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (82, '考核排名落后', '82', '7', '0', NULL, '/7/', 2, 82, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (83, '被上级点名通报', '83', '7', '0', NULL, '/7/', 2, 83, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (84, '其他', '84', '7', '0', NULL, '/7/', 2, 84, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (85, '搞团团伙伙。', '85', '8', '0', NULL, '/8/', 2, 85, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (86, '搞权力交换、利益输送。', '86', '8', '0', NULL, '/8/', 2, 86, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (87, '收受礼金及贵重礼品。', '87', '8', '0', NULL, '/8/', 2, 87, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (88, '组织参与黄、赌活动', '88', '8', '0', NULL, '/8/', 2, 88, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (89, '相互拆台、诬告、陷害,破坏队伍团结。', '89', '8', '0', NULL, '/8/', 2, 89, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (90, '拒绝、拖延执行上级依法依规作出的决定。', '90', '8', '0', NULL, '/8/', 2, 90, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (91, '违反党的干部政策,培植私人势力。', '91', '8', '0', NULL, '/8/', 2, 91, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (92, '干预执法办案。', '92', '8', '0', NULL, '/8/', 2, 92, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (93, '搞无原则一团和气。', '93', '8', '0', NULL, '/8/', 2, 93, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (94, '使用庸俗化称谓,搞人身依附。', '94', '8', '0', NULL, '/8/', 2, 94, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (95, '妄议中央大政方针。', '95', '8', '0', NULL, '/8/', 2, 95, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (96, '结交“风水大师”、参与迷信活动。', '96', '8', '0', NULL, '/8/', 2, 96, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (97, '帮助违法犯罪嫌疑人逃避法律责任。', '97', '8', '0', NULL, '/8/', 2, 97, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (98, '违规与当事人、中间人等特定关系人交往。', '98', '8', '0', NULL, '/8/', 2, 98, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (99, '超越“亲”“清”政商关系与企业老板交往。', '99', '8', '0', NULL, '/8/', 2, 99, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (100, '受雇于任何组织、个人。', '100', '8', '0', NULL, '/8/', 2, 100, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (101, '收受管理、服务对象及其代理人任何好处。', '101', '8', '0', NULL, '/8/', 2, 101, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (102, '违规从事盈利性经营活动。', '102', '8', '0', NULL, '/8/', 2, 102, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (103, '利用职权或影响力为亲友谋取好处。', '103', '8', '0', NULL, '/8/', 2, 103, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sup_dict_problem_type` VALUES (104, '利用网络社交媒体进行不正当交往。', '104', '8', '0', NULL, '/8/', 2, 104, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

5
sql/1011.sql

@ -0,0 +1,5 @@
ALTER TABLE `negative`.`sup_police`
ADD COLUMN `person_type` varchar(255) NULL COMMENT '人员属性' AFTER `position`,
ADD COLUMN `marital_status` varchar(255) NULL COMMENT '婚姻状况' AFTER `person_type`,
ADD COLUMN `have_children` tinyint(1) NULL COMMENT '子女' AFTER `marital_status`,
ADD COLUMN `education` varchar(255) NULL COMMENT '学历' AFTER `have_children`;

9
sql/1014.sql

@ -0,0 +1,9 @@
ALTER TABLE `negative`.`sup_depart`
ADD COLUMN `first_host` tinyint DEFAULT '0' COMMENT '是否是市局主办';
ALTER TABLE `negative`.`negative`
ADD COLUMN `current_processing_object` varchar(255) COMMENT '当前处理对象';
ALTER TABLE `negative`.`sup_police`
ADD COLUMN `employment_date` datetime COMMENT '入职时间',
ADD COLUMN `police_role` varchar(255) COMMENT '角色';

21
sql/1027.sql

@ -0,0 +1,21 @@
UPDATE negative_work w
LEFT JOIN negative n ON w.create_time = n.crtTime
AND n.involveDepartId = w.depart_id
SET w.negative_id = n.id
WHERE
w.negative_id IS NULL
AND n.id IS NOT NULL;
UPDATE negative
SET handle_three_depart_id = involveDepartId,
handle_three_depart_name = involveDepartName
WHERE
crtTime > '2024-10-25 19:00:00'
AND handle_three_depart_id IS NULL;
//
DELETE
FROM
negative_work
WHERE
negative_id IS NULL;

83
sql/data.sql

@ -0,0 +1,83 @@
CREATE TABLE data_case_verification (
origin_id varchar(255) NOT NULL COMMENT '样本源头编号(案件编号)',
discovery_time datetime NULL COMMENT '问题发现时间(受理时间)',
happen_time datetime NULL COMMENT '问题发生时间',
problem_sources varchar(255) NULL COMMENT '问题来源',
complainant varchar(255) NULL COMMENT '投诉反映人(投诉人)',
complainant_phone varchar(255) NULL COMMENT '联系电话(投诉人电话)',
business_type_name varchar(255) NULL COMMENT '业务类别',
involve_problem varchar(255) NULL COMMENT '涉嫌问题(问题类别)',
police_type varchar(255) NULL COMMENT '涉及警种',
police_type_name varchar(255) NULL COMMENT '涉及警种名称',
involve_depart_id varchar(40) NULL COMMENT '涉及单位(被投诉单位)',
thing_desc text NULL COMMENT '事情简述(投诉具体内容)',
check_status_name varchar(255) NULL COMMENT '核查情况(审定结果)',
check_status_desc varchar(255) NULL COMMENT '核查处理结果(处理情况简要描述)',
involved_name varchar(255) NULL COMMENT '涉及人姓名',
involved_id_code varchar(40) NULL COMMENT '身份证号码',
personnel_attr varchar(255) NULL COMMENT '人员属性',
inspection_measures varchar(255) NULL COMMENT '督察措施',
problem_type varchar(255) NULL COMMENT '问题类型',
problem_category varchar(255) NULL COMMENT '问题类别',
subjective_aspect varchar(255) NULL COMMENT '主观方面',
responsibility_category varchar(255) NULL COMMENT '责任类别',
processing_results varchar(255) NULL COMMENT '处理结果',
involved_rights_protection_fault_tolerance varchar(255) NULL COMMENT '维权容错',
assistance_situation varchar(255) NULL COMMENT '帮扶情况',
assistance_start_time datetime NULL COMMENT '帮扶开始时间',
assistance_end_time datetime NULL COMMENT '帮扶结束时间',
involved_leader_name varchar(255) NULL COMMENT '涉及领导姓名',
involved_leader_id_code varchar(40) NULL COMMENT '涉及领导-身份证号码',
involved_leader_inspection_measures varchar(255) NULL COMMENT '涉及领导-督察措施',
involved_leader_responsibility_category varchar(255) NULL COMMENT '涉及领导-责任类别',
involved_leader_processing_results varchar(255) NULL COMMENT '涉及领导-处理结果',
involved_leader_rights_protection_fault_tolerance varchar(255) NULL COMMENT '涉及领导-维权容错',
crt_time datetime NULL DEFAULT now(),
upd_time datetime NULL DEFAULT now(),
PRIMARY KEY (`origin_id`)
) COMMENT='案件核查台账';
CREATE TABLE data_petition_complaint (
letter_id varchar(255) COMMENT '信件编号',
channel_for_filing_complaints varchar(255) COMMENT '投诉渠道',
acceptance_level varchar(255) COMMENT '受理层级',
registration_time datetime COMMENT '登记时间',
complainant varchar(255) COMMENT '投诉人',
complainant_phone varchar(255) COMMENT '投诉人电话',
initial_petition varchar(255) COMMENT '初重信访',
entanglement_disturbance_during_visits varchar(255) COMMENT '缠访闹访',
mass_visits varchar(255) COMMENT '群众集访',
involve_problem varchar(255) COMMENT '涉嫌问题',
business_type_name varchar(255) COMMENT '业务类别',
police_type varchar(255) NULL COMMENT '涉及警种',
police_type_name varchar(255) NULL COMMENT '涉及警种名称',
complained_depart_id varchar(255) COMMENT '被投诉机构ID',
complained_depart_name varchar(255) COMMENT '被投诉机构',
thing_desc text COMMENT '具体内容',
involve_depart_id varchar(255) COMMENT '涉及单位',
involve_depart_name varchar(255) COMMENT '涉及单位',
is_unit_responsible int COMMENT '是否单位责任',
depart_processing_results varchar(255) COMMENT '单位处理结果',
involved_name varchar(255) COMMENT '涉及人姓名',
involved_id_code varchar(40) COMMENT '身份证号码',
personnel_attributes varchar(255) COMMENT '人员属性',
inspection_measures varchar(255) COMMENT '督察措施',
problem_type varchar(255) COMMENT '问题类型',
subjective_aspect varchar(255) COMMENT '主观方面',
responsibility_category varchar(255) COMMENT '责任类别',
processing_results varchar(255) COMMENT '处理结果',
rights_protection_fault_tolerance varchar(255) COMMENT '维权容错',
assistance_situation varchar(255) COMMENT '帮扶情况',
assistance_start_time datetime NULL COMMENT '帮扶开始时间',
assistance_end_time datetime NULL COMMENT '帮扶结束时间',
involved_leader_name varchar(255) COMMENT '涉及领导姓名',
involved_leader_id_code varchar(255) COMMENT '身份证号码',
involved_leader_inspection_measures varchar(255) COMMENT '督察措施',
involved_leader_responsibility_category varchar(255) COMMENT '责任类别',
involved_leader_processing_results varchar(255) COMMENT '处理结果',
involved_leader_rights_protection_fault_tolerance varchar(255) COMMENT '维权容错',
crt_time datetime NULL DEFAULT now(),
upd_time datetime NULL DEFAULT now(),
PRIMARY KEY (`letter_id`)
) COMMENT='信访投诉台账';

25
sql/dict.sql

@ -0,0 +1,25 @@
INSERT INTO `negative`.`sup_dict_type`(`dict_id`, `dict_name`, `dict_type`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (17, '主办层级', 'hostLevel', '0', '', '2024-08-13 16:21:32', '', '2024-08-13 16:21:32', '');
INSERT INTO `negative`.`sup_dict_type`(`dict_id`, `dict_name`, `dict_type`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (18, '办理时限', 'timeLimit', '0', '', '2024-08-13 16:42:50', '', '2024-08-13 16:42:50', '');
INSERT INTO `negative`.`sup_dict_type`(`dict_id`, `dict_name`, `dict_type`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (19, '审批流程', 'approvalFlow', '0', '', '2024-08-13 16:54:26', '', '2024-08-13 16:54:26', '');
INSERT INTO `negative`.`sup_dict_type`(`dict_id`, `dict_name`, `dict_type`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (20, '追责对象', 'accountabilityTarget', '0', '', '2024-08-16 10:23:19', '', '2024-08-16 10:23:19', '');
INSERT INTO `negative`.`sup_dict_type`(`dict_id`, `dict_name`, `dict_type`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (21, '办理状态', 'processingStatus', '0', '', '2024-08-19 15:37:24', '', '2024-08-19 15:37:24', '');
INSERT INTO `negative`.`sup_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (220, 0, '市局主办', '1', 'hostLevel', '', '', '0', '0', '', '2024-08-13 16:34:23', '', '2024-08-13 16:34:23', '');
INSERT INTO `negative`.`sup_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (222, 0, '二级机构主办', '2', 'hostLevel', '', '', '0', '0', '', '2024-08-13 16:39:09', '', '2024-08-13 16:39:09', '');
INSERT INTO `negative`.`sup_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (223, 0, '三级机构主办', '3', 'hostLevel', '', '', '0', '0', '', '2024-08-13 16:39:44', '', '2024-08-13 16:39:44', '');
INSERT INTO `negative`.`sup_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (224, 0, '137工作制', '3+7', 'timeLimit', '', '', '0', '0', '', '2024-08-13 16:44:13', '', '2024-08-13 16:44:13', '1个工作日签收,3个工作日办结,延期不超过7天');
INSERT INTO `negative`.`sup_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (225, 0, '10+10工作制', '10+10', 'timeLimit', '', '', '0', '0', '', '2024-08-13 16:45:49', '', '2024-08-13 16:45:49', '1个工作日签收,10个工作日办结,延期不超过10天');
INSERT INTO `negative`.`sup_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (226, 0, '14+7工作制', '14+7', 'timeLimit', '', '', '0', '0', '', '2024-08-13 16:46:56', '', '2024-08-13 16:46:56', '1个工作日签收,14个工作日办结,延期不超过7天');
INSERT INTO `negative`.`sup_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (227, 0, '其他', 'other', 'timeLimit', '', '', '0', '0', '', '2024-08-13 16:49:33', '', '2024-08-13 16:49:33', '');
INSERT INTO `negative`.`sup_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (228, 0, '三级审批', '3', 'approvalFlow', '', '', '0', '0', '', '2024-08-13 16:55:14', '', '2024-08-13 16:55:14', '所队一>二級机构一>市局');
INSERT INTO `negative`.`sup_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (229, 0, '二级审批', '2', 'approvalFlow', '', '', '0', '0', '', '2024-08-13 16:55:29', '', '2024-08-13 16:55:29', '所队一>二级机构');
INSERT INTO `negative`.`sup_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (230, 0, '涉及个人', '1', 'accountabilityTarget', '', '', '0', '0', '', '2024-08-16 10:24:48', '', '2024-08-16 10:24:48', '');
INSERT INTO `negative`.`sup_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (231, 0, '涉及单位', '2', 'accountabilityTarget', '', '', '0', '0', '', '2024-08-16 10:25:02', '', '2024-08-16 10:25:02', '');
INSERT INTO `negative`.`sup_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (232, 0, '涉及个人及单位', '3', 'accountabilityTarget', '', '', '0', '0', '', '2024-08-16 10:25:16', '', '2024-08-16 10:25:16', '');
INSERT INTO `negative`.`sup_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (233, 0, '签收中', 'signing', 'processingStatus', '', '', '0', '0', '', '2024-08-19 15:38:20', '', '2024-08-19 15:38:20', '问题签收');
INSERT INTO `negative`.`sup_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (234, 0, '办理中', 'processing', 'processingStatus', '', '', '0', '0', '', '2024-08-19 15:39:01', '', '2024-08-19 15:39:01', '核查办理');
INSERT INTO `negative`.`sup_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (235, 0, '审批中', 'approval', 'processingStatus', '', '', '0', '0', '', '2024-08-19 15:40:34', '', '2024-08-19 15:40:34', '办结审批');
INSERT INTO `negative`.`sup_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (236, 0, '已办结', 'completed', 'processingStatus', '', '', '0', '0', '', '2024-08-19 15:41:07', '', '2024-08-19 15:41:07', '认定办结');
INSERT INTO `negative`.`sup_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (237, 2, '分局通报批评', '1-2', 'handleResult', '', '', '0', '0', '', '2024-09-04 18:45:08', '', '2024-09-04 18:45:08', '');
INSERT INTO `negative`.`sup_dict_data`(`dict_code`, `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (238, 3, '市局通报批评', '1-1', 'handleResult', '', '', '0', '0', '', '2024-09-04 18:45:47', '', '2024-09-04 18:45:47', '');

8
sql/file_class.sql

@ -0,0 +1,8 @@
CREATE TABLE file_class (
id int NOT NULL AUTO_INCREMENT,
class_name varchar(255) not null,
class_remarks varchar(255),
problem_sources_code varchar(40) not null COMMENT '问题来源',
sort int,
PRIMARY KEY (`id`)
) COMMENT='文件分类';

548
sql/negative_0904.sql

@ -0,0 +1,548 @@
ALTER TABLE `negative`.`negative`
ADD COLUMN `host_level` varchar(255) NULL COMMENT '主办层级' AFTER `distribute_flow`,
ADD COLUMN `time_limit` varchar(255) NULL COMMENT '办理时限' AFTER `host_level`,
ADD COLUMN `approval_flow` varchar(255) NULL COMMENT '审批流程' AFTER `time_limit`,
ADD COLUMN `flow_key` varchar(255) NULL COMMENT '流程节点key' AFTER `flow_key`,
ADD COLUMN `check_status_desc` text NULL COMMENT '问题核查情况' AFTER `flow_key`,
ADD COLUMN `rectify_desc` text NULL COMMENT '问题整改情况' AFTER `check_status_desc`,
ADD COLUMN `rectify_restriction_days` int NULL COMMENT '整改限制天数' AFTER `rectify_desc`,
ADD COLUMN `accountability_target` varchar(255) NULL COMMENT '追责对象' AFTER `rectify_restriction_days`,
ADD COLUMN `processing_status` varchar(255) NULL COMMENT '办理状态' AFTER `accountability_target`,
ADD COLUMN `negative_extension_apply_id` int NULL COMMENT '延期申请ID' AFTER `processing_status`,
ADD COLUMN `extension_apply_flag` tinyint NULL DEFAULT 1 COMMENT '是否能申请延期' AFTER `negative_extension_apply_id`,
ADD COLUMN `extension_days` int NULL COMMENT '延期天数' AFTER `extension_apply_flag`,
ADD COLUMN `first_distribute_time` datetime NULL COMMENT '市局下发时间' AFTER `extension_days`,
ADD COLUMN `is_second_handle` tinyint NULL DEFAULT 0 COMMENT '是否是二级机构办理 true=是 false=否' AFTER `first_distribute_time`,
ADD COLUMN `handle_second_depart_id` varchar(255) NULL COMMENT '二级办理单位' AFTER `is_second_handle`,
ADD COLUMN `handle_second_depart_name` varchar(255) NULL COMMENT '二级办理单位' AFTER `handle_second_depart_id`,
ADD COLUMN `handle_three_depart_id` varchar(255) NULL COMMENT '三级办理单位' AFTER `handle_second_depart_name`,
ADD COLUMN `handle_three_depart_name` varchar(255) NULL COMMENT '三级办理单位' AFTER `handle_three_depart_id`;
CREATE TABLE `flow_action` (
`id` int(0) NOT NULL AUTO_INCREMENT,
`action_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`flow_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`next_flow_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '下一流程节点key',
`button_label` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '动作名称',
`button_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '按钮类型',
`plain` tinyint(1) NULL DEFAULT NULL COMMENT '是否是简单按钮',
`sort` int(0) NULL DEFAULT NULL COMMENT '排序',
`action_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
`validate_form` tinyint(0) NULL DEFAULT NULL COMMENT '是否需要校验表单',
`do_close` tinyint(0) NULL DEFAULT NULL COMMENT '完成后是否需要关闭',
`open_dialog` tinyint(0) NULL DEFAULT NULL COMMENT '是否需要启动对话框',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 20 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '流程节点动作' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of flow_action
-- ----------------------------
INSERT INTO `flow_action` VALUES (1, 'apply_completion', 'verify', 'second_approve', '提交审批', 'primary', 0, 4, '提交审批', 1, 1, 1);
INSERT INTO `flow_action` VALUES (2, 'apply_extension', 'verify', 'second_extension_approve', '申请延期', 'primary', 1, 3, '申请延期', 0, 0, 1);
INSERT INTO `flow_action` VALUES (3, 'first_approve', 'first_approve', 'completed', '审批通过', 'primary', 0, 2, '已审批', NULL, 1, 1);
INSERT INTO `flow_action` VALUES (4, 'first_approve_return', 'first_approve', 'second_approve', '退回整改', 'danger', 1, 1, '已退回', NULL, NULL, NULL);
INSERT INTO `flow_action` VALUES (5, 'first_distribute', 'first_distribute', 'second_sign', '下发问题', 'primary', 0, 1, '已下发', 1, 1, NULL);
INSERT INTO `flow_action` VALUES (6, 'save', 'verify', 'verify', '保存信息', 'primary', 1, 1, NULL, 1, 0, NULL);
INSERT INTO `flow_action` VALUES (7, 'second_approve', 'second_approve', 'first_approve', '审批通过', 'primary', 0, 2, '已审批', NULL, NULL, 1);
INSERT INTO `flow_action` VALUES (8, 'second_approve_return', 'second_approve', 'verify', '退回整改', 'danger', 1, 1, '退回整改', NULL, 1, 1);
INSERT INTO `flow_action` VALUES (9, 'second_distribute', 'second_distribute', 'three_sign', '下发问题', 'primary', 0, 3, '已下发', 1, 1, NULL);
INSERT INTO `flow_action` VALUES (10, 'second_sign', 'second_sign', 'second_distribute', '确认签收', 'primary', 0, 3, '已签收', 0, 0, NULL);
INSERT INTO `flow_action` VALUES (11, 'second_sign_return', 'second_sign', 'first_distribute', '问题退回', 'danger', 1, 1, '已退回', 0, 0, NULL);
INSERT INTO `flow_action` VALUES (12, 'three_sign', 'three_sign', 'verify', '确认签收', 'primary', 0, 2, '已签收', 0, 0, NULL);
INSERT INTO `flow_action` VALUES (13, 'three_sign_return', 'verify', 'second_distribute', '问题退回', 'danger', 0, 2, '已退回', NULL, 1, 1);
INSERT INTO `flow_action` VALUES (14, 'second_sign_return', 'second_distribute', 'first_distribute', '问题退回', 'danger', 1, 1, '已退回', 0, 1, 1);
INSERT INTO `flow_action` VALUES (15, 'second_extension_approve', 'second_extension_approve', 'first_extension_approve', '审批通过', 'primary', 0, 2, '延期申请已审批', 0, 1, 1);
INSERT INTO `flow_action` VALUES (16, 'second_extension_return', 'second_extension_approve', NULL, '审批驳回', 'danger', 0, 1, '延期申请已驳回', 0, 1, 1);
INSERT INTO `flow_action` VALUES (17, 'first_extension_approve', 'first_extension_approve', '', '审批通过', 'primary', 0, 2, '延期申请已审批', 0, 1, 1);
INSERT INTO `flow_action` VALUES (18, 'first_extension_return', 'first_extension_approve', NULL, '审批驳回', 'danger', 0, 1, '延期申请已驳回', 0, 1, 1);
INSERT INTO `flow_action` VALUES (19, 'second_local_processing', 'second_distribute', 'verify', '本级处理', 'primary', 1, 2, '本级处理', 0, 0, 0);
INSERT INTO `flow_action` VALUES (20, 'three_sign_return', 'three_sign', 'second_distribute', '问题退回', 'danger', 0, 1, '已退回', NULL, 1, 1);
CREATE TABLE `flow_node` (
`flow_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`flow_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '流程节点名称',
`flow_sort` int(0) NULL DEFAULT NULL COMMENT '排序',
PRIMARY KEY (`flow_key`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '流程节点' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of flow_node
-- ----------------------------
INSERT INTO `flow_node` VALUES ('completed', '已办结', 10);
INSERT INTO `flow_node` VALUES ('first_approve', '市局审批', 7);
INSERT INTO `flow_node` VALUES ('first_distribute', '市局下发', 1);
INSERT INTO `flow_node` VALUES ('first_extension_approve', '市局延期审批', 9);
INSERT INTO `flow_node` VALUES ('second_approve', '二级机构审批', 6);
INSERT INTO `flow_node` VALUES ('second_distribute', '二级机构下发', 3);
INSERT INTO `flow_node` VALUES ('second_extension_approve', '二级机构延期审批', 8);
INSERT INTO `flow_node` VALUES ('second_sign', '二级机构签收', 2);
INSERT INTO `flow_node` VALUES ('three_sign', '三级机构签收', 4);
INSERT INTO `flow_node` VALUES ('verify', '核查办理', 5);
CREATE TABLE holiday (
id int NOT NULL AUTO_INCREMENT,
date varchar(255) NOT NULL COMMENT '日期',
flag tinyint NOT NULL COMMENT '是否是节假日',
holiday_name varchar(255) COMMENT '节假日名称',
year int NOT NULL COMMENT '',
PRIMARY KEY (`id`)
) COMMENT='节假日';
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-01', 1, '元旦', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-02', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-03', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-04', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-05', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-06', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-07', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-08', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-09', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-10', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-11', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-12', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-13', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-14', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-15', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-16', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-17', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-18', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-19', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-20', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-21', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-22', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-23', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-24', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-25', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-26', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-27', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-28', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-29', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-30', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-01-31', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-03', 1, '劳动节', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-04', 1, '劳动节', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-05', 1, '劳动节', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-06', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-07', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-08', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-09', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-10', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-11', 0, '正常上班', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-12', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-13', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-14', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-15', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-16', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-17', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-18', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-19', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-20', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-21', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-22', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-23', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-24', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-25', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-26', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-27', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-28', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-29', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-30', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-31', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-01', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-01', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-02', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-03', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-04', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-05', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-06', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-07', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-08', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-09', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-10', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-11', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-12', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-13', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-14', 0, '正常上班', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-15', 1, '中秋节', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-16', 1, '中秋节', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-17', 1, '中秋节', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-18', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-19', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-20', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-21', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-22', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-23', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-24', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-25', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-26', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-27', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-28', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-29', 0, '正常上班', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-30', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-01', 1, '国庆节', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-02', 1, '国庆节', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-03', 1, '国庆节', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-04', 0, '正常上班', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-05', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-06', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-07', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-08', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-09', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-10', 1, '初一', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-11', 1, '初二', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-12', 1, '初三', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-13', 1, '初四', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-14', 1, '初五', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-15', 1, '初六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-16', 1, '初七', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-17', 1, '初八', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-18', 0, '正常上班', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-19', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-20', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-21', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-22', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-23', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-24', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-25', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-26', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-27', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-28', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-02-29', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-01', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-02', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-03', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-04', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-05', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-06', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-07', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-08', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-09', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-10', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-11', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-12', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-13', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-14', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-15', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-16', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-17', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-18', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-19', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-20', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-21', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-22', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-23', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-24', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-25', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-26', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-27', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-28', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-29', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-30', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-03-31', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-01', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-02', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-03', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-04', 1, '清明节', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-05', 1, '清明节', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-06', 1, '清明节', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-07', 0, '正常上班', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-08', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-09', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-10', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-11', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-12', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-13', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-14', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-15', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-16', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-17', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-18', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-19', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-20', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-21', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-22', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-23', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-24', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-25', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-26', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-27', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-28', 0, '正常上班', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-29', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-04-30', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-01', 1, '劳动节', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-05-02', 1, '劳动节', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-02', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-03', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-04', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-05', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-06', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-07', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-08', 1, '端午节', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-09', 1, '端午节', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-10', 1, '端午节', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-11', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-12', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-13', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-14', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-15', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-16', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-17', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-18', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-19', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-20', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-21', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-22', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-23', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-24', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-25', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-26', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-27', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-28', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-29', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-06-30', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-01', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-02', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-03', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-04', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-05', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-06', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-07', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-08', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-09', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-10', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-11', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-12', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-13', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-14', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-15', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-16', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-17', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-18', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-19', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-20', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-21', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-22', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-23', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-24', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-25', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-26', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-27', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-28', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-29', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-30', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-07-31', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-01', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-02', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-03', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-04', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-05', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-06', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-07', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-08', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-09', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-10', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-11', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-12', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-13', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-14', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-15', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-16', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-17', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-18', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-19', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-20', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-21', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-22', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-23', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-24', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-25', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-26', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-27', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-28', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-29', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-30', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-08-31', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-01', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-02', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-09-03', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-04', 1, '国庆节', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-05', 1, '国庆节', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-06', 1, '国庆节', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-07', 1, '国庆节', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-08', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-09', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-10', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-11', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-12', 0, '正常上班', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-13', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-14', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-15', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-16', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-17', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-18', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-19', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-20', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-21', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-22', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-23', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-24', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-25', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-26', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-27', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-28', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-29', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-30', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-10-31', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-01', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-02', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-03', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-04', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-05', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-06', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-07', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-08', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-09', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-10', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-11', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-12', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-13', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-14', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-15', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-16', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-17', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-18', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-19', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-20', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-21', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-22', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-23', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-24', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-25', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-26', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-27', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-28', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-29', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-11-30', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-01', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-02', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-03', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-04', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-05', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-06', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-07', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-08', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-09', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-10', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-11', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-12', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-13', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-14', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-15', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-16', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-17', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-18', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-19', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-20', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-21', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-22', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-23', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-24', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-25', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-26', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-27', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-28', 1, '周六', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-29', 1, '周日', 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-30', 0, NULL, 2024);
INSERT INTO holiday (date, flag, holiday_name, year) VALUES ('2024-12-31', 0, NULL, 2024);
CREATE TABLE negative_approve (
id int NOT NULL AUTO_INCREMENT,
negative_id varchar(40) not null,
state varchar(40) not null,
handler_depart_id varchar(40),
handler_depart_name varchar(255),
handler_user_name varchar(255),
handler_name varchar(255),
comments text COMMENT '审批意见',
action_key varchar(255),
create_time datetime DEFAULT now(),
PRIMARY KEY (`id`)
) COMMENT='问题审批';
CREATE TABLE negative_extension_apply (
id int NOT NULL AUTO_INCREMENT,
negative_id varchar(40) not null,
handler_depart_id varchar(40),
handler_depart_name varchar(255),
handler_user_name varchar(255),
handler_name varchar(255),
comments text COMMENT '延期理由',
extension_days int COMMENT '延期天数',
create_time datetime DEFAULT now(),
PRIMARY KEY (`id`)
) COMMENT='问题申请延期';
CREATE TABLE negative_extension_approve (
id int NOT NULL AUTO_INCREMENT,
negative_id varchar(40) not null,
negative_extension_apply_id int not null,
handler_depart_id varchar(40),
handler_depart_name varchar(255),
handler_user_name varchar(255),
handler_name varchar(255),
comments text COMMENT '审批意见/驳回理由',
state varchar(40) not null,
action_key varchar(255),
create_time datetime DEFAULT now(),
PRIMARY KEY (`id`)
) COMMENT='问题申请延期';
CREATE TABLE negative_fav (
id int NOT NULL AUTO_INCREMENT,
negative_id varchar(40) not null,
user_id varchar(40) not null,
create_time datetime DEFAULT now(),
PRIMARY KEY (`id`)
) COMMENT='问题收藏';
CREATE TABLE negative_sign_return (
id int NOT NULL AUTO_INCREMENT,
negative_id varchar(40) not null,
handler_depart_id varchar(40),
handler_depart_name varchar(255),
handler_user_name varchar(255),
handler_name varchar(255),
comments text COMMENT '退回原因',
action_key varchar(255),
create_time datetime DEFAULT now(),
PRIMARY KEY (`id`)
) COMMENT='问题签收退回';
CREATE TABLE negative_thing_file (
id int NOT NULL AUTO_INCREMENT,
negative_id varchar(40) not null,
file_name varchar(255) not null COMMENT '文件名称',
file_path varchar(255) not null COMMENT '文件路径',
type varchar(255),
create_time datetime DEFAULT now(),
PRIMARY KEY (`id`)
) COMMENT='问题事件附件';
CREATE TABLE negative_work (
id int NOT NULL AUTO_INCREMENT,
negative_id varchar(40),
depart_id varchar(40),
role_code varchar(255),
problem_sources_code varchar(255),
flow_key varchar(255),
status varchar(255) default 'todo',
create_time datetime DEFAULT now(),
update_time datetime DEFAULT now(),
PRIMARY KEY (`id`)
) COMMENT='问题工作记录表';
ALTER TABLE `negative`.`negative_file`
ADD COLUMN `file_class_id` int NULL AFTER `status`;

8
sql/negative_mark.sql

@ -0,0 +1,8 @@
CREATE TABLE negative_mark (
negative_id varchar(40),
involve_second_depart_id varchar(40) COMMENT '涉及二级单位',
involve_second_depart_name varchar(255) COMMENT '涉及二级单位名称',
involve_three_depart_id varchar(40) COMMENT '涉及三级单位',
involve_three_depart_name varchar(255) COMMENT '涉及三级单位名称',
PRIMARY KEY (`negative_id`)
) COMMENT='问题统计表';

89
sql/open-platform_0904.sql

@ -0,0 +1,89 @@
-- ----------------------------
-- Table structure for menu
-- ----------------------------
CREATE TABLE `menu` (
`id` int(0) NOT NULL AUTO_INCREMENT,
`pid` int(0) NULL DEFAULT NULL,
`menu_type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '菜单类型',
`menu_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '菜单名称',
`icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '菜单图标',
`menu_sort` int(0) NULL DEFAULT NULL COMMENT '排序',
`perms` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
`paths` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '路径',
`component` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '组件',
`is_cache` int(0) NOT NULL DEFAULT 0 COMMENT '是否缓存',
`is_show` int(0) NOT NULL DEFAULT 1,
`is_disable` int(0) NOT NULL DEFAULT 0,
`create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
`update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 19 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '菜单' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of menu
-- ----------------------------
INSERT INTO `menu` VALUES (1, 0, 'C', '首页', 'el-icon-House', 1, NULL, '/', 'Home', 1, 1, 0, '2024-08-06 17:13:17', '2024-08-07 15:49:38');
INSERT INTO `menu` VALUES (2, 0, 'C', '一体化大屏', 'el-icon-PieChart', 1, NULL, '/bigscreen', NULL, 1, 1, 0, '2024-08-06 17:20:08', '2024-08-07 15:50:25');
INSERT INTO `menu` VALUES (3, 0, 'M', '我的工作', 'el-icon-Box', 1, NULL, '/work', NULL, 1, 1, 0, '2024-08-06 17:20:42', '2024-08-07 15:51:05');
INSERT INTO `menu` VALUES (4, 0, 'M', '系统管理', 'el-icon-Setting', NULL, NULL, '/system', NULL, 1, 1, 0, '2024-08-06 17:23:12', '2024-08-26 15:47:58');
INSERT INTO `menu` VALUES (5, 3, 'C', '我的待办', NULL, 10, NULL, '/work/todo', '/work/Todo', 1, 1, 0, '2024-08-06 17:26:38', '2024-08-07 16:55:48');
INSERT INTO `menu` VALUES (6, 3, 'C', '我的已办', NULL, 9, NULL, '/work/done', '/work/Done', 1, 1, 0, '2024-08-06 17:26:59', '2024-08-07 16:56:10');
INSERT INTO `menu` VALUES (7, 4, 'C', '用户管理', NULL, 10, NULL, '/system/user', '/system/User', 1, 1, 0, '2024-08-06 17:28:19', '2024-08-09 14:19:48');
INSERT INTO `menu` VALUES (8, 4, 'C', '警员中心', NULL, 9, NULL, '/system/police', '/system/Police', 1, 1, 0, '2024-08-06 17:28:26', '2024-08-07 15:47:53');
INSERT INTO `menu` VALUES (9, 4, 'C', '菜单管理', NULL, 8, NULL, '/system/menu', '/system/Menu', 1, 1, 0, '2024-08-06 17:28:40', '2024-08-07 15:48:30');
INSERT INTO `menu` VALUES (10, 4, 'C', '角色管理', NULL, 7, NULL, '/system/role', '/system/Role', 1, 1, 0, '2024-08-07 16:54:20', '2024-08-07 16:54:20');
INSERT INTO `menu` VALUES (11, 4, 'C', '部门管理', NULL, 6, NULL, '/system/depart', '/system/Depart', 1, 1, 0, '2024-08-08 16:44:16', '2024-08-08 16:44:16');
INSERT INTO `menu` VALUES (12, 4, 'C', '数据字典', NULL, 5, NULL, '/system/dict', '/system/Dict', 1, 1, 0, '2024-08-08 16:44:59', '2024-08-08 16:44:59');
INSERT INTO `menu` VALUES (13, 4, 'C', '问题类型', NULL, NULL, NULL, '/system/dictContent', '/system/DictContent', 1, 1, 0, '2024-08-16 14:40:53', '2024-08-16 14:40:53');
INSERT INTO `menu` VALUES (14, 3, 'C', '我的收藏', NULL, NULL, NULL, '/work/myFav', '/work/Fav', 1, 1, 0, '2024-08-16 18:52:26', '2024-08-16 18:52:26');
INSERT INTO `menu` VALUES (15, 3, 'C', '综合查询', NULL, NULL, NULL, '/query', '/work/Query', 1, 1, 0, '2024-08-27 10:09:25', '2024-08-27 10:09:25');
INSERT INTO `menu` VALUES (16, 8, 'A', '新增警员', NULL, NULL, 'police:add', '', NULL, 0, 1, 0, '2024-09-03 18:38:46', '2024-09-03 18:38:46');
INSERT INTO `menu` VALUES (17, 8, 'A', '权限设置', NULL, NULL, 'police:auth', NULL, NULL, 0, 1, 0, '2024-09-03 18:45:04', '2024-09-03 18:45:04');
INSERT INTO `menu` VALUES (18, 5, 'A', '问题录入', NULL, NULL, 'negative:add', NULL, NULL, 0, 1, 0, '2024-09-04 11:29:54', '2024-09-04 11:29:54');
-- ----------------------------
-- Table structure for role_menu
-- ----------------------------
CREATE TABLE `role_menu` (
`id` int(0) NOT NULL AUTO_INCREMENT,
`role_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
`menu_id` int(0) NULL DEFAULT NULL,
`create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0),
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 103 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '角色菜单权限表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of role_menu
-- ----------------------------
INSERT INTO `role_menu` VALUES (43, 'admin_1_1_1_2', 1, '2024-09-03 18:42:22');
INSERT INTO `role_menu` VALUES (44, 'admin_1_1_1_2', 3, '2024-09-03 18:42:22');
INSERT INTO `role_menu` VALUES (45, 'admin_1_1_1_2', 5, '2024-09-03 18:42:22');
INSERT INTO `role_menu` VALUES (46, 'admin_1_1_1_2', 6, '2024-09-03 18:42:22');
INSERT INTO `role_menu` VALUES (47, 'admin_1_1_1_2', 14, '2024-09-03 18:42:22');
INSERT INTO `role_menu` VALUES (48, 'admin_1_1_1_2', 15, '2024-09-03 18:42:22');
INSERT INTO `role_menu` VALUES (49, 'admin_1_1_1_2', 4, '2024-09-03 18:42:22');
INSERT INTO `role_menu` VALUES (50, 'admin_1_1_1_2', 8, '2024-09-03 18:42:22');
INSERT INTO `role_menu` VALUES (70, 'admin_1_1_1_3', 3, '2024-09-03 20:48:31');
INSERT INTO `role_menu` VALUES (71, 'admin_1_1_1_3', 5, '2024-09-03 20:48:32');
INSERT INTO `role_menu` VALUES (72, 'admin_1_1_1_3', 6, '2024-09-03 20:48:32');
INSERT INTO `role_menu` VALUES (73, 'admin_1_1_1_3', 14, '2024-09-03 20:48:32');
INSERT INTO `role_menu` VALUES (74, 'admin_1_1_1_3', 15, '2024-09-03 20:48:32');
INSERT INTO `role_menu` VALUES (75, 'admin_1_1_1_3', 1, '2024-09-03 20:48:32');
INSERT INTO `role_menu` VALUES (76, 'admin_1_1_1_3', 4, '2024-09-03 20:48:32');
INSERT INTO `role_menu` VALUES (77, 'admin_1_1_1_3', 8, '2024-09-03 20:48:32');
INSERT INTO `role_menu` VALUES (78, 'admin_1_1_1_3', 16, '2024-09-03 20:48:32');
INSERT INTO `role_menu` VALUES (79, 'admin_1_1_1_3', 17, '2024-09-03 20:48:32');
INSERT INTO `role_menu` VALUES (91, 'admin_1', 3, '2024-09-04 11:30:26');
INSERT INTO `role_menu` VALUES (92, 'admin_1', 5, '2024-09-04 11:30:26');
INSERT INTO `role_menu` VALUES (93, 'admin_1', 18, '2024-09-04 11:30:26');
INSERT INTO `role_menu` VALUES (94, 'admin_1', 6, '2024-09-04 11:30:27');
INSERT INTO `role_menu` VALUES (95, 'admin_1', 14, '2024-09-04 11:30:27');
INSERT INTO `role_menu` VALUES (96, 'admin_1', 15, '2024-09-04 11:30:27');
INSERT INTO `role_menu` VALUES (97, 'admin_1', 1, '2024-09-04 11:30:27');
INSERT INTO `role_menu` VALUES (98, 'admin_1', 4, '2024-09-04 11:30:27');
INSERT INTO `role_menu` VALUES (99, 'admin_1', 7, '2024-09-04 11:30:27');
INSERT INTO `role_menu` VALUES (100, 'admin_1', 8, '2024-09-04 11:30:27');
INSERT INTO `role_menu` VALUES (101, 'admin_1', 16, '2024-09-04 11:30:27');
INSERT INTO `role_menu` VALUES (102, 'admin_1', 11, '2024-09-04 11:30:27');

4
sql/truncate.sql

@ -0,0 +1,4 @@
truncate negative_work;
truncate negative_history;
truncate negative_fav;
truncate negative_fav;

1
sql/update-data.sql

@ -0,0 +1 @@
UPDATE `negative`.`negative` set flow_key = 'completed', processing_status = 'completed';

15
src/main/java/com/biutag/supervision/SupervisionApplication.java

@ -0,0 +1,15 @@
package com.biutag.supervision;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
@EnableScheduling
@SpringBootApplication
public class SupervisionApplication {
public static void main(String[] args) {
SpringApplication.run(SupervisionApplication.class, args);
}
}

34
src/main/java/com/biutag/supervision/common/UserContextHolder.java

@ -0,0 +1,34 @@
package com.biutag.supervision.common;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.Header;
import com.biutag.supervision.constants.RedisKeyConstants;
import com.biutag.supervision.exception.AuthException;
import com.biutag.supervision.pojo.model.UserAuth;
import com.biutag.supervision.util.SpringUtil;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
public class UserContextHolder {
public static String getCurrentToken() {
HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
return request.getHeader(Header.AUTHORIZATION.getValue());
}
public static UserAuth getCurrentUser() {
String authorization = getCurrentToken();
if (StrUtil.isBlank(authorization)) {
throw new AuthException();
}
UserAuth userAuth = (UserAuth) SpringUtil.getBean("redisTemplate", RedisTemplate.class).opsForValue().get(String.format(RedisKeyConstants.LOGIN_USERINFO_KEY, authorization));
return userAuth;
}
public static String getCurrentUserId() {
return getCurrentUser().getUserId();
}
}

20
src/main/java/com/biutag/supervision/config/FastDFSConfig.java

@ -0,0 +1,20 @@
package com.biutag.supervision.config;
import com.github.tobato.fastdfs.domain.conn.TrackerConnectionManager;
import jakarta.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@ComponentScan("com.github.tobato.fastdfs")
@Configuration
public class FastDFSConfig {
@Autowired
private TrackerConnectionManager trackerConnectionManager;
@PostConstruct
public void init() {
trackerConnectionManager.initTracker();
}
}

62
src/main/java/com/biutag/supervision/config/GlobalExceptionHandler.java

@ -0,0 +1,62 @@
package com.biutag.supervision.config;
import com.biutag.supervision.exception.AuthException;
import com.biutag.supervision.pojo.Result;
import jakarta.validation.ValidationException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.dao.DataAccessException;
import org.springframework.http.HttpStatus;
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.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;
import java.util.stream.Collectors;
@Slf4j
@ControllerAdvice
public class GlobalExceptionHandler {
@ResponseStatus(HttpStatus.OK)
@ExceptionHandler(Exception.class)
@ResponseBody
public Result<Object> handleException(Exception e) {
log.error("系统异常: {}", e.getMessage(), e);
return Result.failed(e.getMessage());
}
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
@ExceptionHandler(DataAccessException.class)
@ResponseBody
public Result<Object> handleDataAccessException(DataAccessException e) {
log.error("数据库异常: {}", e.getMessage(), e);
return Result.failed(String.format("数据库异常:%s", e.getMessage()));
}
@ResponseStatus(HttpStatus.UNAUTHORIZED)
@ExceptionHandler(AuthException.class)
@ResponseBody
public Result<Object> handleAuthException(AuthException e) {
log.error("未授权", e);
return Result.failed(HttpStatus.UNAUTHORIZED.value(), HttpStatus.UNAUTHORIZED.getReasonPhrase());
}
@ResponseStatus(HttpStatus.BAD_REQUEST)
@ExceptionHandler(MethodArgumentNotValidException.class)
@ResponseBody
public Result<Object> handleMethodArgumentNotValidException(MethodArgumentNotValidException e) {
String message = e.getBindingResult().getFieldErrors().stream().map(item -> "不能为空".equals(item.getDefaultMessage()) ? item.getField() + "-" + item.getDefaultMessage() : item.getDefaultMessage()).collect(Collectors.joining("; "));
log.error("参数错误: {}", message, e);
return Result.failed(HttpStatus.BAD_REQUEST.value(), String.format("参数错误:%s", message));
}
@ResponseStatus(HttpStatus.BAD_REQUEST)
@ExceptionHandler(ValidationException.class)
@ResponseBody
public Result<Object> handleValidationException(ValidationException e) {
log.error("参数错误", e);
return Result.failed(HttpStatus.BAD_REQUEST.value(), e.getMessage());
}
}

73
src/main/java/com/biutag/supervision/config/InterceptorConfig.java

@ -0,0 +1,73 @@
package com.biutag.supervision.config;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.Header;
import com.biutag.supervision.constants.RedisKeyConstants;
import com.biutag.supervision.exception.AuthException;
import com.biutag.supervision.util.SpringUtil;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
/**
* @author wxc
* @date 2024/1/8
*/
@Slf4j
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(new DefaultInterceptor())
.addPathPatterns("/**")
.excludePathPatterns("/api/**")
.excludePathPatterns("/login")
.excludePathPatterns("/auth/self")
.excludePathPatterns("/file/stream/**", "/templates/**")
.excludePathPatterns(List.of("/doc.html", "/webjars/**", "/favicon.ico", "/v3/api-docs/**"));
registry.addInterceptor(new ApiInterceptor())
.addPathPatterns("/api/jwdc/**");
}
static class DefaultInterceptor implements HandlerInterceptor {
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
log.info("请求地址:{}", request.getRequestURI());
String authorization = request.getHeader(Header.AUTHORIZATION.getValue());
RedisTemplate<Object, Object> redisTemplate = SpringUtil.getBean("redisTemplate", RedisTemplate.class);
if (StrUtil.isBlank(authorization) || Objects.isNull(redisTemplate.opsForValue().get(String.format(RedisKeyConstants.LOGIN_USERINFO_KEY, authorization)))) {
throw new AuthException();
}
// 更新 会话 有效期
redisTemplate.expire(String.format(RedisKeyConstants.LOGIN_USERINFO_KEY, authorization), 24, TimeUnit.HOURS);
return true;
}
}
static class ApiInterceptor implements HandlerInterceptor {
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
log.info("请求地址【API】:{}", request.getRequestURI());
String authorization = request.getHeader("Authorization");
if (!"565318a8ea367e03904e1c241048dd6c".equals(authorization)) {
throw new AuthException();
}
return true;
}
}
}

22
src/main/java/com/biutag/supervision/config/MybatisPlusConfig.java

@ -0,0 +1,22 @@
package com.biutag.supervision.config;
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
@MapperScan("com.biutag.supervision.mapper")
public class MybatisPlusConfig {
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); // 如果配置多个插件, 切记分页最后添加
// 如果有多数据源可以不配具体类型, 否则都建议配上具体的 DbType
return interceptor;
}
}

22
src/main/java/com/biutag/supervision/config/ScheduledConfig.java

@ -0,0 +1,22 @@
package com.biutag.supervision.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.TaskScheduler;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;
/**
* @author wxc
* @date 2024/10/17
*/
@Configuration
public class ScheduledConfig {
@Bean
public ScheduledTaskRegistrar scheduledTaskRegistrar(TaskScheduler taskScheduler) {
ScheduledTaskRegistrar scheduledTaskRegistrar = new ScheduledTaskRegistrar();
scheduledTaskRegistrar.setTaskScheduler(taskScheduler);
return scheduledTaskRegistrar;
}
}

28
src/main/java/com/biutag/supervision/config/SwaggerConfig.java

@ -0,0 +1,28 @@
package com.biutag.supervision.config;
import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
@Configuration
public class SwaggerConfig {
@Bean
public OpenAPI springShopOpenAPI() {
return new OpenAPI()
.info(new Info().title("长沙公安数字督察一体化平台接口文档")
.contact(new Contact())
.description("长沙公安数字督察一体化平台接口文档")
.version("v1")
.license(new License().name("长沙市公安局").url("")))
.externalDocs(new ExternalDocumentation()
.description("接口文档"));
}
}

28
src/main/java/com/biutag/supervision/constants/AppConstants.java

@ -0,0 +1,28 @@
package com.biutag.supervision.constants;
public class AppConstants {
public static final int MENU_ROOT_ID = 0;
// 单位
public static final String DICT_CONTENT_ROOT_PARENT_CODE = "-1";
public static final Integer DICT_PROBLEM_SOURCE_ROOT_PARENT_CODE = -1;
// 管理员类型类型(超级管理员)
public static final String USER_TYPE_SUPER = "super";
// 单位
public static final String DEPART_ROOT_PID = "0";
// 单位根节点ID(长沙市公安局)
public static final String ROOT_DEPART_ID = "12630";
public static final String ROOT_DEPART_NAME = "长沙市公安局";
//
public static final String SIGN_RETURN_ACTION_NAME = "已退回";
}

6
src/main/java/com/biutag/supervision/constants/RedisKeyConstants.java

@ -0,0 +1,6 @@
package com.biutag.supervision.constants;
public class RedisKeyConstants {
public final static String LOGIN_USERINFO_KEY = "login:userinfo:%s";
}

17
src/main/java/com/biutag/supervision/constants/enums/ApprovalFlowEnum.java

@ -0,0 +1,17 @@
package com.biutag.supervision.constants.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public enum ApprovalFlowEnum {
// 二级审批 所队一>二级机构
SECOND_APPROVAL("2"),
// 三级审批 所队一>二級机构一>市局
THREE_APPROVAL("3");
private String value;
}

7
src/main/java/com/biutag/supervision/constants/enums/ApproveStateEnum.java

@ -0,0 +1,7 @@
package com.biutag.supervision.constants.enums;
public enum ApproveStateEnum {
approved,
rejected;
}

39
src/main/java/com/biutag/supervision/constants/enums/BusinessTypeEnum.java

@ -0,0 +1,39 @@
package com.biutag.supervision.constants.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@AllArgsConstructor
@Getter
public enum BusinessTypeEnum {
JCJ_110("110接处警", "1", "110"),
JCJ_122("122接处警", "2", "122"),
RJCKFW("人境窗口服务", "3", "RJ"),
CJGFF("车驾管服务", "4", "CJG"),
JJCF("交警执法", "5", "JJ"),
ZFBA("执法办案", "6", "CF"),
ZXGZ("专项工作", "7", "ZX"),
ABWW("安保维稳", "8", "AB"),
JAFK("治安防控", "9", "ZA"),
XZGL("行政管理", "10", "XZ"),
FFJC("服务基层", "12", "FF"),
DWGL("队伍管理", "13", "DW"),
QT("其他", "14", "QT"),
;
private String label;
private String value;
private String key;
public static BusinessTypeEnum get(String value) {
for (BusinessTypeEnum businessTypeEnum : values()) {
if (businessTypeEnum.value.equals(value)) {
return businessTypeEnum;
}
}
throw new RuntimeException("无此业务类型");
}
}

19
src/main/java/com/biutag/supervision/constants/enums/CaseVerifProblemNatureEnum.java

@ -0,0 +1,19 @@
package com.biutag.supervision.constants.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @author wxc
* @date 2024/10/29
*/
@AllArgsConstructor
public enum CaseVerifProblemNatureEnum {
ZFBA("执法办案"),
FWGL("服务管理"),
JJJG("警纪警规");
@Getter
private String laebl;
}

9
src/main/java/com/biutag/supervision/constants/enums/DataUpdateMethodEnum.java

@ -0,0 +1,9 @@
package com.biutag.supervision.constants.enums;
public enum DataUpdateMethodEnum {
// 增量更新
incremental,
// 覆盖更新
overwrite
}

20
src/main/java/com/biutag/supervision/constants/enums/DepartGroupEnum.java

@ -0,0 +1,20 @@
package com.biutag.supervision.constants.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @author wxc
* @date 2024/10/29
*/
@AllArgsConstructor
@Getter
public enum DepartGroupEnum {
COUNTY_CITY_BUREAUS(3, "分县市局"),
BUREAU_AFFILIATED(4, "局属单位");
private Integer id;
private String label;
}

16
src/main/java/com/biutag/supervision/constants/enums/DepartLevelEnum.java

@ -0,0 +1,16 @@
package com.biutag.supervision.constants.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@AllArgsConstructor
@Getter
public enum DepartLevelEnum {
SECOND_CATEGORY(1),
SECOND(2),
THREE(3);
private Integer value;
}

10
src/main/java/com/biutag/supervision/constants/enums/DistributionCycleEnum.java

@ -0,0 +1,10 @@
package com.biutag.supervision.constants.enums;
/**
* @author wxc
* @date 2024/10/17
*/
public enum DistributionCycleEnum {
day,
weekly
}

17
src/main/java/com/biutag/supervision/constants/enums/DistributionFlowEnum.java

@ -0,0 +1,17 @@
package com.biutag.supervision.constants.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @author wxc
* @date 2024/10/17
*/
@AllArgsConstructor
@Getter
public enum DistributionFlowEnum {
SECOND("2"),
THIRD("3");
private String value;
}

23
src/main/java/com/biutag/supervision/constants/enums/DistributionMethodEnum.java

@ -0,0 +1,23 @@
package com.biutag.supervision.constants.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @author wxc
* @date 2024/10/17
*/
@AllArgsConstructor
@Getter
public enum DistributionMethodEnum {
// 问题下发
NEGATIVE_DISTRIBUTE("1"),
// 数据保存
DATA_SAVE("2"),
// 预警通知
WARNING_NOTIFICATION("3");
private String value;
}

22
src/main/java/com/biutag/supervision/constants/enums/DistributionStateEnum.java

@ -0,0 +1,22 @@
package com.biutag.supervision.constants.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @author wxc
* @date 2024/10/17
*/
@AllArgsConstructor
public enum DistributionStateEnum {
// 未分发
UNDISTRIBUTED("0"),
// 已分发
DISTRIBUTED("1"),
// 已处置
HANDLED("2");
@Getter
private String value;
}

19
src/main/java/com/biutag/supervision/constants/enums/FlowActionEnum.java

@ -0,0 +1,19 @@
package com.biutag.supervision.constants.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@AllArgsConstructor
public enum FlowActionEnum {
FIRST_DISTRIBUTE("first_distribute", "已下发"),
SECOND_APPROVE("second_approve", "已审批"),
FIRST_APPROVE("first_approve", "已审批");
@Getter
private String key;
@Getter
private String name;
}

41
src/main/java/com/biutag/supervision/constants/enums/FlowNodeEnum.java

@ -0,0 +1,41 @@
package com.biutag.supervision.constants.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.List;
@AllArgsConstructor
@Getter
public enum FlowNodeEnum {
FIRST_DISTRIBUTE("first_distribute"),
SECOND_SIGN("second_sign"),
SECOND_DISTRIBUTE("second_distribute"),
THREE_SIGN("three_sign"),
VERIFY("verify"),
SECOND_APPROVE("first_approve"),
FIRST_APPROVE("first_approve"),
SECOND_EXTENSION_APPROVE("first_approve"),
FIRST_EXTENSION_APPROVE("first_approve"),
COMPLETED("completed");
private String key;
public static List<String> getSignFlowKeys() {
return List.of(FIRST_DISTRIBUTE.getKey(), SECOND_SIGN.getKey(), SECOND_DISTRIBUTE.getKey(), THREE_SIGN.getKey());
}
public static boolean isSignFlow(String flowKey) {
return getSignFlowKeys().contains(flowKey);
}
/**
* 办结审批
* @return
*/
public static List<String> getApproveFlowKeys() {
return List.of(FIRST_DISTRIBUTE.getKey(), SECOND_SIGN.getKey(), SECOND_DISTRIBUTE.getKey(), THREE_SIGN.getKey());
}
}

15
src/main/java/com/biutag/supervision/constants/enums/HostLevelEnums.java

@ -0,0 +1,15 @@
package com.biutag.supervision.constants.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public enum HostLevelEnums {
FIRST("1"),
SECOND("2"),
THREE("3");
private String value;
}

38
src/main/java/com/biutag/supervision/constants/enums/InitialPetition.java

@ -0,0 +1,38 @@
package com.biutag.supervision.constants.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
*
* @author wxc
* @date 2024/10/22
*/
@Getter
@AllArgsConstructor
public enum InitialPetition {
THE_FIRST("1", "初访"),
REPEAT("2", "重访");
private String value;
public String label;
public static String getValue(String str) {
if ("初".equals(str)) {
return THE_FIRST.getValue();
}
if ("重".equals(str)) {
return REPEAT.getValue();
}
for (InitialPetition value : values()) {
if (value.getLabel().equals(str)) {
return value.getValue();
}
}
return null;
}
}

28
src/main/java/com/biutag/supervision/constants/enums/InspectCaseEnum.java

@ -0,0 +1,28 @@
package com.biutag.supervision.constants.enums;
import cn.hutool.core.util.StrUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public enum InspectCaseEnum {
// 属实
TRUE("1"),
// 部分属实
PARTIALLY_TRUE("2"),
// 不属实
FALSE("3"),
NOT_VERIFIED("4"),
OTHER("5");
private String value;
public static boolean isItTure(String value) {
return StrUtil.isNotBlank(value) && !OTHER.getValue().equals(value);
}
}

16
src/main/java/com/biutag/supervision/constants/enums/IsRectifyEnum.java

@ -0,0 +1,16 @@
package com.biutag.supervision.constants.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
// 是否整改
@AllArgsConstructor
@Getter
public enum IsRectifyEnum {
NOT("0"),
YES("1");
private String value;
}

17
src/main/java/com/biutag/supervision/constants/enums/MenuEnum.java

@ -0,0 +1,17 @@
package com.biutag.supervision.constants.enums;
import lombok.AllArgsConstructor;
@AllArgsConstructor
public enum MenuEnum {
CATALOGUE("M"),
MENU("C"),
BUTTON("A");
private String value;
public String value() {
return value;
}
}

13
src/main/java/com/biutag/supervision/constants/enums/NegativeTaskCategoryEnum.java

@ -0,0 +1,13 @@
package com.biutag.supervision.constants.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@AllArgsConstructor
public enum NegativeTaskCategoryEnum {
IMPORT("0"),
EXPORT("2");
@Getter
private String value;
}

14
src/main/java/com/biutag/supervision/constants/enums/NegativeTaskStatusEnum.java

@ -0,0 +1,14 @@
package com.biutag.supervision.constants.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@AllArgsConstructor
public enum NegativeTaskStatusEnum {
SUCCESS("0"),
FAIL("1"),
PADDING("2");
@Getter
private String value;
}

21
src/main/java/com/biutag/supervision/constants/enums/PersonTypeEnum.java

@ -0,0 +1,21 @@
package com.biutag.supervision.constants.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @author wxc
* @date 2024/11/1
*/
@Getter
@AllArgsConstructor
public enum PersonTypeEnum {
police("1", "民警"),
works("2", "职工"),
aux("3", "辅警"),
clerk("4", "文员"),
xj("5", "协警");
private String value;
private String label;
}

46
src/main/java/com/biutag/supervision/constants/enums/ProblemSourcesEnum.java

@ -0,0 +1,46 @@
package com.biutag.supervision.constants.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public enum ProblemSourcesEnum {
XCDC("现场督察", "13"),
SZDC("数字督察", "14"),
ZXDC("专项督察", "15"),
SPDC("视频督察", "16"),
A12389("12389", "17"),
SLDJB("市局领导交办", "18"),
ZDDJB("支队领导交办", "19"),
SJJB("上级交办", "20"),
GJXFPT("国家信访平台", "21"),
GABXF("公安部信访", "22"),
JZXX("局长信箱", "23"),
XF12337("12337信访", "24"),
XF_QT("其他", "25"),
SJJD("审计监督", "26"),
JWDC("警务评议", "2"),
JYDC("警意调查", "3"),
CFJD("持法监督", "4"),
JCKH("检查考核", "8"),
QT("其他", "9"),
LMGZ("灵敏感知", "27");
private String label;
private String value;
public static ProblemSourcesEnum get(String value) {
for (ProblemSourcesEnum problemSourcesEnum : values()) {
if (problemSourcesEnum.value.equals(value)) {
return problemSourcesEnum;
}
}
throw new RuntimeException("无此问题来源");
}
}

26
src/main/java/com/biutag/supervision/constants/enums/ProcessingStatusEnum.java

@ -0,0 +1,26 @@
package com.biutag.supervision.constants.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@AllArgsConstructor
public enum ProcessingStatusEnum {
signing("签收中"),
processing("办理中"),
approval("审批中"),
completed("已办结");
@Getter
private String label;
public static String getLabel(String name) {
for (ProcessingStatusEnum value : values()) {
if (value.name().equals(name)) {
return value.getLabel();
}
}
return null;
}
}

18
src/main/java/com/biutag/supervision/constants/enums/RepeatEnum.java

@ -0,0 +1,18 @@
package com.biutag.supervision.constants.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@AllArgsConstructor
@Getter
public enum RepeatEnum {
FIRST_MAIL(1, "初访信件"),
REPEAT_MAIL(2, "重访信件");
private Integer id;
private String label;
}

17
src/main/java/com/biutag/supervision/constants/enums/RoleCodeEnum.java

@ -0,0 +1,17 @@
package com.biutag.supervision.constants.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@AllArgsConstructor
@Getter
public enum RoleCodeEnum {
ADMIN("admin"),
FIRST_ADMIN("admin_1"),
SECOND_ADMIN("admin_1_1_1_2"),
THREE_ADMIN("admin_1_1_1_3");
private String code;
}

15
src/main/java/com/biutag/supervision/constants/enums/StatusEnum.java

@ -0,0 +1,15 @@
package com.biutag.supervision.constants.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public enum StatusEnum {
ENABLE("1"),
DISABLE("0");
private String value;
}

38
src/main/java/com/biutag/supervision/constants/enums/TimeLimitEnum.java

@ -0,0 +1,38 @@
package com.biutag.supervision.constants.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
// 办理时限
@Getter
@AllArgsConstructor
public enum TimeLimitEnum {
WORK_137("137工作制", "3+7", 1, 3, 7),
WORK_10_10("10+10工作制", "10+10", 1, 10, 10),
WORK_14_7("14+7工作制", "14+7", 1, 14, 7),
OTHER("其他", "other", null, null, null);
private String label;
private String value;
// 签收时长(天)
private Integer maxSignDuration;
// 办理时长(天)
private Integer maxHandleDuration;
// 最大延期时长(天)
private Integer maxExtensionDuration;
public static TimeLimitEnum get(String value) {
for (TimeLimitEnum timeLimitEnum : values()) {
if (timeLimitEnum.getValue().equals(value)) {
return timeLimitEnum;
}
}
throw new RuntimeException(String.format("办理时限字典[%s]未找到", value));
}
}

7
src/main/java/com/biutag/supervision/constants/enums/WorkStateEnum.java

@ -0,0 +1,7 @@
package com.biutag.supervision.constants.enums;
public enum WorkStateEnum {
todo,
done;
}

7
src/main/java/com/biutag/supervision/constants/enums/WorkStatusEnum.java

@ -0,0 +1,7 @@
package com.biutag.supervision.constants.enums;
public enum WorkStatusEnum {
todo,
done;
}

79
src/main/java/com/biutag/supervision/controller/AuthController.java

@ -0,0 +1,79 @@
package com.biutag.supervision.controller;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
import com.biutag.supervision.common.UserContextHolder;
import com.biutag.supervision.constants.AppConstants;
import com.biutag.supervision.constants.RedisKeyConstants;
import com.biutag.supervision.exception.AuthException;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.domain.Self;
import com.biutag.supervision.pojo.entity.Menu;
import com.biutag.supervision.pojo.model.UserAuth;
import com.biutag.supervision.pojo.vo.MenuTree;
import com.biutag.supervision.service.MenuService;
import com.biutag.supervision.service.UserLoginService;
import com.biutag.supervision.util.JSON;
import com.fasterxml.jackson.databind.JsonNode;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
@Slf4j
@RequiredArgsConstructor
@RequestMapping("auth")
@RestController
public class AuthController {
private final MenuService menuService;
private final UserLoginService userLoginService;
private final RedisTemplate<Object, Object> redisTemplate;
@Value("${spring.profiles.active}")
private String profilesActive;
@Value("${negative.v1-user-url:''}")
private String v1UserUrl;
@GetMapping("self")
public Result<Self> self() {
String authorization = UserContextHolder.getCurrentToken();
if (StrUtil.isBlank(authorization)) {
throw new AuthException();
}
UserAuth user = UserContextHolder.getCurrentUser();
if ("prod".equals(profilesActive)) {
if (Objects.isNull(user)) {
HttpResponse httpResponse = HttpUtil
.createGet(v1UserUrl)
.bearerAuth(authorization)
.execute();
log.info("获取用户信息:{}", httpResponse.body());
JsonNode jsonNode = JSON.readTree(httpResponse.body());
String account = jsonNode.get("data")
.get("username").asText();
user = userLoginService.buildUserAuth(account);
redisTemplate.opsForValue().set(String.format(RedisKeyConstants.LOGIN_USERINFO_KEY, authorization), user, 24, TimeUnit.HOURS);
}
}
if (Objects.isNull(user)) {
throw new AuthException();
}
boolean superFlag = AppConstants.USER_TYPE_SUPER.equals(user.getUserType());
List<Menu> menus = superFlag ? menuService.listAll() : menuService.listMenuByCurrentUser();
List<String> perms = superFlag ? List.of("*") : menuService.listPermsByCurrentUser();
return Result.success(new Self().setUser(user).setMenus(MenuTree.buildTree(menus)).setPerms(perms));
}
}

46
src/main/java/com/biutag/supervision/controller/FileController.java

@ -0,0 +1,46 @@
package com.biutag.supervision.controller;
import cn.hutool.core.io.IoUtil;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.vo.FileVo;
import com.biutag.supervision.service.FileService;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
@Slf4j
@RequiredArgsConstructor
@RequestMapping("file")
@Controller
public class FileController {
private final FileService fileService;
@ResponseBody
@PostMapping("upload")
public Result<FileVo> upload(@RequestPart("file") MultipartFile file) throws IOException {
log.info("文件上传 upload------------------------------");
String filePath = fileService.upload(file);
return Result.success(new FileVo()
.setFileName(file.getOriginalFilename())
.setFilePath(filePath));
}
@GetMapping("stream/**")
public void download(HttpServletRequest request, HttpServletResponse response) throws IOException {
String filePath = request.getRequestURI().substring(12);
if (filePath.toLowerCase().endsWith(".pdf")) {
response.setContentType("application/pdf");
} else {
response.setContentType("application/octet-stream");
}
IoUtil.copy(fileService.download(filePath), response.getOutputStream());
}
}

64
src/main/java/com/biutag/supervision/controller/LoginController.java

@ -0,0 +1,64 @@
package com.biutag.supervision.controller;
import cn.hutool.core.util.IdUtil;
import com.biutag.supervision.common.UserContextHolder;
import com.biutag.supervision.constants.RedisKeyConstants;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.dto.AccountDto;
import com.biutag.supervision.pojo.entity.*;
import com.biutag.supervision.pojo.model.UserAuth;
import com.biutag.supervision.pojo.vo.TokenVo;
import com.biutag.supervision.service.*;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.security.crypto.bcrypt.BCrypt;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
@Tag(name = "登录接口")
@Slf4j
@RequiredArgsConstructor
@RestController
public class LoginController {
private final BaseAccountService accountService;
private final UserLoginService userLoginService;
private final RedisTemplate<Object, Object> redisTemplate;
@Operation(summary = "登录")
@PostMapping("login")
public Result<TokenVo> login(@RequestBody AccountDto account) {
BaseAccount baseAccount = accountService.getByLogin(account.getAccount());
try {
if (Objects.isNull(baseAccount) || !BCrypt.checkpw(account.getPassword(), baseAccount.getPassword())) {
throw new RuntimeException("用户名或密码有误,请重新输入");
}
} catch (RuntimeException e) {
log.error(e.getMessage(), e);
throw new RuntimeException("用户名或密码有误,请重新输入");
}
UserAuth userAuth = userLoginService.buildUserAuth(baseAccount.getAccount());
String token = IdUtil.fastSimpleUUID();
redisTemplate.opsForValue().set(String.format(RedisKeyConstants.LOGIN_USERINFO_KEY, token), userAuth, 24, TimeUnit.HOURS);
return Result.success(new TokenVo().setToken(token));
}
@PostMapping("logout")
public Result<Void> logout() {
redisTemplate.opsForValue();
redisTemplate.delete(String.format(RedisKeyConstants.LOGIN_USERINFO_KEY, UserContextHolder.getCurrentToken()));
return Result.success();
}
}

156
src/main/java/com/biutag/supervision/controller/StatisticsController.java

@ -0,0 +1,156 @@
package com.biutag.supervision.controller;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.biutag.supervision.common.UserContextHolder;
import com.biutag.supervision.constants.AppConstants;
import com.biutag.supervision.constants.enums.FlowNodeEnum;
import com.biutag.supervision.constants.enums.ProcessingStatusEnum;
import com.biutag.supervision.constants.enums.RoleCodeEnum;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.entity.Negative;
import com.biutag.supervision.pojo.model.UserAuth;
import com.biutag.supervision.service.NegativeService;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.*;
@RequiredArgsConstructor
@RequestMapping("statistics")
@RestController
public class StatisticsController {
private final NegativeService negativeService;
@GetMapping("flowNumberAndTodayNumber")
public Result<Map<String, Object>> flowNumber() {
UserAuth user = UserContextHolder.getCurrentUser();
boolean authEmpty = (user.getAuthSources().isEmpty() || user.getAuthDepartIds().isEmpty()) && !AppConstants.USER_TYPE_SUPER.equals(user.getUserType());
if (authEmpty) {
Map<String, Object> data = new HashMap<>();
data.put("flowNumber", List.of(new FlowNumber("问题签收中", "sign", 0L),
new FlowNumber("核查办理", "verify", 0L),
new FlowNumber("申请延期", "delay", 0L),
new FlowNumber("办结审批", "completedApprove", 0L))
);
data.put("todayNumber", List.of(new TodayNumber("今日问题", 0L),
new TodayNumber("今日办结", 0L),
new TodayNumber("累计问题", 0L),
new TodayNumber("累计办结", 0L))
);
return Result.success(data);
}
boolean nonAdminAuth = !AppConstants.USER_TYPE_SUPER.equals(user.getUserType()) && !user.getRoleCodes().contains(RoleCodeEnum.FIRST_ADMIN.getCode());
long signCount = negativeService.count(new LambdaUpdateWrapper<Negative>()
.eq(Negative::getProcessingStatus, ProcessingStatusEnum.signing.name())
.in(!user.getAuthSources().isEmpty(), Negative::getProblemSourcesCode, user.getAuthSources())
.and(nonAdminAuth, query -> {
query.in(Negative::getHandleSecondDepartId, user.getAuthDepartIds()).or()
.in(Negative::getThingDesc, user.getAuthDepartIds());
})
);
long verifyCount = negativeService.count(new LambdaUpdateWrapper<Negative>()
.eq(Negative::getProcessingStatus, ProcessingStatusEnum.processing.name())
.in(!user.getAuthSources().isEmpty(), Negative::getProblemSourcesCode, user.getAuthSources())
.and(nonAdminAuth, query -> {
query.in(Negative::getHandleSecondDepartId, user.getAuthDepartIds()).or()
.in(Negative::getThingDesc, user.getAuthDepartIds());
})
);
long delayCount = negativeService.count(new LambdaUpdateWrapper<Negative>()
.eq(Negative::getExtensionApplyFlag, false)
.in(!user.getAuthSources().isEmpty(), Negative::getProblemSourcesCode, user.getAuthSources())
.and(nonAdminAuth, query -> {
query.in(Negative::getHandleSecondDepartId, user.getAuthDepartIds()).or()
.in(Negative::getThingDesc, user.getAuthDepartIds());
})
);
long completedApproveCount = negativeService.count(new LambdaUpdateWrapper<Negative>()
.eq(Negative::getProcessingStatus, ProcessingStatusEnum.approval.name())
.in(!user.getAuthSources().isEmpty(), Negative::getProblemSourcesCode, user.getAuthSources())
.and(nonAdminAuth, query -> {
query.in(Negative::getHandleSecondDepartId, user.getAuthDepartIds()).or()
.in(Negative::getThingDesc, user.getAuthDepartIds());
})
);
Date now = new Date();
DateTime beginOfDay = DateUtil.beginOfDay(now);
DateTime endOfDay = DateUtil.endOfDay(now);
long todayNumber = negativeService.count(new LambdaUpdateWrapper<Negative>()
.between(Negative::getCrtTime, beginOfDay, endOfDay)
.in(!user.getAuthSources().isEmpty(), Negative::getProblemSourcesCode, user.getAuthSources())
.and(nonAdminAuth, query -> {
query.in(Negative::getHandleSecondDepartId, user.getAuthDepartIds()).or()
.in(Negative::getThingDesc, user.getAuthDepartIds());
})
);
long todayCompleted = negativeService.count(new LambdaUpdateWrapper<Negative>()
.between(Negative::getCompleteDate, beginOfDay, endOfDay)
.in(!user.getAuthSources().isEmpty(), Negative::getProblemSourcesCode, user.getAuthSources())
.and(nonAdminAuth, query -> {
query.in(Negative::getHandleSecondDepartId, user.getAuthDepartIds()).or()
.in(Negative::getThingDesc, user.getAuthDepartIds());
})
);
long totalNumber = negativeService.count(new LambdaUpdateWrapper<Negative>()
.in(!user.getAuthSources().isEmpty(), Negative::getProblemSourcesCode, user.getAuthSources())
.and(nonAdminAuth, query -> {
query.in(Negative::getHandleSecondDepartId, user.getAuthDepartIds()).or()
.in(Negative::getThingDesc, user.getAuthDepartIds());
})
);
long totalCompleted = negativeService.count(new LambdaUpdateWrapper<Negative>()
.eq(Negative::getProcessingStatus, ProcessingStatusEnum.completed.name())
.in(!user.getAuthSources().isEmpty(), Negative::getProblemSourcesCode, user.getAuthSources())
.and(nonAdminAuth, query -> {
query.in(Negative::getHandleSecondDepartId, user.getAuthDepartIds()).or()
.in(Negative::getThingDesc, user.getAuthDepartIds());
})
);
Map<String, Object> data = new HashMap<>();
data.put("flowNumber", List.of(new FlowNumber("问题签收中", "sign", signCount),
new FlowNumber("核查办理", "verify", verifyCount),
new FlowNumber("申请延期", "delay", delayCount),
new FlowNumber("办结审批", "completedApprove", completedApproveCount))
);
data.put("todayNumber", List.of(new TodayNumber("今日问题", todayNumber),
new TodayNumber("今日办结", todayCompleted),
new TodayNumber("累计问题", totalNumber),
new TodayNumber("累计办结", totalCompleted))
);
return Result.success(data);
}
@Setter
@Getter
public class FlowNumber {
private String name;
private String icon;
private Long total;
public FlowNumber(String name, String icon, Long total) {
this.name = name;
this.icon = icon;
this.total = total;
}
}
@Setter
@Getter
public class TodayNumber {
private String name;
private Long total;
public TodayNumber(String name, Long total) {
this.name = name;
this.total = total;
}
}
}

49
src/main/java/com/biutag/supervision/controller/api/jwdc/NegativeApiController.java

@ -0,0 +1,49 @@
package com.biutag.supervision.controller.api.jwdc;
import com.alibaba.fastjson.JSON;
import com.biutag.supervision.pojo.domain.Blame;
import com.biutag.supervision.pojo.dto.jwdc.NegativeApiDto;
import com.biutag.supervision.pojo.entity.Negative;
import com.biutag.supervision.service.NegativeBlameService;
import com.biutag.supervision.service.NegativeService;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
@Slf4j
@Validated
@RequiredArgsConstructor
@RequestMapping("api/jwdc/negative")
@RestController
public class NegativeApiController {
private final NegativeService negativeService;
private final NegativeBlameService negativeBlameService;
@PostMapping
public String addAll(@RequestBody @Valid List<NegativeApiDto> list) {
log.info("问题数据导入: {}", JSON.toJSONString(list));
negativeService.saveByJwpy(list);
return "success";
}
@GetMapping("responsible")
public List<Blame> responsible(@RequestParam @Valid @NotBlank(message = "来源ID不能为空") String originId) {
log.info("警务调查责任民警查询,来源ID: {}", originId);
Negative negative = negativeService.getByOriginId(originId);
if (Objects.isNull(negative)) {
return new ArrayList<>();
}
List<Blame> list = negativeBlameService.list(negative.getId());
log.info("警务调查责任民警查询,返回结果数量: {}", list.size());
return list;
}
}

30
src/main/java/com/biutag/supervision/controller/api/plugin/PetitionComplainApiController.java

@ -0,0 +1,30 @@
package com.biutag.supervision.controller.api.plugin;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.dto.DataPetitionComplaintDto;
import com.biutag.supervision.service.DataPetitionComplaintService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Tag(name = "信访投诉(插件)")
@RequiredArgsConstructor
@RequestMapping("plugin/petitionComplain")
@RestController
public class PetitionComplainApiController {
private final DataPetitionComplaintService dataPetitionComplaintService;
@Operation(summary = "推送信访投诉数据")
@PostMapping
public Result<Boolean> add(@RequestBody @Validated DataPetitionComplaintDto body) {
return Result.success(dataPetitionComplaintService.save(body));
}
}

23
src/main/java/com/biutag/supervision/controller/baseData/BusinessDepartController.java

@ -0,0 +1,23 @@
package com.biutag.supervision.controller.baseData;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.model.BusinessPoliceModel;
import com.biutag.supervision.pojo.param.BusinessQueryParam;
import com.biutag.supervision.service.BusinessDepartService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RequiredArgsConstructor
@RequestMapping("baseData/depart")
@RestController
public class BusinessDepartController {
private final BusinessDepartService businessDepartService;
@GetMapping("page")
public Result<Page<BusinessPoliceModel>> page(BusinessQueryParam businessQueryParam) {
return Result.success(businessDepartService.page(businessQueryParam));
}
}

24
src/main/java/com/biutag/supervision/controller/baseData/BusinessPoliceController.java

@ -0,0 +1,24 @@
package com.biutag.supervision.controller.baseData;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.model.BusinessPoliceModel;
import com.biutag.supervision.pojo.param.BusinessQueryParam;
import com.biutag.supervision.service.BusinessPoliceService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RequiredArgsConstructor
@RequestMapping("baseData/police")
@RestController
public class BusinessPoliceController {
private final BusinessPoliceService businessPoliceService;
@GetMapping("page")
public Result<Page<BusinessPoliceModel>> page(BusinessQueryParam businessQueryParam) {
return Result.success(businessPoliceService.page(businessQueryParam));
}
}

119
src/main/java/com/biutag/supervision/controller/data/DataCaseVerifController.java

@ -0,0 +1,119 @@
package com.biutag.supervision.controller.data;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelReader;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.exception.ExcelDataConvertException;
import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.read.metadata.ReadSheet;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.constants.enums.DepartLevelEnum;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.dto.DataCaseVerifDistribute;
import com.biutag.supervision.pojo.dto.DataCaseVerifImportDto;
import com.biutag.supervision.pojo.entity.DataCaseVerif;
import com.biutag.supervision.pojo.entity.SupDepart;
import com.biutag.supervision.pojo.param.DataCaseVerifQueryParam;
import com.biutag.supervision.service.DataCaseVerifService;
import com.biutag.supervision.service.SupDepartService;
import jakarta.validation.ConstraintViolation;
import jakarta.validation.Validator;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
@Slf4j
@RequestMapping("data/caseVerif")
@RequiredArgsConstructor
@RestController
public class DataCaseVerifController {
private final DataCaseVerifService dataCaseVerifService;
private final SupDepartService departService;
private final Validator validator;
@GetMapping
public Result<Page<DataCaseVerif>> list(DataCaseVerifQueryParam queryParam) {
return Result.success(dataCaseVerifService.page(queryParam));
}
@PostMapping("import")
public Result<List<DataCaseVerifImportDto>> importExcel(@RequestPart("file") MultipartFile file) throws IOException {
log.info("文件导入中------------------------------");
String fileNameType = FileUtil.extName(file.getOriginalFilename());
if (!"xls".equals(fileNameType) && !"xlsx".equals(fileNameType)) {
throw new RuntimeException("仅支持 xls/xlsx 格式文件的导入");
}
List<DataCaseVerifImportDto> list = new ArrayList<>();
List<SupDepart> secondDeparts = departService.listByLevel(List.of(DepartLevelEnum.SECOND.getValue()));
ExcelReader excelReader = EasyExcel.read(file.getInputStream(), DataCaseVerifImportDto.class, new ReadListener<DataCaseVerifImportDto>() {
@Override
public void invoke(DataCaseVerifImportDto data, AnalysisContext analysisContext) {
String secondDepartId = secondDeparts.stream()
.filter(item -> item.getShortName().equals(data.getSecondDepartName())).findFirst()
.map(SupDepart::getId).orElse("");
data.setSecondDepartId(secondDepartId);
if (StrUtil.isNotBlank(secondDepartId)) {
String complainedThirdDepartId = departService.list(new LambdaQueryWrapper<SupDepart>().eq(SupDepart::getPid, secondDepartId)
.like(SupDepart::getShortName, data.getThirdDepartName()))
.stream().findFirst().map(SupDepart::getId).orElse("");
data.setThirdDepartId(complainedThirdDepartId);
}
Set<ConstraintViolation<DataCaseVerifImportDto>> validate = validator.validate(data);
if (!validate.isEmpty()) {
String message = validate.stream().map(ConstraintViolation::getMessage).collect(Collectors.joining("\n"));
data.setErrMsg(message);
data.setState("fail");
} else {
data.setState("success");
}
list.add(data);
}
@Override
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
}
}).build();
ReadSheet sheet = EasyExcel.readSheet(0).build();
try {
excelReader.read(sheet);
} catch (ExcelDataConvertException e) {
log.error(e.getMessage(), e);
throw new RuntimeException("日期格式错误");
}
excelReader.close();
return Result.success(list);
}
@PostMapping("{dataUpdateMethod}")
public Result<Boolean> add(@RequestBody List<DataCaseVerifImportDto> body, @PathVariable String dataUpdateMethod) {
if (body.isEmpty()) {
return Result.success();
}
return Result.success(dataCaseVerifService.save(body, dataUpdateMethod));
}
@DeleteMapping("{id}")
public Result<Boolean> del(@PathVariable String id) {
return Result.success(dataCaseVerifService.removeById(id));
}
@PostMapping("distribute")
public Result<Boolean> distribute(@RequestBody DataCaseVerifDistribute dataDistribute) {
return Result.success(dataCaseVerifService.distribution(dataDistribute));
}
}

134
src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaintController.java

@ -0,0 +1,134 @@
package com.biutag.supervision.controller.data;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelReader;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.read.metadata.ReadSheet;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.constants.enums.DepartLevelEnum;
import com.biutag.supervision.constants.enums.InitialPetition;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.dto.DataDataPetitionComplainDistribute;
import com.biutag.supervision.pojo.dto.DataPetitionComplaintAddDto;
import com.biutag.supervision.pojo.dto.DataPetitionComplaintImportDto;
import com.biutag.supervision.pojo.entity.DataPetitionComplaint;
import com.biutag.supervision.pojo.entity.SupDepart;
import com.biutag.supervision.pojo.param.DataPetitionComplaintQueryParam;
import com.biutag.supervision.service.DataPetitionComplaintService;
import com.biutag.supervision.service.SupDepartService;
import jakarta.validation.ConstraintViolation;
import jakarta.validation.Validator;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
/**
*
* @author wxc
* @date
*/
@Slf4j
@RequiredArgsConstructor
@RequestMapping("data/petitionComplaint")
@RestController
public class DataPetitionComplaintController {
private final DataPetitionComplaintService dataPetitionComplaintService;
private final SupDepartService departService;
private final Validator validator;
@GetMapping
public Result<Page<DataPetitionComplaint>> list(DataPetitionComplaintQueryParam queryParam) {
return Result.success(dataPetitionComplaintService.page(queryParam));
}
@PostMapping("import")
public Result<List<DataPetitionComplaintImportDto>> importExcel(@RequestPart("file") MultipartFile file) throws IOException {
log.info("文件导入中------------------------------");
String fileNameType = FileUtil.extName(file.getOriginalFilename());
if (!"xls".equals(fileNameType) && !"xlsx".equals(fileNameType)) {
throw new RuntimeException("仅支持 xls/xlsx 格式文件的导入");
}
List<SupDepart> secondDeparts = departService.listByLevel(List.of(DepartLevelEnum.SECOND.getValue()));
List<DataPetitionComplaintImportDto> list = new ArrayList<>();
ExcelReader excelReader = EasyExcel.read(file.getInputStream(), DataPetitionComplaintImportDto.class, new ReadListener<DataPetitionComplaintImportDto>() {
@Override
public void invoke(DataPetitionComplaintImportDto data, AnalysisContext analysisContext) {
if ("是".equals(data.getEntanglementVisitsLabel())) {
data.setEntanglementVisits(true);
}
if ("否".equals(data.getEntanglementVisitsLabel())) {
data.setEntanglementVisits(false);
}
if ("是".equals(data.getMassVisitsLabel())) {
data.setMassVisits(true);
}
if ("否".equals(data.getMassVisitsLabel())) {
data.setMassVisits(false);
}
data.setInitialPetition(InitialPetition.getValue(data.getInitialPetition()));
String secondDepartId = secondDeparts.stream()
.filter(item -> item.getShortName().equals(data.getInvolveSecondDepartName())).findFirst()
.map(SupDepart::getId).orElse("");
data.setInvolveSecondDepartId(secondDepartId);
if (StrUtil.isNotBlank(secondDepartId)) {
String complainedThirdDepartId = departService.list(new LambdaQueryWrapper<SupDepart>().eq(SupDepart::getPid, secondDepartId)
.like(SupDepart::getShortName, data.getInvolveThirdDepartName()))
.stream().findFirst().map(SupDepart::getId).orElse("");
data.setInvolveThirdDepartId(complainedThirdDepartId);
}
Set<ConstraintViolation<DataPetitionComplaintImportDto>> validate = validator.validate(data);
if (!validate.isEmpty()) {
String message = validate.stream().map(ConstraintViolation::getMessage).collect(Collectors.joining("\n"));
data.setErrMsg(message);
data.setState("fail");
} else {
data.setState("success");
}
list.add(data);
}
@Override
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
}
}).build();
ReadSheet sheet = EasyExcel.readSheet(0).build();
excelReader.read(sheet);
excelReader.close();
return Result.success(list);
}
@PostMapping()
public Result<Boolean> add(@RequestBody DataPetitionComplaintAddDto body) {
if (body.getData().isEmpty()) {
return Result.success();
}
return Result.success(dataPetitionComplaintService.save(body));
}
@DeleteMapping("{id}")
public Result<Boolean> del(@PathVariable String id) {
return Result.success(dataPetitionComplaintService.removeById(id));
}
@PostMapping("distribute")
public Result<Boolean> distribute(@RequestBody DataDataPetitionComplainDistribute dataDistribute) {
return Result.success(dataPetitionComplaintService.distribution(dataDistribute));
}
}

79
src/main/java/com/biutag/supervision/controller/datav/DataPetitionComplaintViewController.java

@ -0,0 +1,79 @@
package com.biutag.supervision.controller.datav;
import cn.hutool.core.util.NumberUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.biutag.supervision.constants.enums.DepartGroupEnum;
import com.biutag.supervision.constants.enums.RepeatEnum;
import com.biutag.supervision.mapper.DataCaseVerifMapper;
import com.biutag.supervision.mapper.DataPetitionComplaintMapper;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.dto.CaseVerifDepart;
import com.biutag.supervision.pojo.entity.DataPetitionComplaint;
import com.biutag.supervision.service.DataPetitionComplaintService;
import lombok.RequiredArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* @author: sh
* @date: 2024/10/31
*/
@RequestMapping("datav/mailVisits")
@RequiredArgsConstructor
@RestController
public class DataPetitionComplaintViewController {
private final DataPetitionComplaintService dataPetitionComplaintService;
private final DataPetitionComplaintMapper dataPetitionComplaintMapper;
/**
* 信访数据大屏统计
*
* @param beginTime
* @param endTime
* @return
*/
@GetMapping
public Result<JSONObject> mailVisits(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
// 信访数据总数概览
JSONObject overview = dataPetitionComplaintService.allMailCount(beginTime, endTime);
// 分县市局信初重访领导访排名
List<CaseVerifDepart> fxsjFirstMailList = dataPetitionComplaintService.mailRank(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId(), RepeatEnum.FIRST_MAIL.getId(), beginTime, endTime);
List<CaseVerifDepart> fxsjRepeatMailList = dataPetitionComplaintService.mailRank(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId(), RepeatEnum.REPEAT_MAIL.getId(), beginTime, endTime);
List<CaseVerifDepart> fxsjLeaderViewMailList = dataPetitionComplaintMapper.selectLeaderViewMail(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId(), beginTime, endTime);
// 部委支队初重领导访排名
List<CaseVerifDepart> bwzdFirstMailList = dataPetitionComplaintService.mailRank(DepartGroupEnum.BUREAU_AFFILIATED.getId(), RepeatEnum.FIRST_MAIL.getId(), beginTime, endTime);
List<CaseVerifDepart> bwzdRepeatMailList = dataPetitionComplaintService.mailRank(DepartGroupEnum.BUREAU_AFFILIATED.getId(), RepeatEnum.REPEAT_MAIL.getId(), beginTime, endTime);
List<CaseVerifDepart> bwzdLeaderViewMailList = dataPetitionComplaintMapper.selectLeaderViewMail(DepartGroupEnum.BUREAU_AFFILIATED.getId(), beginTime, endTime);
// 分县市局领导督办、缠访、集访排名
List<CaseVerifDepart> fxsjEntanglementMailList = dataPetitionComplaintMapper.selectEntanglementMail(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId(), 1, beginTime, endTime);
List<CaseVerifDepart> fxsjMassMailList = dataPetitionComplaintMapper.selectMassMail(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId(), 1, beginTime, endTime);
// 部委支队缠访集访排名
List<CaseVerifDepart> bwzdEntanglementMailList = dataPetitionComplaintMapper.selectEntanglementMail(DepartGroupEnum.BUREAU_AFFILIATED.getId(), 1, beginTime, endTime);
List<CaseVerifDepart> bwzdMassMailList = dataPetitionComplaintMapper.selectMassMail(DepartGroupEnum.BUREAU_AFFILIATED.getId(), 1, beginTime, endTime);
JSONObject data = new JSONObject().fluentPut("overview", overview)
.fluentPut("fxsjFirstMailList", fxsjFirstMailList)
.fluentPut("fxsjRepeatMailList", fxsjRepeatMailList)
.fluentPut("fxsjLeaderViewMailList", fxsjLeaderViewMailList)
.fluentPut("bwzdFirstMailList", bwzdFirstMailList)
.fluentPut("bwzdRepeatMailList", bwzdRepeatMailList)
.fluentPut("bwzdLeaderViewMailList", bwzdLeaderViewMailList)
.fluentPut("fxsjEntanglementMailList", fxsjEntanglementMailList)
.fluentPut("fxsjMassMailList", fxsjMassMailList)
.fluentPut("bwzdEntanglementMailList", bwzdEntanglementMailList)
.fluentPut("bwzdMassMailList", bwzdMassMailList);
return Result.success(data);
}
}

78
src/main/java/com/biutag/supervision/controller/datav/DataVCaseVerifController.java

@ -0,0 +1,78 @@
package com.biutag.supervision.controller.datav;
import cn.hutool.core.util.NumberUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.biutag.supervision.constants.enums.CaseVerifProblemNatureEnum;
import com.biutag.supervision.constants.enums.DepartGroupEnum;
import com.biutag.supervision.mapper.DataCaseVerifMapper;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.dto.CaseVerifDepart;
import com.biutag.supervision.pojo.dto.common.PieItem;
import com.biutag.supervision.pojo.entity.DataCaseVerif;
import com.biutag.supervision.service.DataCaseVerifService;
import lombok.RequiredArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* @author wxc
* @date 2024/10/24
*/
@RequestMapping("datav/caseVerif")
@RequiredArgsConstructor
@RestController
public class DataVCaseVerifController {
private final DataCaseVerifService dataCaseVerifService;
private final DataCaseVerifMapper dataCaseVerifMapper;
@GetMapping
public Result<JSONObject> caseVerif(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
long total = dataCaseVerifService.count(new LambdaQueryWrapper<DataCaseVerif>().between(DataCaseVerif::getDiscoveryTime, beginTime, endTime));
long confirmed = 0;
JSONObject overview = new JSONObject()
// 案件总数(起)
.fluentPut("total", total)
// 查实案件数
.fluentPut("confirmed", 0)
// 查处问题(个)
.fluentPut("investigateAndPunish", 0)
// 问责人次
.fluentPut("accountablePeopleNumber", 0)
// 问责单位数
.fluentPut("accountableDepartNumber", 0)
// 查实率
.fluentPut("confirmedRate", total == 0 ? 0 : BigDecimal.valueOf(NumberUtil.div(confirmed, total) * 100).intValue());
// 分县市局排名
List<CaseVerifDepart> fxsjBarList = dataCaseVerifMapper.selectDepartStatistic(DepartGroupEnum.COUNTY_CITY_BUREAUS.getId(), beginTime, endTime);
// 局属单位排名
List<CaseVerifDepart> jsdwBarList = dataCaseVerifMapper.selectDepartStatistic(DepartGroupEnum.BUREAU_AFFILIATED.getId(), beginTime, endTime);
// 执法办案
List<PieItem> zfbaPieList = dataCaseVerifMapper.selectInvolveProblemGroupByBusinessTypeName(CaseVerifProblemNatureEnum.ZFBA.getLaebl(), beginTime, endTime);
// 服务管理
List<PieItem> fwglPieList = dataCaseVerifMapper.selectInvolveProblemGroupByBusinessTypeName(CaseVerifProblemNatureEnum.FWGL.getLaebl(), beginTime, endTime);
// 警察纪警规
List<PieItem> jjjgPieList = dataCaseVerifMapper.selectInvolveProblemGroupByBusinessTypeName(CaseVerifProblemNatureEnum.JJJG.getLaebl(), beginTime, endTime);
// 案件来源占比
List<PieItem> ajlyPieList = dataCaseVerifMapper.selectGroupByProblemSources(beginTime, endTime);
JSONObject data = new JSONObject().fluentPut("overview", overview)
.fluentPut("fxsjBarList", fxsjBarList)
.fluentPut("jsdwBarList", jsdwBarList)
.fluentPut("zfbaPieList", zfbaPieList)
.fluentPut("fwglPieList", fwglPieList)
.fluentPut("jjjgPieList", jjjgPieList)
.fluentPut("ajlyPieList", ajlyPieList);
return Result.success(data);
}
}

54
src/main/java/com/biutag/supervision/controller/datav/DatavRightsComfortController.java

@ -0,0 +1,54 @@
package com.biutag.supervision.controller.datav;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.model.DataRightsComfortModel;
import com.biutag.supervision.service.DataRightsComfortService;
import com.biutag.supervision.service.RpcApplyService;
import com.biutag.supervision.service.RpcInfringerResultService;
import lombok.RequiredArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
@RequestMapping("datav/rightsComfort")
@RequiredArgsConstructor
@RestController
public class DatavRightsComfortController {
private final RpcApplyService rpcApplyService;
private final DataRightsComfortService dataRightsComfortService;
private final RpcInfringerResultService rpcInfringerResultService;
@GetMapping
public Result<DataRightsComfortModel> rightsComfort(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) {
DataRightsComfortModel result = new DataRightsComfortModel();
// 维权案件总数
// 受侵害人数
// 抚慰人数
result.setComfortPersonNumber(dataRightsComfortService.countComfortPersonNumber(beginTime, endTime));
// 打击处理人数
result.setHitPersonNumber(dataRightsComfortService.countHitPersonNumber(beginTime, endTime));
// 抚慰金额(万元)
result.setComfortMoney(dataRightsComfortService.countComfortMoney(beginTime, endTime));
// 维权案件情况
// 案件类别占比
// 打处情况
result.setPunishmentSituation(dataRightsComfortService.selectPunishmentSituation(beginTime, endTime));
// 抚慰情况
result.setComfortSituation(dataRightsComfortService.selectComfortSituation(beginTime, endTime));
// 民辅警受伤情况
// 发案情况占比
return Result.success(result);
}
}

26
src/main/java/com/biutag/supervision/controller/sensitivePerception/ModelClassController.java

@ -0,0 +1,26 @@
package com.biutag.supervision.controller.sensitivePerception;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.entity.ModelClass;
import com.biutag.supervision.service.ModelClassService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RequestMapping("modelClass")
@RequiredArgsConstructor
@RestController
public class ModelClassController {
private final ModelClassService modelClassService;
@GetMapping
public Result<List<ModelClass>> list() {
return Result.success(modelClassService.list(new LambdaQueryWrapper<ModelClass>().orderByAsc(ModelClass::getSort)));
}
}

58
src/main/java/com/biutag/supervision/controller/sensitivePerception/ModelClueController.java

@ -0,0 +1,58 @@
package com.biutag.supervision.controller.sensitivePerception;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.dto.ModelClueDepartDto;
import com.biutag.supervision.pojo.dto.ModelClueTaskDistribute;
import com.biutag.supervision.pojo.entity.ModelClue;
import com.biutag.supervision.pojo.model.ModelClueModel;
import com.biutag.supervision.pojo.param.ModelClueQueryParam;
import com.biutag.supervision.service.ModelClueService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.*;
/**
* @author wxc
* @date 2024/10/16
*/
@RequestMapping("model/clues")
@RequiredArgsConstructor
@RestController
public class ModelClueController {
private final ModelClueService modelClueService;
@GetMapping
public Result<Page<ModelClueModel>> page(ModelClueQueryParam param) {
return Result.success(modelClueService.page(param));
}
@GetMapping("{id}")
public Result<ModelClueModel> page(@PathVariable Integer id) {
ModelClueModel modelClueModel = new ModelClueModel();
ModelClue modelClue = modelClueService.getById(id);
BeanUtils.copyProperties(modelClue, modelClueModel);
return Result.success(modelClueModel);
}
/**
* 手动分发
* @param taskDistribute
* @return
*/
@PostMapping("task/distribute/manuel")
public Result<Boolean> manuelDistribute(@RequestBody ModelClueTaskDistribute taskDistribute) {
return Result.success(modelClueService.distribution(taskDistribute));
}
@PostMapping("{id}/updateDepart")
public Result<Boolean> updateDepart(@PathVariable Integer id, @RequestBody ModelClueDepartDto departDto) {
LambdaUpdateWrapper<ModelClue> updateWrapper = new LambdaUpdateWrapper<ModelClue>()
.eq(ModelClue::getId, id)
.set(ModelClue::getInvolveDepartId, departDto.getDepartId());
return Result.success(modelClueService.update(updateWrapper));
}
}

37
src/main/java/com/biutag/supervision/controller/sensitivePerception/ModelClueRecordController.java

@ -0,0 +1,37 @@
package com.biutag.supervision.controller.sensitivePerception;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.entity.ModelClueRecord;
import com.biutag.supervision.service.ModelClueRecordService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @author wxc
* @date 2024/10/16
*/
@RequestMapping("model/clue/records")
@RequiredArgsConstructor
@RestController
public class ModelClueRecordController {
private final ModelClueRecordService modelClueRecordService;
@GetMapping("/{modelId}/top")
public Result<List<ModelClueRecord>> list(@PathVariable Integer modelId) {
LambdaQueryWrapper<ModelClueRecord> queryWrapper = new LambdaQueryWrapper<ModelClueRecord>()
.eq(ModelClueRecord::getModelId, modelId)
.orderByDesc(ModelClueRecord::getCreateTime);
return Result.success(modelClueRecordService.page(new Page<>(1, 8), queryWrapper).getRecords());
}
}

38
src/main/java/com/biutag/supervision/controller/sensitivePerception/ModelClueTaskController.java

@ -0,0 +1,38 @@
package com.biutag.supervision.controller.sensitivePerception;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.model.ModelClueTaskDepartModel;
import com.biutag.supervision.pojo.model.ModelClueTaskModel;
import com.biutag.supervision.pojo.param.ModelClueTaskQueryParam;
import com.biutag.supervision.service.ModelClueTaskService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @author wxc
* @date 2024/10/16
*/
@RequestMapping("model/clue/tasks")
@RequiredArgsConstructor
@RestController
public class ModelClueTaskController {
private final ModelClueTaskService modelClueTaskService;
@GetMapping
public Result<Page<ModelClueTaskModel>> page(ModelClueTaskQueryParam param) {
return Result.success(modelClueTaskService.page(param));
}
@GetMapping("{taskId}/byDepart")
public Result<List<ModelClueTaskDepartModel>> listDepart(@PathVariable Integer taskId) {
return Result.success(modelClueTaskService.listDepart(taskId));
}
}

75
src/main/java/com/biutag/supervision/controller/sensitivePerception/ModelController.java

@ -0,0 +1,75 @@
package com.biutag.supervision.controller.sensitivePerception;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.entity.Model;
import com.biutag.supervision.pojo.entity.ModelClass;
import com.biutag.supervision.pojo.param.ModelQueryParam;
import com.biutag.supervision.pojo.vo.ModelTree;
import com.biutag.supervision.service.ModelClassService;
import com.biutag.supervision.service.ModelService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
@RequestMapping("models")
@RequiredArgsConstructor
@RestController
public class ModelController {
private final ModelService modelService;
private final ModelClassService modelClassService;
@GetMapping
public Result<Page<Model>> list(ModelQueryParam queryParam) {
LambdaQueryWrapper<Model> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper
.like(StrUtil.isNotBlank(queryParam.getModelName()), Model::getModelName, queryParam.getModelName())
.eq(StrUtil.isNotBlank(queryParam.getDistributionMethod()), Model::getDistributionMethod, queryParam.getDistributionMethod())
.eq(Objects.nonNull(queryParam.getClassId()), Model::getClassId, queryParam.getClassId())
.orderByDesc(Model::getCreateTime);
return Result.success(modelService.page(new Page<>(queryParam.getCurrent(), queryParam.getSize()), queryWrapper));
}
@GetMapping("tree")
public Result<List<ModelTree>> tree() {
List<ModelClass> modelClasses = modelClassService.list();
List<Model> models = modelService.list();
List<ModelTree> list = new ArrayList<>();
list.addAll(modelClasses.stream().map(item -> {
ModelTree node = new ModelTree();
node.setValue(item.getId());
node.setLabel(item.getName());
node.setType("modelClass");
List<ModelTree> children = models.stream().filter(model -> item.getId().equals(model.getClassId())).map(ModelTree::of).toList();
node.setChildren(children);
return node;
}).toList());
list.addAll(models.stream().filter(model -> Objects.isNull(model.getClassId())).map(ModelTree::of).toList());
return Result.success(list);
}
@PostMapping
public Result<Boolean> add(@RequestBody Model model) {
return Result.success(modelService.saveModel(model));
}
@PutMapping
public Result<Model> update(@RequestBody Model model) {
modelService.updateModel(model);
return Result.success(model);
}
@DeleteMapping("{id}")
public Result<Boolean> del(@PathVariable Integer id) {
return Result.success(modelService.remove(id));
}
}

81
src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfileDepartController.java

@ -0,0 +1,81 @@
package com.biutag.supervision.controller.sensitivePerception;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.constants.enums.InspectCaseEnum;
import com.biutag.supervision.constants.enums.PersonTypeEnum;
import com.biutag.supervision.mapper.ProfileDepartMapper;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.domain.ProfileDepart;
import com.biutag.supervision.pojo.entity.Negative;
import com.biutag.supervision.pojo.entity.NegativeBlame;
import com.biutag.supervision.pojo.entity.SupDepart;
import com.biutag.supervision.pojo.entity.SupPolice;
import com.biutag.supervision.pojo.model.DepartNegativeModel;
import com.biutag.supervision.pojo.param.DepartNegativeQueryParam;
import com.biutag.supervision.service.NegativeBlameService;
import com.biutag.supervision.service.NegativeService;
import com.biutag.supervision.service.SupDepartService;
import com.biutag.supervision.service.SupPoliceService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
import java.util.List;
import java.util.Objects;
/**
* 单位/个人画像
* @author wxc
* @date 2024/10/31
*/
@RequiredArgsConstructor
@RequestMapping("profile/depart")
@RestController
public class ProfileDepartController {
private final ProfileDepartMapper profileDepartMapper;
private final SupDepartService departService;
private final SupPoliceService policeService;
private final NegativeService negativeService;
private final NegativeBlameService blameService;
@GetMapping
public Result<Page<DepartNegativeModel>> list(DepartNegativeQueryParam param) {
Date beginTime = DateUtil.parse("1949", "YYYY");
Date endTime = new Date();
if (Objects.nonNull(param.getCrtTime()) && !param.getCrtTime().isEmpty()) {
beginTime = param.getCrtTime().get(0);
endTime = param.getCrtTime().get(1);
}
Page<DepartNegativeModel> page = profileDepartMapper.queryDepartNegative(Page.of(param.getCurrent(), param.getSize()), beginTime, endTime, param.getDepartName(), param.getDepartId());
return Result.success(page);
}
@GetMapping("{departId}")
public Result<ProfileDepart> profile(@PathVariable String departId, Date beginTime, Date endTime) {
ProfileDepart profileDepart = new ProfileDepart();
SupDepart depart = departService.getById(departId);
profileDepart.getDepartInfo()
.setName(depart.getName())
.setShortName(depart.getShortName());
List<SupPolice> polices = policeService.listAllByDepartId(departId);
profileDepart.getDepartInfo().setMainRole(polices.stream().filter(item -> "正职".equals(item.getPosition())).findFirst().map(SupPolice::getName).orElse(null));
profileDepart.getDepartInfo().setDeputyRole(polices.stream().filter(item -> "副职".equals(item.getPosition())).map(SupPolice::getName).toList());
// 民警数量
profileDepart.getDepartInfo().setPoliceSize(polices.stream().filter(item -> PersonTypeEnum.police.getValue().equals(item.getPersonStatus())).count());
// 协警辅警数量
profileDepart.getDepartInfo().setAuxSize(polices.stream().filter(item -> PersonTypeEnum.aux.getValue().equals(item.getPersonStatus()) || PersonTypeEnum.xj.getValue().equals(item.getPersonStatus())).count());
long negativeSize = negativeService.count(new LambdaQueryWrapper<Negative>().eq(Negative::getInvolveDepartId, departId)
.in(Negative::getCheckStatus, List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue())));
profileDepart.getNegativeInfo().setSize(negativeSize);
return Result.success(profileDepart);
}
}

100
src/main/java/com/biutag/supervision/controller/system/DepartController.java

@ -0,0 +1,100 @@
package com.biutag.supervision.controller.system;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.constants.enums.DepartLevelEnum;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.entity.SupDepart;
import com.biutag.supervision.pojo.param.DepartQueryParam;
import com.biutag.supervision.pojo.param.DepartTreeListParam;
import com.biutag.supervision.pojo.vo.DepartTree;
import com.biutag.supervision.service.SupDepartService;
import com.biutag.supervision.service.SupPoliceService;
import jakarta.validation.ValidationException;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
@RequestMapping("depart")
@RequiredArgsConstructor
@RestController
public class DepartController {
private final SupDepartService departService;
public final SupPoliceService policeService;
@GetMapping
public Result<List<DepartTree>> treeList(DepartTreeListParam departTreeListParam) {
return Result.success(departService.buildTreeByParam(departTreeListParam));
}
@GetMapping("list")
public Result<Page<SupDepart>> list(DepartQueryParam departQueryParam) {
return Result.success(departService.page(departQueryParam));
}
@PostMapping
public Result<Boolean> add(@RequestBody SupDepart supDepart) {
if (departService.existsByName(supDepart.getName())) {
throw new ValidationException("单位全称已存在");
}
if (departService.existsByCode(supDepart.getCode())) {
throw new ValidationException("单位编码已存在");
}
SupDepart parent = departService.getById(supDepart.getPid());
supDepart.setId(String.valueOf(NumberUtil.nullToZero(departService.getMaxId()) + 1));
supDepart.setLevel(parent.getLevel() + 1);
supDepart.setUpdatedAt(DateUtil.format(new Date(), DatePattern.NORM_DATETIME_FORMAT));
return Result.success(departService.save(supDepart));
}
@PutMapping
public Result<Boolean> update(@RequestBody SupDepart supDepart) {
if (departService.exists(new LambdaQueryWrapper<SupDepart>().eq(SupDepart::getName, supDepart.getName()).ne(SupDepart::getId, supDepart.getId()))) {
throw new ValidationException("单位全称已存在");
}
if (departService.exists(new LambdaQueryWrapper<SupDepart>().eq(SupDepart::getCode, supDepart.getCode()).ne(SupDepart::getId, supDepart.getId()))) {
throw new ValidationException("单位编码已存在");
}
SupDepart parent = departService.getById(supDepart.getPid());
supDepart.setLevel(parent.getLevel() + 1);
supDepart.setUpdatedAt(DateUtil.format(new Date(), DatePattern.NORM_DATETIME_FORMAT));
return Result.success(departService.updateById(supDepart));
}
@DeleteMapping("{id}")
public Result<Boolean> del(@PathVariable String id) {
if (policeService.exists(id)) {
throw new RuntimeException("该单位下还有警务人员,请移除后再删除");
}
return Result.success(departService.removeById(id));
}
@GetMapping("tree")
public Result<List<DepartTree>> tree() {
return Result.success(departService.buildTreeByAuth());
}
@GetMapping("second")
public Result<List<DepartTree>> seconds() {
List<SupDepart> supDeparts = departService.listByLevel(List.of(DepartLevelEnum.SECOND_CATEGORY.getValue(), DepartLevelEnum.SECOND.getValue()));
return Result.success(departService.buildTreeBySecond(supDeparts));
}
@GetMapping("firstHost")
public Result<List<DepartTree>> firstHost() {
return Result.success(departService.buildTreeByFirstHost());
}
@GetMapping("{departId}/children")
public Result<List<SupDepart>> children(@PathVariable String departId) {
return Result.success(departService.list(new LambdaQueryWrapper<SupDepart>().eq(SupDepart::getPid, departId).orderByAsc(SupDepart::getOrderNo)));
}
}

52
src/main/java/com/biutag/supervision/controller/system/DictContentController.java

@ -0,0 +1,52 @@
package com.biutag.supervision.controller.system;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.entity.SupDictProblemType;
import com.biutag.supervision.pojo.vo.DictContentTree;
import com.biutag.supervision.service.SupDictContentService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.time.LocalDateTime;
import java.util.List;
@RequiredArgsConstructor
@RequestMapping("dict/content")
@RestController
public class DictContentController {
private final SupDictContentService dictContentService;
@GetMapping("tree")
public Result<List<DictContentTree>> list() {
return Result.success(dictContentService.buildTree());
}
@PostMapping
public Result<Void> add(@RequestBody SupDictProblemType dictContent) {
dictContent.setUpdTime(LocalDateTime.now());
dictContent.setCrtTime(LocalDateTime.now());
dictContent.setStatus("0");
dictContentService.save(dictContent);
dictContentService.update(new LambdaUpdateWrapper<SupDictProblemType>().eq(SupDictProblemType::getId, dictContent.getId()).set(SupDictProblemType::getCode, dictContent.getId()));
return Result.success();
}
@PutMapping
public Result<Void> update(@RequestBody SupDictProblemType dictContent) {
dictContent.setUpdTime(LocalDateTime.now());
dictContentService.updateById(dictContent);
return Result.success();
}
@DeleteMapping("{id}")
public Result<Void> update(@PathVariable Integer id) {
if (dictContentService.exists(new LambdaQueryWrapper<SupDictProblemType>().eq(SupDictProblemType::getParentCode, id))) {
throw new RuntimeException("该节点下还存在子节点,无法删除");
}
dictContentService.removeById(id);
return Result.success();
}
}

104
src/main/java/com/biutag/supervision/controller/system/DictController.java

@ -0,0 +1,104 @@
package com.biutag.supervision.controller.system;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.dto.DictDataDto;
import com.biutag.supervision.pojo.dto.DictTypeDto;
import com.biutag.supervision.pojo.entity.SupDictData;
import com.biutag.supervision.pojo.entity.SupDictType;
import com.biutag.supervision.pojo.vo.DictProblemSourceTree;
import com.biutag.supervision.service.SupDictDataService;
import com.biutag.supervision.service.SupDictProblemSourceService;
import com.biutag.supervision.service.SupDictTypeService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.time.LocalDateTime;
import java.util.List;
@RequiredArgsConstructor
@RequestMapping("dict")
@RestController
public class DictController {
private final SupDictTypeService dictTypeService;
private final SupDictDataService dictDataService;
private final SupDictProblemSourceService dictProblemSourceService;
@GetMapping
public Result<Page<SupDictType>> page(Page<SupDictType> page, String dictName) {
LambdaQueryWrapper<SupDictType> queryWrapper = new LambdaQueryWrapper<SupDictType>()
.like(StrUtil.isNotBlank(dictName), SupDictType::getDictName, dictName)
.orderByDesc(SupDictType::getUpdateTime);
return Result.success(dictTypeService.page(page, queryWrapper));
}
@PostMapping
public Result<Boolean> add(@RequestBody DictTypeDto dictType) {
return Result.success(dictTypeService.save(dictType));
}
@PutMapping
public Result<Boolean> update(@RequestBody DictTypeDto dictType) {
SupDictType supDictType = new SupDictType();
BeanUtil.copyProperties(dictType, supDictType);
supDictType.setUpdateTime(LocalDateTime.now());
LambdaQueryWrapper<SupDictType> queryWrapper = new LambdaQueryWrapper<SupDictType>().ne(SupDictType::getDictId, dictType.getDictId()).eq(SupDictType::getDictType, dictType.getDictType());
if (dictTypeService.exists(queryWrapper)) {
throw new RuntimeException("字典类型已存在");
}
SupDictType oldSupDictType = dictTypeService.getById(dictType.getDictId());
if (!oldSupDictType.getDictType().equals(supDictType.getDictType())) {
// 更新
dictDataService.update(new LambdaUpdateWrapper<SupDictData>().eq(SupDictData::getDictType, oldSupDictType.getDictType()).set(SupDictData::getDictType, dictType.getDictType()));
}
return Result.success(dictTypeService.updateById(supDictType));
}
@DeleteMapping("{dictId}")
public Result<Boolean> update(@PathVariable Integer dictId) {
return Result.success(dictTypeService.removeById(dictId));
}
@GetMapping("{dictType}/dictData")
public Result<Page<SupDictData>> list(Page<SupDictData> page, @PathVariable String dictType) {
return Result.success(dictDataService.page(page, new LambdaQueryWrapper<SupDictData>()
.eq(SupDictData::getDictType, dictType)
.orderByAsc(SupDictData::getDictSort)));
}
@PostMapping("{dictType}/dictData")
public Result<Boolean> add(@RequestBody DictDataDto dictData) {
return Result.success(dictDataService.save(dictData));
}
@PutMapping("{dictType}/dictData")
public Result<Boolean> update(@RequestBody DictDataDto dictData) {
SupDictData supDictData = new SupDictData();
BeanUtil.copyProperties(dictData, supDictData);
return Result.success(dictDataService.updateById(supDictData));
}
@DeleteMapping("{dictType}/dictData/{dictCode}")
public Result<Boolean> del(@PathVariable Integer dictCode) {
return Result.success(dictDataService.removeById(dictCode));
}
@GetMapping("data/{dictType}")
public Result<List<SupDictData>> list(@PathVariable String dictType) {
return Result.success(dictDataService.list(new LambdaQueryWrapper<SupDictData>()
.eq(SupDictData::getDictType, dictType)
.orderByAsc(SupDictData::getDictSort)));
}
@GetMapping("problemSource")
public Result<List<DictProblemSourceTree>> listProblemSource() {
return Result.success(dictProblemSourceService.buildTree());
}
}

71
src/main/java/com/biutag/supervision/controller/system/HolidayController.java

@ -0,0 +1,71 @@
package com.biutag.supervision.controller.system;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.entity.Holiday;
import com.biutag.supervision.service.HolidayService;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.time.LocalDate;
import java.time.temporal.TemporalAdjusters;
import java.util.ArrayList;
import java.util.List;
@RequiredArgsConstructor
@RequestMapping("holiday")
@RestController
public class HolidayController {
private final HolidayService holidayService;
public static final List<Integer> months = List.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
@GetMapping("{year}")
public Result<List<HolidayVo>> list(@PathVariable Integer year) {
List<Holiday> holidays = holidayService.list(year);
List<HolidayVo> list = months.stream().map(month -> {
HolidayVo holidayVo = new HolidayVo();
holidayVo.setMonth(month);
LocalDate beginDay = LocalDate.of(year, month, 1);
int beginDayOfWeek = beginDay.getDayOfWeek().getValue();
for (int i = 0; i < (beginDayOfWeek != 0 ? beginDayOfWeek - 1 : 6); i++) {
holidayVo.getDays().add(new Day());
}
LocalDate.of(year, month, 1);
for (int i = 1; i <= beginDay.with(TemporalAdjusters.lastDayOfMonth()).getDayOfMonth(); i++) {
String date = LocalDate.of(year, month, i).toString();
Boolean flag = holidays.stream().filter(item -> item.getDate().equals(date)).findFirst().map(Holiday::getFlag).orElse(false);
holidayVo.getDays().add(Day.of(i, flag));
}
return holidayVo;
}).toList();
return Result.success(list);
}
@Setter
@Getter
public static class HolidayVo {
private Integer month;
private List<Day> days = new ArrayList<>();
}
@Setter
@Getter
public static class Day {
private Integer day;
private Boolean flag = false;
public static Day of(Integer day, Boolean flag) {
Day obj = new Day();
obj.setDay(day);
obj.setFlag(flag);
return obj;
}
}
}

51
src/main/java/com/biutag/supervision/controller/system/MenuController.java

@ -0,0 +1,51 @@
package com.biutag.supervision.controller.system;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.dto.MenuDto;
import com.biutag.supervision.pojo.entity.Menu;
import com.biutag.supervision.pojo.vo.MenuTree;
import com.biutag.supervision.service.MenuService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.*;
import java.time.LocalDateTime;
import java.util.List;
@RequiredArgsConstructor
@RequestMapping("menu")
@RestController
public class MenuController {
private final MenuService menuService;
@GetMapping
public Result<List<MenuTree>> list() {
List<Menu> menus = menuService.list(new LambdaQueryWrapper<Menu>().orderByAsc(Menu::getMenuSort));
return Result.success(MenuTree.buildTree(menus));
}
@PostMapping
public Result<Void> add(@RequestBody MenuDto menuDto) {
Menu menu = new Menu();
BeanUtils.copyProperties(menuDto, menu);
menuService.save(menu);
return Result.success();
}
@PutMapping
public Result<List<MenuTree>> update(@RequestBody MenuDto menuDto) {
Menu menu = new Menu();
BeanUtils.copyProperties(menuDto, menu);
menu.setUpdateTime(LocalDateTime.now());
menuService.updateById(menu);
return Result.success();
}
@DeleteMapping("{id}")
public Result<Boolean> del(@PathVariable Integer id) {
return Result.success(menuService.removeById(id));
}
}

249
src/main/java/com/biutag/supervision/controller/system/PoliceController.java

@ -0,0 +1,249 @@
package com.biutag.supervision.controller.system;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelReader;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.read.metadata.ReadSheet;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.constants.enums.DepartLevelEnum;
import com.biutag.supervision.constants.enums.InitialPetition;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.domain.PoliceAuth;
import com.biutag.supervision.pojo.dto.PoliceImport;
import com.biutag.supervision.pojo.entity.*;
import com.biutag.supervision.pojo.model.PoliceModel;
import com.biutag.supervision.pojo.param.PoliceQueryParam;
import com.biutag.supervision.service.*;
import jakarta.validation.ConstraintViolation;
import jakarta.validation.Validator;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
@RequestMapping("police")
@RequiredArgsConstructor
@RestController
public class PoliceController {
private final SupPoliceService policeService;
private final SupDepartService departService;
private final NegDepartAuthorityService negDepartAuthorityService;
private final NegSourceAuthorityService negSourceAuthorityService;
private final Validator validator;
@GetMapping
public Result<Page<PoliceModel>> list(PoliceQueryParam param) {
return Result.success(policeService.page(param));
}
@PostMapping
public Result<Boolean> add(@RequestBody SupPolice police) {
SupPolice policeByEmpNo = policeService.getOne(new LambdaQueryWrapper<SupPolice>().eq(SupPolice::getEmpNo, police.getEmpNo()));
if (Objects.nonNull(policeByEmpNo)) {
SupDepart depart = departService.getById(policeByEmpNo.getOrgId());
throw new RuntimeException(String.format("该人员[%s]已存在于“%s”单位中,请联系二级机构或市局管理员以进行人员调整。", police.getEmpNo(), depart.getName()));
}
SupPolice one = policeService.getOne(new LambdaQueryWrapper<SupPolice>().eq(SupPolice::getIdCode, police.getIdCode()));
if (Objects.nonNull(one)) {
SupDepart depart = departService.getById(one.getOrgId());
throw new RuntimeException(String.format("该人员[%s]已存在于“%s”单位中,请联系二级机构或市局管理员以进行人员调整。", police.getIdCode(), depart.getName()));
}
police.setId(IdUtil.getSnowflakeNextIdStr());
police.setUpdatedAt(DateUtil.format(new Date(), DatePattern.NORM_DATETIME_FORMAT));
police.setCreatedAt(DateUtil.format(new Date(), DatePattern.NORM_DATETIME_FORMAT));
return Result.success(policeService.save(police));
}
@PutMapping
public Result<Boolean> update(@RequestBody SupPolice police) {
SupPolice policeByEmpNo = policeService.getOne(new LambdaQueryWrapper<SupPolice>().eq(SupPolice::getEmpNo, police.getEmpNo()).ne(SupPolice::getId, police.getId()));
if (Objects.nonNull(policeByEmpNo)) {
SupDepart depart = departService.getById(policeByEmpNo.getOrgId());
throw new RuntimeException(String.format("该人员[%s]已存在于“%s”单位中,请联系二级机构或市局管理员以进行人员调整。", police.getEmpNo(), depart.getName()));
}
SupPolice one = policeService.getOne(new LambdaQueryWrapper<SupPolice>().eq(SupPolice::getIdCode, police.getIdCode()).ne(SupPolice::getId, police.getId()));
if (Objects.nonNull(one)) {
SupDepart depart = departService.getById(one.getOrgId());
throw new RuntimeException(String.format("该人员[%s]已存在于“%s”单位中,请联系二级机构或市局管理员以进行人员调整。", police.getIdCode(), depart.getName()));
}
police.setUpdatedAt(DateUtil.format(new Date(), DatePattern.NORM_DATETIME_FORMAT));
return Result.success(policeService.updateById(police));
}
@DeleteMapping("{id}")
public Result<Boolean> del(@PathVariable String id) {
return Result.success(policeService.removeById(id));
}
@GetMapping("{departId}/all")
public Result<List<SupPolice>> all(@PathVariable String departId) {
return Result.success(policeService.listAllByDepartId(departId));
}
@GetMapping("{departId}/leader")
public Result<List<SupPolice>> leader(@PathVariable String departId) {
return Result.success(policeService.listLeaderByDepartId(departId));
}
@GetMapping("auth/{idCode}")
public Result<PoliceAuth> auth(@PathVariable String idCode) {
PoliceAuth policeAuth = new PoliceAuth().setDeparts(negDepartAuthorityService.list(idCode).stream().map(NegDepartAuthority::getDepartId).toList())
.setSources(negSourceAuthorityService.list(idCode).stream().map(NegSourceAuthority::getSource).toList());
return Result.success(policeAuth);
}
@PostMapping("auth/{idCode}")
public Result<Void> auth(@PathVariable String idCode, @RequestBody PoliceAuth policeAuth) {
negDepartAuthorityService.save(idCode, policeAuth.getDeparts());
negSourceAuthorityService.save(idCode, policeAuth.getSources());
return Result.success();
}
private final BaseUserService userService;
private final BaseAccountService accountService;
private final SupDictProblemSourceService dictProblemSourceService;
@PostMapping("import")
public Result<List<PoliceImport>> importExcel(@RequestPart("file") MultipartFile file) throws IOException {
String fileNameType = FileUtil.extName(file.getOriginalFilename());
if (!"xls".equals(fileNameType) && !"xlsx".equals(fileNameType)) {
throw new RuntimeException("仅支持 xls/xlsx 格式文件的导入");
}
List<PoliceImport> list = new ArrayList<>();
List<SupDictProblemSource> problemSources = dictProblemSourceService.list();
ExcelReader excelReader = EasyExcel.read(file.getInputStream(), PoliceImport.class, new ReadListener<PoliceImport>() {
@Override
public void invoke(PoliceImport data, AnalysisContext analysisContext) {
Set<ConstraintViolation<PoliceImport>> validate = validator.validate(data);
if (!validate.isEmpty()) {
String message = validate.stream().map(ConstraintViolation::getMessage).collect(Collectors.joining("\n"));
throw new RuntimeException(String.format("第%s条数据的异常:%s", list.size() + 1, message));
}
list.add(data);
}
@Override
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
}
}).build();
ReadSheet sheet = EasyExcel.readSheet(0).build();
excelReader.read(sheet);
excelReader.close();
for (int i = 0; i < list.size(); i++) {
PoliceImport police = list.get(i);
SupDepart depart = departService.getOne(new LambdaQueryWrapper<SupDepart>().eq(SupDepart::getShortName, police.getSecondDepartName()).eq(SupDepart::getLevel, 2));
if (Objects.isNull(depart)) {
throw new RuntimeException(String.format("%s 该单位在系统中未找到,请核实", police.getSecondDepartName()));
}
if (StrUtil.isNotBlank(police.getThirdDepartName())) {
depart = departService.getOne(new LambdaQueryWrapper<SupDepart>().eq(SupDepart::getPid, depart.getId())
.eq(SupDepart::getShortName, police.getThirdDepartName()).eq(SupDepart::getLevel, 3));
if (Objects.isNull(depart)) {
throw new RuntimeException(String.format("%s/%s 该单位在系统中未找到,请核实", police.getSecondDepartName(), police.getThirdDepartName()));
}
}
SupPolice supPolice = policeService.getByIdCode(list.get(i).getIdCode());
if (supPolice == null) {
supPolice = new SupPolice();
supPolice.setName(police.getName());
supPolice.setIdCode(police.getIdCode());
supPolice.setEmpNo(police.getEmpNo());
supPolice.setOrgId(depart.getId());
} else {
supPolice.setName(police.getName());
supPolice.setIdCode(police.getIdCode());
supPolice.setEmpNo(police.getEmpNo());
supPolice.setOrgId(depart.getId());
if (police.getEmpNo().contains("A")) {
supPolice.setPersonType("3");
} else {
supPolice.setPersonType("1");
}
policeService.updateById(supPolice);
}
if ("三级机构专班".equals(police.getRole()) || "二级机构专班".equals(police.getRole())) {
String userId = saveOrUpdateUser(police);
// 角色
addRoleUser(userId, police.getRole());
// 权限
addAuth(police.getIdCode(), supPolice.getOrgId(), problemSources);
}
}
return Result.success(list);
}
public String saveOrUpdateUser(PoliceImport police) {
BaseUser user = userService.getByUserName(police.getIdCode());
if (user != null) {
return user.getUserId();
}
BaseUser baseUser = new BaseUser();
baseUser.setUserName(police.getIdCode());
baseUser.setNickName(police.getName());
baseUser.setUserType("admin");
baseUser.setCreateTime(LocalDateTime.now());
baseUser.setUpdateTime(LocalDateTime.now());
userService.save(baseUser);
BaseAccount account = new BaseAccount();
account.setAccount(police.getIdCode());
account.setUserId(baseUser.getUserId());
account.setAccountType("username");
account.setDomain("@admin.com");
account.setPassword("$2a$10$q0NbHH1fbkDotxJ1dT7PbOcV4G47R8n15uVxz2.imTiDqdCwAJYBC");
account.setDomain("@admin.com");
account.setCreateTime(LocalDateTime.now());
account.setUpdateTime(LocalDateTime.now());
accountService.save(account);
return baseUser.getUserId();
}
private final BaseRoleUserService roleUserService;
public void addRoleUser(String userId, String role) {
roleUserService.remove(new LambdaQueryWrapper<BaseRoleUser>().eq(BaseRoleUser::getUserId, userId));
BaseRoleUser baseRoleUser = new BaseRoleUser();
baseRoleUser.setUserId(userId);
if ("三级机构专班".equals(role)) {
baseRoleUser.setRoleId("5");
}
if ("二级机构专班".equals(role)) {
baseRoleUser.setRoleId("4");
}
baseRoleUser.setCreateTime(LocalDateTime.now());
baseRoleUser.setUpdateTime(LocalDateTime.now());
roleUserService.save(baseRoleUser);
}
public void addAuth(String idCode, String orgId, List<SupDictProblemSource> problemSources) {
negDepartAuthorityService.remove(new LambdaQueryWrapper<NegDepartAuthority>().eq(NegDepartAuthority::getIdCode, idCode));
NegDepartAuthority authority = new NegDepartAuthority();
authority.setDepartId(orgId);
authority.setIdCode(idCode);
negDepartAuthorityService.save(authority);
negSourceAuthorityService.remove(new LambdaQueryWrapper<NegSourceAuthority>().eq(NegSourceAuthority::getIdCode, idCode));
List<NegSourceAuthority> list = problemSources.stream().map(item -> {
NegSourceAuthority sourceAuthority = new NegSourceAuthority();
sourceAuthority.setIdCode(idCode);
sourceAuthority.setSource(item.getId());
return sourceAuthority;
}).toList();
negSourceAuthorityService.saveBatch(list);
}
}

60
src/main/java/com/biutag/supervision/controller/system/RoleController.java

@ -0,0 +1,60 @@
package com.biutag.supervision.controller.system;
import cn.hutool.core.util.IdUtil;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.entity.BaseRole;
import com.biutag.supervision.pojo.entity.RoleMenu;
import com.biutag.supervision.pojo.param.RoleQueryParam;
import com.biutag.supervision.service.BaseRoleService;
import com.biutag.supervision.service.RoleMenuService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.time.LocalDateTime;
import java.util.List;
@RequiredArgsConstructor
@RequestMapping("role")
@RestController
public class RoleController {
private final BaseRoleService baseRoleService;
private final RoleMenuService roleMenuService;
@GetMapping
public Result<List<BaseRole>> list(RoleQueryParam roleQueryParam) {
List<BaseRole> roles = baseRoleService.list(roleQueryParam);
return Result.success(roles);
}
@PostMapping
public Result<Boolean> add(@RequestBody BaseRole role) {
role.setRoleId(String.valueOf(IdUtil.getSnowflakeNextId()));
role.setCreateTime(LocalDateTime.now());
role.setUpdateTime(LocalDateTime.now());
return Result.success(baseRoleService.save(role));
}
@PutMapping
public Result<Boolean> update(@RequestBody BaseRole role) {
role.setUpdateTime(LocalDateTime.now());
return Result.success(baseRoleService.updateById(role));
}
@DeleteMapping("{id}")
public Result<Boolean> del(@PathVariable String id) {
return Result.success(baseRoleService.removeById(id));
}
@GetMapping("{roleCode}/menu")
public Result<List<Integer>> add(@PathVariable String roleCode) {
return Result.success(roleMenuService.list(roleCode).stream().map(RoleMenu::getMenuId).toList());
}
@PostMapping("{roleCode}/menu")
public Result<Boolean> add(@PathVariable String roleCode, @RequestBody List<Integer> menuIds) {
return Result.success(roleMenuService.update(roleCode, menuIds));
}
}

30
src/main/java/com/biutag/supervision/controller/system/UserController.java

@ -0,0 +1,30 @@
package com.biutag.supervision.controller.system;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.dto.UserDto;
import com.biutag.supervision.pojo.model.UserModel;
import com.biutag.supervision.pojo.param.UserQueryParam;
import com.biutag.supervision.service.BaseUserService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
@RequiredArgsConstructor
@RequestMapping("user")
@RestController
public class UserController {
private final BaseUserService baseUserService;
@GetMapping
public Result<Page<UserModel>> list(UserQueryParam queryParam) {
Page<UserModel> baseUserPage = baseUserService.page(queryParam);
return Result.success(baseUserPage);
}
@PostMapping
public Result<Boolean> update(@RequestBody UserDto userDto) {
return Result.success(baseUserService.update(userDto));
}
}

25
src/main/java/com/biutag/supervision/controller/work/FlowNodeController.java

@ -0,0 +1,25 @@
package com.biutag.supervision.controller.work;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.entity.FlowNode;
import com.biutag.supervision.service.FlowNodeService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RequestMapping("negative/flowNode")
@RequiredArgsConstructor
@RestController
public class FlowNodeController {
private final FlowNodeService flowNodeService;
@GetMapping
public Result<List<FlowNode>> list() {
return Result.success(flowNodeService.listAll());
}
}

68
src/main/java/com/biutag/supervision/controller/work/NegativeController.java

@ -0,0 +1,68 @@
package com.biutag.supervision.controller.work;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.flow.FlowService;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.domain.NegativeDetail;
import com.biutag.supervision.pojo.dto.ActionDto;
import com.biutag.supervision.pojo.dto.NegativeDto;
import com.biutag.supervision.pojo.entity.NegativeTask;
import com.biutag.supervision.pojo.param.NegativeQueryParam;
import com.biutag.supervision.pojo.vo.NegativeQueryVo;
import com.biutag.supervision.service.NegativeQueryService;
import com.biutag.supervision.service.NegativeService;
import com.biutag.supervision.service.NegativeTaskService;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
@RequiredArgsConstructor
@RequestMapping("negative")
@RestController
public class NegativeController {
private final NegativeService negativeService;
private final FlowService flowService;
private final NegativeQueryService negativeQueryService;
private final NegativeTaskService negativeTaskService;
@GetMapping
public Result<Page<NegativeQueryVo>> list(NegativeQueryParam queryParam) {
return Result.success(negativeQueryService.page(queryParam));
}
@GetMapping("{id}")
public Result<NegativeDetail> get(@PathVariable String id, Integer workId) {
return Result.success(negativeService.get(id, workId));
}
@PostMapping
public Result<Boolean> add(@Valid @RequestBody NegativeDto negativeDto) {
return Result.success(negativeService.save(negativeDto));
}
@PostMapping("{id}/execute")
public Result<Boolean> execute(@PathVariable String id, @RequestBody ActionDto action) {
action.setNegativeId(id);
return Result.success(flowService.execute(action));
}
@PostMapping("export/excel")
public Result<Void> export(NegativeQueryParam queryParam) {
queryParam.setSize(10000);
queryParam.setCurrent(1);
Page<NegativeQueryVo> page = negativeQueryService.page(queryParam);
NegativeTask negativeTask = negativeTaskService.save(page.getRecords().size());
negativeTaskService.updateExcel(page.getRecords(), negativeTask.getId());
return Result.success();
}
@DeleteMapping("{id}")
public Result<Boolean> remove(@PathVariable String id) {
return Result.success(negativeService.remove(id));
}
}

43
src/main/java/com/biutag/supervision/controller/work/NegativeFavController.java

@ -0,0 +1,43 @@
package com.biutag.supervision.controller.work;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.common.UserContextHolder;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.entity.NegativeFav;
import com.biutag.supervision.pojo.model.NegativeFavModel;
import com.biutag.supervision.pojo.param.WorkParam;
import com.biutag.supervision.service.NegativeFavService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.time.LocalDateTime;
@RequestMapping("negative/fav")
@RequiredArgsConstructor
@RestController
public class NegativeFavController {
private final NegativeFavService favService;
@GetMapping
public Result<Page<NegativeFavModel>> list(WorkParam workParam) {
return Result.success(favService.page(workParam));
}
@PostMapping
public Result<Boolean> add(@RequestBody NegativeFav fav) {
fav.setCreateTime(LocalDateTime.now());
fav.setUserId(UserContextHolder.getCurrentUserId());
fav.setCreateTime(LocalDateTime.now());
return Result.success(favService.save(fav));
}
@DeleteMapping("{negativeId}")
public Result<Boolean> del(@PathVariable String negativeId) {
return Result.success(favService.remove(new LambdaQueryWrapper<NegativeFav>()
.eq(NegativeFav::getNegativeId, negativeId)
.eq(NegativeFav::getUserId, UserContextHolder.getCurrentUserId())));
}
}

26
src/main/java/com/biutag/supervision/controller/work/NegativeTaskController.java

@ -0,0 +1,26 @@
package com.biutag.supervision.controller.work;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.entity.NegativeTask;
import com.biutag.supervision.pojo.param.NegativeTaskQueryParam;
import com.biutag.supervision.service.NegativeTaskService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RequiredArgsConstructor
@RequestMapping("negativeTask")
@RestController
public class NegativeTaskController {
private final NegativeTaskService negativeTaskService;
@GetMapping
public Result<Page<NegativeTask>> page(NegativeTaskQueryParam param) {
return Result.success(negativeTaskService.page(param));
}
}

31
src/main/java/com/biutag/supervision/controller/work/WorkController.java

@ -0,0 +1,31 @@
package com.biutag.supervision.controller.work;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.constants.enums.WorkStatusEnum;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.model.NegativeWorkModel;
import com.biutag.supervision.pojo.param.WorkParam;
import com.biutag.supervision.service.NegativeWorkService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RequiredArgsConstructor
@RequestMapping("work")
@RestController
public class WorkController {
private final NegativeWorkService negativeWorkService;
@GetMapping("todo")
public Result<Page<NegativeWorkModel>> todo(WorkParam workParam) {
return Result.success(negativeWorkService.page(workParam, WorkStatusEnum.todo.name()));
}
@GetMapping("done")
public Result<Page<NegativeWorkModel>> done(WorkParam workParam) {
return Result.success(negativeWorkService.page(workParam, WorkStatusEnum.done.name()));
}
}

4
src/main/java/com/biutag/supervision/exception/AuthException.java

@ -0,0 +1,4 @@
package com.biutag.supervision.exception;
public class AuthException extends RuntimeException {
}

53
src/main/java/com/biutag/supervision/flow/FlowService.java

@ -0,0 +1,53 @@
package com.biutag.supervision.flow;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.biutag.supervision.common.UserContextHolder;
import com.biutag.supervision.flow.action.Action;
import com.biutag.supervision.pojo.dto.ActionDto;
import com.biutag.supervision.pojo.entity.NegativeHistory;
import com.biutag.supervision.pojo.entity.NegativeWork;
import com.biutag.supervision.pojo.model.UserAuth;
import com.biutag.supervision.service.NegativeHistoryService;
import com.biutag.supervision.service.NegativeWorkService;
import com.biutag.supervision.util.JSON;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.util.List;
@RequiredArgsConstructor
@Service
public class FlowService {
private final List<Action> actions;
private final NegativeHistoryService negativeHistoryService;
private final NegativeWorkService workService;
@Transactional(rollbackFor = Exception.class)
public Boolean execute(ActionDto actionDto) {
Action action = actions
.stream()
.filter(item -> item.getClass().getName().contains(StrUtil.upperFirst(StrUtil.toCamelCase(actionDto.getActionKey()))))
.findFirst()
.orElseThrow(() -> new RuntimeException("配置异常,请联系系统管理员"));
action.next(actionDto);
NegativeWork work = workService.getById(actionDto.getWorkId());
UserAuth user = UserContextHolder.getCurrentUser();
NegativeHistory history = new NegativeHistory().setHistoryId(IdUtil.fastSimpleUUID())
.setNegativeId(actionDto.getNegativeId())
.setActionName(actionDto.getActionName())
.setDepartName(work.getDepartName())
.setCrtUser(user.getUserId())
.setCrtUserName(user.getUserName())
.setCrtName(user.getNickName())
.setCrtTime(LocalDateTime.now())
.setDataJson(JSON.toJSONString(actionDto));
return negativeHistoryService.save(history);
}
}

9
src/main/java/com/biutag/supervision/flow/action/Action.java

@ -0,0 +1,9 @@
package com.biutag.supervision.flow.action;
import com.biutag.supervision.pojo.dto.ActionDto;
public interface Action {
void next(ActionDto actionDto);
}

182
src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java

@ -0,0 +1,182 @@
package com.biutag.supervision.flow.action;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.biutag.supervision.constants.AppConstants;
import com.biutag.supervision.constants.enums.*;
import com.biutag.supervision.pojo.dto.ActionDto;
import com.biutag.supervision.pojo.dto.flow.VerifyData;
import com.biutag.supervision.pojo.entity.*;
import com.biutag.supervision.service.*;
import jakarta.validation.Validator;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
* 申请办结
*/
@RequiredArgsConstructor
@Component
public class ApplyCompletionAction implements Action {
private final NegativeService negativeService;
private final NegativeBlameService negativeBlameService;
private final NegativeProblemRelationService negativeProblemRelationService;
private final NegativeFileService fileService;
private final NegativeApproveService aproveService;
private final NegativeWorkService workService;
private final SupDepartService departService;
private final Validator validator;
@Override
public void next(ActionDto actionDto) {
VerifyData verifyData = BeanUtil.toBean(actionDto.getData(), VerifyData.class);
//validator.validate(verifyData);
// 新增审批数据
Negative negative = negativeService.getById(actionDto.getNegativeId());
updateNegative(actionDto.getNegativeId(), actionDto.getNextFlowKey(), verifyData, negative);
doneWork(actionDto.getWorkId());
addWork(actionDto.getNegativeId(), actionDto.getWorkId(),
// 是否是本级办理
negative.getIsSecondHandle() ? RoleCodeEnum.FIRST_ADMIN.getCode() : RoleCodeEnum.SECOND_ADMIN.getCode(),
negative);
}
public void updateNegative(String negativeId, String nextFlowKey, VerifyData verifyData, Negative negative) {
LocalDateTime now = LocalDateTime.now();
LambdaUpdateWrapper<Negative> updateWrapper = new LambdaUpdateWrapper<Negative>()
.eq(Negative::getId, negativeId)
.set(Negative::getFlowKey, nextFlowKey)
.set(Negative::getUpdTime, now)
.set(Negative::getProcessingStatus, ProcessingStatusEnum.approval.name())
.set(Negative::getCheckStatus, verifyData.getCheckStatus())
.set(Negative::getCheckStatusDesc, verifyData.getCheckStatusDesc())
.set(Negative::getCheckStatusName, verifyData.getCheckStatusName())
.set(Negative::getIsRectifyCode, verifyData.getIsRectifyCode())
.set(Negative::getIsRectifyName, verifyData.getIsRectifyName())
.set(Negative::getAccountabilityTarget, verifyData.getAccountabilityTarget())
.set(Negative::getCaseNumber, verifyData.getCaseNumber())
// 当前处理对象
.set(Negative::getCurrentProcessingObject, negative.getIsSecondHandle() ? "市局专班" : String.format("%s专班", negative.getHandleSecondDepartName()));
// 未整改
if (IsRectifyEnum.NOT.getValue().equals(verifyData.getIsRectifyCode())) {
updateWrapper.set(Negative::getRectifyRestrictionDays, verifyData.getRectifyRestrictionDays());
}
negativeService.update(updateWrapper);
if (!verifyData.getBlames().isEmpty()) {
List<NegativeProblemRelation> problemRelations = new ArrayList<>();
List<NegativeBlame> negativeBlames = verifyData.getBlames().stream().map(item -> {
NegativeBlame negativeBlame = new NegativeBlame();
BeanUtil.copyProperties(item, negativeBlame);
negativeBlame
.setBlameId(IdUtil.fastSimpleUUID())
.setNegativeId(negativeId)
.setCrtTime(now)
.setUpdTime(now);
if (Objects.nonNull(item.getAssistTime()) && item.getAssistTime().size() >= 2) {
negativeBlame.setAssistStartTime(item.getAssistTime().get(0))
.setAssistEndTime(item.getAssistTime().get(1));
}
problemRelations.addAll(item.getProblems().stream().filter(problem -> StrUtil.isNotBlank(problem.getOneLevelCode())).map(problem -> {
NegativeProblemRelation problemRelation = new NegativeProblemRelation();
BeanUtil.copyProperties(problem, problemRelation);
problemRelation.setId(IdUtil.fastSimpleUUID());
problemRelation.setBlameId(negativeBlame.getBlameId());
problemRelation.setNegativeId(negativeId);
return problemRelation;
}).toList());
return negativeBlame;
}).toList();
// 先删除
negativeBlameService.remove(negativeId);
// 新增涉及人员
negativeBlameService.saveBatch(negativeBlames);
// 新增涉及人员问题类型
// 先删除
negativeProblemRelationService.remove(negativeId);
if (!problemRelations.isEmpty()) {
// 新增
negativeProblemRelationService.saveBatch(problemRelations);
}
}
if (!verifyData.getFiles().isEmpty()) {
// 先删除
fileService.remove(negativeId);
// 新增
fileService.saveBatch(verifyData.getFiles(), negativeId);
}
aproveService.remove(negativeId);
// 不是二级机构本级办理
if (!negative.getIsSecondHandle()) {
NegativeApprove approve1 = new NegativeApprove()
.setNegativeId(negativeId)
.setActionKey(FlowActionEnum.SECOND_APPROVE.getKey())
.setCreateTime(now);
aproveService.save(approve1);
}
// 三级审批 所队一>二級机构一>市局
if (!ApprovalFlowEnum.SECOND_APPROVAL.getValue().equals(negative.getApprovalFlow())) {
NegativeApprove approve2 = new NegativeApprove()
.setNegativeId(negativeId)
.setActionKey(FlowActionEnum.FIRST_APPROVE.getKey())
.setCreateTime(now);
aproveService.save(approve2);
}
}
public void doneWork(Integer workId) {
workService.update(new LambdaUpdateWrapper<NegativeWork>()
.set(NegativeWork::getStatus, WorkStatusEnum.done.name())
.set(NegativeWork::getUpdateTime, LocalDateTime.now())
.eq(NegativeWork::getId, workId));
}
public void addWork(String negativeId, Integer workId, String roleCode, Negative negative) {
NegativeWork currentWork = workService.getById(workId);
SupDepart depart = departService.getById(currentWork.getDepartId());
String parentDepartId;
String parentDepartName;
if (DepartLevelEnum.SECOND.getValue().equals(depart.getLevel())) {
parentDepartId = AppConstants.ROOT_DEPART_ID;
parentDepartName = AppConstants.ROOT_DEPART_NAME;
} else {
SupDepart parentDepart = departService.getById(depart.getPid());
parentDepartId = parentDepart.getId();
parentDepartName = parentDepart.getShortName();
}
workService.remove(new LambdaQueryWrapper<NegativeWork>()
.eq(NegativeWork::getNegativeId, negativeId)
.eq(NegativeWork::getRoleCode, roleCode)
.eq(NegativeWork::getDepartId, parentDepartId));
NegativeWork work = new NegativeWork()
.setNegativeId(negativeId)
.setRoleCode(roleCode)
.setDepartId(parentDepartId)
.setDepartName(parentDepartName)
.setProblemSourcesCode(negative.getProblemSourcesCode())
.setCreateTime(LocalDateTime.now())
.setUpdateTime(LocalDateTime.now())
.setStatus(WorkStatusEnum.todo.name());
workService.save(work);
}
}

108
src/main/java/com/biutag/supervision/flow/action/ApplyExtensionAction.java

@ -0,0 +1,108 @@
package com.biutag.supervision.flow.action;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.biutag.supervision.common.UserContextHolder;
import com.biutag.supervision.constants.AppConstants;
import com.biutag.supervision.constants.enums.RoleCodeEnum;
import com.biutag.supervision.constants.enums.WorkStatusEnum;
import com.biutag.supervision.pojo.dto.ActionDto;
import com.biutag.supervision.pojo.dto.flow.ExtensionApplyData;
import com.biutag.supervision.pojo.entity.Negative;
import com.biutag.supervision.pojo.entity.NegativeExtensionApply;
import com.biutag.supervision.pojo.entity.NegativeWork;
import com.biutag.supervision.pojo.entity.SupDepart;
import com.biutag.supervision.pojo.model.UserAuth;
import com.biutag.supervision.service.NegativeExtensionApplyService;
import com.biutag.supervision.service.NegativeService;
import com.biutag.supervision.service.NegativeWorkService;
import com.biutag.supervision.service.SupDepartService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;
import java.time.LocalDateTime;
/**
* 申请延期
*/
@RequiredArgsConstructor
@Component
public class ApplyExtensionAction implements Action {
private final NegativeService negativeService;
private final NegativeExtensionApplyService extensionApplyService;
private final NegativeWorkService workService;
private final SupDepartService departService;
@Override
public void next(ActionDto actionDto) {
ExtensionApplyData extensionApplyData = BeanUtil.toBean(actionDto.getData(), ExtensionApplyData.class);
NegativeExtensionApply extensionApply = addExtensionApply(actionDto, extensionApplyData);
updateNegative(actionDto.getNegativeId(), extensionApply.getId());
addWork(actionDto);
}
public NegativeExtensionApply addExtensionApply(ActionDto actionDto, ExtensionApplyData applyExtensionData) {
UserAuth user = UserContextHolder.getCurrentUser();
NegativeWork work = workService.getById(actionDto.getWorkId());
NegativeExtensionApply extensionApply = new NegativeExtensionApply()
.setNegativeId(actionDto.getNegativeId())
.setComments(applyExtensionData.getComments())
.setExtensionDays(applyExtensionData.getExtensionDays())
.setHandlerDepartId(work.getDepartId())
.setHandlerDepartName(work.getDepartName())
.setHandlerUserName(user.getUserName())
.setHandlerName(user.getNickName())
.setCreateTime(LocalDateTime.now());
extensionApplyService.save(extensionApply);
return extensionApply;
}
public void updateNegative(String negativeId, Integer negativeExtensionApplyId) {
negativeService.update(new LambdaUpdateWrapper<Negative>()
.set(Negative::getUpdTime, LocalDateTime.now())
.set(Negative::getNegativeExtensionApplyId, negativeExtensionApplyId)
.set(Negative::getExtensionApplyFlag, false)
.eq(Negative::getId, negativeId));
}
public void addWork(ActionDto actionDto) {
NegativeWork currentWork = workService.getById(actionDto.getWorkId());
Negative negative = negativeService.getById(actionDto.getNegativeId());
String roleCode;
String departId;
String departName;
// 是否是二级机构办理
if (negative.getIsSecondHandle()) {
roleCode = RoleCodeEnum.FIRST_ADMIN.getCode();
departId = AppConstants.ROOT_DEPART_ID;
departName = AppConstants.ROOT_DEPART_NAME;
} else {
roleCode = RoleCodeEnum.SECOND_ADMIN.getCode();
SupDepart parentDepart = departService.getParentDepart(currentWork.getDepartId());
departId = parentDepart.getId();
departName = parentDepart.getShortName();
}
workService.remove(new LambdaQueryWrapper<NegativeWork>()
.eq(NegativeWork::getNegativeId, actionDto.getNegativeId())
.eq(NegativeWork::getRoleCode, roleCode)
.eq(NegativeWork::getDepartId, departId));
NegativeWork work = new NegativeWork()
.setNegativeId(actionDto.getNegativeId())
.setRoleCode(roleCode)
.setDepartId(departId)
.setDepartName(departName)
.setProblemSourcesCode(negative.getProblemSourcesCode())
.setFlowKey(actionDto.getNextFlowKey())
.setCreateTime(LocalDateTime.now())
.setUpdateTime(LocalDateTime.now())
.setStatus(WorkStatusEnum.todo.name());
workService.save(work);
}
}

77
src/main/java/com/biutag/supervision/flow/action/FirstApproveAction.java

@ -0,0 +1,77 @@
package com.biutag.supervision.flow.action;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.biutag.supervision.common.UserContextHolder;
import com.biutag.supervision.constants.enums.ApproveStateEnum;
import com.biutag.supervision.constants.enums.ProcessingStatusEnum;
import com.biutag.supervision.constants.enums.WorkStatusEnum;
import com.biutag.supervision.pojo.dto.ActionDto;
import com.biutag.supervision.pojo.dto.flow.ApproveData;
import com.biutag.supervision.pojo.entity.Negative;
import com.biutag.supervision.pojo.entity.NegativeApprove;
import com.biutag.supervision.pojo.entity.NegativeWork;
import com.biutag.supervision.pojo.model.UserAuth;
import com.biutag.supervision.service.NegativeApproveService;
import com.biutag.supervision.service.NegativeService;
import com.biutag.supervision.service.NegativeWorkService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;
import java.time.LocalDateTime;
/**
* 市局审批通过
*/
@RequiredArgsConstructor
@Component
public class FirstApproveAction implements Action {
private final NegativeService negativeService;
private final NegativeWorkService workService;
private final NegativeApproveService approveService;
@Override
public void next(ActionDto actionDto) {
ApproveData approveData = BeanUtil.toBean(actionDto.getData(), ApproveData.class);
updateNegative(actionDto.getNegativeId(), actionDto.getNextFlowKey());
updateApprove(actionDto.getNegativeId(), actionDto.getActionKey(), actionDto.getWorkId(), approveData.getComments());
doneWork(actionDto.getWorkId());
}
public void updateNegative(String negativeId, String nextFlowKey) {
negativeService.update(new LambdaUpdateWrapper<Negative>()
.set(Negative::getFlowKey, nextFlowKey)
.set(Negative::getProcessingStatus, ProcessingStatusEnum.completed.name())
.set(Negative::getCompleteDate, LocalDateTime.now())
.set(Negative::getUpdTime, LocalDateTime.now())
.eq(Negative::getId, negativeId));
}
public void updateApprove(String negativeId, String actionKey, Integer workId, String comments) {
UserAuth user = UserContextHolder.getCurrentUser();
NegativeWork work = workService.getById(workId);
approveService.update(new LambdaUpdateWrapper<NegativeApprove>()
.set(NegativeApprove::getState, ApproveStateEnum.approved.name())
.set(NegativeApprove::getComments, comments)
.set(NegativeApprove::getHandlerDepartId, work.getDepartId())
.set(NegativeApprove::getHandlerDepartName, work.getDepartName())
.set(NegativeApprove::getHandlerUserName, user.getUserName())
.set(NegativeApprove::getHandlerName, user.getNickName())
.set(NegativeApprove::getUpdateTime, LocalDateTime.now())
.eq(NegativeApprove::getNegativeId, negativeId)
.eq(NegativeApprove::getActionKey, actionKey));
}
public void doneWork(Integer workId) {
workService.update(new LambdaUpdateWrapper<NegativeWork>()
.set(NegativeWork::getUpdateTime, LocalDateTime.now())
.set(NegativeWork::getStatus, WorkStatusEnum.done.name())
.eq(NegativeWork::getId, workId));
}
}

89
src/main/java/com/biutag/supervision/flow/action/FirstApproveReturnAction.java

@ -0,0 +1,89 @@
package com.biutag.supervision.flow.action;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.biutag.supervision.common.UserContextHolder;
import com.biutag.supervision.constants.enums.*;
import com.biutag.supervision.pojo.dto.ActionDto;
import com.biutag.supervision.pojo.dto.flow.ApproveData;
import com.biutag.supervision.pojo.entity.Negative;
import com.biutag.supervision.pojo.entity.NegativeApprove;
import com.biutag.supervision.pojo.entity.NegativeWork;
import com.biutag.supervision.pojo.model.UserAuth;
import com.biutag.supervision.service.NegativeApproveService;
import com.biutag.supervision.service.NegativeService;
import com.biutag.supervision.service.NegativeWorkService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;
import java.time.LocalDateTime;
import java.util.List;
/**
* 市局 退回整改
*/
@RequiredArgsConstructor
@Component
public class FirstApproveReturnAction implements Action {
private final NegativeService negativeService;
private final NegativeWorkService workService;
private final NegativeApproveService approveService;
@Override
public void next(ActionDto actionDto) {
ApproveData approveData = BeanUtil.toBean(actionDto.getData(), ApproveData.class);
updateNegative(actionDto.getNegativeId(), actionDto.getNextFlowKey());
addApprove(actionDto.getNegativeId(), approveData.getComments(), actionDto.getWorkId());
doneWork(actionDto.getWorkId());
addWork(actionDto.getNegativeId(), RoleCodeEnum.SECOND_ADMIN.getCode());
}
public void updateNegative(String negativeId, String nextFlowKey) {
Negative negative = negativeService.getById(negativeId);
negativeService.update(new LambdaUpdateWrapper<Negative>()
.set(Negative::getFlowKey, nextFlowKey)
.set(Negative::getUpdTime, LocalDateTime.now())
// 当前处理对象
.set(Negative::getCurrentProcessingObject, String.format("%s专班", negative.getHandleSecondDepartName()))
.eq(Negative::getId, negativeId));
}
public void addApprove(String negativeId, String comments, Integer workId) {
UserAuth user = UserContextHolder.getCurrentUser();
NegativeWork work = workService.getById(workId);
approveService.update(new LambdaUpdateWrapper<NegativeApprove>()
.set(NegativeApprove::getState, ApproveStateEnum.rejected.name())
.set(NegativeApprove::getComments, comments)
.set(NegativeApprove::getHandlerDepartId, work.getDepartId())
.set(NegativeApprove::getHandlerDepartName, work.getDepartName())
.set(NegativeApprove::getHandlerUserName, user.getUserName())
.set(NegativeApprove::getHandlerName, user.getNickName())
.set(NegativeApprove::getUpdateTime, LocalDateTime.now())
.eq(NegativeApprove::getNegativeId, negativeId)
.eq(NegativeApprove::getActionKey, FlowActionEnum.FIRST_APPROVE.getKey()));
}
public void doneWork(Integer workId) {
workService.update(new LambdaUpdateWrapper<NegativeWork>()
.set(NegativeWork::getUpdateTime, LocalDateTime.now())
.set(NegativeWork::getStatus, WorkStatusEnum.done.name())
.eq(NegativeWork::getId, workId));
}
public void addWork(String negativeId, String roleCode) {
List<NegativeWork> works = workService.list(new LambdaQueryWrapper<NegativeWork>()
.eq(NegativeWork::getNegativeId, negativeId)
.eq(NegativeWork::getRoleCode, roleCode)
.orderByDesc(NegativeWork::getCreateTime));
if (works.isEmpty()) {
throw new RuntimeException("数据异常,请联系管理员:无二级机构工作流程数据");
}
works.get(0).setUpdateTime(LocalDateTime.now())
.setStatus(WorkStatusEnum.todo.name());
workService.updateById(works.get(0));
}
}

114
src/main/java/com/biutag/supervision/flow/action/FirstDistributeAction.java

@ -0,0 +1,114 @@
package com.biutag.supervision.flow.action;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.biutag.supervision.constants.enums.*;
import com.biutag.supervision.pojo.dto.ActionDto;
import com.biutag.supervision.pojo.dto.flow.FirstDistributeData;
import com.biutag.supervision.pojo.entity.Negative;
import com.biutag.supervision.pojo.entity.NegativeWork;
import com.biutag.supervision.pojo.entity.SupDepart;
import com.biutag.supervision.service.NegativeService;
import com.biutag.supervision.service.NegativeWorkService;
import com.biutag.supervision.service.SupDepartService;
import jakarta.validation.Validator;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;
import java.time.LocalDateTime;
/**
* 市局下发
*/
@Validated
@RequiredArgsConstructor
@Component
public class FirstDistributeAction implements Action {
private final NegativeService negativeService;
private final NegativeWorkService workService;
private final SupDepartService departService;
private final Validator validator;
@Override
public void next(ActionDto actionDto) {
FirstDistributeData firstDistributeData = BeanUtil.toBean(actionDto.getData(), FirstDistributeData.class);
validator.validate(firstDistributeData);
SupDepart depart = departService.getById(firstDistributeData.getDepartId());
// 三级单位办理
boolean thirdHandling = DepartLevelEnum.THREE.getValue().equals(depart.getLevel());
updateNegative(actionDto.getNegativeId(), actionDto.getNextFlowKey(), firstDistributeData, thirdHandling);
doneWork(actionDto.getWorkId());
addWork(actionDto.getNegativeId(),
thirdHandling ? RoleCodeEnum.THREE_ADMIN.getCode() : RoleCodeEnum.SECOND_ADMIN.getCode(),
firstDistributeData.getDepartId(), firstDistributeData.getDepartName());
}
public void updateNegative(String negativeId, String nextFlowKey, @Validated FirstDistributeData distributeData, boolean thirdHandling) {
LocalDateTime now = LocalDateTime.now();
LambdaUpdateWrapper<Negative> updateWrapper = new LambdaUpdateWrapper<Negative>()
.set(Negative::getHostLevel, distributeData.getHostLevel())
.set(Negative::getTimeLimit, distributeData.getTimeLimit())
.set(Negative::getApprovalFlow, distributeData.getApprovalFlow())
// 当前处理对象
.set(Negative::getCurrentProcessingObject, String.format("%s专班", distributeData.getDepartName()))
.set(Negative::getFirstDistributeTime, now)
.set(Negative::getUpdTime, now)
.eq(Negative::getId, negativeId);
if (TimeLimitEnum.OTHER.getValue().equals(distributeData.getTimeLimit())) {
updateWrapper.set(Negative::getMaxSignDuration, distributeData.getMaxSignDuration())
.set(Negative::getMaxHandleDuration, distributeData.getMaxHandleDuration())
.set(Negative::getMaxExtensionDuration, distributeData.getMaxExtensionDuration());
} else {
TimeLimitEnum timeLimitEnum = TimeLimitEnum.get(distributeData.getTimeLimit());
updateWrapper.set(Negative::getMaxSignDuration, timeLimitEnum.getMaxSignDuration())
.set(Negative::getMaxHandleDuration, timeLimitEnum.getMaxHandleDuration())
.set(Negative::getMaxExtensionDuration, timeLimitEnum.getMaxExtensionDuration());
}
if (thirdHandling) {
SupDepart parentDepart = departService.getParentDepart(distributeData.getDepartId());
updateWrapper.set(Negative::getFlowKey, FlowNodeEnum.THREE_SIGN.getKey())
.set(Negative::getHandleSecondDepartId, parentDepart.getId())
.set(Negative::getHandleSecondDepartName, parentDepart.getShortName())
.set(Negative::getHandleThreeDepartId, distributeData.getDepartId())
.set(Negative::getHandleThreeDepartName, distributeData.getDepartName());
} else {
updateWrapper.set(Negative::getFlowKey, nextFlowKey)
.set(Negative::getHandleSecondDepartId, distributeData.getDepartId())
.set(Negative::getHandleSecondDepartName, distributeData.getDepartName());
}
negativeService.update(updateWrapper);
}
public void doneWork(Integer workId) {
workService.update(new LambdaUpdateWrapper<NegativeWork>()
.set(NegativeWork::getStatus, WorkStatusEnum.done.name())
.set(NegativeWork::getUpdateTime, LocalDateTime.now())
.eq(NegativeWork::getId, workId));
}
public void addWork(String negativeId, String roleCode, String departId, String departName) {
workService.remove(new LambdaQueryWrapper<NegativeWork>()
.eq(NegativeWork::getNegativeId, negativeId)
.eq(NegativeWork::getRoleCode, roleCode)
.eq(NegativeWork::getDepartId, departId));
Negative negative = negativeService.getById(negativeId);
NegativeWork work = new NegativeWork()
.setNegativeId(negativeId)
.setRoleCode(roleCode)
.setDepartId(departId)
.setDepartName(departName)
.setProblemSourcesCode(negative.getProblemSourcesCode())
.setCreateTime(LocalDateTime.now())
.setUpdateTime(LocalDateTime.now())
.setStatus(WorkStatusEnum.todo.name());
workService.save(work);
}
}

82
src/main/java/com/biutag/supervision/flow/action/FirstExtensionApproveAction.java

@ -0,0 +1,82 @@
package com.biutag.supervision.flow.action;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.NumberUtil;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.biutag.supervision.common.UserContextHolder;
import com.biutag.supervision.constants.enums.ApproveStateEnum;
import com.biutag.supervision.constants.enums.WorkStatusEnum;
import com.biutag.supervision.pojo.dto.ActionDto;
import com.biutag.supervision.pojo.dto.flow.ApproveData;
import com.biutag.supervision.pojo.entity.Negative;
import com.biutag.supervision.pojo.entity.NegativeExtensionApply;
import com.biutag.supervision.pojo.entity.NegativeExtensionApprove;
import com.biutag.supervision.pojo.entity.NegativeWork;
import com.biutag.supervision.pojo.model.UserAuth;
import com.biutag.supervision.service.NegativeExtensionApplyService;
import com.biutag.supervision.service.NegativeExtensionApproveService;
import com.biutag.supervision.service.NegativeService;
import com.biutag.supervision.service.NegativeWorkService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;
import java.time.LocalDateTime;
/**
* 市局申请延期审批通过
*/
@RequiredArgsConstructor
@Component
public class FirstExtensionApproveAction implements Action {
private final NegativeService negativeService;
private final NegativeExtensionApplyService extensionApplyService;
private final NegativeExtensionApproveService extensionApproveService;
private final NegativeWorkService workService;
@Override
public void next(ActionDto actionDto) {
ApproveData approveData = BeanUtil.toBean(actionDto.getData(), ApproveData.class);
Negative negative = negativeService.getById(actionDto.getNegativeId());
updateNegative(negative);
addExtensionApprove(actionDto, approveData.getComments(), negative.getNegativeExtensionApplyId());
doneWork(actionDto.getWorkId());
}
public void updateNegative(Negative negative) {
NegativeExtensionApply extensionApply = extensionApplyService.getById(negative.getNegativeExtensionApplyId());
negativeService.update(new LambdaUpdateWrapper<Negative>()
.set(Negative::getExtensionApplyFlag, true)
// 延期天数
.set(Negative::getExtensionDays, NumberUtil.nullToZero(negative.getExtensionDays()) + extensionApply.getExtensionDays())
.eq(Negative::getId, negative.getId()));
}
public void addExtensionApprove(ActionDto actionDto, String comments, Integer negativeExtensionApplyId) {
UserAuth user = UserContextHolder.getCurrentUser();
NegativeWork work = workService.getById(actionDto.getWorkId());
NegativeExtensionApprove extensionApprove = new NegativeExtensionApprove()
.setNegativeId(actionDto.getNegativeId())
.setNegativeExtensionApplyId(negativeExtensionApplyId)
.setComments(comments)
.setHandlerDepartId(work.getDepartId())
.setHandlerDepartName(work.getDepartName())
.setHandlerUserName(user.getUserName())
.setHandlerName(user.getNickName())
.setState(ApproveStateEnum.approved.name())
.setCreateTime(LocalDateTime.now());
extensionApproveService.save(extensionApprove);
}
public void doneWork(Integer workId) {
workService.update(new LambdaUpdateWrapper<NegativeWork>().set(NegativeWork::getStatus, WorkStatusEnum.done.name())
.set(NegativeWork::getFlowKey, null)
.eq(NegativeWork::getId, workId));
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save