ws 2 tahun lalu
melakukan
2f7f091cba
100 mengubah file dengan 3246 tambahan dan 0 penghapusan
  1. 37 0
      .gitignore
  2. 30 0
      build.gradle
  3. TEMPAT SAMPAH
      gradle/wrapper/gradle-wrapper.jar
  4. 5 0
      gradle/wrapper/gradle-wrapper.properties
  5. 240 0
      gradlew
  6. 91 0
      gradlew.bat
  7. TEMPAT SAMPAH
      lib/dcs-app-client-api-jdk8-0.0.0.5.jar
  8. TEMPAT SAMPAH
      lib/dcs-crypto-api-jdk8-0.0.1.0.jar
  9. TEMPAT SAMPAH
      lib/open_platform_sdk-1.1.0.9.jar
  10. 1 0
      settings.gradle
  11. 15 0
      src/main/groovy/com/jd/brume/BrumeApplication.groovy
  12. 25 0
      src/main/groovy/com/jd/brume/config/CorsConfig.groovy
  13. 25 0
      src/main/groovy/com/jd/brume/config/PagingConfig.groovy
  14. 23 0
      src/main/groovy/com/jd/brume/config/RedisConfig.groovy
  15. 19 0
      src/main/groovy/com/jd/brume/config/ValidConfig.groovy
  16. 114 0
      src/main/groovy/com/jd/brume/controller/CorpController.groovy
  17. 16 0
      src/main/groovy/com/jd/brume/controller/DictController.groovy
  18. 16 0
      src/main/groovy/com/jd/brume/controller/DictTypeController.groovy
  19. 48 0
      src/main/groovy/com/jd/brume/controller/LoginController.groovy
  20. 107 0
      src/main/groovy/com/jd/brume/controller/MenuButtonController.groovy
  21. 160 0
      src/main/groovy/com/jd/brume/controller/MenuController.groovy
  22. 129 0
      src/main/groovy/com/jd/brume/controller/RoleController.groovy
  23. 165 0
      src/main/groovy/com/jd/brume/controller/ServiceController.groovy
  24. 139 0
      src/main/groovy/com/jd/brume/controller/UserController.groovy
  25. 13 0
      src/main/groovy/com/jd/brume/entity/ConfigEntity.groovy
  26. 42 0
      src/main/groovy/com/jd/brume/entity/CorpEntity.groovy
  27. 38 0
      src/main/groovy/com/jd/brume/entity/DictEntity.groovy
  28. 34 0
      src/main/groovy/com/jd/brume/entity/DictTypeEntity.groovy
  29. 22 0
      src/main/groovy/com/jd/brume/entity/FileEntity.groovy
  30. 34 0
      src/main/groovy/com/jd/brume/entity/LogEntity.groovy
  31. 33 0
      src/main/groovy/com/jd/brume/entity/MenuButtonEntity.groovy
  32. 57 0
      src/main/groovy/com/jd/brume/entity/MenuEntity.groovy
  33. 29 0
      src/main/groovy/com/jd/brume/entity/RoleEntity.groovy
  34. 20 0
      src/main/groovy/com/jd/brume/entity/RoleMenuEntity.groovy
  35. 63 0
      src/main/groovy/com/jd/brume/entity/ServiceEntity.groovy
  36. 40 0
      src/main/groovy/com/jd/brume/entity/ServiceRecordEntity.groovy
  37. 18 0
      src/main/groovy/com/jd/brume/entity/SmsEntity.groovy
  38. 28 0
      src/main/groovy/com/jd/brume/entity/SmsRecordEntity.groovy
  39. 56 0
      src/main/groovy/com/jd/brume/entity/UserEntity.groovy
  40. 23 0
      src/main/groovy/com/jd/brume/entity/func/ConfigFunc.java
  41. 35 0
      src/main/groovy/com/jd/brume/entity/func/CorpFunc.java
  42. 44 0
      src/main/groovy/com/jd/brume/entity/func/DictFunc.java
  43. 35 0
      src/main/groovy/com/jd/brume/entity/func/DictTypeFunc.java
  44. 69 0
      src/main/groovy/com/jd/brume/entity/func/LogFunc.java
  45. 30 0
      src/main/groovy/com/jd/brume/entity/func/MenuButtonFunc.java
  46. 55 0
      src/main/groovy/com/jd/brume/entity/func/MenuFunc.java
  47. 30 0
      src/main/groovy/com/jd/brume/entity/func/RoleFunc.java
  48. 30 0
      src/main/groovy/com/jd/brume/entity/func/RoleMenuFunc.java
  49. 40 0
      src/main/groovy/com/jd/brume/entity/func/ServiceFileFunc.java
  50. 65 0
      src/main/groovy/com/jd/brume/entity/func/ServiceFunc.java
  51. 69 0
      src/main/groovy/com/jd/brume/entity/func/ServiceRecordFunc.java
  52. 30 0
      src/main/groovy/com/jd/brume/entity/func/SmsFunc.java
  53. 50 0
      src/main/groovy/com/jd/brume/entity/func/SmsRecordFunc.java
  54. 50 0
      src/main/groovy/com/jd/brume/entity/func/UserFunc.java
  55. 11 0
      src/main/groovy/com/jd/brume/entity/resultmap/MenuButtonSelect.groovy
  56. 11 0
      src/main/groovy/com/jd/brume/entity/resultmap/MenuSelect.groovy
  57. 14 0
      src/main/groovy/com/jd/brume/entity/resultmap/UserSelect.groovy
  58. 38 0
      src/main/groovy/com/jd/brume/handler/CustomExceptionHandler.groovy
  59. 7 0
      src/main/groovy/com/jd/brume/mapper/ConfigMapper.groovy
  60. 7 0
      src/main/groovy/com/jd/brume/mapper/CorpMapper.groovy
  61. 7 0
      src/main/groovy/com/jd/brume/mapper/DictMapper.groovy
  62. 7 0
      src/main/groovy/com/jd/brume/mapper/DictTypeMapper.groovy
  63. 7 0
      src/main/groovy/com/jd/brume/mapper/MenuButtonMapper.groovy
  64. 7 0
      src/main/groovy/com/jd/brume/mapper/MenuMapper.groovy
  65. 7 0
      src/main/groovy/com/jd/brume/mapper/RoleMapper.groovy
  66. 7 0
      src/main/groovy/com/jd/brume/mapper/RoleMenuMapper.groovy
  67. 7 0
      src/main/groovy/com/jd/brume/mapper/ServiceFileMapper.groovy
  68. 25 0
      src/main/groovy/com/jd/brume/mapper/ServiceMapper.groovy
  69. 7 0
      src/main/groovy/com/jd/brume/mapper/ServiceRecordMapper.groovy
  70. 7 0
      src/main/groovy/com/jd/brume/mapper/SmsMapper.groovy
  71. 7 0
      src/main/groovy/com/jd/brume/mapper/SmsRecordMapper.groovy
  72. 7 0
      src/main/groovy/com/jd/brume/mapper/UserMapper.groovy
  73. 7 0
      src/main/groovy/com/jd/brume/service/ConfigService.groovy
  74. 7 0
      src/main/groovy/com/jd/brume/service/CorpService.groovy
  75. 14 0
      src/main/groovy/com/jd/brume/service/DictService.groovy
  76. 7 0
      src/main/groovy/com/jd/brume/service/MenuButtonService.groovy
  77. 7 0
      src/main/groovy/com/jd/brume/service/MenuService.groovy
  78. 7 0
      src/main/groovy/com/jd/brume/service/RoleMenuService.groovy
  79. 7 0
      src/main/groovy/com/jd/brume/service/RoleService.groovy
  80. 7 0
      src/main/groovy/com/jd/brume/service/ServiceFileService.groovy
  81. 7 0
      src/main/groovy/com/jd/brume/service/ServiceRecordService.groovy
  82. 13 0
      src/main/groovy/com/jd/brume/service/ServiceService.groovy
  83. 7 0
      src/main/groovy/com/jd/brume/service/SmsRecordService.groovy
  84. 7 0
      src/main/groovy/com/jd/brume/service/SmsService.groovy
  85. 7 0
      src/main/groovy/com/jd/brume/service/UserService.groovy
  86. 12 0
      src/main/groovy/com/jd/brume/service/impl/ConfigServiceImpl.groovy
  87. 12 0
      src/main/groovy/com/jd/brume/service/impl/CorpServiceImpl.groovy
  88. 34 0
      src/main/groovy/com/jd/brume/service/impl/DictServiceImpl.groovy
  89. 12 0
      src/main/groovy/com/jd/brume/service/impl/MenuButtonServiceImpl.groovy
  90. 12 0
      src/main/groovy/com/jd/brume/service/impl/MenuServiceImpl.groovy
  91. 12 0
      src/main/groovy/com/jd/brume/service/impl/RoleMenuServiceImpl.groovy
  92. 12 0
      src/main/groovy/com/jd/brume/service/impl/RoleServiceImpl.groovy
  93. 12 0
      src/main/groovy/com/jd/brume/service/impl/ServiceFileServiceImpl.groovy
  94. 12 0
      src/main/groovy/com/jd/brume/service/impl/ServiceRecordServiceImpl.groovy
  95. 35 0
      src/main/groovy/com/jd/brume/service/impl/ServiceServiceImpl.groovy
  96. 12 0
      src/main/groovy/com/jd/brume/service/impl/SmsRecordServiceImpl.groovy
  97. 12 0
      src/main/groovy/com/jd/brume/service/impl/SmsServiceImpl.groovy
  98. 12 0
      src/main/groovy/com/jd/brume/service/impl/UserServiceImpl.groovy
  99. 114 0
      src/main/groovy/com/jd/brume/task/ServiceTask.java
  100. 50 0
      src/main/groovy/com/jd/brume/task/SmsTask.java

+ 37 - 0
.gitignore

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

+ 30 - 0
build.gradle

@@ -0,0 +1,30 @@
+plugins {
+	id 'groovy'
+	id 'org.springframework.boot' version '2.6.0'
+	id 'io.spring.dependency-management' version '1.0.15.RELEASE'
+}
+
+group = 'com.jd.brume'
+version = '0.0.1-SNAPSHOT'
+sourceCompatibility = '1.8'
+
+repositories {
+	mavenCentral()
+}
+
+dependencies {
+	implementation 'org.springframework.boot:spring-boot-starter-web'
+	implementation 'org.codehaus.groovy:groovy'
+	implementation 'com.baomidou:mybatis-plus-boot-starter:3.5.3'
+	implementation 'mysql:mysql-connector-java'
+	implementation 'cn.hutool:hutool-all:5.8.12'
+	implementation 'org.springframework.boot:spring-boot-starter-validation'
+	implementation 'org.bouncycastle:bcprov-jdk15to18:1.72'
+	implementation 'org.springframework.boot:spring-boot-starter-data-redis'
+	implementation 'com.alibaba:fastjson:2.0.26'
+	testImplementation 'org.springframework.boot:spring-boot-starter-test'
+}
+
+tasks.named('test') {
+	useJUnitPlatform()
+}

TEMPAT SAMPAH
gradle/wrapper/gradle-wrapper.jar


+ 5 - 0
gradle/wrapper/gradle-wrapper.properties

@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists

+ 240 - 0
gradlew

@@ -0,0 +1,240 @@
+#!/bin/sh
+
+#
+# Copyright © 2015-2021 the original authors.
+#
+# Licensed 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.
+#
+
+##############################################################################
+#
+#   Gradle start up script for POSIX generated by Gradle.
+#
+#   Important for running:
+#
+#   (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
+#       noncompliant, but you have some other compliant shell such as ksh or
+#       bash, then to run this script, type that shell name before the whole
+#       command line, like:
+#
+#           ksh Gradle
+#
+#       Busybox and similar reduced shells will NOT work, because this script
+#       requires all of these POSIX shell features:
+#         * functions;
+#         * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
+#           «${var#prefix}», «${var%suffix}», and «$( cmd )»;
+#         * compound commands having a testable exit status, especially «case»;
+#         * various built-in commands including «command», «set», and «ulimit».
+#
+#   Important for patching:
+#
+#   (2) This script targets any POSIX shell, so it avoids extensions provided
+#       by Bash, Ksh, etc; in particular arrays are avoided.
+#
+#       The "traditional" practice of packing multiple parameters into a
+#       space-separated string is a well documented source of bugs and security
+#       problems, so this is (mostly) avoided, by progressively accumulating
+#       options in "$@", and eventually passing that to Java.
+#
+#       Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
+#       and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
+#       see the in-line comments for details.
+#
+#       There are tweaks for specific operating systems such as AIX, CygWin,
+#       Darwin, MinGW, and NonStop.
+#
+#   (3) This script is generated from the Groovy template
+#       https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+#       within the Gradle project.
+#
+#       You can find Gradle at https://github.com/gradle/gradle/.
+#
+##############################################################################
+
+# Attempt to set APP_HOME
+
+# Resolve links: $0 may be a link
+app_path=$0
+
+# Need this for daisy-chained symlinks.
+while
+    APP_HOME=${app_path%"${app_path##*/}"}  # leaves a trailing /; empty if no leading path
+    [ -h "$app_path" ]
+do
+    ls=$( ls -ld "$app_path" )
+    link=${ls#*' -> '}
+    case $link in             #(
+      /*)   app_path=$link ;; #(
+      *)    app_path=$APP_HOME$link ;;
+    esac
+done
+
+APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
+
+APP_NAME="Gradle"
+APP_BASE_NAME=${0##*/}
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD=maximum
+
+warn () {
+    echo "$*"
+} >&2
+
+die () {
+    echo
+    echo "$*"
+    echo
+    exit 1
+} >&2
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "$( uname )" in                #(
+  CYGWIN* )         cygwin=true  ;; #(
+  Darwin* )         darwin=true  ;; #(
+  MSYS* | MINGW* )  msys=true    ;; #(
+  NONSTOP* )        nonstop=true ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+
+# Determine the Java command to use to start the JVM.
+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
+    else
+        JAVACMD=$JAVA_HOME/bin/java
+    fi
+    if [ ! -x "$JAVACMD" ] ; then
+        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+    fi
+else
+    JAVACMD=java
+    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
+    case $MAX_FD in #(
+      max*)
+        MAX_FD=$( ulimit -H -n ) ||
+            warn "Could not query maximum file descriptor limit"
+    esac
+    case $MAX_FD in  #(
+      '' | soft) :;; #(
+      *)
+        ulimit -n "$MAX_FD" ||
+            warn "Could not set maximum file descriptor limit to $MAX_FD"
+    esac
+fi
+
+# Collect all arguments for the java command, stacking in reverse order:
+#   * args from the command line
+#   * the main class name
+#   * -classpath
+#   * -D...appname settings
+#   * --module-path (only if needed)
+#   * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if "$cygwin" || "$msys" ; then
+    APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
+    CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
+
+    JAVACMD=$( cygpath --unix "$JAVACMD" )
+
+    # Now convert the arguments - kludge to limit ourselves to /bin/sh
+    for arg do
+        if
+            case $arg in                                #(
+              -*)   false ;;                            # don't mess with options #(
+              /?*)  t=${arg#/} t=/${t%%/*}              # looks like a POSIX filepath
+                    [ -e "$t" ] ;;                      #(
+              *)    false ;;
+            esac
+        then
+            arg=$( cygpath --path --ignore --mixed "$arg" )
+        fi
+        # Roll the args list around exactly as many times as the number of
+        # args, so each arg winds up back in the position where it started, but
+        # possibly modified.
+        #
+        # NB: a `for` loop captures its iteration list before it begins, so
+        # changing the positional parameters here affects neither the number of
+        # iterations, nor the values presented in `arg`.
+        shift                   # remove old arg
+        set -- "$@" "$arg"      # push replacement arg
+    done
+fi
+
+# Collect all arguments for the java command;
+#   * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
+#     shell script including quotes and variable substitutions, so put them in
+#     double quotes to make sure that they get re-expanded; and
+#   * put everything else in single quotes, so that it's not re-expanded.
+
+set -- \
+        "-Dorg.gradle.appname=$APP_BASE_NAME" \
+        -classpath "$CLASSPATH" \
+        org.gradle.wrapper.GradleWrapperMain \
+        "$@"
+
+# Stop when "xargs" is not available.
+if ! command -v xargs >/dev/null 2>&1
+then
+    die "xargs is not available"
+fi
+
+# Use "xargs" to parse quoted args.
+#
+# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
+#
+# In Bash we could simply go:
+#
+#   readarray ARGS < <( xargs -n1 <<<"$var" ) &&
+#   set -- "${ARGS[@]}" "$@"
+#
+# but POSIX shell has neither arrays nor command substitution, so instead we
+# post-process each arg (as a line of input to sed) to backslash-escape any
+# character that might be a shell metacharacter, then use eval to reverse
+# that process (while maintaining the separation between arguments), and wrap
+# the whole thing up as a single "set" statement.
+#
+# This will of course break if any of these variables contains a newline or
+# an unmatched quote.
+#
+
+eval "set -- $(
+        printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
+        xargs -n1 |
+        sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
+        tr '\n' ' '
+    )" '"$@"'
+
+exec "$JAVACMD" "$@"

+ 91 - 0
gradlew.bat

@@ -0,0 +1,91 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem 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, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
+@if "%DEBUG%"=="" @echo off
+@rem ##########################################################################
+@rem
+@rem  Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%"=="" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if %ERRORLEVEL% equ 0 goto execute
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto execute
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
+
+:end
+@rem End local scope for the variables with windows NT shell
+if %ERRORLEVEL% equ 0 goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+set EXIT_CODE=%ERRORLEVEL%
+if %EXIT_CODE% equ 0 set EXIT_CODE=1
+if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
+exit /b %EXIT_CODE%
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega

TEMPAT SAMPAH
lib/dcs-app-client-api-jdk8-0.0.0.5.jar


TEMPAT SAMPAH
lib/dcs-crypto-api-jdk8-0.0.1.0.jar


TEMPAT SAMPAH
lib/open_platform_sdk-1.1.0.9.jar


+ 1 - 0
settings.gradle

@@ -0,0 +1 @@
+rootProject.name = 'brume'

+ 15 - 0
src/main/groovy/com/jd/brume/BrumeApplication.groovy

@@ -0,0 +1,15 @@
+package com.jd.brume
+
+import org.mybatis.spring.annotation.MapperScan
+import org.springframework.boot.SpringApplication
+import org.springframework.boot.autoconfigure.SpringBootApplication
+
+@MapperScan('com.jd.brume.mapper')
+@SpringBootApplication
+class BrumeApplication {
+
+	static void main(String[] args) {
+		SpringApplication.run(BrumeApplication, args)
+	}
+
+}

+ 25 - 0
src/main/groovy/com/jd/brume/config/CorsConfig.groovy

@@ -0,0 +1,25 @@
+package com.jd.brume.config
+
+import org.springframework.context.annotation.Configuration
+import org.springframework.web.servlet.config.annotation.CorsRegistry
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer
+
+/**
+ * ¿çÓòÅäÖÃ
+ * @author Íõ˧
+ *
+ */ 
+@Configuration 
+class CorsConfig implements WebMvcConfigurer {
+	
+	@Override
+	public void addCorsMappings(CorsRegistry registry) {
+		registry.addMapping("/**")
+                .allowCredentials(true) 
+                .allowedOriginPatterns("*")
+                .allowedMethods("GET", "POST", "PUT", "DELETE")
+                .allowedHeaders("*")
+                .exposedHeaders("*");
+	}
+	 
+}

+ 25 - 0
src/main/groovy/com/jd/brume/config/PagingConfig.groovy

@@ -0,0 +1,25 @@
+package com.jd.brume.config
+
+import org.springframework.context.annotation.Bean
+import org.springframework.context.annotation.Configuration
+import com.baomidou.mybatisplus.annotation.DbType
+import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor
+import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor
+import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor
+
+@Configuration
+class PagingConfig {
+	
+	/**
+	 * ·ÖÒ³²å¼þ
+	 */
+	@Bean
+    MybatisPlusInterceptor mybatisPlusInterceptor() {
+        def interceptor = new MybatisPlusInterceptor()
+        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL))
+		interceptor.addInnerInterceptor(new OptimisticLockerInnerInterceptor())
+        return interceptor
+    }
+	
+
+}

+ 23 - 0
src/main/groovy/com/jd/brume/config/RedisConfig.groovy

@@ -0,0 +1,23 @@
+package com.jd.brume.config
+
+import org.springframework.context.annotation.Bean
+import org.springframework.context.annotation.Configuration
+import org.springframework.data.redis.connection.RedisConnectionFactory
+import org.springframework.data.redis.core.RedisTemplate
+import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer
+import org.springframework.data.redis.serializer.StringRedisSerializer
+
+@Configuration
+class RedisConfig {
+
+	@Bean
+	def redisTemplate(RedisConnectionFactory redisConnectionFactory) {
+		def redisTemplate = new RedisTemplate()
+		redisTemplate.setConnectionFactory(redisConnectionFactory)
+		def stringRedisSerializer = new StringRedisSerializer()
+		redisTemplate.setKeySerializer(stringRedisSerializer)
+		def jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class)
+		redisTemplate.setValueSerializer(jackson2JsonRedisSerializer)
+		return redisTemplate
+	} 
+} 

+ 19 - 0
src/main/groovy/com/jd/brume/config/ValidConfig.groovy

@@ -0,0 +1,19 @@
+package com.jd.brume.config
+
+import javax.validation.Validation
+import javax.validation.Validator
+import org.hibernate.validator.HibernateValidator
+import org.hibernate.validator.HibernateValidatorConfiguration
+import org.springframework.context.annotation.Bean
+import org.springframework.context.annotation.Configuration
+
+@Configuration
+class ValidConfig {
+
+	@Bean
+	Validator validator() {
+		HibernateValidatorConfiguration configuration = Validation.byProvider(HibernateValidator.class).configure()
+		def validatorFactory = configuration.failFast(true).buildValidatorFactory()
+		return validatorFactory.getValidator()
+	}
+}

+ 114 - 0
src/main/groovy/com/jd/brume/controller/CorpController.groovy

@@ -0,0 +1,114 @@
+package com.jd.brume.controller
+
+import javax.annotation.Resource
+import javax.validation.constraints.NotNull
+
+import org.springframework.validation.annotation.Validated
+import org.springframework.web.bind.annotation.DeleteMapping
+import org.springframework.web.bind.annotation.GetMapping
+import org.springframework.web.bind.annotation.PostMapping
+import org.springframework.web.bind.annotation.RequestMapping
+import org.springframework.web.bind.annotation.RestController
+import com.baomidou.mybatisplus.core.conditions.Wrapper
+import com.baomidou.mybatisplus.core.toolkit.StringUtils
+import com.baomidou.mybatisplus.core.toolkit.Wrappers
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page
+import com.jd.brume.entity.CorpEntity
+import com.jd.brume.entity.func.CorpFunc
+import com.jd.brume.service.CorpService
+import com.jd.brume.service.DictService
+import com.jd.brume.util.Constant
+import com.jd.brume.util.Result
+import com.jd.brume.util.ResultEnum
+import com.jd.brume.vo.CorpVo
+import com.jd.brume.vo.group.PagingGroup
+import com.jd.brume.vo.group.SaveGroup
+import com.jd.brume.vo.group.UpdateGroup
+
+@Validated
+@RestController
+@RequestMapping('corp')
+class CorpController {
+	
+	@Resource
+	CorpService corpService
+	
+	@Resource
+	DictService dictService
+	
+	/**
+	 * 分页查询
+	 * @param corVo
+	 * @return
+	 */
+	@GetMapping('paging')
+	def getCorpPaging(@Validated(PagingGroup) CorpVo corVo) {
+		Wrapper<CorpEntity> wrapper = Wrappers.lambdaQuery()
+		if (StringUtils.isNotBlank(corVo.queryVal)) {
+			wrapper.and({i -> i.like(StringUtils.isNotBlank(corVo.queryVal), CorpFunc.deptName(), corVo.queryVal).or()
+				.like(StringUtils.isNotBlank(corVo.queryVal), CorpFunc.deptPrefix(), corVo.queryVal)})
+		}
+		wrapper.eq(corVo.type != null, CorpFunc.type(), corVo.type)
+		def count = corpService.count(wrapper)
+		if (count == 0) return new Result().msg(ResultEnum.NO_DATA_TABLE)
+		wrapper.orderByDesc(CorpFunc.createTime())
+		def data = corpService.page(new Page(corVo.page, corVo.limit, count), wrapper)
+		return new Result().layTable([list: data.records, count: data.total])
+	}
+	
+	/**
+	 * 查询部门
+	 * @param deptId
+	 * @return
+	 */
+	@GetMapping('one')
+	def getCorp(@NotNull Integer deptId) {
+		return new Result().ok(corpService.getById(deptId))
+	}
+	
+	/**
+	 * 删除部门
+	 * @param deptId
+	 * @return
+	 */
+	@DeleteMapping('delete')
+	def deleteCorp(@NotNull Integer deptId) {
+		return new Result().ok(corpService.removeById(deptId))
+	}
+	
+	/**
+	 * 保存部门
+	 * @param corVo
+	 * @return
+	 */
+	@PostMapping('save')
+	def saveCorp(@Validated(SaveGroup) CorpVo corVo) {
+		def count = corpService.count(Wrappers.lambdaQuery().eq(CorpFunc.deptName(), corVo.deptName).or()
+			.eq(CorpFunc.deptPrefix(), corVo.deptPrefix))
+		if (count > 0) return new Result().msg(100, '名称或户号前缀重复')
+		return new Result().ok(corpService.save(new CorpEntity(deptName: corVo.deptName, deptPrefix: corVo.deptPrefix, type: corVo.type)))
+	}
+	
+	/**
+	 * 修改部门
+	 * @param corVo
+	 * @return
+	 */
+	@PostMapping('update')
+	def updateCorp(@Validated(UpdateGroup) CorpVo corVo) {
+		def count = corpService.count(Wrappers.lambdaQuery().and({i -> i.eq(CorpFunc.deptName(), corVo.deptName).or()
+			.eq(CorpFunc.deptPrefix(), corVo.deptPrefix)}).ne(CorpFunc.deptId(), corVo.deptId))
+		if (count > 0) return new Result().msg(100, '名称或户号前缀重复')
+		return new Result().ok(corpService.updateById(new CorpEntity(deptId: corVo.deptId, deptName: corVo.deptName, 
+			deptPrefix: corVo.deptPrefix, type: corVo.type)))
+	}
+	
+	/**
+	 * 初始化
+	 * @return
+	 */
+	@GetMapping('init')
+	def init() {
+		return new Result().ok([type: dictService.getDictByType(Constant.CORP_TYPE)])
+	}
+}

+ 16 - 0
src/main/groovy/com/jd/brume/controller/DictController.groovy

@@ -0,0 +1,16 @@
+package com.jd.brume.controller
+
+import org.springframework.validation.annotation.Validated
+import org.springframework.web.bind.annotation.RequestMapping
+import org.springframework.web.bind.annotation.RestController
+
+/**
+ * ×Öµä
+ * @author Íõ˧
+ *
+ */
+@Validated
+@RestController
+@RequestMapping('dict')
+class DictController {
+}

+ 16 - 0
src/main/groovy/com/jd/brume/controller/DictTypeController.groovy

@@ -0,0 +1,16 @@
+package com.jd.brume.controller
+
+import org.springframework.validation.annotation.Validated
+import org.springframework.web.bind.annotation.RequestMapping
+import org.springframework.web.bind.annotation.RestController
+
+/**
+ * ×ÖµäÀàÐÍ
+ * @author Íõ˧
+ *
+ */
+@Validated
+@RestController
+@RequestMapping('dict/type')
+class DictTypeController {
+}

+ 48 - 0
src/main/groovy/com/jd/brume/controller/LoginController.groovy

@@ -0,0 +1,48 @@
+package com.jd.brume.controller
+
+import javax.annotation.Resource
+
+import org.springframework.validation.annotation.Validated
+import org.springframework.web.bind.annotation.PostMapping
+import org.springframework.web.bind.annotation.RequestMapping
+import org.springframework.web.bind.annotation.RestController
+import com.jd.brume.entity.UserEntity
+import com.jd.brume.entity.func.UserFunc
+import com.jd.brume.service.UserService
+import com.jd.brume.util.Result
+import com.jd.brume.util.SMUtil
+import com.jd.brume.util.TokenUtil
+import com.jd.brume.vo.UserVo
+import com.jd.brume.vo.group.LoginGroup
+
+import cn.hutool.core.codec.Base64
+
+@RestController
+@RequestMapping('login')
+class LoginController {
+	
+	@Resource
+	UserService userService
+	
+	/**
+	 * 登录
+	 * @param userVo
+	 * @return
+	 */
+	@PostMapping('web')
+	def login(@Validated(LoginGroup) UserVo userVo) {
+		UserEntity user
+		try {
+			user = userService.lambdaQuery().eq(UserFunc.account(), userVo.account).one()
+		} catch (Exception e) {
+			return new Result().msg(100, '账号不存在')
+		}
+		if (!user) return new Result().msg(100, '账号不存在')
+		
+		if (Base64.decodeStr(userVo.password) != SMUtil.sm2Decrypt(user.password)) return new Result().msg(101, '密码错误')
+		
+		def token = TokenUtil.create(user)
+		
+		return new Result().ok(token)
+	}
+}

+ 107 - 0
src/main/groovy/com/jd/brume/controller/MenuButtonController.groovy

@@ -0,0 +1,107 @@
+package com.jd.brume.controller
+
+import javax.annotation.Resource
+import javax.validation.constraints.NotNull
+
+import org.springframework.validation.annotation.Validated
+import org.springframework.web.bind.annotation.DeleteMapping
+import org.springframework.web.bind.annotation.GetMapping
+import org.springframework.web.bind.annotation.PostMapping
+import org.springframework.web.bind.annotation.RequestMapping
+import org.springframework.web.bind.annotation.RestController
+import com.baomidou.mybatisplus.core.conditions.Wrapper
+import com.baomidou.mybatisplus.core.toolkit.StringUtils
+import com.baomidou.mybatisplus.core.toolkit.Wrappers
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page
+import com.jd.brume.entity.MenuButtonEntity
+import com.jd.brume.entity.func.MenuButtonFunc
+import com.jd.brume.entity.resultmap.MenuButtonSelect
+import com.jd.brume.service.DictService
+import com.jd.brume.service.MenuButtonService
+import com.jd.brume.util.Constant
+import com.jd.brume.util.Result
+import com.jd.brume.util.ResultEnum
+import com.jd.brume.vo.MenuButtonVo
+import com.jd.brume.vo.group.PagingGroup
+import com.jd.brume.vo.group.SaveGroup
+import com.jd.brume.vo.group.UpdateGroup
+
+/**
+ * 菜单
+ * @author 王帅
+ *
+ */
+@Validated
+@RestController
+@RequestMapping('menu/button')
+class MenuButtonController {
+	
+	@Resource
+	MenuButtonService menuButtonService
+	
+	@Resource
+	DictService dictService
+	
+	/**
+	 * 分页查询
+	 * @param menuButtonVo
+	 * @return
+	 */
+	@GetMapping('paging')
+	def getMenuButtonPaging(@Validated(PagingGroup) MenuButtonVo menuButtonVo) {
+		Wrapper<MenuButtonEntity> wrapper = Wrappers.lambdaQuery()
+			.like(StringUtils.isNotBlank(menuButtonVo.queryVal), MenuButtonFunc.btnName(), menuButtonVo.queryVal)
+			.or()
+			.like(StringUtils.isNotBlank(menuButtonVo.queryVal), MenuButtonFunc.btnTag(), menuButtonVo.queryVal)
+		def count = menuButtonService.count(wrapper)
+		if (count == 0) return new Result().msg(ResultEnum.NO_DATA_TABLE)
+		wrapper.select(MenuButtonSelect.page).orderByDesc(MenuButtonFunc.createTime())
+		def data = menuButtonService.page(new Page(menuButtonVo.page, menuButtonVo.limit, count), wrapper)
+		return new Result().layTable([list: data.records, count: data.total])
+	}
+	
+	/**
+	 * 保存按钮
+	 * @param menuButtonVo
+	 * @return
+	 */
+	@PostMapping('save')
+	def saveMenuButton(@Validated(SaveGroup) MenuButtonVo menuButtonVo) {
+		def count = menuButtonService.count(Wrappers.lambdaQuery().eq(MenuButtonFunc.btnTag(), menuButtonVo.btnTag)
+			.or().eq(MenuButtonFunc.btnName(), menuButtonVo.btnName))
+		if (count > 0) return new Result().msg(100, '名称或标签不能重复')
+		return new Result().ok(menuButtonService.save(new MenuButtonEntity(btnName: menuButtonVo.btnName, btnTag: menuButtonVo.btnTag)))
+	}
+	
+	/**
+	 * 修改按钮
+	 * @param menuButtonVo
+	 * @return
+	 */
+	@PostMapping('update')
+	def updateMenuButton(@Validated(UpdateGroup) MenuButtonVo menuButtonVo) {
+		def count = menuButtonService.count(Wrappers.lambdaQuery().or({it.eq(MenuButtonFunc.btnTag(), menuButtonVo.btnTag)
+			.or().eq(MenuButtonFunc.btnName(), menuButtonVo.btnName)}).ne(MenuButtonFunc.btnId(), menuButtonVo.btnId))
+		if (count > 0) return new Result().msg(100, '名称或标签不能重复')
+			return new Result().ok(menuButtonService.updateById(new MenuButtonEntity(btnId: menuButtonVo.btnId, 
+				btnName: menuButtonVo.btnName, btnTag: menuButtonVo.btnTag)))
+	}
+	
+	/**
+	 * 删除按钮
+	 */
+	@DeleteMapping('delete')
+	def deleteMenuButton(@NotNull Integer btnId) {
+		return new Result().ok(menuButtonService.removeById(btnId))
+	}
+	
+	/**
+	 * 获取按钮
+	 * @param btnId
+	 * @return
+	 */
+	@GetMapping('one')
+	def getMenuButton(@NotNull Integer btnId) {
+		return new Result().ok(menuButtonService.getById(btnId))
+	}
+}

+ 160 - 0
src/main/groovy/com/jd/brume/controller/MenuController.groovy

@@ -0,0 +1,160 @@
+package com.jd.brume.controller
+
+import javax.annotation.Resource
+import javax.validation.constraints.NotNull
+
+import org.springframework.validation.annotation.Validated
+import org.springframework.web.bind.annotation.DeleteMapping
+import org.springframework.web.bind.annotation.GetMapping
+import org.springframework.web.bind.annotation.PostMapping
+import org.springframework.web.bind.annotation.RequestMapping
+import org.springframework.web.bind.annotation.RestController
+
+import com.baomidou.mybatisplus.core.conditions.Wrapper
+import com.baomidou.mybatisplus.core.toolkit.StringUtils
+import com.baomidou.mybatisplus.core.toolkit.Wrappers
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page
+import com.jd.brume.entity.MenuEntity
+import com.jd.brume.entity.func.MenuButtonFunc
+import com.jd.brume.entity.func.MenuFunc
+import com.jd.brume.entity.resultmap.MenuButtonSelect
+import com.jd.brume.entity.resultmap.MenuSelect
+import com.jd.brume.service.DictService
+import com.jd.brume.service.MenuButtonService
+import com.jd.brume.service.MenuService
+import com.jd.brume.util.Constant
+import com.jd.brume.util.LayTreeUtil
+import com.jd.brume.util.Result
+import com.jd.brume.util.ResultEnum
+import com.jd.brume.vo.MenuVo
+import com.jd.brume.vo.group.PagingGroup
+import com.jd.brume.vo.group.SaveGroup
+import com.jd.brume.vo.group.UpdateGroup
+
+/**
+ * 菜单
+ * @author 王帅
+ *
+ */
+@Validated
+@RestController
+@RequestMapping('menu')
+class MenuController {
+	
+	@Resource
+	MenuService menuService
+	
+	@Resource
+	DictService dictService
+	
+	@Resource
+	MenuButtonService menuButtonService
+	
+	/**
+	 * 分页查询
+	 * @param menuVo
+	 * @return
+	 */
+	@GetMapping('paging')
+	def getMenuPaging(@Validated(PagingGroup) MenuVo menuVo) {
+		Wrapper<MenuEntity> wrapper = Wrappers.lambdaQuery()
+			.eq(menuVo.parentId != null, MenuFunc.parentId(), menuVo.parentId)
+			.like(StringUtils.isNotBlank(menuVo.queryVal), MenuFunc.menuName(), menuVo.queryVal)
+			
+		def count = menuService.count(wrapper)
+		if (count == 0) return new Result().msg(ResultEnum.NO_DATA_TABLE)
+		wrapper.select(MenuSelect.page)
+			.orderByAsc(MenuFunc.menuSort())
+			.orderByDesc(MenuFunc.createTime())
+		def data = menuService.page(new Page(menuVo.page, menuVo.limit, count), wrapper)
+		return new Result().layTable([list: data.records, count: data.total])
+	}
+	
+	/**
+	 * 获取初始化参数
+	 * @return
+	 */
+	@GetMapping('init')
+	def init() {
+		// 获取所有上级菜单
+		def parents = menuService.lambdaQuery()
+			.select(MenuSelect.parentMenu)
+			.eq(MenuFunc.parentId(), Constant.MENU_PARENT_ID)
+			.orderByAsc(MenuFunc.menuSort())
+			.orderByDesc(MenuFunc.createTime())
+			.list()
+		// 获取状态字典
+		def status = dictService.getDictByType(Constant.IS_USING_STATUS)
+		// 获取所有按钮
+		def btns = menuButtonService.lambdaQuery().select(MenuButtonSelect.query).orderByDesc(MenuButtonFunc.createTime()).list()
+		return new Result().ok([parents: parents, status: status, btns: btns])
+	}
+	
+	/**
+	 * 停用启用
+	 * @param menuId
+	 * @param status
+	 * @return
+	 */
+	@PostMapping('changeStatus')
+	def changeStatus(@NotNull Integer menuId, @NotNull Integer status) {
+		return new Result().ok(menuService.update(Wrappers.lambdaUpdate().set(MenuFunc.menuStatus(), status).eq(MenuFunc.menuId(), menuId)))
+	}
+	
+	/**
+	 * 获取菜单信息
+	 * @param menuId
+	 * @return
+	 */
+	@GetMapping('one')
+	def getOne(@NotNull Integer menuId) {
+		return new Result().ok(menuService.getById(menuId))
+	}
+	
+	/**
+	 * 保存菜单信息
+	 * @param menuVo
+	 * @return
+	 */
+	@PostMapping('save')
+	def saveMenu(@Validated(SaveGroup) MenuVo menuVo) {
+		def count = menuService.count(Wrappers.lambdaQuery().eq(MenuFunc.menuName(), menuVo.menuName))
+		if (count > 0) return new Result().msg(100, '名称重复')
+		return new Result().ok(menuService.save(new MenuEntity(menuName: menuVo.menuName, menuUrl: menuVo.menuUrl, menuIcon: menuVo.menuIcon, 
+			parentId: menuVo.parentId, menuSort: menuVo.menuSort, menuStatus: menuVo.menuStatus, btnIds: menuVo.btnIds)))
+	}
+	
+	/**
+	 * 修改菜单信息
+	 * @param menuVo
+	 * @return
+	 */
+	@PostMapping('update')
+	def updateMenu(@Validated(UpdateGroup) MenuVo menuVo) {
+		def count = menuService.count(Wrappers.lambdaQuery().eq(MenuFunc.menuName(), menuVo.menuName).ne(MenuFunc.menuId(), menuVo.menuId))
+		if (count > 0) return new Result().msg(100, '名称重复')
+		return new Result().ok(menuService.updateById(new MenuEntity(menuId: menuVo.menuId, menuName: menuVo.menuName, menuUrl: menuVo.menuUrl,
+			 menuIcon: menuVo.menuIcon, parentId: menuVo.parentId, menuSort: menuVo.menuSort, menuStatus: menuVo.menuStatus, btnIds: menuVo.btnIds)))
+	}
+	
+	/**
+	 * 删除菜单
+	 * @param menuId
+	 * @return
+	 */
+	@DeleteMapping('delete')
+	def deleteMenu(@NotNull Integer menuId) {
+		return new Result().ok(menuService.removeById(menuId))
+	}
+	
+	/**
+	 * 获取树形菜单
+	 * @return
+	 */
+	@GetMapping('tree')
+	def getMenuTree() {
+		def menu = menuService.query().list()
+		def button = menuButtonService.query().list()
+		return new Result().ok(LayTreeUtil.getTree(menu, button))
+	}
+}

+ 129 - 0
src/main/groovy/com/jd/brume/controller/RoleController.groovy

@@ -0,0 +1,129 @@
+package com.jd.brume.controller
+
+import javax.annotation.Resource
+import javax.validation.constraints.NotNull
+
+import org.springframework.validation.annotation.Validated
+import org.springframework.web.bind.annotation.DeleteMapping
+import org.springframework.web.bind.annotation.GetMapping
+import org.springframework.web.bind.annotation.PostMapping
+import org.springframework.web.bind.annotation.RequestMapping
+import org.springframework.web.bind.annotation.RestController
+
+import com.baomidou.mybatisplus.core.conditions.Wrapper
+import com.baomidou.mybatisplus.core.toolkit.StringUtils
+import com.baomidou.mybatisplus.core.toolkit.Wrappers
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page
+import com.jd.brume.entity.RoleEntity
+import com.jd.brume.entity.RoleMenuEntity
+import com.jd.brume.entity.func.RoleFunc
+import com.jd.brume.entity.func.RoleMenuFunc
+import com.jd.brume.service.RoleMenuService
+import com.jd.brume.service.RoleService
+import com.jd.brume.util.Result
+import com.jd.brume.util.ResultEnum
+import com.jd.brume.vo.RoleVo
+import com.jd.brume.vo.group.PagingGroup
+import com.jd.brume.vo.group.SaveGroup
+import com.jd.brume.vo.group.UpdateGroup
+
+/**
+ * 角色管理
+ * @author 王帅
+ *
+ */
+@Validated
+@RestController
+@RequestMapping('role')
+class RoleController {
+	
+	@Resource
+	RoleService roleService
+	
+	@Resource
+	RoleMenuService roleMenuService
+	
+	/**
+	 * 分页查询
+	 * @param roleVo
+	 * @return
+	 */
+	@GetMapping('paging')
+	def getRolePaging(@Validated(PagingGroup) RoleVo roleVo) {
+		Wrapper<RoleEntity> wrapper = Wrappers.lambdaQuery()
+			.like(StringUtils.isNotBlank(roleVo.queryVal), RoleFunc.roleName(), roleVo.queryVal)
+		def count = roleService.count(wrapper)
+		if (count == 0) return new Result().msg(ResultEnum.NO_DATA_TABLE)
+		wrapper.orderByDesc(RoleFunc.createTime())
+		def data = roleService.page(new Page(roleVo.page, roleVo.limit, count), wrapper)
+		return new Result().layTable([list: data.records, count: data.total])
+	}
+	
+	/**
+	 * 删除角色
+	 * @param roleId
+	 * @return
+	 */
+	@DeleteMapping('delete')
+	def deleteRole(@NotNull Integer roleId) {
+		return new Result().ok(roleService.removeById(roleId))
+	}
+	
+	@GetMapping('one')
+	def getRole(@NotNull Integer roleId) {
+		return new Result().ok([role: roleService.getById(roleId), menus: roleMenuService.lambdaQuery().eq(RoleMenuFunc.roleId(), roleId).list()])
+	}
+	
+	/**
+	 * 保存角色
+	 * @param roleVo
+	 * @return
+	 */
+	@PostMapping('save')
+	def saveRole(@Validated(SaveGroup) RoleVo roleVo) {
+		def count = roleService.count(Wrappers.lambdaQuery().eq(RoleFunc.roleName(), roleVo.roleName))
+		if (count > 0) return new Result().msg(100, '名称重复')
+		// 保存角色
+		RoleEntity role = new RoleEntity(roleName: roleVo.roleName, description: roleVo.description)
+		def status = roleService.save(role)
+		// 保存权限
+		if (roleVo.roleMenu) {
+			RoleMenuEntity roleMenu
+			def arr = []
+			for (int i = 0; i < roleVo.roleMenu.size(); i++) {
+				def id = roleVo.roleMenu.get(i)
+				roleMenu = new RoleMenuEntity(menuId: Integer.valueOf(id), buttonIds: roleVo.roleBtn[String.valueOf(id)], roleId: role.roleId)
+				arr.add(roleMenu)
+			}
+			status = roleMenuService.saveBatch(arr)
+		}
+		return new Result().ok(status)
+	}
+	
+	/**
+	 * 修改角色
+	 * @param roleVo
+	 * @return
+	 */
+	@PostMapping('update')
+	def updateRole(@Validated(UpdateGroup) RoleVo roleVo) {
+		def count = roleService.count(Wrappers.lambdaQuery().eq(RoleFunc.roleName(), roleVo.roleName).ne(RoleFunc.roleId(), roleVo.roleId))
+		if (count > 0) return new Result().msg(100, '名称重复')
+		// 修改角色
+		def status = roleService.updateById(new RoleEntity(roleId: roleVo.roleId, roleName: roleVo.roleName, description: roleVo.description))
+		// 清空权限
+		status = roleMenuService.remove(Wrappers.lambdaQuery().eq(RoleMenuFunc.roleId(), roleVo.roleId))
+		// 保存权限
+		if (roleVo.roleMenu) {
+			RoleMenuEntity roleMenu
+			def arr = []
+			for (int i = 0; i < roleVo.roleMenu.size(); i++) {
+				def id = roleVo.roleMenu.get(i)
+				roleMenu = new RoleMenuEntity(menuId: Integer.valueOf(id), buttonIds: roleVo.roleBtn[String.valueOf(id)], roleId: roleVo.roleId)
+				arr.add(roleMenu)
+			}
+			status = roleMenuService.saveBatch(arr)
+		}
+		return new Result().ok(status)
+	}
+}

+ 165 - 0
src/main/groovy/com/jd/brume/controller/ServiceController.groovy

@@ -0,0 +1,165 @@
+package com.jd.brume.controller
+
+import java.util.zip.ZipEntry
+import java.util.zip.ZipOutputStream
+
+import javax.annotation.Resource
+import javax.servlet.http.HttpServletRequest
+import javax.servlet.http.HttpServletResponse
+import javax.validation.constraints.NotBlank
+import javax.validation.constraints.NotNull
+
+import org.springframework.validation.annotation.Validated
+import org.springframework.web.bind.annotation.GetMapping
+import org.springframework.web.bind.annotation.PostMapping
+import org.springframework.web.bind.annotation.RequestMapping
+import org.springframework.web.bind.annotation.RestController
+import com.baomidou.mybatisplus.core.conditions.Wrapper
+import com.baomidou.mybatisplus.core.toolkit.StringUtils
+import com.baomidou.mybatisplus.core.toolkit.Wrappers
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page
+import com.jd.brume.entity.CorpEntity
+import com.jd.brume.entity.DictEntity
+import com.jd.brume.entity.FileEntity
+import com.jd.brume.entity.ServiceEntity
+import com.jd.brume.entity.ServiceRecordEntity
+import com.jd.brume.entity.func.CorpFunc
+import com.jd.brume.entity.func.ServiceFileFunc
+import com.jd.brume.entity.func.ServiceFunc
+import com.jd.brume.entity.func.ServiceRecordFunc
+import com.jd.brume.service.CorpService
+import com.jd.brume.service.DictService
+import com.jd.brume.service.ServiceFileService
+import com.jd.brume.service.ServiceRecordService
+import com.jd.brume.service.ServiceService
+import com.jd.brume.util.Constant
+import com.jd.brume.util.MyFileUtil
+import com.jd.brume.util.Result
+import com.jd.brume.util.ResultEnum
+import com.jd.brume.util.TokenUtil
+import com.jd.brume.vo.ServiceVo
+import com.jd.brume.vo.group.PagingGroup
+
+import cn.hutool.json.JSONObject
+
+
+@Validated
+@RestController
+@RequestMapping('service')
+class ServiceController {
+	
+	@Resource
+	ServiceService service
+	
+	@Resource
+	CorpService corpService
+	
+	@Resource
+	DictService dictService
+	
+	@Resource
+	ServiceFileService fileService
+	
+	@Resource
+	ServiceRecordService recordService
+	
+	/**
+	 * 待办
+	 */
+	@GetMapping('paging')
+	def getDealtPaging(@Validated(PagingGroup) ServiceVo serviceVo, HttpServletRequest req) {
+		// 查询单位前缀
+		CorpEntity corp = corpService.lambdaQuery().eq(CorpFunc.deptId(), TokenUtil.getParams('deptId', req)).one()
+		serviceVo.deptPrefix = corp.deptPrefix
+		serviceVo.type = corp.type
+		return service.getDealtPaging(serviceVo)
+	}
+	
+	/**
+	 * 初始化信息
+	 * @param req
+	 * @return
+	 */
+	@GetMapping('dealt/init')
+	def init(HttpServletRequest req) {
+		CorpEntity corp = corpService.lambdaQuery().eq(CorpFunc.deptId(), TokenUtil.getParams('deptId', req)).one()
+		return new Result().ok([type: corp.type, sort: dictService.getDictByType(Constant.CORP_TYPE),
+			 qxbm: dictService.getDictByType(Constant.QXBM_ZD)])
+	}
+	
+	/**
+	 * 下载资料
+	 * @param id
+	 * @return
+	 */
+	@GetMapping('download')
+	def download(@NotNull Integer id, @NotBlank String serviceId, HttpServletResponse response) {
+		try {
+			DictEntity dict = dictService.getDictByType(Constant.DOWNLOAD_PATH).get(0)
+			
+			List<FileEntity> list = fileService.lambdaQuery().eq(ServiceFileFunc.serviceId(), id).list()
+			MyFileUtil.writeFileToRes(response, list, dict, serviceId)
+		} catch (Exception e) {
+			e.printStackTrace()
+			return new Result().msg(100, '下载失败')
+		}
+	}
+	
+	/**
+	 * 受理
+	 * @param id
+	 * @param req
+	 * @return
+	 */
+	@PostMapping('dealt/case')
+	def dealtCase(@NotNull Integer id, HttpServletRequest req) {
+		JSONObject obj = TokenUtil.getParamStr(['userId', 'deptId'], req)
+		CorpEntity corp = corpService.lambdaQuery().eq(CorpFunc.deptId(), obj.get('deptId')).one()
+		def count = recordService.count(Wrappers.lambdaQuery().eq(ServiceRecordFunc.serviceId(), id).eq(ServiceRecordFunc.type(), corp.type))
+		if (count > 0) return new Result().msg(100, '业务已受理')
+		def status = recordService.save(new ServiceRecordEntity(serviceId: id, type: corp.type, caseStatus: 1, caseTime: new Date(), caseUserId: obj.get('userId')))
+		return new Result().ok(status)
+	}
+	
+	/**
+	 * 补齐补证
+	 * @param id
+	 * @param req
+	 * @return
+	 */
+	@PostMapping('dealt/use')
+	def dealtUse(@NotNull Integer id, HttpServletRequest req) {
+		JSONObject obj = TokenUtil.getParamStr(['userId', 'deptId'], req)
+		CorpEntity corp = corpService.lambdaQuery().eq(CorpFunc.deptId(), obj.get('deptId')).one()
+		Wrapper<ServiceRecordEntity> wrapper = Wrappers.lambdaQuery().eq(ServiceRecordFunc.serviceId(), id).eq(ServiceRecordFunc.type(), corp.type)
+					.eq(ServiceRecordFunc.caseStatus(), 1)
+		def count = recordService.count(wrapper)
+		if (count == 0) return new Result().msg(100, '业务未受理,请先受理')
+		ServiceRecordEntity record = recordService.getOne(wrapper)
+		record.useStatus = 1
+		record.useTime = new Date()
+		record.useUserId = obj.get('userId')
+		return new Result().ok(recordService.updateById(record))
+	}
+	
+	/**
+	 * 办结
+	 * @param id
+	 * @param req
+	 * @return
+	 */
+	@PostMapping('dealt/completion')
+	def dealtCompletion(@NotNull Integer id, HttpServletRequest req) {
+		JSONObject obj = TokenUtil.getParamStr(['userId', 'deptId'], req)
+		CorpEntity corp = corpService.lambdaQuery().eq(CorpFunc.deptId(), obj.get('deptId')).one()
+		Wrapper<ServiceRecordEntity> wrapper = Wrappers.lambdaQuery().eq(ServiceRecordFunc.serviceId(), id).eq(ServiceRecordFunc.type(), corp.type)
+					.eq(ServiceRecordFunc.caseStatus(), 1)
+		def count = recordService.count(wrapper)
+		if (count == 0) return new Result().msg(100, '业务未受理,请先受理')
+		ServiceRecordEntity record = recordService.getOne(wrapper)
+		record.completion = 1
+		record.completionTime = new Date()
+		record.caseUserId = obj.get('userId')
+		return new Result().ok(recordService.updateById(record))
+	}
+}

+ 139 - 0
src/main/groovy/com/jd/brume/controller/UserController.groovy

@@ -0,0 +1,139 @@
+package com.jd.brume.controller
+
+import javax.annotation.Resource
+import javax.validation.constraints.NotNull
+
+import org.springframework.validation.annotation.Validated
+import org.springframework.web.bind.annotation.DeleteMapping
+import org.springframework.web.bind.annotation.GetMapping
+import org.springframework.web.bind.annotation.PostMapping
+import org.springframework.web.bind.annotation.RequestMapping
+import org.springframework.web.bind.annotation.RestController
+import com.baomidou.mybatisplus.core.conditions.Wrapper
+import com.baomidou.mybatisplus.core.toolkit.StringUtils
+import com.baomidou.mybatisplus.core.toolkit.Wrappers
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page
+import com.jd.brume.entity.UserEntity
+import com.jd.brume.entity.func.UserFunc
+import com.jd.brume.entity.resultmap.UserSelect
+import com.jd.brume.service.CorpService
+import com.jd.brume.service.RoleService
+import com.jd.brume.service.UserService
+import com.jd.brume.util.Result
+import com.jd.brume.util.ResultEnum
+import com.jd.brume.util.SMUtil
+import com.jd.brume.vo.UserVo
+import com.jd.brume.vo.group.PagingGroup
+import com.jd.brume.vo.group.SaveGroup
+import com.jd.brume.vo.group.UpdateGroup
+
+import cn.hutool.core.util.StrUtil
+
+/**
+ * user 控制层
+ * @author 王帅
+ *
+ */
+@Validated
+@RestController
+@RequestMapping('user')
+class UserController {
+	
+	@Resource
+	UserService userService
+	
+	@Resource
+	RoleService roleService
+	
+	@Resource
+	CorpService corpService
+	
+	/**
+	 * 分页获取用户数据
+	 * @param userVo
+	 * @return
+	 */
+	@GetMapping('paging')
+	def getUserPaging(@Validated(PagingGroup) UserVo userVo) {
+		Wrapper<UserEntity> wrapper = Wrappers.lambdaQuery()
+		.like(StringUtils.isNotBlank(userVo.queryVal), UserFunc.userName(), userVo.queryVal)
+		.eq(userVo.roleId != null, UserFunc.roleId(), userVo.roleId)
+		.eq(userVo.deptId != null, UserFunc.deptId(), userVo.deptId)
+		def count = userService.count(wrapper)
+		if (count == 0) return new Result().msg(ResultEnum.NO_DATA_TABLE)
+		wrapper.select(UserSelect.page).orderByDesc(UserFunc.createTime())
+		def data = userService.page(new Page(userVo.page, userVo.limit, count), wrapper)
+		return new Result().layTable([list: data.records, count: data.total])
+	}
+	
+	/**
+	 * 保存用户信息
+	 * @param saveUserVo
+	 * @return
+	 */
+	@PostMapping('save')
+	def saveUser(@Validated(SaveGroup) UserVo userVo) {
+		if (userVo.password != userVo.repeatPass) return new Result().msg(100, '密码输入不一致')
+		// 账号是否存在
+		def count = userService.count(Wrappers.lambdaQuery().eq(UserFunc.account(), userVo.account))
+		if (count > 0) return new Result().msg(101, '账号已存在')
+		// 加密密码
+		return new Result().ok(userService.save(new UserEntity(userName: userVo.userName, account: userVo.account, deptId: userVo.deptId, 
+			roleId: userVo.roleId, password: SMUtil.sm2Encrypt(userVo.password), phone: userVo.phone)))
+	}
+	
+	/**
+	 * 修改用户信息
+	 * @param userVo
+	 * @return
+	 */
+	@PostMapping('update')
+	def updateUser(@Validated(UpdateGroup) UserVo userVo) {
+		if (StrUtil.isNotBlank(userVo.password)) {
+			if (userVo.password != userVo.repeatPass) return new Result().msg(100, '密码输入不一致')
+			userVo.password = SMUtil.sm2Encrypt(userVo.password)
+		}
+		def count = userService.count(Wrappers.lambdaQuery().eq(UserFunc.account(), userVo.account).ne(UserFunc.userId(), userVo.userId))
+		if (count > 0) return new Result().msg(100, '账号重复')
+		UserEntity user = new UserEntity(userId: userVo.userId, userName: userVo.userName,
+			deptId: userVo.deptId, roleId: userVo.roleId, phone: userVo.phone)
+		if (StrUtil.isNotBlank(userVo.password)) {
+			user.password = userVo.password
+		}
+		return new Result().ok(userService.updateById(user))
+	}
+	
+	/**
+	 * 删除用户信息
+	 * @param userId
+	 * @return
+	 */
+	@DeleteMapping('delete')
+	def deleteUser(@NotNull Integer userId) {
+		return new Result().ok(userService.removeById(userId))
+	}
+	
+	/**
+	 * 查询单条用户信息
+	 * @param userId
+	 * @return
+	 */
+	@GetMapping('one')
+	def getUserById(@NotNull Integer userId) {
+		return new Result().ok(userService.lambdaQuery().select(UserSelect.one).eq(UserFunc.userId(), userId).one())
+	}
+	
+	/**
+	 * 初始化信息
+	 * @return
+	 */
+	@GetMapping('init')
+	def init() {
+		return new Result().ok([
+			role: roleService.lambdaQuery().list(),
+			corp: corpService.lambdaQuery().list()
+		])
+	}
+	
+	
+}

+ 13 - 0
src/main/groovy/com/jd/brume/entity/ConfigEntity.groovy

@@ -0,0 +1,13 @@
+package com.jd.brume.entity
+
+import com.baomidou.mybatisplus.annotation.TableName
+
+@TableName('t_config')
+class ConfigEntity {
+	
+	String pullCron
+	
+	String smsCron
+	
+	String apiEnv
+}

+ 42 - 0
src/main/groovy/com/jd/brume/entity/CorpEntity.groovy

@@ -0,0 +1,42 @@
+package com.jd.brume.entity
+
+import com.baomidou.mybatisplus.annotation.IdType
+import com.baomidou.mybatisplus.annotation.TableId
+import com.baomidou.mybatisplus.annotation.TableName
+
+/**
+ * 单位
+ * @author 王帅
+ *
+ */
+@TableName('t_corp')
+class CorpEntity {
+	
+	/**
+	 * 单位id
+	 */
+	@TableId(type = IdType.AUTO)
+	Integer deptId
+	
+	/**
+	 * 单位名称
+	 */
+	String deptName
+	
+	/**
+	 * 1、水
+	 * 2、电
+	 * 3、气
+	 */
+	Integer type
+	
+	/**
+	 * 户号前缀
+	 */
+	String deptPrefix
+	
+	/**
+	 * 创建时间
+	 */
+	Date createTime
+}

+ 38 - 0
src/main/groovy/com/jd/brume/entity/DictEntity.groovy

@@ -0,0 +1,38 @@
+package com.jd.brume.entity
+
+import com.baomidou.mybatisplus.annotation.IdType
+import com.baomidou.mybatisplus.annotation.TableId
+import com.baomidou.mybatisplus.annotation.TableName
+
+/**
+ * 字典表
+ * @author 王帅
+ *
+ */
+@TableName('t_dict')
+class DictEntity {
+	
+	@TableId(type = IdType.AUTO)
+	Integer dictId
+	
+	Integer dictTypeId
+	
+	/**
+	 * 类型
+	 */
+	String dictCut
+	
+	/**
+	 * 值
+	 */
+	String dictVal
+	
+	String remark
+	
+	Date createTime
+	
+	/**
+	 * 1、系统字典;2、用户字典
+	 */
+	Integer fieldType
+}

+ 34 - 0
src/main/groovy/com/jd/brume/entity/DictTypeEntity.groovy

@@ -0,0 +1,34 @@
+package com.jd.brume.entity
+
+import com.baomidou.mybatisplus.annotation.IdType
+import com.baomidou.mybatisplus.annotation.TableId
+import com.baomidou.mybatisplus.annotation.TableName
+
+/**
+ * ×ÖµäÀàÐͱí
+ * @author Íõ˧
+ *
+ */
+@TableName('t_dict_type')
+class DictTypeEntity {
+	
+	@TableId(type = IdType.AUTO)
+	Integer dictTypeId
+	
+	/**
+	 * Ãû³Æ
+	 */
+	String dictTypeName
+	
+	/**
+	 * ÀàÐÍ
+	 */
+	String dictType
+	
+	/**
+	 * ÃèÊö
+	 */
+	String remark
+	
+	Date createTime
+}

+ 22 - 0
src/main/groovy/com/jd/brume/entity/FileEntity.groovy

@@ -0,0 +1,22 @@
+package com.jd.brume.entity
+
+import com.baomidou.mybatisplus.annotation.IdType
+import com.baomidou.mybatisplus.annotation.TableId
+import com.baomidou.mybatisplus.annotation.TableName
+
+@TableName('t_service_file')
+class FileEntity {
+	
+	@TableId(type = IdType.AUTO)
+	Integer id
+	
+	String fileType
+	
+	String fileName
+	
+	String fileStr
+	
+	Integer serviceId
+	
+	Date createTime
+}

+ 34 - 0
src/main/groovy/com/jd/brume/entity/LogEntity.groovy

@@ -0,0 +1,34 @@
+package com.jd.brume.entity
+
+import com.baomidou.mybatisplus.annotation.IdType
+import com.baomidou.mybatisplus.annotation.TableId
+import com.baomidou.mybatisplus.annotation.TableName
+
+@TableName('t_log')
+class LogEntity {
+	
+	@TableId(type = IdType.AUTO)
+	Integer id
+	
+	Integer opertateId
+	
+	String opertateIp
+	
+	Integer opertateType
+	
+	String opertateName
+	
+	Date opertateTime
+	
+	String opertateModule
+	
+	String opertateDesc
+	
+	Integer opertateStatus
+	
+	String oldMsg
+	
+	String newMsg
+	
+	Date createTime
+}

+ 33 - 0
src/main/groovy/com/jd/brume/entity/MenuButtonEntity.groovy

@@ -0,0 +1,33 @@
+package com.jd.brume.entity
+
+import com.baomidou.mybatisplus.annotation.IdType
+import com.baomidou.mybatisplus.annotation.TableId
+import com.baomidou.mybatisplus.annotation.TableName
+
+/**
+ * 按钮
+ * @author 王帅
+ *
+ */
+@TableName('t_menu_button')
+class MenuButtonEntity {
+	
+	@TableId(type = IdType.AUTO)
+	Integer btnId
+	
+	/**
+	 * 按钮名称
+	 */
+	String btnName
+	
+	/**
+	 * 按钮标签
+	 */
+	String btnTag
+	
+	/**
+	 * 创建时间
+	 */
+	Date createTime
+	
+}

+ 57 - 0
src/main/groovy/com/jd/brume/entity/MenuEntity.groovy

@@ -0,0 +1,57 @@
+package com.jd.brume.entity
+
+import com.baomidou.mybatisplus.annotation.IdType
+import com.baomidou.mybatisplus.annotation.TableId
+import com.baomidou.mybatisplus.annotation.TableName
+
+/**
+ * 菜单
+ * @author 王帅
+ *
+ */
+@TableName('t_menu')
+class MenuEntity {
+	
+	@TableId(type = IdType.AUTO)
+	Integer menuId
+	
+	/**
+	 * 菜单名称
+	 */
+	String menuName
+	
+	/**
+	 * 菜单路径
+	 */
+	String menuUrl
+	
+	/**
+	 * 上级id
+	 */
+	Integer parentId
+	
+	/**
+	 * 排序号
+	 */
+	Integer menuSort
+	
+	/**
+	 * 图标
+	 */
+	String menuIcon
+	
+	/**
+	 * 0、启用;1、停用
+	 */
+	Integer menuStatus
+	
+	/**
+	 * 按钮
+	 */
+	String btnIds
+	
+	/**
+	 * 创建时间
+	 */
+	Date createTime
+}

+ 29 - 0
src/main/groovy/com/jd/brume/entity/RoleEntity.groovy

@@ -0,0 +1,29 @@
+package com.jd.brume.entity
+
+import com.baomidou.mybatisplus.annotation.IdType
+import com.baomidou.mybatisplus.annotation.TableId
+import com.baomidou.mybatisplus.annotation.TableName
+
+/**
+ * ½ÇÉ«±í
+ * @author Íõ˧
+ *
+ */
+@TableName('t_role')
+class RoleEntity {
+	
+	@TableId(type = IdType.AUTO)
+	Integer roleId
+	
+	/**
+	 * ½ÇÉ«Ãû³Æ
+	 */
+	String roleName
+	
+	/**
+	 * ½ÇÉ«ÃèÊö
+	 */
+	String description
+	
+	Date createTime
+}

+ 20 - 0
src/main/groovy/com/jd/brume/entity/RoleMenuEntity.groovy

@@ -0,0 +1,20 @@
+package com.jd.brume.entity
+
+import com.baomidou.mybatisplus.annotation.IdType
+import com.baomidou.mybatisplus.annotation.TableId
+import com.baomidou.mybatisplus.annotation.TableName
+
+@TableName('t_role_menu')
+class RoleMenuEntity {
+	
+	@TableId(type = IdType.AUTO)
+	Integer id
+	
+	Integer roleId
+	
+	Integer menuId
+	
+	String buttonIds
+	
+	Date createTime
+}

+ 63 - 0
src/main/groovy/com/jd/brume/entity/ServiceEntity.groovy

@@ -0,0 +1,63 @@
+package com.jd.brume.entity
+
+import com.baomidou.mybatisplus.annotation.IdType
+import com.baomidou.mybatisplus.annotation.TableId
+import com.baomidou.mybatisplus.annotation.TableName
+
+@TableName('t_service')
+class ServiceEntity {
+	
+	@TableId(type = IdType.AUTO)
+	Integer id
+	
+	/**
+	 * 业务id
+	 */
+	String dataId
+	
+	/**
+	 * 申请人姓名
+	 */
+	String sqrxm
+	
+	/**
+	 * 证件号
+	 */
+	String sqrzjhm
+	
+	/**
+	 * 手机号
+	 */
+	String sqrlxdh
+	
+	/**
+	 * 区县代码
+	 */
+	String qxbm
+	
+	/**
+	 * 供水户号
+	 */
+	String gshh
+	
+	/**
+	 * 供电户号
+	 */
+	String gdhh
+	
+	/**
+	 * 供气户号
+	 */
+	String gqhh
+	
+	/**
+	 * 申请时间
+	 */
+	Date sqsj
+	
+	/**
+	 * 创建时间
+	 */
+	Date createTime
+	
+}

+ 40 - 0
src/main/groovy/com/jd/brume/entity/ServiceRecordEntity.groovy

@@ -0,0 +1,40 @@
+package com.jd.brume.entity
+
+import com.baomidou.mybatisplus.annotation.IdType
+import com.baomidou.mybatisplus.annotation.TableId
+import com.baomidou.mybatisplus.annotation.TableName
+
+@TableName('t_service_record')
+class ServiceRecordEntity {
+	
+	@TableId(type = IdType.AUTO)
+	Integer id
+	
+	/**
+	 * ÒµÎñid
+	 */
+	Integer serviceId
+	
+	/**
+	 * ÀàÐÍ
+	 */
+	Integer type
+	
+	Integer caseUserId
+	
+	Integer caseStatus
+	
+	Integer useStatus
+	
+	Integer completion
+	
+	Date caseTime
+	
+	Date useTime
+	
+	Date completionTime
+	
+	Integer useUserId
+	
+	Integer cUserId
+}

+ 18 - 0
src/main/groovy/com/jd/brume/entity/SmsEntity.groovy

@@ -0,0 +1,18 @@
+package com.jd.brume.entity
+
+import com.baomidou.mybatisplus.annotation.IdType
+import com.baomidou.mybatisplus.annotation.TableId
+import com.baomidou.mybatisplus.annotation.TableName
+
+@TableName('t_sms')
+class SmsEntity {
+	
+	@TableId(type = IdType.AUTO)
+	Integer id
+	
+	Integer userId
+	
+	Integer status
+	
+	Date createTime
+}

+ 28 - 0
src/main/groovy/com/jd/brume/entity/SmsRecordEntity.groovy

@@ -0,0 +1,28 @@
+package com.jd.brume.entity
+
+import com.baomidou.mybatisplus.annotation.IdType
+import com.baomidou.mybatisplus.annotation.TableId
+import com.baomidou.mybatisplus.annotation.TableName
+
+@TableName('t_sms_record')
+class SmsRecordEntity {
+	
+	@TableId(type = IdType.AUTO)
+	Integer id
+	
+	Integer type
+	
+	Integer userId
+	
+	Integer serviceId
+	
+	Integer serviceType
+	
+	String phone 
+	
+	String content
+	
+	Date createTime
+	
+	Integer status
+}

+ 56 - 0
src/main/groovy/com/jd/brume/entity/UserEntity.groovy

@@ -0,0 +1,56 @@
+package com.jd.brume.entity
+
+import com.baomidou.mybatisplus.annotation.IdType
+import com.baomidou.mybatisplus.annotation.TableId
+import com.baomidou.mybatisplus.annotation.TableName
+
+/**
+ * 用户表
+ * @author 王帅
+ *
+ */
+@TableName('t_user')
+class UserEntity {
+	
+	/**
+	 * 用户id
+	 */
+	@TableId(type = IdType.AUTO)
+	Integer userId
+	
+	/**
+	 * 用户名称
+	 */
+	String userName
+	
+	/**
+	 * 账号
+	 */
+	String account
+	
+	/**
+	 * 密码
+	 */
+	String password
+	
+	/**
+	 * 角色id
+	 */
+	Integer roleId
+	
+	/**
+	 * 单位id
+	 */
+	Integer deptId
+	
+	/**
+	 * 创建时间
+	 */
+	Date createTime
+	
+	/**
+	 * 手机号
+	 */
+	String phone
+	
+}

+ 23 - 0
src/main/groovy/com/jd/brume/entity/func/ConfigFunc.java

@@ -0,0 +1,23 @@
+package com.jd.brume.entity.func;
+
+import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
+import com.jd.brume.entity.ConfigEntity;
+
+public class ConfigFunc {
+
+	public static SFunction<ConfigEntity, String> pullCron() {
+		SFunction<ConfigEntity, String> f = ConfigEntity::getPullCron;
+		return f;
+	}
+
+	public static SFunction<ConfigEntity, String> smsCron() {
+		SFunction<ConfigEntity, String> f = ConfigEntity::getSmsCron;
+		return f;
+	}
+	
+	public static SFunction<ConfigEntity, String> apiEnv() {
+		SFunction<ConfigEntity, String> f = ConfigEntity::getApiEnv;
+		return f;
+	}
+
+}

+ 35 - 0
src/main/groovy/com/jd/brume/entity/func/CorpFunc.java

@@ -0,0 +1,35 @@
+package com.jd.brume.entity.func;
+
+import java.util.Date;
+
+import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
+import com.jd.brume.entity.CorpEntity;
+
+public class CorpFunc {
+	
+	public static SFunction<CorpEntity, Integer> deptId() {
+		SFunction<CorpEntity, Integer> f = CorpEntity::getDeptId;
+		return f;
+	}
+	
+	public static SFunction<CorpEntity, String> deptName() {
+		SFunction<CorpEntity, String> f = CorpEntity::getDeptName;
+		return f;
+	}
+	
+	public static SFunction<CorpEntity, Integer> type() {
+		SFunction<CorpEntity, Integer> f = CorpEntity::getType;
+		return f;
+	}
+	
+	public static SFunction<CorpEntity, String> deptPrefix() {
+		SFunction<CorpEntity, String> f = CorpEntity::getDeptPrefix;
+		return f;
+	}
+	
+	public static SFunction<CorpEntity, Date> createTime() {
+		SFunction<CorpEntity, Date> f = CorpEntity::getCreateTime;
+		return f;
+	}
+	
+}

+ 44 - 0
src/main/groovy/com/jd/brume/entity/func/DictFunc.java

@@ -0,0 +1,44 @@
+package com.jd.brume.entity.func;
+
+import java.util.Date;
+
+import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
+import com.jd.brume.entity.DictEntity;
+
+public class DictFunc {
+
+	public static SFunction<DictEntity, Integer> dictId() {
+		SFunction<DictEntity, Integer> f = DictEntity::getDictId;
+		return f;
+	}
+	
+	public static SFunction<DictEntity, Integer> dictTypeId() {
+		SFunction<DictEntity, Integer> f = DictEntity::getDictTypeId;
+		return f;
+	}
+	
+	public static SFunction<DictEntity, String> dictCut() {
+		SFunction<DictEntity, String> f = DictEntity::getDictCut;
+		return f;
+	}
+	
+	public static SFunction<DictEntity, String> dictVal() {
+		SFunction<DictEntity, String> f = DictEntity::getDictVal;
+		return f;
+	}
+	
+	public static SFunction<DictEntity, String> remark() {
+		SFunction<DictEntity, String> f = DictEntity::getRemark;
+		return f;
+	}
+	
+	public static SFunction<DictEntity, Date> createTime() {
+		SFunction<DictEntity, Date> f = DictEntity::getCreateTime;
+		return f;
+	}
+	
+	public static SFunction<DictEntity, Integer> fieldType() {
+		SFunction<DictEntity, Integer> f = DictEntity::getFieldType;
+		return f;
+	}
+}

+ 35 - 0
src/main/groovy/com/jd/brume/entity/func/DictTypeFunc.java

@@ -0,0 +1,35 @@
+package com.jd.brume.entity.func;
+
+import java.util.Date;
+
+import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
+import com.jd.brume.entity.DictTypeEntity;
+
+public class DictTypeFunc {
+
+	public static SFunction<DictTypeEntity, Integer> dictTypeId() {
+		SFunction<DictTypeEntity, Integer> f = DictTypeEntity::getDictTypeId;
+		return f;
+	}
+	
+	public static SFunction<DictTypeEntity, String> dictTypeName() {
+		SFunction<DictTypeEntity, String> f = DictTypeEntity::getDictTypeName;
+		return f;
+	}
+	
+	public static SFunction<DictTypeEntity, String> dictType() {
+		SFunction<DictTypeEntity, String> f = DictTypeEntity::getDictType;
+		return f;
+	}
+	
+	public static SFunction<DictTypeEntity, Date> createTime() {
+		SFunction<DictTypeEntity, Date> f = DictTypeEntity::getCreateTime;
+		return f;
+	}
+	
+	public static SFunction<DictTypeEntity, String> remark() {
+		SFunction<DictTypeEntity, String> f = DictTypeEntity::getRemark;
+		return f;
+	}
+	
+}

+ 69 - 0
src/main/groovy/com/jd/brume/entity/func/LogFunc.java

@@ -0,0 +1,69 @@
+package com.jd.brume.entity.func;
+
+import java.util.Date;
+
+import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
+import com.jd.brume.entity.LogEntity;
+
+public class LogFunc {
+
+	public static SFunction<LogEntity, Integer> id() {
+		SFunction<LogEntity, Integer> f = LogEntity::getId;
+		return f;
+	}
+	
+	public static SFunction<LogEntity, Integer> opertateId() {
+		SFunction<LogEntity, Integer> f = LogEntity::getOpertateId;
+		return f;
+	}
+
+	public static SFunction<LogEntity, String> opertateIp() {
+		SFunction<LogEntity, String> f = LogEntity::getOpertateIp;
+		return f;
+	}
+
+	public static SFunction<LogEntity, Integer> opertateType() {
+		SFunction<LogEntity, Integer> f = LogEntity::getOpertateType;
+		return f;
+	}
+
+	public static SFunction<LogEntity, String> opertateName() {
+		SFunction<LogEntity, String> f = LogEntity::getOpertateName;
+		return f;
+	}
+
+	public static SFunction<LogEntity, Date> opertateTime() {
+		SFunction<LogEntity, Date> f = LogEntity::getOpertateTime;
+		return f;
+	}
+
+	public static SFunction<LogEntity, String> opertateModule() {
+		SFunction<LogEntity, String> f = LogEntity::getOpertateModule;
+		return f;
+	}
+
+	public static SFunction<LogEntity, String> opertateDesc() {
+		SFunction<LogEntity, String> f = LogEntity::getOpertateDesc;
+		return f;
+	}
+
+	public static SFunction<LogEntity, Integer> opertateStatus() {
+		SFunction<LogEntity, Integer> f = LogEntity::getOpertateStatus;
+		return f;
+	}
+
+	public static SFunction<LogEntity, String> oldMsg() {
+		SFunction<LogEntity, String> f = LogEntity::getOldMsg;
+		return f;
+	}
+
+	public static SFunction<LogEntity, String> newMsg() {
+		SFunction<LogEntity, String> f = LogEntity::getNewMsg;
+		return f;
+	}
+
+	public static SFunction<LogEntity, Date> createTime() {
+		SFunction<LogEntity, Date> f = LogEntity::getCreateTime;
+		return f;
+	}
+}

+ 30 - 0
src/main/groovy/com/jd/brume/entity/func/MenuButtonFunc.java

@@ -0,0 +1,30 @@
+package com.jd.brume.entity.func;
+
+import java.util.Date;
+
+import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
+import com.jd.brume.entity.MenuButtonEntity;
+
+public class MenuButtonFunc {
+	
+	public static SFunction<MenuButtonEntity, Integer> btnId() {
+		SFunction<MenuButtonEntity, Integer> f = MenuButtonEntity::getBtnId;
+		return f;
+	}
+	
+	public static SFunction<MenuButtonEntity, String> btnName() {
+		SFunction<MenuButtonEntity, String> f = MenuButtonEntity::getBtnName;
+		return f;
+	}
+	
+	public static SFunction<MenuButtonEntity, String> btnTag() {
+		SFunction<MenuButtonEntity, String> f = MenuButtonEntity::getBtnTag;
+		return f;
+	}
+	
+	public static SFunction<MenuButtonEntity, Date> createTime() {
+		SFunction<MenuButtonEntity, Date> f = MenuButtonEntity::getCreateTime;
+		return f;
+	}
+
+}

+ 55 - 0
src/main/groovy/com/jd/brume/entity/func/MenuFunc.java

@@ -0,0 +1,55 @@
+package com.jd.brume.entity.func;
+
+import java.util.Date;
+
+import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
+import com.jd.brume.entity.MenuEntity;
+
+public class MenuFunc {
+	
+	public static SFunction<MenuEntity, Integer> menuId() {
+		SFunction<MenuEntity, Integer> f = MenuEntity::getMenuId;
+		return f;
+	}
+	
+	public static SFunction<MenuEntity, String> menuName() {
+		SFunction<MenuEntity, String> f = MenuEntity::getMenuName;
+		return f;
+	}
+	
+	public static SFunction<MenuEntity, String> menuUrl() {
+		SFunction<MenuEntity, String> f = MenuEntity::getMenuUrl;
+		return f;
+	}
+	
+	public static SFunction<MenuEntity, Integer> parentId() {
+		SFunction<MenuEntity, Integer> f = MenuEntity::getParentId;
+		return f;
+	}
+	
+	public static SFunction<MenuEntity, Integer> menuSort() {
+		SFunction<MenuEntity, Integer> f = MenuEntity::getMenuSort;
+		return f;
+	}
+	
+	public static SFunction<MenuEntity, String> menuIcon() {
+		SFunction<MenuEntity, String> f = MenuEntity::getMenuIcon;
+		return f;
+	}
+	
+	public static SFunction<MenuEntity, Integer> menuStatus() {
+		SFunction<MenuEntity, Integer> f = MenuEntity::getMenuStatus;
+		return f;
+	}
+	
+	public static SFunction<MenuEntity, String> btnIds() {
+		SFunction<MenuEntity, String> f = MenuEntity::getBtnIds;
+		return f;
+	}
+	
+	public static SFunction<MenuEntity, Date> createTime() {
+		SFunction<MenuEntity, Date> f = MenuEntity::getCreateTime;
+		return f;
+	}
+
+}

+ 30 - 0
src/main/groovy/com/jd/brume/entity/func/RoleFunc.java

@@ -0,0 +1,30 @@
+package com.jd.brume.entity.func;
+
+import java.util.Date;
+
+import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
+import com.jd.brume.entity.RoleEntity;
+
+public class RoleFunc {
+
+	public static SFunction<RoleEntity, Integer> roleId() {
+		SFunction<RoleEntity, Integer> f = RoleEntity::getRoleId;
+		return f;
+	}
+
+	public static SFunction<RoleEntity, String> roleName() {
+		SFunction<RoleEntity, String> f = RoleEntity::getRoleName;
+		return f;
+	}
+
+	public static SFunction<RoleEntity, String> description() {
+		SFunction<RoleEntity, String> f = RoleEntity::getDescription;
+		return f;
+	}
+
+	public static SFunction<RoleEntity, Date> createTime() {
+		SFunction<RoleEntity, Date> f = RoleEntity::getCreateTime;
+		return f;
+	}
+
+}

+ 30 - 0
src/main/groovy/com/jd/brume/entity/func/RoleMenuFunc.java

@@ -0,0 +1,30 @@
+package com.jd.brume.entity.func;
+
+import java.util.Date;
+
+import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
+import com.jd.brume.entity.RoleMenuEntity;
+
+public class RoleMenuFunc {
+
+	public static SFunction<RoleMenuEntity, Integer> id() {
+		SFunction<RoleMenuEntity, Integer> f = RoleMenuEntity::getId;
+		return f;
+	}
+
+	public static SFunction<RoleMenuEntity, Integer> roleId() {
+		SFunction<RoleMenuEntity, Integer> f = RoleMenuEntity::getRoleId;
+		return f;
+	}
+
+	public static SFunction<RoleMenuEntity, String> buttonIds() {
+		SFunction<RoleMenuEntity, String> f = RoleMenuEntity::getButtonIds;
+		return f;
+	}
+
+	public static SFunction<RoleMenuEntity, Date> createTime() {
+		SFunction<RoleMenuEntity, Date> f = RoleMenuEntity::getCreateTime;
+		return f;
+	}
+
+}

+ 40 - 0
src/main/groovy/com/jd/brume/entity/func/ServiceFileFunc.java

@@ -0,0 +1,40 @@
+package com.jd.brume.entity.func;
+
+import java.util.Date;
+
+import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
+import com.jd.brume.entity.FileEntity;
+
+public class ServiceFileFunc {
+
+	public static SFunction<FileEntity, Integer> id() {
+		SFunction<FileEntity, Integer> f = FileEntity::getId;
+		return f;
+	}
+	
+	public static SFunction<FileEntity, Integer> serviceId() {
+		SFunction<FileEntity, Integer> f = FileEntity::getServiceId;
+		return f;
+	}
+
+	public static SFunction<FileEntity, String> fileType() {
+		SFunction<FileEntity, String> f = FileEntity::getFileType;
+		return f;
+	}
+
+	public static SFunction<FileEntity, String> fileName() {
+		SFunction<FileEntity, String> f = FileEntity::getFileName;
+		return f;
+	}
+
+	public static SFunction<FileEntity, String> fileStr() {
+		SFunction<FileEntity, String> f = FileEntity::getFileStr;
+		return f;
+	}
+
+	public static SFunction<FileEntity, Date> createTime() {
+		SFunction<FileEntity, Date> f = FileEntity::getCreateTime;
+		return f;
+	}
+
+}

+ 65 - 0
src/main/groovy/com/jd/brume/entity/func/ServiceFunc.java

@@ -0,0 +1,65 @@
+package com.jd.brume.entity.func;
+
+import java.util.Date;
+
+import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
+import com.jd.brume.entity.ServiceEntity;
+
+public class ServiceFunc {
+
+	public static SFunction<ServiceEntity, Integer> id() {
+		SFunction<ServiceEntity, Integer> f = ServiceEntity::getId;
+		return f;
+	}
+
+	public static SFunction<ServiceEntity, String> dataId() {
+		SFunction<ServiceEntity, String> f = ServiceEntity::getDataId;
+		return f;
+	}
+
+	public static SFunction<ServiceEntity, String> sqrxm() {
+		SFunction<ServiceEntity, String> f = ServiceEntity::getSqrxm;
+		return f;
+	}
+
+	public static SFunction<ServiceEntity, String> sqrzjhm() {
+		SFunction<ServiceEntity, String> f = ServiceEntity::getSqrzjhm;
+		return f;
+	}
+
+	public static SFunction<ServiceEntity, String> sqrlxdh() {
+		SFunction<ServiceEntity, String> f = ServiceEntity::getSqrlxdh;
+		return f;
+	}
+
+	public static SFunction<ServiceEntity, String> qxbm() {
+		SFunction<ServiceEntity, String> f = ServiceEntity::getQxbm;
+		return f;
+	}
+
+	public static SFunction<ServiceEntity, String> gshh() {
+		SFunction<ServiceEntity, String> f = ServiceEntity::getGshh;
+		return f;
+	}
+
+	public static SFunction<ServiceEntity, String> gdhh() {
+		SFunction<ServiceEntity, String> f = ServiceEntity::getGdhh;
+		return f;
+	}
+
+	public static SFunction<ServiceEntity, String> gqhh() {
+		SFunction<ServiceEntity, String> f = ServiceEntity::getGqhh;
+		return f;
+	}
+
+	public static SFunction<ServiceEntity, Date> sqsj() {
+		SFunction<ServiceEntity, Date> f = ServiceEntity::getSqsj;
+		return f;
+	}
+
+	public static SFunction<ServiceEntity, Date> createTime() {
+		SFunction<ServiceEntity, Date> f = ServiceEntity::getCreateTime;
+		return f;
+	}
+	
+}

+ 69 - 0
src/main/groovy/com/jd/brume/entity/func/ServiceRecordFunc.java

@@ -0,0 +1,69 @@
+package com.jd.brume.entity.func;
+
+import java.util.Date;
+
+import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
+import com.jd.brume.entity.ServiceRecordEntity;
+
+public class ServiceRecordFunc {
+
+	public static SFunction<ServiceRecordEntity, Integer> id() {
+		SFunction<ServiceRecordEntity, Integer> f = ServiceRecordEntity::getId;
+		return f;
+	}
+
+	public static SFunction<ServiceRecordEntity, Integer> serviceId() {
+		SFunction<ServiceRecordEntity, Integer> f = ServiceRecordEntity::getServiceId;
+		return f;
+	}
+
+	public static SFunction<ServiceRecordEntity, Integer> type() {
+		SFunction<ServiceRecordEntity, Integer> f = ServiceRecordEntity::getType;
+		return f;
+	}
+	
+	public static SFunction<ServiceRecordEntity, Integer> caseUserId() {
+		SFunction<ServiceRecordEntity, Integer> f = ServiceRecordEntity::getCaseUserId;
+		return f;
+	}
+	
+	public static SFunction<ServiceRecordEntity, Integer> useUserId() {
+		SFunction<ServiceRecordEntity, Integer> f = ServiceRecordEntity::getUseUserId;
+		return f;
+	}
+	
+	public static SFunction<ServiceRecordEntity, Integer> cUserId() {
+		SFunction<ServiceRecordEntity, Integer> f = ServiceRecordEntity::getcUserId;
+		return f;
+	}
+
+	public static SFunction<ServiceRecordEntity, Integer> caseStatus() {
+		SFunction<ServiceRecordEntity, Integer> f = ServiceRecordEntity::getCaseStatus;
+		return f;
+	}
+
+	public static SFunction<ServiceRecordEntity, Integer> useStatus() {
+		SFunction<ServiceRecordEntity, Integer> f = ServiceRecordEntity::getUseStatus;
+		return f;
+	}
+
+	public static SFunction<ServiceRecordEntity, Integer> completion() {
+		SFunction<ServiceRecordEntity, Integer> f = ServiceRecordEntity::getCompletion;
+		return f;
+	}
+
+	public static SFunction<ServiceRecordEntity, Date> caseTime() {
+		SFunction<ServiceRecordEntity, Date> f = ServiceRecordEntity::getCaseTime;
+		return f;
+	}
+
+	public static SFunction<ServiceRecordEntity, Date> useTime() {
+		SFunction<ServiceRecordEntity, Date> f = ServiceRecordEntity::getUseTime;
+		return f;
+	}
+
+	public static SFunction<ServiceRecordEntity, Date> completionTime() {
+		SFunction<ServiceRecordEntity, Date> f = ServiceRecordEntity::getCompletionTime;
+		return f;
+	}
+}

+ 30 - 0
src/main/groovy/com/jd/brume/entity/func/SmsFunc.java

@@ -0,0 +1,30 @@
+package com.jd.brume.entity.func;
+
+import java.util.Date;
+
+import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
+import com.jd.brume.entity.SmsEntity;
+
+public class SmsFunc {
+
+	public static SFunction<SmsEntity, Integer> id() {
+		SFunction<SmsEntity, Integer> f = SmsEntity::getId;
+		return f;
+	}
+
+	public static SFunction<SmsEntity, Integer> userId() {
+		SFunction<SmsEntity, Integer> f = SmsEntity::getUserId;
+		return f;
+	}
+
+	public static SFunction<SmsEntity, Integer> status() {
+		SFunction<SmsEntity, Integer> f = SmsEntity::getStatus;
+		return f;
+	}
+
+	public static SFunction<SmsEntity, Date> createTime() {
+		SFunction<SmsEntity, Date> f = SmsEntity::getCreateTime;
+		return f;
+	}
+
+}

+ 50 - 0
src/main/groovy/com/jd/brume/entity/func/SmsRecordFunc.java

@@ -0,0 +1,50 @@
+package com.jd.brume.entity.func;
+
+import java.util.Date;
+
+import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
+import com.jd.brume.entity.SmsRecordEntity;
+
+public class SmsRecordFunc {
+
+	public static SFunction<SmsRecordEntity, Integer> id() {
+		SFunction<SmsRecordEntity, Integer> f = SmsRecordEntity::getId;
+		return f;
+	}
+
+	public static SFunction<SmsRecordEntity, Integer> type() {
+		SFunction<SmsRecordEntity, Integer> f = SmsRecordEntity::getType;
+		return f;
+	}
+
+	public static SFunction<SmsRecordEntity, Integer> userId() {
+		SFunction<SmsRecordEntity, Integer> f = SmsRecordEntity::getUserId;
+		return f;
+	}
+
+	public static SFunction<SmsRecordEntity, Integer> serviceId() {
+		SFunction<SmsRecordEntity, Integer> f = SmsRecordEntity::getServiceId;
+		return f;
+	}
+
+	public static SFunction<SmsRecordEntity, Integer> serviceType() {
+		SFunction<SmsRecordEntity, Integer> f = SmsRecordEntity::getServiceType;
+		return f;
+	}
+
+	public static SFunction<SmsRecordEntity, String> phone() {
+		SFunction<SmsRecordEntity, String> f = SmsRecordEntity::getPhone;
+		return f;
+	}
+
+	public static SFunction<SmsRecordEntity, String> content() {
+		SFunction<SmsRecordEntity, String> f = SmsRecordEntity::getContent;
+		return f;
+	}
+
+	public static SFunction<SmsRecordEntity, Date> createTime() {
+		SFunction<SmsRecordEntity, Date> f = SmsRecordEntity::getCreateTime;
+		return f;
+	}
+
+}

+ 50 - 0
src/main/groovy/com/jd/brume/entity/func/UserFunc.java

@@ -0,0 +1,50 @@
+package com.jd.brume.entity.func;
+
+import java.util.Date;
+
+import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
+import com.jd.brume.entity.UserEntity;
+
+public class UserFunc {
+	
+	public static SFunction<UserEntity, Integer> userId() {
+		SFunction<UserEntity, Integer> f = UserEntity::getUserId;
+		return f;
+	}
+	
+	public static SFunction<UserEntity, String> userName() {
+		SFunction<UserEntity, String> f = UserEntity::getUserName;
+		return f;
+	}
+	
+	public static SFunction<UserEntity, String> account() {
+		SFunction<UserEntity, String> f = UserEntity::getAccount;
+		return f;
+	}
+	
+	public static SFunction<UserEntity, String> password() {
+		SFunction<UserEntity, String> f = UserEntity::getPassword;
+		return f;
+	}
+	
+	public static SFunction<UserEntity, Integer> roleId() {
+		SFunction<UserEntity, Integer> f = UserEntity::getRoleId;
+		return f;
+	}
+	
+	public static SFunction<UserEntity, Integer> deptId() {
+		SFunction<UserEntity, Integer> f = UserEntity::getDeptId;
+		return f;
+	}
+	
+	public static SFunction<UserEntity, Date> createTime() {
+		SFunction<UserEntity, Date> f = UserEntity::getCreateTime;
+		return f;
+	}
+	
+	public static SFunction<UserEntity, String> phone() {
+		SFunction<UserEntity, String> f = UserEntity::getPhone;
+		return f;
+	}
+	
+}

+ 11 - 0
src/main/groovy/com/jd/brume/entity/resultmap/MenuButtonSelect.groovy

@@ -0,0 +1,11 @@
+package com.jd.brume.entity.resultmap
+
+import com.baomidou.mybatisplus.core.toolkit.support.SFunction
+import com.jd.brume.entity.func.MenuButtonFunc
+
+class MenuButtonSelect {
+	
+	static SFunction<?, ?>[] page = [MenuButtonFunc.btnId(), MenuButtonFunc.btnName(), MenuButtonFunc.btnTag(), MenuButtonFunc.createTime()]
+	
+	static SFunction<?, ?>[] query = [MenuButtonFunc.btnId(), MenuButtonFunc.btnName(), MenuButtonFunc.btnTag()]
+}

+ 11 - 0
src/main/groovy/com/jd/brume/entity/resultmap/MenuSelect.groovy

@@ -0,0 +1,11 @@
+package com.jd.brume.entity.resultmap
+
+import com.baomidou.mybatisplus.core.toolkit.support.SFunction
+import com.jd.brume.entity.func.MenuFunc
+
+class MenuSelect {
+	
+	static SFunction<?, ?>[] page = [MenuFunc.menuId(), MenuFunc.menuName(), MenuFunc.menuUrl(), MenuFunc.menuStatus(), MenuFunc.createTime()]
+	
+	static SFunction<?, ?>[] parentMenu = [MenuFunc.menuId(), MenuFunc.menuName()]
+}

+ 14 - 0
src/main/groovy/com/jd/brume/entity/resultmap/UserSelect.groovy

@@ -0,0 +1,14 @@
+package com.jd.brume.entity.resultmap
+
+import com.baomidou.mybatisplus.core.toolkit.support.SFunction
+import com.jd.brume.entity.func.UserFunc
+
+class UserSelect {
+	
+	static SFunction<?, ?>[] page = [UserFunc.userId(), UserFunc.userName(), UserFunc.account(), UserFunc.createTime(), UserFunc.deptId(), 
+		UserFunc.roleId(), UserFunc.phone()]
+	
+	static SFunction<?, ?>[] one = [UserFunc.userId(), UserFunc.userName(), UserFunc.account(), UserFunc.roleId(), UserFunc.deptId(),
+		 UserFunc.createTime(), UserFunc.phone()]
+	 
+}

+ 38 - 0
src/main/groovy/com/jd/brume/handler/CustomExceptionHandler.groovy

@@ -0,0 +1,38 @@
+package com.jd.brume.handler
+
+import javax.validation.ValidationException
+
+import org.springframework.http.HttpStatus
+import org.springframework.web.bind.MethodArgumentNotValidException
+import org.springframework.web.bind.annotation.ExceptionHandler
+import org.springframework.web.bind.annotation.ResponseStatus
+import org.springframework.web.bind.annotation.RestControllerAdvice
+
+import cn.hutool.log.StaticLog
+import com.jd.brume.util.Result
+import com.jd.brume.util.ResultEnum
+
+@RestControllerAdvice
+class CustomExceptionHandler {
+	
+	@ResponseStatus(HttpStatus.OK)
+	@ExceptionHandler(MethodArgumentNotValidException.class)
+	def validExceptionHandler(MethodArgumentNotValidException e) {
+		StaticLog.error(e.getMessage())
+		return new Result().msg(ResultEnum.PARAMETER_ERROR)
+	}
+	
+	@ResponseStatus(HttpStatus.OK)
+	@ExceptionHandler(org.springframework.validation.BindException.class)
+	def validExceptionHandler(org.springframework.validation.BindException e) {
+		StaticLog.error(e.getMessage())
+		return new Result().msg(ResultEnum.PARAMETER_ERROR)
+	}
+	
+	@ResponseStatus(HttpStatus.OK)
+	@ExceptionHandler(ValidationException.class)
+	def validExceptionHandler(ValidationException e) {
+		StaticLog.error(e.getMessage())
+		return new Result().msg(ResultEnum.PARAMETER_ERROR)
+	}
+}

+ 7 - 0
src/main/groovy/com/jd/brume/mapper/ConfigMapper.groovy

@@ -0,0 +1,7 @@
+package com.jd.brume.mapper
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper
+import com.jd.brume.entity.ConfigEntity
+
+interface ConfigMapper extends BaseMapper<ConfigEntity> {
+}

+ 7 - 0
src/main/groovy/com/jd/brume/mapper/CorpMapper.groovy

@@ -0,0 +1,7 @@
+package com.jd.brume.mapper
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper
+import com.jd.brume.entity.CorpEntity
+
+interface CorpMapper extends BaseMapper<CorpEntity> {
+}

+ 7 - 0
src/main/groovy/com/jd/brume/mapper/DictMapper.groovy

@@ -0,0 +1,7 @@
+package com.jd.brume.mapper
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper
+import com.jd.brume.entity.DictEntity
+
+interface DictMapper extends BaseMapper<DictEntity> {
+}

+ 7 - 0
src/main/groovy/com/jd/brume/mapper/DictTypeMapper.groovy

@@ -0,0 +1,7 @@
+package com.jd.brume.mapper
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper
+import com.jd.brume.entity.DictTypeEntity
+
+interface DictTypeMapper extends BaseMapper<DictTypeEntity> {
+}

+ 7 - 0
src/main/groovy/com/jd/brume/mapper/MenuButtonMapper.groovy

@@ -0,0 +1,7 @@
+package com.jd.brume.mapper
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper
+import com.jd.brume.entity.MenuButtonEntity
+
+interface MenuButtonMapper extends BaseMapper<MenuButtonEntity> {
+}

+ 7 - 0
src/main/groovy/com/jd/brume/mapper/MenuMapper.groovy

@@ -0,0 +1,7 @@
+package com.jd.brume.mapper
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper
+import com.jd.brume.entity.MenuEntity
+
+interface MenuMapper extends BaseMapper<MenuEntity> {
+}

+ 7 - 0
src/main/groovy/com/jd/brume/mapper/RoleMapper.groovy

@@ -0,0 +1,7 @@
+package com.jd.brume.mapper
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper
+import com.jd.brume.entity.RoleEntity
+
+interface RoleMapper extends BaseMapper<RoleEntity> {
+}

+ 7 - 0
src/main/groovy/com/jd/brume/mapper/RoleMenuMapper.groovy

@@ -0,0 +1,7 @@
+package com.jd.brume.mapper
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper
+import com.jd.brume.entity.RoleMenuEntity
+
+interface RoleMenuMapper extends BaseMapper<RoleMenuEntity> {
+}

+ 7 - 0
src/main/groovy/com/jd/brume/mapper/ServiceFileMapper.groovy

@@ -0,0 +1,7 @@
+package com.jd.brume.mapper
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper
+import com.jd.brume.entity.FileEntity
+
+interface ServiceFileMapper extends BaseMapper<FileEntity> {
+}

+ 25 - 0
src/main/groovy/com/jd/brume/mapper/ServiceMapper.groovy

@@ -0,0 +1,25 @@
+package com.jd.brume.mapper
+
+import org.apache.ibatis.annotations.Param
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper
+import com.jd.brume.entity.ServiceEntity
+import com.jd.brume.vo.ServiceVo
+
+interface ServiceMapper extends BaseMapper<ServiceEntity> {
+	
+	/**
+	 * 分页查询待办
+	 * @param serviceVo
+	 * @return
+	 */
+	List<Map> getDealtPaging(ServiceVo serviceVo)
+	
+	Integer getDealtCount(ServiceVo serviceVo)
+	
+	/**
+	 * 获取水电气未办条数
+	 * @return
+	 */
+	Integer getServiceByType(@Param('deptPrefix') String deptPrefix, @Param('type') Integer type)
+}

+ 7 - 0
src/main/groovy/com/jd/brume/mapper/ServiceRecordMapper.groovy

@@ -0,0 +1,7 @@
+package com.jd.brume.mapper
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper
+import com.jd.brume.entity.ServiceRecordEntity
+
+interface ServiceRecordMapper extends BaseMapper<ServiceRecordEntity> {
+}

+ 7 - 0
src/main/groovy/com/jd/brume/mapper/SmsMapper.groovy

@@ -0,0 +1,7 @@
+package com.jd.brume.mapper
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper
+import com.jd.brume.entity.SmsEntity
+
+interface SmsMapper extends BaseMapper<SmsEntity> {
+}

+ 7 - 0
src/main/groovy/com/jd/brume/mapper/SmsRecordMapper.groovy

@@ -0,0 +1,7 @@
+package com.jd.brume.mapper
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper
+import com.jd.brume.entity.SmsRecordEntity
+
+interface SmsRecordMapper extends BaseMapper<SmsRecordEntity> {
+}

+ 7 - 0
src/main/groovy/com/jd/brume/mapper/UserMapper.groovy

@@ -0,0 +1,7 @@
+package com.jd.brume.mapper
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper
+import com.jd.brume.entity.UserEntity
+
+interface UserMapper extends BaseMapper<UserEntity> {
+}

+ 7 - 0
src/main/groovy/com/jd/brume/service/ConfigService.groovy

@@ -0,0 +1,7 @@
+package com.jd.brume.service
+
+import com.baomidou.mybatisplus.extension.service.IService
+import com.jd.brume.entity.ConfigEntity
+
+interface ConfigService extends IService<ConfigEntity> {
+}

+ 7 - 0
src/main/groovy/com/jd/brume/service/CorpService.groovy

@@ -0,0 +1,7 @@
+package com.jd.brume.service
+
+import com.baomidou.mybatisplus.extension.service.IService
+import com.jd.brume.entity.CorpEntity
+
+interface CorpService extends IService<CorpEntity> {
+}

+ 14 - 0
src/main/groovy/com/jd/brume/service/DictService.groovy

@@ -0,0 +1,14 @@
+package com.jd.brume.service
+
+import com.baomidou.mybatisplus.extension.service.IService
+import com.jd.brume.entity.DictEntity
+
+interface DictService extends IService<DictEntity> {
+	
+	/**
+	 * ²éѯ×Öµä
+	 * @param type
+	 * @return
+	 */
+	List<DictEntity> getDictByType(String type)
+}

+ 7 - 0
src/main/groovy/com/jd/brume/service/MenuButtonService.groovy

@@ -0,0 +1,7 @@
+package com.jd.brume.service
+
+import com.baomidou.mybatisplus.extension.service.IService
+import com.jd.brume.entity.MenuButtonEntity
+
+interface MenuButtonService extends IService<MenuButtonEntity> {
+}

+ 7 - 0
src/main/groovy/com/jd/brume/service/MenuService.groovy

@@ -0,0 +1,7 @@
+package com.jd.brume.service
+
+import com.baomidou.mybatisplus.extension.service.IService
+import com.jd.brume.entity.MenuEntity
+
+interface MenuService extends IService<MenuEntity> {
+}

+ 7 - 0
src/main/groovy/com/jd/brume/service/RoleMenuService.groovy

@@ -0,0 +1,7 @@
+package com.jd.brume.service
+
+import com.baomidou.mybatisplus.extension.service.IService
+import com.jd.brume.entity.RoleMenuEntity
+
+interface RoleMenuService extends IService<RoleMenuEntity> {
+}

+ 7 - 0
src/main/groovy/com/jd/brume/service/RoleService.groovy

@@ -0,0 +1,7 @@
+package com.jd.brume.service
+
+import com.baomidou.mybatisplus.extension.service.IService
+import com.jd.brume.entity.RoleEntity
+
+interface RoleService extends IService<RoleEntity> {
+}

+ 7 - 0
src/main/groovy/com/jd/brume/service/ServiceFileService.groovy

@@ -0,0 +1,7 @@
+package com.jd.brume.service
+
+import com.baomidou.mybatisplus.extension.service.IService
+import com.jd.brume.entity.FileEntity
+
+interface ServiceFileService extends IService<FileEntity> {
+}

+ 7 - 0
src/main/groovy/com/jd/brume/service/ServiceRecordService.groovy

@@ -0,0 +1,7 @@
+package com.jd.brume.service
+
+import com.baomidou.mybatisplus.extension.service.IService
+import com.jd.brume.entity.ServiceRecordEntity
+
+interface ServiceRecordService extends IService<ServiceRecordEntity> {
+}

+ 13 - 0
src/main/groovy/com/jd/brume/service/ServiceService.groovy

@@ -0,0 +1,13 @@
+package com.jd.brume.service
+
+import com.baomidou.mybatisplus.extension.service.IService
+import com.jd.brume.entity.ServiceEntity
+import com.jd.brume.util.Result
+import com.jd.brume.vo.ServiceVo
+
+interface ServiceService extends IService<ServiceEntity> {
+	
+	Result getDealtPaging(ServiceVo serviceVo)
+	
+	Integer getServiceByType(String deptPrefix, Integer type)
+}

+ 7 - 0
src/main/groovy/com/jd/brume/service/SmsRecordService.groovy

@@ -0,0 +1,7 @@
+package com.jd.brume.service
+
+import com.baomidou.mybatisplus.extension.service.IService
+import com.jd.brume.entity.SmsRecordEntity
+
+interface SmsRecordService extends IService<SmsRecordEntity> {
+}

+ 7 - 0
src/main/groovy/com/jd/brume/service/SmsService.groovy

@@ -0,0 +1,7 @@
+package com.jd.brume.service
+
+import com.baomidou.mybatisplus.extension.service.IService
+import com.jd.brume.entity.SmsEntity
+
+interface SmsService extends IService<SmsEntity> {
+}

+ 7 - 0
src/main/groovy/com/jd/brume/service/UserService.groovy

@@ -0,0 +1,7 @@
+package com.jd.brume.service
+
+import com.baomidou.mybatisplus.extension.service.IService
+import com.jd.brume.entity.UserEntity
+
+interface UserService extends IService<UserEntity> {
+}

+ 12 - 0
src/main/groovy/com/jd/brume/service/impl/ConfigServiceImpl.groovy

@@ -0,0 +1,12 @@
+package com.jd.brume.service.impl
+
+import org.springframework.stereotype.Service
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
+import com.jd.brume.entity.ConfigEntity
+import com.jd.brume.mapper.ConfigMapper
+import com.jd.brume.service.ConfigService
+
+@Service
+class ConfigServiceImpl extends ServiceImpl<ConfigMapper, ConfigEntity> implements ConfigService {
+}

+ 12 - 0
src/main/groovy/com/jd/brume/service/impl/CorpServiceImpl.groovy

@@ -0,0 +1,12 @@
+package com.jd.brume.service.impl
+
+import org.springframework.stereotype.Service
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
+import com.jd.brume.entity.CorpEntity
+import com.jd.brume.mapper.CorpMapper
+import com.jd.brume.service.CorpService
+
+@Service
+class CorpServiceImpl extends ServiceImpl<CorpMapper, CorpEntity> implements CorpService {
+}

+ 34 - 0
src/main/groovy/com/jd/brume/service/impl/DictServiceImpl.groovy

@@ -0,0 +1,34 @@
+package com.jd.brume.service.impl
+
+import javax.annotation.Resource
+
+import org.springframework.stereotype.Service
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
+import com.jd.brume.entity.DictEntity
+import com.jd.brume.entity.func.DictFunc
+import com.jd.brume.entity.func.DictTypeFunc
+import com.jd.brume.mapper.DictMapper
+import com.jd.brume.mapper.DictTypeMapper
+import com.jd.brume.service.DictService
+
+@Service
+class DictServiceImpl extends ServiceImpl<DictMapper, DictEntity> implements DictService {
+	
+	@Resource
+	DictTypeMapper dictTypeMapper
+	
+	@Resource
+	DictMapper dictMapper
+
+	@Override
+	List<DictEntity> getDictByType(String type) {
+		try {
+			def dictType = dictTypeMapper.selectOne(Wrappers.lambdaQuery().select(DictTypeFunc.dictTypeId()).eq(DictTypeFunc.dictType(), type))
+			return dictMapper.selectList(Wrappers.lambdaQuery().select(DictFunc.dictCut(), DictFunc.dictVal()).eq(DictFunc.dictTypeId(), dictType.dictTypeId))
+		} catch (Exception e) {
+			return null
+		}
+	}
+}

+ 12 - 0
src/main/groovy/com/jd/brume/service/impl/MenuButtonServiceImpl.groovy

@@ -0,0 +1,12 @@
+package com.jd.brume.service.impl
+
+import org.springframework.stereotype.Service
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
+import com.jd.brume.entity.MenuButtonEntity
+import com.jd.brume.mapper.MenuButtonMapper
+import com.jd.brume.service.MenuButtonService
+
+@Service
+class MenuButtonServiceImpl extends ServiceImpl<MenuButtonMapper, MenuButtonEntity> implements MenuButtonService {
+}

+ 12 - 0
src/main/groovy/com/jd/brume/service/impl/MenuServiceImpl.groovy

@@ -0,0 +1,12 @@
+package com.jd.brume.service.impl
+
+import org.springframework.stereotype.Service
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
+import com.jd.brume.entity.MenuEntity
+import com.jd.brume.mapper.MenuMapper
+import com.jd.brume.service.MenuService
+
+@Service
+class MenuServiceImpl extends ServiceImpl<MenuMapper, MenuEntity> implements MenuService {
+}

+ 12 - 0
src/main/groovy/com/jd/brume/service/impl/RoleMenuServiceImpl.groovy

@@ -0,0 +1,12 @@
+package com.jd.brume.service.impl
+
+import org.springframework.stereotype.Service
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
+import com.jd.brume.entity.RoleMenuEntity
+import com.jd.brume.mapper.RoleMenuMapper
+import com.jd.brume.service.RoleMenuService
+
+@Service
+class RoleMenuServiceImpl extends ServiceImpl<RoleMenuMapper, RoleMenuEntity> implements RoleMenuService {
+}

+ 12 - 0
src/main/groovy/com/jd/brume/service/impl/RoleServiceImpl.groovy

@@ -0,0 +1,12 @@
+package com.jd.brume.service.impl
+
+import org.springframework.stereotype.Service
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
+import com.jd.brume.entity.RoleEntity
+import com.jd.brume.mapper.RoleMapper
+import com.jd.brume.service.RoleService
+
+@Service
+class RoleServiceImpl extends ServiceImpl<RoleMapper, RoleEntity> implements RoleService {
+}

+ 12 - 0
src/main/groovy/com/jd/brume/service/impl/ServiceFileServiceImpl.groovy

@@ -0,0 +1,12 @@
+package com.jd.brume.service.impl
+
+import org.springframework.stereotype.Service
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
+import com.jd.brume.entity.FileEntity
+import com.jd.brume.mapper.ServiceFileMapper
+import com.jd.brume.service.ServiceFileService
+
+@Service
+class ServiceFileServiceImpl extends ServiceImpl<ServiceFileMapper, FileEntity> implements ServiceFileService {
+}

+ 12 - 0
src/main/groovy/com/jd/brume/service/impl/ServiceRecordServiceImpl.groovy

@@ -0,0 +1,12 @@
+package com.jd.brume.service.impl
+
+import org.springframework.stereotype.Service
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
+import com.jd.brume.entity.ServiceRecordEntity
+import com.jd.brume.mapper.ServiceRecordMapper
+import com.jd.brume.service.ServiceRecordService
+
+@Service
+class ServiceRecordServiceImpl extends ServiceImpl<ServiceRecordMapper, ServiceRecordEntity> implements ServiceRecordService {
+}

+ 35 - 0
src/main/groovy/com/jd/brume/service/impl/ServiceServiceImpl.groovy

@@ -0,0 +1,35 @@
+package com.jd.brume.service.impl
+
+import javax.annotation.Resource
+
+import org.springframework.stereotype.Service
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
+import com.jd.brume.entity.ServiceEntity
+import com.jd.brume.mapper.ServiceMapper
+import com.jd.brume.service.ServiceService
+import com.jd.brume.util.Result
+import com.jd.brume.util.ResultEnum
+import com.jd.brume.vo.ServiceVo
+
+@Service
+class ServiceServiceImpl extends ServiceImpl<ServiceMapper, ServiceEntity> implements ServiceService {
+	
+	@Resource
+	ServiceMapper serviceMapper
+
+	@Override
+	public Result getDealtPaging(ServiceVo serviceVo) {
+		def count = serviceMapper.getDealtCount(serviceVo)
+		if (count == 0) return new Result().msg(ResultEnum.NO_DATA_TABLE)
+		
+		serviceVo.page = (serviceVo.page - 1) * serviceVo.limit
+		List<Map> data = serviceMapper.getDealtPaging(serviceVo)
+		return new Result().layTable([list: data, count: count])
+	}
+
+	@Override
+	public Integer getServiceByType(String deptPrefix, Integer type) {
+		return serviceMapper.getServiceByType(deptPrefix, type);
+	}
+}

+ 12 - 0
src/main/groovy/com/jd/brume/service/impl/SmsRecordServiceImpl.groovy

@@ -0,0 +1,12 @@
+package com.jd.brume.service.impl
+
+import org.springframework.stereotype.Service
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
+import com.jd.brume.entity.SmsRecordEntity
+import com.jd.brume.mapper.SmsRecordMapper
+import com.jd.brume.service.SmsRecordService
+
+@Service
+class SmsRecordServiceImpl extends ServiceImpl<SmsRecordMapper, SmsRecordEntity> implements SmsRecordService {
+}

+ 12 - 0
src/main/groovy/com/jd/brume/service/impl/SmsServiceImpl.groovy

@@ -0,0 +1,12 @@
+package com.jd.brume.service.impl
+
+import org.springframework.stereotype.Service
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
+import com.jd.brume.entity.SmsEntity
+import com.jd.brume.mapper.SmsMapper
+import com.jd.brume.service.SmsService
+
+@Service
+class SmsServiceImpl extends ServiceImpl<SmsMapper, SmsEntity> implements SmsService {
+}

+ 12 - 0
src/main/groovy/com/jd/brume/service/impl/UserServiceImpl.groovy

@@ -0,0 +1,12 @@
+package com.jd.brume.service.impl
+
+import org.springframework.stereotype.Service
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
+import com.jd.brume.entity.UserEntity
+import com.jd.brume.mapper.UserMapper
+import com.jd.brume.service.UserService
+
+@Service
+class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> implements UserService {
+}

+ 114 - 0
src/main/groovy/com/jd/brume/task/ServiceTask.java

@@ -0,0 +1,114 @@
+package com.jd.brume.task;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.Resource;
+
+import org.springframework.scheduling.Trigger;
+import org.springframework.scheduling.TriggerContext;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.SchedulingConfigurer;
+import org.springframework.scheduling.config.ScheduledTaskRegistrar;
+import org.springframework.scheduling.support.CronTrigger;
+import org.springframework.stereotype.Component;
+
+import com.jd.brume.entity.CorpEntity;
+import com.jd.brume.entity.SmsEntity;
+import com.jd.brume.entity.SmsRecordEntity;
+import com.jd.brume.entity.UserEntity;
+import com.jd.brume.service.ConfigService;
+import com.jd.brume.service.CorpService;
+import com.jd.brume.service.ServiceService;
+import com.jd.brume.service.SmsRecordService;
+import com.jd.brume.service.SmsService;
+import com.jd.brume.service.UserService;
+import com.jd.brume.util.ApiUtil;
+import com.jd.brume.util.SmsUtil;
+
+import cn.hutool.core.convert.Convert;
+import cn.hutool.core.date.DateUtil;
+
+@Component
+@EnableScheduling
+class ServiceTask implements SchedulingConfigurer {
+	
+	@Resource
+	private ConfigService configService;
+	
+	@Resource
+	private SmsService smsService;
+	
+	@Resource
+	private UserService userService;
+	
+	@Resource
+	private CorpService corpService;
+	
+	@Resource
+	private ServiceService service;
+	
+	@Resource
+	private SmsRecordService recordService;
+
+	@Override
+	public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
+		taskRegistrar.addTriggerTask(new Runnable() {
+
+			@Override
+			public void run() {
+				System.out.println("拉取数据,拉取时间:".concat(DateUtil.now()));
+				ApiUtil.getService();
+				System.out.println("拉取数据完毕,拉取时间:".concat(DateUtil.now()));
+				// 判断是否发送短信
+				Map<String, Object> config = configService.listMaps().get(0);
+				if (Convert.toInt(config.get("smsType")) == 1) {
+					return;
+				}
+				System.err.println("发送短信");
+				List<SmsEntity> list = smsService.lambdaQuery().eq(SmsEntity::getStatus, 0).list();
+				if (list == null || list.size() == 0) {
+					return;
+				}
+				List<Integer> userIds = new ArrayList<>();
+				for (SmsEntity smsEntity : list) {
+					userIds.add(smsEntity.getUserId());
+				}
+				List<SmsRecordEntity> recordList = new ArrayList<>();
+				SmsRecordEntity recordEntity;
+				// 短信模板
+				String templet = String.valueOf(config.get("userTemplet"));
+				List<UserEntity> userList = userService.lambdaQuery().in(UserEntity::getUserId, userIds).list();
+				for (UserEntity userEntity : userList) {
+					CorpEntity corp = corpService.lambdaQuery().eq(CorpEntity::getDeptId, userEntity.getDeptId()).one();
+					
+					Integer num = service.getServiceByType(corp.getDeptPrefix(), corp.getType());
+					String sms = templet.replace("{user}", userEntity.getUserName()).replace("{number}", String.valueOf(num));
+					// 发送短信
+					boolean status = SmsUtil.sendSms(String.valueOf(config.get("smsUrl")), userEntity.getPhone(), sms);
+					recordEntity = new SmsRecordEntity();
+					recordEntity.setType(0);
+					recordEntity.setUserId(userEntity.getUserId());
+					recordEntity.setContent(sms);
+					recordEntity.setPhone(userEntity.getPhone());
+					recordEntity.setStatus(status ? 0 : 1);
+					recordList.add(recordEntity);
+				}
+				// 保存记录
+				recordService.saveBatch(recordList);
+			}
+		}, new Trigger() {
+
+			@Override
+			public Date nextExecutionTime(TriggerContext triggerContext) {
+				Map<String, Object> config = configService.listMaps().get(0);
+				return new CronTrigger(String.valueOf(config.get("pull_cron"))).nextExecutionTime(triggerContext);
+			}
+		});
+
+	}
+	
+
+}

+ 50 - 0
src/main/groovy/com/jd/brume/task/SmsTask.java

@@ -0,0 +1,50 @@
+package com.jd.brume.task;
+
+import java.util.Date;
+import java.util.Map;
+
+import javax.annotation.Resource;
+
+import org.springframework.scheduling.Trigger;
+import org.springframework.scheduling.TriggerContext;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.SchedulingConfigurer;
+import org.springframework.scheduling.config.ScheduledTaskRegistrar;
+import org.springframework.scheduling.support.CronTrigger;
+import org.springframework.stereotype.Component;
+
+import com.jd.brume.service.ConfigService;
+import com.jd.brume.util.ApiUtil;
+
+import cn.hutool.core.date.DateUtil;
+
+@Component
+@EnableScheduling
+class SmsTask implements SchedulingConfigurer {
+	
+	@Resource
+	ConfigService configService;
+
+	@Override
+	public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
+		taskRegistrar.addTriggerTask(new Runnable() {
+
+			@Override
+			public void run() {
+				System.out.println("拉取数据,拉取时间:".concat(DateUtil.now()));
+				ApiUtil.getService();
+				System.out.println("拉取数据完毕,拉取时间:".concat(DateUtil.now()));
+			}
+		}, new Trigger() {
+
+			@Override
+			public Date nextExecutionTime(TriggerContext triggerContext) {
+				Map<String, Object> config = configService.listMaps().get(0);
+				return new CronTrigger(String.valueOf(config.get("pull_cron"))).nextExecutionTime(triggerContext);
+			}
+		});
+
+	}
+
+
+}

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini