Browse Source

删除系统证书认证,添加注册码认证

zhoupeng 1 year ago
parent
commit
1f539ae155
57 changed files with 1803 additions and 86 deletions
  1. 38 0
      industry-admin/src/api/system/system.js
  2. 90 3
      industry-admin/src/views/login/index.vue
  3. 1 1
      industry-admin/src/views/source/dataQuery/chooseItem.vue
  4. 6 2
      industry-admin/src/views/source/dataQuery/index.vue
  5. 33 0
      industry-code/.gitignore
  6. BIN
      industry-code/.mvn/wrapper/maven-wrapper.jar
  7. 2 0
      industry-code/.mvn/wrapper/maven-wrapper.properties
  8. 308 0
      industry-code/mvnw
  9. 205 0
      industry-code/mvnw.cmd
  10. 59 0
      industry-code/pom.xml
  11. 13 0
      industry-code/src/main/java/com/example/industrycode/IndustryCodeApplication.java
  12. 55 0
      industry-code/src/main/java/com/example/industrycode/controller/SystemController.java
  13. 358 0
      industry-code/src/main/java/com/example/industrycode/util/Base64Util.java
  14. 189 0
      industry-code/src/main/java/com/example/industrycode/util/RSAUtil.java
  15. 35 0
      industry-code/src/main/java/com/example/industrycode/util/Result.java
  16. 2 0
      industry-code/src/main/resources/application.yml
  17. 75 0
      industry-code/src/main/resources/public/index.html
  18. 0 0
      industry-code/src/main/resources/public/layui/css/layui.css
  19. 1 0
      industry-code/src/main/resources/public/layui/css/modules/code.css
  20. 0 0
      industry-code/src/main/resources/public/layui/css/modules/laydate/default/laydate.css
  21. BIN
      industry-code/src/main/resources/public/layui/css/modules/layer/default/icon-ext.png
  22. BIN
      industry-code/src/main/resources/public/layui/css/modules/layer/default/icon.png
  23. 0 0
      industry-code/src/main/resources/public/layui/css/modules/layer/default/layer.css
  24. BIN
      industry-code/src/main/resources/public/layui/css/modules/layer/default/loading-0.gif
  25. BIN
      industry-code/src/main/resources/public/layui/css/modules/layer/default/loading-1.gif
  26. BIN
      industry-code/src/main/resources/public/layui/css/modules/layer/default/loading-2.gif
  27. BIN
      industry-code/src/main/resources/public/layui/font/iconfont.eot
  28. 25 0
      industry-code/src/main/resources/public/layui/font/iconfont.svg
  29. BIN
      industry-code/src/main/resources/public/layui/font/iconfont.ttf
  30. BIN
      industry-code/src/main/resources/public/layui/font/iconfont.woff
  31. BIN
      industry-code/src/main/resources/public/layui/font/iconfont.woff2
  32. 0 0
      industry-code/src/main/resources/public/layui/layui.js
  33. 13 0
      industry-code/src/test/java/com/example/industrycode/IndustryCodeApplicationTests.java
  34. 1 1
      industry-system/cqcy-ei-common/src/main/java/com/example/opc_common/entity/TrafficChartItem.java
  35. 14 14
      industry-system/industry-da/pom.xml
  36. 1 2
      industry-system/industry-da/src/main/java/com/example/opc_da/alarmConfig/AlarmRun.java
  37. 3 0
      industry-system/industry-da/src/main/java/com/example/opc_da/config/InterceptorConfig.java
  38. 4 2
      industry-system/industry-da/src/main/java/com/example/opc_da/controller/ItemGroupController.java
  39. 48 0
      industry-system/industry-da/src/main/java/com/example/opc_da/controller/SystemController.java
  40. 15 2
      industry-system/industry-da/src/main/java/com/example/opc_da/controller/TrafficChartController.java
  41. 0 4
      industry-system/industry-da/src/main/java/com/example/opc_da/controller/UserController.java
  42. 14 0
      industry-system/industry-da/src/main/java/com/example/opc_da/dao/SystemDao.java
  43. 1 1
      industry-system/industry-da/src/main/java/com/example/opc_da/service/ItemGroupService.java
  44. 3 0
      industry-system/industry-da/src/main/java/com/example/opc_da/service/SystemService.java
  45. 2 0
      industry-system/industry-da/src/main/java/com/example/opc_da/service/TrafficChartService.java
  46. 4 1
      industry-system/industry-da/src/main/java/com/example/opc_da/service/impl/DeviceLedgerServiceImpl.java
  47. 51 44
      industry-system/industry-da/src/main/java/com/example/opc_da/service/impl/ItemGroupServiceImpl.java
  48. 84 0
      industry-system/industry-da/src/main/java/com/example/opc_da/service/impl/SystemServiceImpl.java
  49. 19 0
      industry-system/industry-da/src/main/java/com/example/opc_da/service/impl/TrafficChartServiceImpl.java
  50. 12 8
      industry-system/industry-da/src/main/resources/mapper/DeviceLedgerDao.xml
  51. 18 0
      industry-system/industry-da/src/main/resources/mapper/SystemDao.xml
  52. 1 1
      industry-system/industry-da/src/main/resources/static/page/index.html
  53. 0 0
      industry-system/industry-da/src/main/resources/static/page/static/js/app.7aa6b13b.js
  54. 0 0
      industry-system/industry-da/src/main/resources/static/page/static/js/chunk-3ead4208.303a87bb.js
  55. 0 0
      industry-system/industry-da/src/main/resources/static/page/static/js/chunk-79903d7d.6593b48e.js
  56. 0 0
      industry-system/industry-da/src/main/resources/static/page/static/js/chunk-df471c44.07450a07.js
  57. 0 0
      industry-system/industry-da/src/main/resources/static/page/static/js/chunk-eba4d76c.45d9a77d.js

+ 38 - 0
industry-admin/src/api/system/system.js

@@ -0,0 +1,38 @@
+import request from '@/utils/request'
+
+/**
+ * 更新注册码
+ * @param data
+ * @returns {AxiosPromise}
+ */
+export function registerCode(data) {
+    return request({
+        url: '/system/registerCode',
+        method: 'post',
+        params: data
+    })
+}
+
+/**
+ * 获取子码
+ * @param query
+ * @returns {AxiosPromise}
+ */
+export function getCode() {
+    return request({
+        url: '/system/getCode',
+        method: 'get'
+    })
+}
+
+/**
+ * 验证注册码
+ * @param query
+ * @returns {AxiosPromise}
+ */
+export function validityCode() {
+    return request({
+        url: '/system/validityCode',
+        method: 'get'
+    })
+}

+ 90 - 3
industry-admin/src/views/login/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="login-container">
-    <div class="login-div" v-if="isLoginShow && isLoadingStatus">
+    <div class="login-div" v-if="isLoginShow && isLoadingStatus&&isRegister">
       <el-form
         ref="loginForm"
         :model="loginForm"
@@ -86,7 +86,7 @@
         </el-button>
       </el-form>
     </div>
-    <div class="login-div" v-if="!isLoginShow && isLoadingStatus">
+    <div class="login-div" v-if="!isLoginShow && isLoadingStatus&&isRegister">
       <el-form
         ref="fluxForm"
         :model="fluxForm"
@@ -132,6 +132,56 @@
         </el-button>
       </el-form>
     </div>
+
+    <!-- 注册码 -->
+    <div class="login-div" v-if="!isRegister">
+      <el-form
+        ref="codeForm"
+        :model="codeForm"
+         class="code-form"
+        autocomplete="on"
+        label-position="right"
+        label-width="80px"
+      >
+        <div class="title-container">
+          <h3 class="title">注册</h3>
+        </div>
+        <el-row>
+          <el-col :span=20>
+            <el-form-item label="子码">
+              <el-input readonly type="textarea" v-model="codeForm.subcode"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span=4>
+            <el-button
+              :loading="loading"
+              type="primary"
+              style="width:100%; margin-top: 5px;"
+              @click.native.prevent="getSubcode"
+            >
+              获取子码
+            </el-button>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span=20>
+            <el-form-item label="注册码" prop="code">
+              <el-input type="textarea" v-model="codeForm.code" placeholder="请输入注册码"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span=4>
+            <el-button
+              :loading="loading"
+              type="primary"
+              style="width:100%; margin-top: 5px;"
+              @click.native.prevent="handleSaveCodeInfo"
+            >
+              提交
+            </el-button>
+          </el-col>
+      </el-row>
+      </el-form>
+    </div>
   </div>
 </template>
 
@@ -139,6 +189,7 @@
 import { Message } from 'element-ui'
 import errorCode from '@/utils/errorCode'
 import {getInfoCount, saveInFluxDBInfo} from "@/api/user";
+import {getCode,registerCode, validityCode} from "@/api/system/system"
 
 export default {
   name: 'Login',
@@ -146,6 +197,7 @@ export default {
     return {
       isLoginShow: false,
       isLoadingStatus: false,
+      isRegister: false,
       fluxForm: {
         subType: 0,
         url: '',
@@ -226,7 +278,11 @@ export default {
       // 验证码开关
       captchaEnabled: true,
       redirect: undefined,
-      otherQuery: {}
+      otherQuery: {},
+      codeForm:{
+        subcode:null,
+        code:null
+      }
     }
   },
   computed: {
@@ -250,6 +306,11 @@ export default {
     }
   },
   created() {
+    validityCode().then(res=>{
+      if(res.code==200){
+        this.isRegister = true
+      }
+    })
     getInfoCount().then((json) => {
       this.isLoadingStatus = true;
       this.isLoginShow = json.data == 1;
@@ -338,6 +399,26 @@ export default {
         }
       })
     },
+    /** 提交注册码 */
+    handleSaveCodeInfo(){
+      registerCode({code:this.codeForm.code}).then((res)=>{
+        if(res.code==200){
+          this.$message({
+              message: '注册成功!',
+              type: 'success'
+          })
+          this.isRegister = true
+        }
+      })
+    },
+    /** 获取子码 */
+    getSubcode(){
+      getCode().then((res)=>{
+        if(res.data){
+          this.codeForm.subcode=res.data
+        }
+      })
+    }
   }
 }
 </script>
@@ -366,6 +447,12 @@ $dark_gray: #889aa4;
     width: 600px;
     padding: 25px 25px 5px 25px
   }
+  .code-form{
+    border-radius: 6px;
+    background: #ffffff;
+    width: 800px;
+    padding: 25px 25px 5px 25px
+  }
   .login-form {
     border-radius: 6px;
     background: #ffffff;

+ 1 - 1
industry-admin/src/views/source/dataQuery/chooseItem.vue

@@ -245,7 +245,7 @@ export default {
             }
             if (this.selectedItemList.length > 8) {
                 this.$message({
-                    message: '最多选择8个数据项查看实时数据!',
+                    message: '最多选择8个数据项查看数据!',
                     type: 'warning'
                 });
                 return;

+ 6 - 2
industry-admin/src/views/source/dataQuery/index.vue

@@ -349,7 +349,7 @@ export default {
                 }
 
                 //时间往前推一秒,防止数据没拿到
-                let currentTime = new Date().getTime()-1000
+                let currentTime = new Date().getTime() - 1000
                 this.count = this.timeCalculation(this.chartForm.timeValue, this.chartForm.timeType)
                 this.chooseStartTime = parseTime(new Date(currentTime - this.count))
                 this.chooseEndTime = parseTime(currentTime)
@@ -460,6 +460,7 @@ export default {
                         //是否平滑曲线
                         smooth: true,
                         yAxisIndex: n,
+                        //标记图形。图形大小
                         symbol: 'circle',
                         symbolSize: 5,
                         //是否显示线上点
@@ -514,8 +515,10 @@ export default {
                 this.legend.data = legendData
                 this.xAxis.data = xAxisData.filter((item, index) => xAxisData.indexOf(item) === index).sort()
                 this.grid.left = data.length + '%'
+                this.grid.left = data.length * 40
                 this.yAxis = yAxisData
                 this.series = seriesData
+                console.log(this.yAxis)
                 this.chart.setOption({
                     backgroundColor: this.backgroundColor,
                     // title: this.title,
@@ -580,7 +583,7 @@ export default {
             this.timer = setInterval(() => {
                 this.chooseStartTime = this.chooseEndTime
                 //时间往前推一秒,防止数据没拿到
-                this.chooseEndTime = parseTime(new Date().getTime()-1000)
+                this.chooseEndTime = parseTime(new Date().getTime() - 1000)
                 this.updateChartData()
             }, this.timeCalculation(this.chartForm.frequencyValue, this.chartForm.frequencyType))
         },
@@ -694,6 +697,7 @@ export default {
                 startTime: startTime,
                 endTime: endTime,
                 type: type,
+                trendType: trendType
             }
             let params = qs.stringify(param, { arrayFormat: 'repeat' })
             axios({

+ 33 - 0
industry-code/.gitignore

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

BIN
industry-code/.mvn/wrapper/maven-wrapper.jar


+ 2 - 0
industry-code/.mvn/wrapper/maven-wrapper.properties

@@ -0,0 +1,2 @@
+distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip
+wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar

+ 308 - 0
industry-code/mvnw

@@ -0,0 +1,308 @@
+#!/bin/sh
+# ----------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#    https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# ----------------------------------------------------------------------------
+
+# ----------------------------------------------------------------------------
+# Apache Maven Wrapper startup batch script, version 3.2.0
+#
+# Required ENV vars:
+# ------------------
+#   JAVA_HOME - location of a JDK home dir
+#
+# Optional ENV vars
+# -----------------
+#   MAVEN_OPTS - parameters passed to the Java VM when running Maven
+#     e.g. to debug Maven itself, use
+#       set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+#   MAVEN_SKIP_RC - flag to disable loading of mavenrc files
+# ----------------------------------------------------------------------------
+
+if [ -z "$MAVEN_SKIP_RC" ] ; then
+
+  if [ -f /usr/local/etc/mavenrc ] ; then
+    . /usr/local/etc/mavenrc
+  fi
+
+  if [ -f /etc/mavenrc ] ; then
+    . /etc/mavenrc
+  fi
+
+  if [ -f "$HOME/.mavenrc" ] ; then
+    . "$HOME/.mavenrc"
+  fi
+
+fi
+
+# OS specific support.  $var _must_ be set to either true or false.
+cygwin=false;
+darwin=false;
+mingw=false
+case "$(uname)" in
+  CYGWIN*) cygwin=true ;;
+  MINGW*) mingw=true;;
+  Darwin*) darwin=true
+    # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
+    # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
+    if [ -z "$JAVA_HOME" ]; then
+      if [ -x "/usr/libexec/java_home" ]; then
+        JAVA_HOME="$(/usr/libexec/java_home)"; export JAVA_HOME
+      else
+        JAVA_HOME="/Library/Java/Home"; export JAVA_HOME
+      fi
+    fi
+    ;;
+esac
+
+if [ -z "$JAVA_HOME" ] ; then
+  if [ -r /etc/gentoo-release ] ; then
+    JAVA_HOME=$(java-config --jre-home)
+  fi
+fi
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched
+if $cygwin ; then
+  [ -n "$JAVA_HOME" ] &&
+    JAVA_HOME=$(cygpath --unix "$JAVA_HOME")
+  [ -n "$CLASSPATH" ] &&
+    CLASSPATH=$(cygpath --path --unix "$CLASSPATH")
+fi
+
+# For Mingw, ensure paths are in UNIX format before anything is touched
+if $mingw ; then
+  [ -n "$JAVA_HOME" ] && [ -d "$JAVA_HOME" ] &&
+    JAVA_HOME="$(cd "$JAVA_HOME" || (echo "cannot cd into $JAVA_HOME."; exit 1); pwd)"
+fi
+
+if [ -z "$JAVA_HOME" ]; then
+  javaExecutable="$(which javac)"
+  if [ -n "$javaExecutable" ] && ! [ "$(expr "\"$javaExecutable\"" : '\([^ ]*\)')" = "no" ]; then
+    # readlink(1) is not available as standard on Solaris 10.
+    readLink=$(which readlink)
+    if [ ! "$(expr "$readLink" : '\([^ ]*\)')" = "no" ]; then
+      if $darwin ; then
+        javaHome="$(dirname "\"$javaExecutable\"")"
+        javaExecutable="$(cd "\"$javaHome\"" && pwd -P)/javac"
+      else
+        javaExecutable="$(readlink -f "\"$javaExecutable\"")"
+      fi
+      javaHome="$(dirname "\"$javaExecutable\"")"
+      javaHome=$(expr "$javaHome" : '\(.*\)/bin')
+      JAVA_HOME="$javaHome"
+      export JAVA_HOME
+    fi
+  fi
+fi
+
+if [ -z "$JAVACMD" ] ; then
+  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
+  else
+    JAVACMD="$(\unset -f command 2>/dev/null; \command -v java)"
+  fi
+fi
+
+if [ ! -x "$JAVACMD" ] ; then
+  echo "Error: JAVA_HOME is not defined correctly." >&2
+  echo "  We cannot execute $JAVACMD" >&2
+  exit 1
+fi
+
+if [ -z "$JAVA_HOME" ] ; then
+  echo "Warning: JAVA_HOME environment variable is not set."
+fi
+
+# traverses directory structure from process work directory to filesystem root
+# first directory with .mvn subdirectory is considered project base directory
+find_maven_basedir() {
+  if [ -z "$1" ]
+  then
+    echo "Path not specified to find_maven_basedir"
+    return 1
+  fi
+
+  basedir="$1"
+  wdir="$1"
+  while [ "$wdir" != '/' ] ; do
+    if [ -d "$wdir"/.mvn ] ; then
+      basedir=$wdir
+      break
+    fi
+    # workaround for JBEAP-8937 (on Solaris 10/Sparc)
+    if [ -d "${wdir}" ]; then
+      wdir=$(cd "$wdir/.." || exit 1; pwd)
+    fi
+    # end of workaround
+  done
+  printf '%s' "$(cd "$basedir" || exit 1; pwd)"
+}
+
+# concatenates all lines of a file
+concat_lines() {
+  if [ -f "$1" ]; then
+    # Remove \r in case we run on Windows within Git Bash
+    # and check out the repository with auto CRLF management
+    # enabled. Otherwise, we may read lines that are delimited with
+    # \r\n and produce $'-Xarg\r' rather than -Xarg due to word
+    # splitting rules.
+    tr -s '\r\n' ' ' < "$1"
+  fi
+}
+
+log() {
+  if [ "$MVNW_VERBOSE" = true ]; then
+    printf '%s\n' "$1"
+  fi
+}
+
+BASE_DIR=$(find_maven_basedir "$(dirname "$0")")
+if [ -z "$BASE_DIR" ]; then
+  exit 1;
+fi
+
+MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}; export MAVEN_PROJECTBASEDIR
+log "$MAVEN_PROJECTBASEDIR"
+
+##########################################################################################
+# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+# This allows using the maven wrapper in projects that prohibit checking in binary data.
+##########################################################################################
+wrapperJarPath="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar"
+if [ -r "$wrapperJarPath" ]; then
+    log "Found $wrapperJarPath"
+else
+    log "Couldn't find $wrapperJarPath, downloading it ..."
+
+    if [ -n "$MVNW_REPOURL" ]; then
+      wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
+    else
+      wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
+    fi
+    while IFS="=" read -r key value; do
+      # Remove '\r' from value to allow usage on windows as IFS does not consider '\r' as a separator ( considers space, tab, new line ('\n'), and custom '=' )
+      safeValue=$(echo "$value" | tr -d '\r')
+      case "$key" in (wrapperUrl) wrapperUrl="$safeValue"; break ;;
+      esac
+    done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties"
+    log "Downloading from: $wrapperUrl"
+
+    if $cygwin; then
+      wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath")
+    fi
+
+    if command -v wget > /dev/null; then
+        log "Found wget ... using wget"
+        [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--quiet"
+        if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
+            wget $QUIET "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
+        else
+            wget $QUIET --http-user="$MVNW_USERNAME" --http-password="$MVNW_PASSWORD" "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
+        fi
+    elif command -v curl > /dev/null; then
+        log "Found curl ... using curl"
+        [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--silent"
+        if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
+            curl $QUIET -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath"
+        else
+            curl $QUIET --user "$MVNW_USERNAME:$MVNW_PASSWORD" -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath"
+        fi
+    else
+        log "Falling back to using Java to download"
+        javaSource="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.java"
+        javaClass="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.class"
+        # For Cygwin, switch paths to Windows format before running javac
+        if $cygwin; then
+          javaSource=$(cygpath --path --windows "$javaSource")
+          javaClass=$(cygpath --path --windows "$javaClass")
+        fi
+        if [ -e "$javaSource" ]; then
+            if [ ! -e "$javaClass" ]; then
+                log " - Compiling MavenWrapperDownloader.java ..."
+                ("$JAVA_HOME/bin/javac" "$javaSource")
+            fi
+            if [ -e "$javaClass" ]; then
+                log " - Running MavenWrapperDownloader.java ..."
+                ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$wrapperUrl" "$wrapperJarPath") || rm -f "$wrapperJarPath"
+            fi
+        fi
+    fi
+fi
+##########################################################################################
+# End of extension
+##########################################################################################
+
+# If specified, validate the SHA-256 sum of the Maven wrapper jar file
+wrapperSha256Sum=""
+while IFS="=" read -r key value; do
+  case "$key" in (wrapperSha256Sum) wrapperSha256Sum=$value; break ;;
+  esac
+done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties"
+if [ -n "$wrapperSha256Sum" ]; then
+  wrapperSha256Result=false
+  if command -v sha256sum > /dev/null; then
+    if echo "$wrapperSha256Sum  $wrapperJarPath" | sha256sum -c > /dev/null 2>&1; then
+      wrapperSha256Result=true
+    fi
+  elif command -v shasum > /dev/null; then
+    if echo "$wrapperSha256Sum  $wrapperJarPath" | shasum -a 256 -c > /dev/null 2>&1; then
+      wrapperSha256Result=true
+    fi
+  else
+    echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available."
+    echo "Please install either command, or disable validation by removing 'wrapperSha256Sum' from your maven-wrapper.properties."
+    exit 1
+  fi
+  if [ $wrapperSha256Result = false ]; then
+    echo "Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised." >&2
+    echo "Investigate or delete $wrapperJarPath to attempt a clean download." >&2
+    echo "If you updated your Maven version, you need to update the specified wrapperSha256Sum property." >&2
+    exit 1
+  fi
+fi
+
+MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin; then
+  [ -n "$JAVA_HOME" ] &&
+    JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME")
+  [ -n "$CLASSPATH" ] &&
+    CLASSPATH=$(cygpath --path --windows "$CLASSPATH")
+  [ -n "$MAVEN_PROJECTBASEDIR" ] &&
+    MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR")
+fi
+
+# Provide a "standardized" way to retrieve the CLI args that will
+# work with both Windows and non-Windows executions.
+MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*"
+export MAVEN_CMD_LINE_ARGS
+
+WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
+
+# shellcheck disable=SC2086 # safe args
+exec "$JAVACMD" \
+  $MAVEN_OPTS \
+  $MAVEN_DEBUG_OPTS \
+  -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
+  "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
+  ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

+ 205 - 0
industry-code/mvnw.cmd

@@ -0,0 +1,205 @@
+@REM ----------------------------------------------------------------------------
+@REM Licensed to the Apache Software Foundation (ASF) under one
+@REM or more contributor license agreements.  See the NOTICE file
+@REM distributed with this work for additional information
+@REM regarding copyright ownership.  The ASF licenses this file
+@REM to you under the Apache License, Version 2.0 (the
+@REM "License"); you may not use this file except in compliance
+@REM with the License.  You may obtain a copy of the License at
+@REM
+@REM    https://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing,
+@REM software distributed under the License is distributed on an
+@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+@REM KIND, either express or implied.  See the License for the
+@REM specific language governing permissions and limitations
+@REM under the License.
+@REM ----------------------------------------------------------------------------
+
+@REM ----------------------------------------------------------------------------
+@REM Apache Maven Wrapper startup batch script, version 3.2.0
+@REM
+@REM Required ENV vars:
+@REM JAVA_HOME - location of a JDK home dir
+@REM
+@REM Optional ENV vars
+@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
+@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
+@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
+@REM     e.g. to debug Maven itself, use
+@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
+@REM ----------------------------------------------------------------------------
+
+@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
+@echo off
+@REM set title of command window
+title %0
+@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
+@if "%MAVEN_BATCH_ECHO%" == "on"  echo %MAVEN_BATCH_ECHO%
+
+@REM set %HOME% to equivalent of $HOME
+if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
+
+@REM Execute a user defined script before this one
+if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
+@REM check for pre script, once with legacy .bat ending and once with .cmd ending
+if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %*
+if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %*
+:skipRcPre
+
+@setlocal
+
+set ERROR_CODE=0
+
+@REM To isolate internal variables from possible post scripts, we use another setlocal
+@setlocal
+
+@REM ==== START VALIDATION ====
+if not "%JAVA_HOME%" == "" goto OkJHome
+
+echo.
+echo Error: JAVA_HOME not found in your environment. >&2
+echo Please set the JAVA_HOME variable in your environment to match the >&2
+echo location of your Java installation. >&2
+echo.
+goto error
+
+:OkJHome
+if exist "%JAVA_HOME%\bin\java.exe" goto init
+
+echo.
+echo Error: JAVA_HOME is set to an invalid directory. >&2
+echo JAVA_HOME = "%JAVA_HOME%" >&2
+echo Please set the JAVA_HOME variable in your environment to match the >&2
+echo location of your Java installation. >&2
+echo.
+goto error
+
+@REM ==== END VALIDATION ====
+
+:init
+
+@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
+@REM Fallback to current working directory if not found.
+
+set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
+IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
+
+set EXEC_DIR=%CD%
+set WDIR=%EXEC_DIR%
+:findBaseDir
+IF EXIST "%WDIR%"\.mvn goto baseDirFound
+cd ..
+IF "%WDIR%"=="%CD%" goto baseDirNotFound
+set WDIR=%CD%
+goto findBaseDir
+
+:baseDirFound
+set MAVEN_PROJECTBASEDIR=%WDIR%
+cd "%EXEC_DIR%"
+goto endDetectBaseDir
+
+:baseDirNotFound
+set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
+cd "%EXEC_DIR%"
+
+:endDetectBaseDir
+
+IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
+
+@setlocal EnableExtensions EnableDelayedExpansion
+for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
+@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
+
+:endReadAdditionalConfig
+
+SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
+set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
+set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
+
+set WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
+
+FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
+    IF "%%A"=="wrapperUrl" SET WRAPPER_URL=%%B
+)
+
+@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
+if exist %WRAPPER_JAR% (
+    if "%MVNW_VERBOSE%" == "true" (
+        echo Found %WRAPPER_JAR%
+    )
+) else (
+    if not "%MVNW_REPOURL%" == "" (
+        SET WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
+    )
+    if "%MVNW_VERBOSE%" == "true" (
+        echo Couldn't find %WRAPPER_JAR%, downloading it ...
+        echo Downloading from: %WRAPPER_URL%
+    )
+
+    powershell -Command "&{"^
+		"$webclient = new-object System.Net.WebClient;"^
+		"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
+		"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
+		"}"^
+		"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%WRAPPER_URL%', '%WRAPPER_JAR%')"^
+		"}"
+    if "%MVNW_VERBOSE%" == "true" (
+        echo Finished downloading %WRAPPER_JAR%
+    )
+)
+@REM End of extension
+
+@REM If specified, validate the SHA-256 sum of the Maven wrapper jar file
+SET WRAPPER_SHA_256_SUM=""
+FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
+    IF "%%A"=="wrapperSha256Sum" SET WRAPPER_SHA_256_SUM=%%B
+)
+IF NOT %WRAPPER_SHA_256_SUM%=="" (
+    powershell -Command "&{"^
+       "$hash = (Get-FileHash \"%WRAPPER_JAR%\" -Algorithm SHA256).Hash.ToLower();"^
+       "If('%WRAPPER_SHA_256_SUM%' -ne $hash){"^
+       "  Write-Output 'Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised.';"^
+       "  Write-Output 'Investigate or delete %WRAPPER_JAR% to attempt a clean download.';"^
+       "  Write-Output 'If you updated your Maven version, you need to update the specified wrapperSha256Sum property.';"^
+       "  exit 1;"^
+       "}"^
+       "}"
+    if ERRORLEVEL 1 goto error
+)
+
+@REM Provide a "standardized" way to retrieve the CLI args that will
+@REM work with both Windows and non-Windows executions.
+set MAVEN_CMD_LINE_ARGS=%*
+
+%MAVEN_JAVA_EXE% ^
+  %JVM_CONFIG_MAVEN_PROPS% ^
+  %MAVEN_OPTS% ^
+  %MAVEN_DEBUG_OPTS% ^
+  -classpath %WRAPPER_JAR% ^
+  "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^
+  %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
+if ERRORLEVEL 1 goto error
+goto end
+
+:error
+set ERROR_CODE=1
+
+:end
+@endlocal & set ERROR_CODE=%ERROR_CODE%
+
+if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost
+@REM check for post script, once with legacy .bat ending and once with .cmd ending
+if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat"
+if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd"
+:skipRcPost
+
+@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
+if "%MAVEN_BATCH_PAUSE%"=="on" pause
+
+if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE%
+
+cmd /C exit /B %ERROR_CODE%

+ 59 - 0
industry-code/pom.xml

@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-parent</artifactId>
+        <version>2.3.4.RELEASE</version>
+        <relativePath/> <!-- lookup parent from repository -->
+    </parent>
+    <groupId>com.example</groupId>
+    <artifactId>industry-code</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <name>industry-code</name>
+    <description>industry-code</description>
+    <properties>
+        <java.version>1.8</java.version>
+    </properties>
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>5.5.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <configuration>
+                    <excludes>
+                        <exclude>
+                            <groupId>org.projectlombok</groupId>
+                            <artifactId>lombok</artifactId>
+                        </exclude>
+                    </excludes>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

+ 13 - 0
industry-code/src/main/java/com/example/industrycode/IndustryCodeApplication.java

@@ -0,0 +1,13 @@
+package com.example.industrycode;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class IndustryCodeApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(IndustryCodeApplication.class, args);
+    }
+
+}

+ 55 - 0
industry-code/src/main/java/com/example/industrycode/controller/SystemController.java

@@ -0,0 +1,55 @@
+package com.example.industrycode.controller;
+
+import com.example.industrycode.util.RSAUtil;
+import com.example.industrycode.util.Result;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.util.StringUtils;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/**
+ * 系统信息
+ */
+@RestController
+@RequestMapping("system")
+@Slf4j
+public class SystemController {
+
+    /**
+     * 生成注册码
+     *
+     * @param validityPeriod 有效期
+     * @param code           子码
+     * @return
+     */
+    @RequestMapping(value = "/generateCode", method = RequestMethod.POST)
+    public Result generateCode(String validityPeriod, String code) {
+        if (StringUtils.isEmpty(validityPeriod)) {
+            return Result.no(500, "有效期不能为空");
+        }
+        if (StringUtils.isEmpty(code)) {
+            return Result.no(500, "子码不能为空");
+        }
+        if (validityPeriod.length() != 19) {
+            return Result.no(500, "有效期格式不正确");
+        }
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date date = null;
+        try {
+            date = sdf.parse(validityPeriod);
+        } catch (Exception e) {
+            return Result.no(500, "有效期格式不正确");
+        }
+        try {
+            code = RSAUtil.decrypt(code, "UTF-8");
+        } catch (Exception e) {
+            return Result.no(500, "子码不正确");
+        }
+        return Result.ok(RSAUtil.encryptByPublic(validityPeriod + code, RSAUtil.PUBLIC_KEY));
+    }
+
+}

+ 358 - 0
industry-code/src/main/java/com/example/industrycode/util/Base64Util.java

@@ -0,0 +1,358 @@
+package com.example.industrycode.util;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class Base64Util {
+
+	private static final int BASELENGTH = 128;
+	private static final int LOOKUPLENGTH = 64;
+	private static final int TWENTYFOURBITGROUP = 24;
+	private static final int EIGHTBIT = 8;
+	private static final int SIXTEENBIT = 16;
+	private static final int FOURBYTE = 4;
+	private static final int SIGN = -128;
+	private static final char PAD = '=';
+	private static final boolean fDebug = false;
+	private static final byte[] base64Alphabet = new byte[BASELENGTH];
+	private static final char[] lookUpBase64Alphabet = new char[LOOKUPLENGTH];
+
+	static {
+		for (int i = 0; i < BASELENGTH; ++i) {
+			base64Alphabet[i] = -1;
+		}
+		for (int i = 'Z'; i >= 'A'; i--) {
+			base64Alphabet[i] = (byte) (i - 'A');
+		}
+		for (int i = 'z'; i >= 'a'; i--) {
+			base64Alphabet[i] = (byte) (i - 'a' + 26);
+		}
+		for (int i = '9'; i >= '0'; i--) {
+			base64Alphabet[i] = (byte) (i - '0' + 52);
+		}
+		base64Alphabet['+'] = 62;
+		base64Alphabet['/'] = 63;
+		for (int i = 0; i <= 25; i++) {
+			lookUpBase64Alphabet[i] = (char) ('A' + i);
+		}
+		for (int i = 26, j = 0; i <= 51; i++, j++) {
+			lookUpBase64Alphabet[i] = (char) ('a' + j);
+		}
+		for (int i = 52, j = 0; i <= 61; i++, j++) {
+			lookUpBase64Alphabet[i] = (char) ('0' + j);
+		}
+		lookUpBase64Alphabet[62] = (char) '+';
+		lookUpBase64Alphabet[63] = (char) '/';
+
+	}
+
+	private static boolean isWhiteSpace(char octect) {
+		return (octect == 0x20 || octect == 0xd || octect == 0xa || octect == 0x9);
+	}
+
+	private static boolean isPad(char octect) {
+		return (octect == PAD);
+	}
+
+	private static boolean isData(char octect) {
+		return (octect < BASELENGTH && base64Alphabet[octect] != -1);
+	}
+
+	/**
+	 * Encodes hex octects into Base64
+	 *
+	 * @param binaryData Array containing binaryData
+	 * @return Encoded Base64 array
+	 */
+	public static String encode(byte[] binaryData) {
+		if (binaryData == null) {
+			return null;
+		}
+		int lengthDataBits = binaryData.length * EIGHTBIT;
+		if (lengthDataBits == 0) {
+			return "";
+		}
+		int fewerThan24bits = lengthDataBits % TWENTYFOURBITGROUP;
+		int numberTriplets = lengthDataBits / TWENTYFOURBITGROUP;
+		int numberQuartet = fewerThan24bits != 0 ? numberTriplets + 1 : numberTriplets;
+		char encodedData[] = null;
+		encodedData = new char[numberQuartet * 4];
+		byte k = 0, l = 0, b1 = 0, b2 = 0, b3 = 0;
+		int encodedIndex = 0;
+		int dataIndex = 0;
+		if (fDebug) {
+			System.out.println("number of triplets = " + numberTriplets);
+		}
+		for (int i = 0; i < numberTriplets; i++) {
+			b1 = binaryData[dataIndex++];
+			b2 = binaryData[dataIndex++];
+			b3 = binaryData[dataIndex++];
+			if (fDebug) {
+				System.out.println("b1= " + b1 + ", b2= " + b2 + ", b3= " + b3);
+			}
+			l = (byte) (b2 & 0x0f);
+			k = (byte) (b1 & 0x03);
+			byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0);
+			byte val2 = ((b2 & SIGN) == 0) ? (byte) (b2 >> 4) : (byte) ((b2) >> 4 ^ 0xf0);
+			byte val3 = ((b3 & SIGN) == 0) ? (byte) (b3 >> 6) : (byte) ((b3) >> 6 ^ 0xfc);
+			if (fDebug) {
+				System.out.println("val2 = " + val2);
+				System.out.println("k4   = " + (k << 4));
+				System.out.println("vak  = " + (val2 | (k << 4)));
+			}
+			encodedData[encodedIndex++] = lookUpBase64Alphabet[val1];
+			encodedData[encodedIndex++] = lookUpBase64Alphabet[val2 | (k << 4)];
+			encodedData[encodedIndex++] = lookUpBase64Alphabet[(l << 2) | val3];
+			encodedData[encodedIndex++] = lookUpBase64Alphabet[b3 & 0x3f];
+		}
+
+		// form integral number of 6-bit groups
+		if (fewerThan24bits == EIGHTBIT) {
+			b1 = binaryData[dataIndex];
+			k = (byte) (b1 & 0x03);
+			if (fDebug) {
+				System.out.println("b1=" + b1);
+				System.out.println("b1<<2 = " + (b1 >> 2));
+			}
+			byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0);
+			encodedData[encodedIndex++] = lookUpBase64Alphabet[val1];
+			encodedData[encodedIndex++] = lookUpBase64Alphabet[k << 4];
+			encodedData[encodedIndex++] = PAD;
+			encodedData[encodedIndex++] = PAD;
+		} else if (fewerThan24bits == SIXTEENBIT) {
+			b1 = binaryData[dataIndex];
+			b2 = binaryData[dataIndex + 1];
+			l = (byte) (b2 & 0x0f);
+			k = (byte) (b1 & 0x03);
+			byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0);
+			byte val2 = ((b2 & SIGN) == 0) ? (byte) (b2 >> 4) : (byte) ((b2) >> 4 ^ 0xf0);
+			encodedData[encodedIndex++] = lookUpBase64Alphabet[val1];
+			encodedData[encodedIndex++] = lookUpBase64Alphabet[val2 | (k << 4)];
+			encodedData[encodedIndex++] = lookUpBase64Alphabet[l << 2];
+			encodedData[encodedIndex++] = PAD;
+		}
+		return new String(encodedData);
+	}
+
+	/**
+	 * Decodes Base64 data into octects
+	 *
+	 * @param encoded string containing Base64 data
+	 * @return Array containind decoded data.
+	 */
+	public static byte[] decode(String encoded) {
+		if (encoded == null) {
+			return null;
+		}
+		char[] base64Data = encoded.toCharArray();
+		// remove white spaces
+		int len = removeWhiteSpace(base64Data);
+		if (len % FOURBYTE != 0) {
+			return null;// should be divisible by four
+		}
+		int numberQuadruple = (len / FOURBYTE);
+		if (numberQuadruple == 0) {
+			return new byte[0];
+		}
+		byte decodedData[] = null;
+		byte b1 = 0, b2 = 0, b3 = 0, b4 = 0;
+		char d1 = 0, d2 = 0, d3 = 0, d4 = 0;
+		int i = 0;
+		int encodedIndex = 0;
+		int dataIndex = 0;
+		decodedData = new byte[(numberQuadruple) * 3];
+		for (; i < numberQuadruple - 1; i++) {
+			if (!isData((d1 = base64Data[dataIndex++])) || !isData((d2 = base64Data[dataIndex++]))
+					|| !isData((d3 = base64Data[dataIndex++])) || !isData((d4 = base64Data[dataIndex++]))) {
+				return null;
+			} // if found "no data" just return null
+			b1 = base64Alphabet[d1];
+			b2 = base64Alphabet[d2];
+			b3 = base64Alphabet[d3];
+			b4 = base64Alphabet[d4];
+			decodedData[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);
+			decodedData[encodedIndex++] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
+			decodedData[encodedIndex++] = (byte) (b3 << 6 | b4);
+		}
+		if (!isData((d1 = base64Data[dataIndex++])) || !isData((d2 = base64Data[dataIndex++]))) {
+			return null;// if found "no data" just return null
+		}
+		b1 = base64Alphabet[d1];
+		b2 = base64Alphabet[d2];
+		d3 = base64Data[dataIndex++];
+		d4 = base64Data[dataIndex++];
+		if (!isData((d3)) || !isData((d4))) {// Check if they are PAD characters
+			if (isPad(d3) && isPad(d4)) {
+				if ((b2 & 0xf) != 0)// last 4 bits should be zero
+				{
+					return null;
+				}
+				byte[] tmp = new byte[i * 3 + 1];
+				System.arraycopy(decodedData, 0, tmp, 0, i * 3);
+				tmp[encodedIndex] = (byte) (b1 << 2 | b2 >> 4);
+				return tmp;
+			} else if (!isPad(d3) && isPad(d4)) {
+				b3 = base64Alphabet[d3];
+				if ((b3 & 0x3) != 0)// last 2 bits should be zero
+				{
+					return null;
+				}
+				byte[] tmp = new byte[i * 3 + 2];
+				System.arraycopy(decodedData, 0, tmp, 0, i * 3);
+				tmp[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);
+				tmp[encodedIndex] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
+				return tmp;
+			} else {
+				return null;
+			}
+		} else { // No PAD e.g 3cQl
+			b3 = base64Alphabet[d3];
+			b4 = base64Alphabet[d4];
+			decodedData[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);
+			decodedData[encodedIndex++] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
+			decodedData[encodedIndex++] = (byte) (b3 << 6 | b4);
+		}
+
+		return decodedData;
+	}
+
+	/**
+	 * remove WhiteSpace from MIME containing encoded Base64 data.
+	 *
+	 * @param data the byte array of base64 data (with WS)
+	 * @return the new length
+	 */
+	private static int removeWhiteSpace(char[] data) {
+		if (data == null) {
+			return 0;
+		}
+		// count characters that's not whitespace
+		int newSize = 0;
+		int len = data.length;
+		for (int i = 0; i < len; i++) {
+			if (!isWhiteSpace(data[i])) {
+				data[newSize++] = data[i];
+			}
+		}
+		return newSize;
+	}
+
+	private static String base64hash = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+
+	/**
+	 * Matcher Check
+	 *
+	 * @param inStr
+	 * @param reg
+	 * @return
+	 */
+	public static boolean isMatcher(String inStr, String reg) {
+		Pattern pattern = Pattern.compile(reg);
+		Matcher matcher = pattern.matcher(inStr);
+		if (matcher.matches()) {
+			return true;
+		}
+		return false;
+	}
+
+	/**
+	 * btoa
+	 *
+	 * @param inStr
+	 * @return
+	 */
+	public static String btoa(String inStr) {
+
+		// if (/([^\u0000-\u00ff])/.test(s)) {
+		// throw new Error('INVALID_CHARACTER_ERR');
+		// }
+		if (inStr == null || isMatcher(inStr, "([^\\u0000-\\u00ff])")) {
+			return null;
+		}
+
+		StringBuilder result = new StringBuilder();
+
+		int i = 0;
+		int mod = 0;
+		int ascii;
+		int prev = 0;
+		while (i < inStr.length()) {
+			ascii = inStr.charAt(i);
+			mod = i % 3;
+
+			switch (mod) {
+			case 0:
+				result.append(String.valueOf(base64hash.charAt(ascii >> 2)));
+				break;
+			case 1:
+
+				result.append(String.valueOf(base64hash.charAt((prev & 3) << 4 | (ascii >> 4))));
+				break;
+			case 2:
+				result.append(String.valueOf(base64hash.charAt((prev & 0x0f) << 2 | (ascii >> 6))));
+				result.append(String.valueOf(base64hash.charAt(ascii & 0x3f)));
+				break;
+
+			}
+
+			prev = ascii;
+			i++;
+		}
+
+		if (mod == 0) {
+			result.append(String.valueOf(base64hash.charAt((prev & 3) << 4)));
+			result.append("==");
+		} else if (mod == 1) {
+			result.append(String.valueOf(base64hash.charAt((prev & 0x0f) << 2)));
+			result.append("=");
+		}
+
+		return result.toString();
+	}
+
+	/**
+	 * atob
+	 *
+	 * @param inStr
+	 * @return
+	 */
+	public static String atob(String inStr) {
+		if (inStr == null)
+			return null;
+		// s = s.replace(/\s|=/g, '');
+		inStr = inStr.replaceAll("\\s|=", "");
+		StringBuilder result = new StringBuilder();
+
+		int cur;
+		int prev = -1;
+		// Integer prev=null;
+		int mod;
+		int i = 0;
+
+		while (i < inStr.length()) {
+			cur = base64hash.indexOf(inStr.charAt(i));
+			mod = i % 4;
+			switch (mod) {
+			case 0:
+				break;
+			case 1:
+				result.append(String.valueOf((char) (prev << 2 | cur >> 4)));
+				break;
+			case 2:
+
+				result.append(String.valueOf((char) ((prev & 0x0f) << 4 | cur >> 2)));
+				break;
+			case 3:
+
+				result.append(String.valueOf((char) ((prev & 3) << 6 | cur)));
+				break;
+			}
+
+			prev = cur;
+			i++;
+		}
+
+		return result.toString();
+	}
+
+}

+ 189 - 0
industry-code/src/main/java/com/example/industrycode/util/RSAUtil.java

@@ -0,0 +1,189 @@
+package com.example.industrycode.util;
+
+
+import javax.crypto.Cipher;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.security.KeyFactory;
+import java.security.NoSuchAlgorithmException;
+import java.security.PrivateKey;
+import java.security.PublicKey;
+import java.security.spec.PKCS8EncodedKeySpec;
+import java.security.spec.X509EncodedKeySpec;
+
+public class RSAUtil {
+
+	private static final int MAX_DECRYPT = 256;
+	private static final int MAX_DECRYPT_BLOCK = 245;
+
+	/**
+	 * @Title: decrypt
+	 * @Description: 使用私钥解密
+	 * @author: YJQ
+	 * @date: 2021年4月13日 下午9:27:31
+	 * @returnType String
+	 * @param content
+	 * @param private_key
+	 * @param input_charset
+	 * @return
+	 * @throws Exception
+	 */
+	public static String decrypt(String content, String private_key, String input_charset) throws Exception {
+		PrivateKey prikey = getPrivateKey(private_key);
+		Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");
+		cipher.init(Cipher.DECRYPT_MODE, prikey);
+		InputStream ins = new ByteArrayInputStream(Base64Util.decode(content));
+		ByteArrayOutputStream writer = new ByteArrayOutputStream();
+		byte[] buf = new byte[MAX_DECRYPT];
+		int bufl;
+		while ((bufl = ins.read(buf)) != -1) {
+			byte[] block = null;
+			if (buf.length == bufl) {
+				block = buf;
+			} else {
+				block = new byte[bufl];
+				for (int i = 0; i < bufl; i++) {
+					block[i] = buf[i];
+				}
+			}
+			writer.write(cipher.doFinal(block));
+		}
+		return new String(writer.toByteArray(), input_charset);
+	}
+
+	/**
+	 * @Title: decrypt
+	 * @Description: 使用私钥解密
+	 * @author: YJQ
+	 * @date: 2021年4月13日 下午9:27:41
+	 * @returnType String
+	 * @param content
+	 * @param input_charset
+	 * @return
+	 * @throws Exception
+	 */
+	public static String decrypt(String content, String input_charset) throws Exception {
+		PrivateKey prikey = getPrivateKey(PRIVATE_KEY);
+		Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");
+		cipher.init(Cipher.DECRYPT_MODE, prikey);
+		InputStream ins = new ByteArrayInputStream(Base64Util.decode(content));
+		ByteArrayOutputStream writer = new ByteArrayOutputStream();
+		byte[] buf = new byte[MAX_DECRYPT];
+		int bufl;
+		while ((bufl = ins.read(buf)) != -1) {
+			byte[] block = null;
+			if (buf.length == bufl) {
+				block = buf;
+			} else {
+				block = new byte[bufl];
+				for (int i = 0; i < bufl; i++) {
+					block[i] = buf[i];
+				}
+			}
+			writer.write(cipher.doFinal(block));
+		}
+		return new String(writer.toByteArray(), input_charset);
+	}
+
+	/**
+	 * @Title: getPrivateKey
+	 * @Description: 获得私钥
+	 * @author: YJQ
+	 * @date: 2021年4月13日 下午9:27:53
+	 * @returnType PrivateKey
+	 * @param key
+	 * @return
+	 * @throws Exception
+	 */
+	public static PrivateKey getPrivateKey(String key) throws Exception {
+		byte[] keyBytes;
+		keyBytes = Base64Util.decode(key);
+		PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(keyBytes);
+		KeyFactory keyFactory = KeyFactory.getInstance("RSA");
+		PrivateKey privateKey = keyFactory.generatePrivate(keySpec);
+		return privateKey;
+	}
+
+	/**
+	 * @Title: getPublicKeyFromX509
+	 * @Description: 得到公钥
+	 * @author: YJQ
+	 * @date: 2021年4月13日 下午9:28:00
+	 * @returnType PublicKey
+	 * @param bysKey
+	 * @return
+	 * @throws NoSuchAlgorithmException
+	 * @throws Exception
+	 */
+	private static PublicKey getPublicKeyFromX509(String bysKey) throws NoSuchAlgorithmException, Exception {
+		byte[] decodedKey = Base64Util.decode(bysKey);
+		X509EncodedKeySpec x509 = new X509EncodedKeySpec(decodedKey);
+		KeyFactory keyFactory = KeyFactory.getInstance("RSA");
+		return keyFactory.generatePublic(x509);
+	}
+
+	/**
+	 * @Title: encryptByPublic
+	 * @Description: 使用公钥加密
+	 * @author: YJQ
+	 * @date: 2021年4月13日 下午9:28:07
+	 * @returnType String
+	 * @param content
+	 * @param pub_key
+	 * @return
+	 */
+	public static String encryptByPublic(String content, String pub_key) {
+		try {
+			PublicKey pubkey = getPublicKeyFromX509(pub_key);
+			Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");
+			cipher.init(Cipher.ENCRYPT_MODE, pubkey);
+			// 分段加密
+			byte[] data = content.getBytes("UTF-8");
+			int inputLength = data.length;
+			ByteArrayOutputStream out = new ByteArrayOutputStream();
+			int offset = 0;
+			byte[] cache;
+			int i = 0;
+			while (inputLength - offset > 0) {
+				if (inputLength - offset > MAX_DECRYPT_BLOCK) {
+					cache = cipher.doFinal(data, offset, MAX_DECRYPT_BLOCK);
+				} else {
+					cache = cipher.doFinal(data, offset, inputLength - offset);
+				}
+				out.write(cache);
+				i++;
+				offset = i * MAX_DECRYPT_BLOCK;
+			}
+			byte[] decryptedData = out.toByteArray();
+			out.close();
+			return new String(Base64Util.encode(decryptedData));
+		} catch (Exception e) {
+			e.printStackTrace();
+			return null;
+		}
+	}
+
+	/* 私钥 */
+	public static final String PRIVATE_KEY = "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAJszNAoIzCXk81ZJ\r\n"
+			+ "jmhfwWbW0HxnHSLKnekIyGgkfdgJpXtPe+ca9DSC5J4h2C6liZix0/kVnUcBa3F6\r\n"
+			+ "/H2C6222BObb5PLBqJhfrXry23tOA4PZDRhmtyzwDQHlvFLhJkaaKEp4/Wf5F2b6\r\n"
+			+ "1VJAvGGw35+YD+hHvsTvHQHxfVCbAgMBAAECgYAdNV+/27QAFbyuKp3AivTtE9Sc\r\n"
+			+ "9RMIrzVU3DBLWULN29LnCCh7cBkxoMjB8gCrlr/0mtMX97dn256K9uh5/p+r9R+j\r\n"
+			+ "30TUmLDa0fi0WNXHZ+FitYGdBhtcdaYiDsiDKIe87ItCKH/cfazgUOV9AjqaDlxp\r\n"
+			+ "x6qhsPDosA/O7JidcQJBAMvvI6YUJ2+PKPUKgWZ55JZMpSUAJXmP5OfvFb+hBmst\r\n"
+			+ "ErzVMMhoBUF7g/6NXWDz8fmDiy5s8/c4X742cIxsVScCQQDC0t4B9BTje7PZ+s5Y\r\n"
+			+ "PY1NOLR3xP+3uG89J+7JW87zXEKDHejrR7KNkjb3rWl8NJvdP+6iv1yERu6n/Hcm\r\n"
+			+ "udltAkA0ZHKvJzxeb9Qg6BsIfcZZSsWetOPr0CkJ4SWgPrlMbZ8Dvm2y/u5ivV3S\r\n"
+			+ "1vSnhOSkqsPmIH2pBOWsE4ZkvSw/AkEAjuPf5qjhhTMeZxrXqsqCT4fufQWk1FfW\r\n"
+			+ "ZpFaRp8qez1InygZxC7S25jI7gFnI6zmQHD6kq0tqurncZfuwB2BRQJAc5XbwsEj\r\n"
+			+ "lhvSnGHx2fe9c/BzaM7J575aJLtVPq3NrO3APMTwSGmK1kTiE+13041QHRVN25Ni\r\n"
+			+ "uaqJA3hsfOTwQA==";
+
+	/* 公钥 */
+	public static final String PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCbMzQKCMwl5PNWSY5oX8Fm1tB8\r\n"
+			+ "Zx0iyp3pCMhoJH3YCaV7T3vnGvQ0guSeIdgupYmYsdP5FZ1HAWtxevx9gutttgTm\r\n"
+			+ "2+TywaiYX6168tt7TgOD2Q0YZrcs8A0B5bxS4SZGmihKeP1n+Rdm+tVSQLxhsN+f\r\n"
+			+ "mA/oR77E7x0B8X1QmwIDAQAB";
+
+}

+ 35 - 0
industry-code/src/main/java/com/example/industrycode/util/Result.java

@@ -0,0 +1,35 @@
+package com.example.industrycode.util;
+
+
+import lombok.Data;
+
+@Data
+public class Result {
+    private Integer code;//响应码
+    private String msg;//响应消息
+    private Object data;//返回的数据
+
+    public static Result ok(Object data) {
+        Result result = new Result();
+        result.setCode(200);
+        result.setMsg("");
+        result.setData(data);
+        return result;
+    }
+
+    public static Result ok(Object data, String msg) {
+        Result result = new Result();
+        result.setCode(200);
+        result.setMsg(msg);
+        result.setData(data);
+        return result;
+    }
+
+    public static Result no(Integer code, String msg) {
+        Result result = new Result();
+        result.setCode(code);
+        result.setMsg(msg);
+        return result;
+    }
+
+}

+ 2 - 0
industry-code/src/main/resources/application.yml

@@ -0,0 +1,2 @@
+server:
+  port: 8085

+ 75 - 0
industry-code/src/main/resources/public/index.html

@@ -0,0 +1,75 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <title>Title</title>
+    <link rel="stylesheet" href="./layui/css/layui.css" media="all">
+</head>
+<script src="./layui/layui.js"></script>
+<body>
+<!--<div style="display:flex;justify-content:center;align-items:center;">-->
+<form class="layui-form" action="">
+    <div class="layui-form-item">
+        <label class="layui-form-label">有效期</label>
+        <div class="layui-input-inline">
+            <input type="text" name="validityPeriod" id="validityPeriod" class="layui-input" placeholder="有效期">
+        </div>
+    </div>
+    <div class="layui-form-item layui-form-text">
+        <label class="layui-form-label">子码</label>
+        <div class="layui-input-block">
+            <textarea name="code" placeholder="请输入子码" class="layui-textarea"></textarea>
+        </div>
+    </div>
+    <div class="layui-form-item">
+        <div class="layui-input-block">
+            <button class="layui-btn" lay-submit lay-filter="formDemo">生成注册码</button>
+            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
+        </div>
+    </div>
+</form>
+<div class="layui-form-item layui-form-text">
+    <label class="layui-form-label">注册码</label>
+    <div class="layui-input-block">
+        <textarea readonly="true" id="registerCode" class="layui-textarea"></textarea>
+    </div>
+</div>
+<!--</div>-->
+<script>
+    //Demo
+    layui.use(['element', 'jquery', 'form', 'laydate'], function () {
+        var $ = layui.jquery;
+        var element = layui.element;
+        var laydate = layui.laydate;
+        var form = layui.form;
+
+        //监听提交
+        form.on('submit(formDemo)', function (data) {
+            // layer.msg(JSON.stringify(data.field));
+            //使用ajax发送请求
+            $.ajax({
+                url: "/system/generateCode",
+                type: "post",
+                data: data.field,
+                dataType: "json",
+                success: function (data) {
+                    console.log(data)
+                    if (data.code == 200) {
+                        $("#registerCode").val(data.data)
+                    } else {
+                        layer.msg(data.msg);
+                    }
+                }
+            });
+            return false;  //阻止表单跳转。如果需要表单跳转,去掉这段即可。
+        });
+
+        //日期时间选择器
+        laydate.render({
+            elem: '#validityPeriod'
+            , type: 'datetime'
+        });
+    });
+</script>
+</body>
+</html>

File diff suppressed because it is too large
+ 0 - 0
industry-code/src/main/resources/public/layui/css/layui.css


+ 1 - 0
industry-code/src/main/resources/public/layui/css/modules/code.css

@@ -0,0 +1 @@
+html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-h3,.layui-code-view{position:relative;font-size:12px}.layui-code-view{display:block;margin:10px 0;padding:0;border:1px solid #eee;border-left-width:6px;background-color:#FAFAFA;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:40px;line-height:40px;border-bottom:1px solid #eee}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 10px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view .layui-code-ol li:first-child{padding-top:10px}.layui-code-view .layui-code-ol li:last-child{padding-bottom:10px}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0C0C0C;border-left-color:#3F3F3F;background-color:#0C0C0C;color:#C2BE9E}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3F3F3F;border-left:none}.layui-code-demo .layui-code{visibility:visible!important;margin:-15px;border-top:none;border-right:none;border-bottom:none}.layui-code-demo .layui-tab-content{padding:15px;border-top:none}

File diff suppressed because it is too large
+ 0 - 0
industry-code/src/main/resources/public/layui/css/modules/laydate/default/laydate.css


BIN
industry-code/src/main/resources/public/layui/css/modules/layer/default/icon-ext.png


BIN
industry-code/src/main/resources/public/layui/css/modules/layer/default/icon.png


File diff suppressed because it is too large
+ 0 - 0
industry-code/src/main/resources/public/layui/css/modules/layer/default/layer.css


BIN
industry-code/src/main/resources/public/layui/css/modules/layer/default/loading-0.gif


BIN
industry-code/src/main/resources/public/layui/css/modules/layer/default/loading-1.gif


BIN
industry-code/src/main/resources/public/layui/css/modules/layer/default/loading-2.gif


BIN
industry-code/src/main/resources/public/layui/font/iconfont.eot


File diff suppressed because it is too large
+ 25 - 0
industry-code/src/main/resources/public/layui/font/iconfont.svg


BIN
industry-code/src/main/resources/public/layui/font/iconfont.ttf


BIN
industry-code/src/main/resources/public/layui/font/iconfont.woff


BIN
industry-code/src/main/resources/public/layui/font/iconfont.woff2


File diff suppressed because it is too large
+ 0 - 0
industry-code/src/main/resources/public/layui/layui.js


+ 13 - 0
industry-code/src/test/java/com/example/industrycode/IndustryCodeApplicationTests.java

@@ -0,0 +1,13 @@
+package com.example.industrycode;
+
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.context.SpringBootTest;
+
+@SpringBootTest
+class IndustryCodeApplicationTests {
+
+    @Test
+    void contextLoads() {
+    }
+
+}

+ 1 - 1
industry-system/cqcy-ei-common/src/main/java/com/example/opc_common/entity/TrafficChartItem.java

@@ -2,7 +2,7 @@ package com.example.opc_common.entity;
 
 import lombok.Data;
 @Data
-public class TrafficChartItem extends ItemParent {
+public class TrafficChartItem extends ItemsParent {
 
     //id
     private Integer id;

+ 14 - 14
industry-system/industry-da/pom.xml

@@ -108,20 +108,20 @@
             <artifactId>bdparsii</artifactId>
         </dependency>
         <!--证书认证-->
-        <dependency>
-            <groupId>de.schlichtherle.truelicense</groupId>
-            <artifactId>truelicense-core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.license</groupId>
-            <artifactId>core</artifactId>
-            <version>1.0</version>
-        </dependency>
-        <dependency>
-            <groupId>com.license</groupId>
-            <artifactId>verify</artifactId>
-            <version>1.0</version>
-        </dependency>
+<!--        <dependency>-->
+<!--            <groupId>de.schlichtherle.truelicense</groupId>-->
+<!--            <artifactId>truelicense-core</artifactId>-->
+<!--        </dependency>-->
+<!--        <dependency>-->
+<!--            <groupId>com.license</groupId>-->
+<!--            <artifactId>core</artifactId>-->
+<!--            <version>1.0</version>-->
+<!--        </dependency>-->
+<!--        <dependency>-->
+<!--            <groupId>com.license</groupId>-->
+<!--            <artifactId>verify</artifactId>-->
+<!--            <version>1.0</version>-->
+<!--        </dependency>-->
 
         <!--opcDa读取依赖-->
         <!--utgard -->

+ 1 - 2
industry-system/industry-da/src/main/java/com/example/opc_da/alarmConfig/AlarmRun.java

@@ -9,11 +9,10 @@ import com.example.opc_da.dao.DataSourceDao;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.ApplicationArguments;
 import org.springframework.boot.ApplicationRunner;
-import org.springframework.stereotype.Component;
 
 import java.util.List;
 
-@Component
+//@Component
 public class AlarmRun implements ApplicationRunner {
 
     @Autowired

+ 3 - 0
industry-system/industry-da/src/main/java/com/example/opc_da/config/InterceptorConfig.java

@@ -24,6 +24,9 @@ public class InterceptorConfig implements WebMvcConfigurer {
     public void addInterceptors(InterceptorRegistry registry) {
         registry.addInterceptor(interceptors())
                 .addPathPatterns("/**")
+                .excludePathPatterns("/system/getCode")
+                .excludePathPatterns("/system/registerCode")
+                .excludePathPatterns("/system/validityCode")
                 .excludePathPatterns("/user/getCodeImage")
                 .excludePathPatterns("/user/getPublicKey")
                 .excludePathPatterns("/user/frontUserLogin")

+ 4 - 2
industry-system/industry-da/src/main/java/com/example/opc_da/controller/ItemGroupController.java

@@ -262,12 +262,14 @@ public class ItemGroupController {
      * @param startTime
      * @param endTime
      * @param type 0横向导出,1纵向导出
+     * @param trendType 0实时趋势,1历史趋势
      * @param response
      */
     @RequestMapping(value = "/exportItemListData", method = RequestMethod.GET)
     public void exportItemListData(@RequestParam List<Integer> idList, @RequestParam String startTime,
-                                   @RequestParam String endTime, @RequestParam Integer type, HttpServletResponse response) {
-        itemGroupService.exportItemListData(idList, startTime, endTime, type, response);
+                                   @RequestParam String endTime, @RequestParam Integer type,
+                                   @RequestParam Integer trendType, HttpServletResponse response) {
+        itemGroupService.exportItemListData(idList, startTime, endTime, type, trendType, response);
     }
 
     /**

+ 48 - 0
industry-system/industry-da/src/main/java/com/example/opc_da/controller/SystemController.java

@@ -1,13 +1,21 @@
 package com.example.opc_da.controller;
 
+import cn.hutool.core.net.NetUtil;
+import com.example.opc_common.enums.ResultEnum;
+import com.example.opc_common.util.Blank;
+import com.example.opc_common.util.RSAUtil;
 import com.example.opc_common.util.Result;
 import com.example.opc_da.service.SystemService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
 /**
  * 系统信息
  */
@@ -29,4 +37,44 @@ public class SystemController {
         return systemService.getSystemMemory();
     }
 
+    /**
+     * 获取子码
+     *
+     * @return
+     */
+    @RequestMapping(value = "/getCode", method = RequestMethod.GET)
+    public Result getCode() {
+        InetAddress inetAddress = null;
+        try {
+            inetAddress = InetAddress.getLocalHost();
+        } catch (UnknownHostException e) {
+            throw new RuntimeException(e);
+        }
+        return Result.ok(RSAUtil.encryptByPublic(NetUtil.getMacAddress(inetAddress), RSAUtil.PUBLIC_KEY));
+    }
+
+    /**
+     * 更新注册码
+     *
+     * @param code
+     * @return
+     */
+    @RequestMapping(value = "/registerCode", method = RequestMethod.POST)
+    public Result registerCode(String code) {
+        if (Blank.isEmpty(code)) {
+            return Result.no(ResultEnum.UNKNOWN_ERROR.getRespCode(), "注册码不能为空");
+        }
+        return systemService.registerCode(code);
+    }
+
+    /**
+     * 验证注册码
+     *
+     * @return
+     */
+    @RequestMapping(value = "/validityCode", method = RequestMethod.GET)
+    public Result validityCode() {
+        return systemService.validityCode();
+    }
+
 }

+ 15 - 2
industry-system/industry-da/src/main/java/com/example/opc_da/controller/TrafficChartController.java

@@ -96,18 +96,31 @@ public class TrafficChartController {
     }
 
     /**
-     * 通过id获取流量图表配置组,及数据
+     * 通过id获取流量图表配置组,及实时数据
      *
      * @param id
      * @return
      */
-    @RequestMapping(value = "/getTrafficChartDataById",method = RequestMethod.GET)
+    @RequestMapping(value = "/getTrafficChartDataById", method = RequestMethod.GET)
     @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.TRAFFICCHART, OperationEnum = OperationEnum.SELECT)
     public Result getTrafficChartDataById(@NotNull Integer id) {
         return trafficChartService.getTrafficChartDataById(id);
     }
 
     /**
+     * 通过id获取流量图表配置组,及历史数据
+     *
+     * @param id
+     * @return
+     */
+    @RequestMapping(value = "/getTcHistoryDataById", method = RequestMethod.GET)
+    @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.TRAFFICCHART, OperationEnum = OperationEnum.SELECT)
+    public Result getTcHistoryDataById(@NotNull Integer id, @RequestParam String startTime,
+                                       @RequestParam String endTime) {
+        return trafficChartService.getTcHistoryDataById(id, startTime, endTime);
+    }
+
+    /**
      * 获取所有已经分配的数据项信息
      *
      * @return

+ 0 - 4
industry-system/industry-da/src/main/java/com/example/opc_da/controller/UserController.java

@@ -1,6 +1,5 @@
 package com.example.opc_da.controller;
 
-import com.appleyk.verify.annotion.VLicense;
 import com.example.opc_common.entity.AddUserRole;
 import com.example.opc_common.entity.User;
 import com.example.opc_common.entity.UserRole;
@@ -55,7 +54,6 @@ public class UserController {
      * @param user
      * @return
      */
-    @VLicense
     @PostMapping("/frontUserLogin")
     @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.USER, OperationEnum = OperationEnum.LOGIN)
     public Result frontUserLogin(@RequestBody User user) {
@@ -72,7 +70,6 @@ public class UserController {
      * @param user
      * @return
      */
-    @VLicense
     @PostMapping("/phoneUserLogin")
     @WebLog(ServerEnum = ServerEnum.CLIENT, ModelEnum = ModelEnum.USER, OperationEnum = OperationEnum.LOGIN)
     public Result phoneUserLogin(@RequestBody User user) {
@@ -88,7 +85,6 @@ public class UserController {
      * @param user
      * @return
      */
-    @VLicense
     @PostMapping("/backUserLogin")
     @WebLog(ServerEnum = ServerEnum.SERVER, ModelEnum = ModelEnum.USER, OperationEnum = OperationEnum.LOGIN)
     public Result backUserLogin(@RequestBody User user) {

+ 14 - 0
industry-system/industry-da/src/main/java/com/example/opc_da/dao/SystemDao.java

@@ -0,0 +1,14 @@
+package com.example.opc_da.dao;
+
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface SystemDao {
+
+    void clearCode();
+
+    Integer addCode(String code);
+
+    String getCode();
+
+}

+ 1 - 1
industry-system/industry-da/src/main/java/com/example/opc_da/service/ItemGroupService.java

@@ -38,6 +38,6 @@ public interface ItemGroupService {
 
     Result getItemListValue(List<Integer> idList, String startTime, String endTime);
 
-    void exportItemListData(List<Integer> idList, String startTime, String endTime, Integer type, HttpServletResponse response);
+    void exportItemListData(List<Integer> idList, String startTime, String endTime, Integer type, Integer trendType, HttpServletResponse response);
 
 }

+ 3 - 0
industry-system/industry-da/src/main/java/com/example/opc_da/service/SystemService.java

@@ -6,4 +6,7 @@ public interface SystemService {
 
     Result getSystemMemory();
 
+    Result registerCode(String code);
+
+    Result validityCode();
 }

+ 2 - 0
industry-system/industry-da/src/main/java/com/example/opc_da/service/TrafficChartService.java

@@ -17,4 +17,6 @@ public interface TrafficChartService {
     Result getTrafficChartDataById(Integer id);
 
     Result getAssignedItemList();
+
+    Result getTcHistoryDataById(Integer id, String startTime, String endTime);
 }

+ 4 - 1
industry-system/industry-da/src/main/java/com/example/opc_da/service/impl/DeviceLedgerServiceImpl.java

@@ -423,7 +423,10 @@ public class DeviceLedgerServiceImpl implements DeviceLedgerService {
         //从工具类中组装对应数据项的数据到集合中
         deviceLedgerItems = (List<DeviceLedgerItem>) queryServiceUtil.exchangeData(deviceLedgerItems);
         //获取相关台账数据项的数据模型
-        List<DataModel> dataModels = deviceLedgerDao.getItemDataModel(deviceLedgerItems);
+        List<DataModel> dataModels=new ArrayList<>();
+        if(Blank.isNotEmpty(deviceLedgerItems)){
+            dataModels = deviceLedgerDao.getItemDataModel(deviceLedgerItems);
+        }
         Map<Integer, DataModel> dmMap = DeviceLedgerItem.genIntegerMap(deviceLedgerItems, dataModels);
         //赋值计算值
         for (DeviceLedgerItem ledgerItem : deviceLedgerItems) {

+ 51 - 44
industry-system/industry-da/src/main/java/com/example/opc_da/service/impl/ItemGroupServiceImpl.java

@@ -408,24 +408,27 @@ public class ItemGroupServiceImpl implements ItemGroupService {
         //从工具类中组装对应数据项的数据到集合中
         itemList = (List<Item>) queryServiceUtil.exchangeData(itemList);
         //获取数据项的所有数据模型
-        List<DataModel> dataModels = dataModelDao.getDmListByItemList(itemList);
-        Map<Integer, DataModel> dmMap = DataModel.genIntegerMap(itemList, dataModels);
-        //赋值计算值
-        for (Item item : itemList) {
-            String dataValue = item.getDataValue();
-            if (Blank.isNotEmpty(dataValue)) {
-                Integer itemId = item.getId();
-                DataModel dm = dmMap.get(itemId);
-                if (Blank.isNotEmpty(dm) && dm.getModelType().equals(ConstantStr.VALUE_REPLACE)) {
-                    item.setCountDataValue(DataModel.valueReplace(dm, dataValue));
-                } else {
-                    try {
-                        BigDecimal bigDecimal = JSON.parseObject(dataValue, BigDecimal.class);
-                        item.setCountDataValue((Blank.isNotEmpty(dm) ?
-                                MathUtil.quadricOperation(dm.getMathParameter(), dm.getOperationRule(), bigDecimal)
-                                : bigDecimal).toString());
-                    } catch (Exception e) {
-                        item.setCountDataValue(dataValue);
+        List<DataModel> dataModels = new ArrayList<>();
+        if (Blank.isNotEmpty(itemList)) {
+            dataModels = dataModelDao.getDmListByItemList(itemList);
+            Map<Integer, DataModel> dmMap = DataModel.genIntegerMap(itemList, dataModels);
+            //赋值计算值
+            for (Item item : itemList) {
+                String dataValue = item.getDataValue();
+                if (Blank.isNotEmpty(dataValue)) {
+                    Integer itemId = item.getId();
+                    DataModel dm = dmMap.get(itemId);
+                    if (Blank.isNotEmpty(dm) && dm.getModelType().equals(ConstantStr.VALUE_REPLACE)) {
+                        item.setCountDataValue(DataModel.valueReplace(dm, dataValue));
+                    } else {
+                        try {
+                            BigDecimal bigDecimal = JSON.parseObject(dataValue, BigDecimal.class);
+                            item.setCountDataValue((Blank.isNotEmpty(dm) ?
+                                    MathUtil.quadricOperation(dm.getMathParameter(), dm.getOperationRule(), bigDecimal)
+                                    : bigDecimal).toString());
+                        } catch (Exception e) {
+                            item.setCountDataValue(dataValue);
+                        }
                     }
                 }
             }
@@ -443,39 +446,42 @@ public class ItemGroupServiceImpl implements ItemGroupService {
                 itemList
         );
         //获取数据项的所有数据模型
-        List<DataModel> dataModels = dataModelDao.getDmListByItemList(itemList);
-        Map<Integer, DataModel> dmMap = DataModel.genIntegerMap(itemList, dataModels);
-        //赋值计算值
-        for (Item item : itemList) {
-            List<String> dataValueList = item.getDataValueList();
-            List<String> arr = new ArrayList<>();
-            if (Blank.isNotEmpty(dataValueList)) {
-                for (String dataValue : dataValueList) {
-                    if (Blank.isNotEmpty(dataValue)) {
-                        Integer itemId = item.getId();
-                        DataModel dm = dmMap.get(itemId);
-                        if (Blank.isNotEmpty(dm) && dm.getModelType().equals(ConstantStr.VALUE_REPLACE)) {
-                            arr.add(DataModel.valueReplace(dm, dataValue));
-                        } else {
-                            try {
-                                BigDecimal bigDecimal = JSON.parseObject(dataValue, BigDecimal.class);
-                                arr.add((Blank.isNotEmpty(dm) ?
-                                        MathUtil.quadricOperation(dm.getMathParameter(), dm.getOperationRule(), bigDecimal)
-                                        : bigDecimal).toString());
-                            } catch (Exception e) {
-                                arr.add(dataValue);
+        List<DataModel> dataModels = new ArrayList<>();
+        if (Blank.isNotEmpty(itemList)) {
+            dataModels = dataModelDao.getDmListByItemList(itemList);
+            Map<Integer, DataModel> dmMap = DataModel.genIntegerMap(itemList, dataModels);
+            //赋值计算值
+            for (Item item : itemList) {
+                List<String> dataValueList = item.getDataValueList();
+                List<String> arr = new ArrayList<>();
+                if (Blank.isNotEmpty(dataValueList)) {
+                    for (String dataValue : dataValueList) {
+                        if (Blank.isNotEmpty(dataValue)) {
+                            Integer itemId = item.getId();
+                            DataModel dm = dmMap.get(itemId);
+                            if (Blank.isNotEmpty(dm) && dm.getModelType().equals(ConstantStr.VALUE_REPLACE)) {
+                                arr.add(DataModel.valueReplace(dm, dataValue));
+                            } else {
+                                try {
+                                    BigDecimal bigDecimal = JSON.parseObject(dataValue, BigDecimal.class);
+                                    arr.add((Blank.isNotEmpty(dm) ?
+                                            MathUtil.quadricOperation(dm.getMathParameter(), dm.getOperationRule(), bigDecimal)
+                                            : bigDecimal).toString());
+                                } catch (Exception e) {
+                                    arr.add(dataValue);
+                                }
                             }
                         }
                     }
                 }
+                item.setCountDataValueList(arr);
             }
-            item.setCountDataValueList(arr);
         }
         return Result.ok(itemList);
     }
 
     @Override
-    public void exportItemListData(List<Integer> idList, String startTime, String endTime, Integer type, HttpServletResponse response) {
+    public void exportItemListData(List<Integer> idList, String startTime, String endTime, Integer type, Integer trendType, HttpServletResponse response) {
         List<Item> itemList = itemGroupDao.getItemsParentByIdList(idList);
         //从工具类中组装对应数据项的数据到集合中
         itemList = (List<Item>) queryServiceUtil.exchangeDatas(
@@ -540,9 +546,10 @@ public class ItemGroupServiceImpl implements ItemGroupService {
             writer.write(rows, true);
             response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8");
             response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(
-                    DateUtil.dateChangeStr(DateUtil.strYmdhmsChangeDate(startTime), "yyyyMMddHHmmss")
-                            + "-" + DateUtil.dateChangeStr(DateUtil.strYmdhmsChangeDate(endTime), "yyyyMMddHHmmss")
-                            + ".xlsx", "UTF-8"));
+                    trendType.equals(0) ? DateUtil.dateChangeStr(DateUtil.strYmdhmsChangeDate(endTime), "yyyyMMddHHmmss") + ".xlsx" :
+                            DateUtil.dateChangeStr(DateUtil.strYmdhmsChangeDate(startTime), "yyyyMMddHHmmss")
+                                    + "-" + DateUtil.dateChangeStr(DateUtil.strYmdhmsChangeDate(endTime), "yyyyMMddHHmmss")
+                                    + ".xlsx", "UTF-8"));
             response.setHeader("Access-Control-Expose-Headers", "Content-disposition");
             out = response.getOutputStream();
             writer.flush(out, true);

+ 84 - 0
industry-system/industry-da/src/main/java/com/example/opc_da/service/impl/SystemServiceImpl.java

@@ -1,16 +1,26 @@
 package com.example.opc_da.service.impl;
 
+import cn.hutool.core.net.NetUtil;
 import com.alibaba.fastjson.JSONObject;
+import com.example.opc_common.enums.ResultEnum;
+import com.example.opc_common.util.Blank;
+import com.example.opc_common.util.RSAUtil;
 import com.example.opc_common.util.Result;
+import com.example.opc_da.dao.SystemDao;
 import com.example.opc_da.service.SystemService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.io.File;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
 import java.sql.Connection;
 import java.sql.DriverManager;
 import java.sql.ResultSet;
 import java.sql.Statement;
+import java.text.SimpleDateFormat;
+import java.util.Date;
 
 @Transactional
 @Service
@@ -21,6 +31,9 @@ public class SystemServiceImpl implements SystemService {
     static final String USER = "root";
     static final String PASS = "root";
 
+    @Autowired
+    private SystemDao systemDao;
+
     @Override
     public Result getSystemMemory() {
         Connection connection = null;
@@ -78,4 +91,75 @@ public class SystemServiceImpl implements SystemService {
         return Result.ok(jsonObject);
     }
 
+    @Override
+    public synchronized Result registerCode(String code) {
+        try {
+            String rsaCode = RSAUtil.decrypt(code, "UTF-8");
+            String dateStr = rsaCode.substring(0, 19);
+            String macCode = rsaCode.substring(19);
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            Date date = null;
+            try {
+                date = sdf.parse(dateStr);
+                if (date.getTime() <= System.currentTimeMillis()) {
+                    return Result.no(ResultEnum.UNKNOWN_ERROR.getRespCode(), "注册码失效,有效期为:" + dateStr);
+                }
+            } catch (Exception e) {
+                return Result.no(500, "注册码有误");
+            }
+            InetAddress inetAddress = null;
+            try {
+                inetAddress = InetAddress.getLocalHost();
+            } catch (UnknownHostException e) {
+                throw new RuntimeException(e);
+            }
+            if (!macCode.equals(NetUtil.getMacAddress(inetAddress))) {
+                return Result.no(ResultEnum.UNKNOWN_ERROR.getRespCode(), "注册码不正确");
+            }
+            systemDao.clearCode();
+            if (systemDao.addCode(code) <= 0) {
+                return Result.no(ResultEnum.UNKNOWN_ERROR.getRespCode(), "注册失败,请重新注册");
+            }
+            return Result.ok("注册成功,有效期为:" + dateStr);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return Result.no(ResultEnum.UNKNOWN_ERROR.getRespCode(), "注册码不正确");
+        }
+    }
+
+    @Override
+    public Result validityCode() {
+        String code = systemDao.getCode();
+        if (Blank.isEmpty(code)) {
+            return Result.no(ResultEnum.UNKNOWN_ERROR.getRespCode(), "没有注册码");
+        }
+        try {
+            code = RSAUtil.decrypt(code, "UTF-8");
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            String dateStr = code.substring(0, 19);
+            Date date = null;
+            try {
+                date = sdf.parse(dateStr);
+                if (date.getTime() <= System.currentTimeMillis()) {
+                    return Result.no(ResultEnum.UNKNOWN_ERROR.getRespCode(), "注册码失效,有效期为:" + dateStr);
+                }
+            } catch (Exception e) {
+                return Result.no(500, "注册码有误");
+            }
+            String macCode = code.substring(19);
+            InetAddress inetAddress = null;
+            try {
+                inetAddress = InetAddress.getLocalHost();
+            } catch (UnknownHostException e) {
+                throw new RuntimeException(e);
+            }
+            if (!macCode.equals(NetUtil.getMacAddress(inetAddress))) {
+                return Result.no(ResultEnum.UNKNOWN_ERROR.getRespCode(), "注册码不正确");
+            }
+        } catch (Exception e) {
+            return Result.no(ResultEnum.UNKNOWN_ERROR.getRespCode(), "注册码不正确");
+        }
+        return Result.ok("注册码有效");
+    }
+
 }

+ 19 - 0
industry-system/industry-da/src/main/java/com/example/opc_da/service/impl/TrafficChartServiceImpl.java

@@ -6,6 +6,7 @@ import com.example.opc_common.entity.TrafficChartItem;
 import com.example.opc_common.enums.ResultEnum;
 import com.example.opc_common.exception.CustomException;
 import com.example.opc_common.util.Blank;
+import com.example.opc_common.util.DateUtil;
 import com.example.opc_common.util.Result;
 import com.example.opc_da.dao.TrafficChartDao;
 import com.example.opc_da.service.TrafficChartService;
@@ -116,4 +117,22 @@ public class TrafficChartServiceImpl implements TrafficChartService {
     public Result getAssignedItemList() {
         return Result.ok(trafficChartDao.getAssignedItemList());
     }
+
+    @Override
+    public Result getTcHistoryDataById(Integer id, String startTime, String endTime) {
+        //只查询展示的数据项
+        List<TrafficChartItem> trafficChartItemList = trafficChartDao.getTcItemShowByTrafficChartId(id, 1);
+        for (TrafficChartItem t : trafficChartItemList) {
+            if (Blank.isEmpty(t.getDataSourceId(), t.getItemReadName())) {
+                return Result.no(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "表格中没有名称的数据项在数据组中已被删除,请调整后调用");
+            }
+        }
+        //从工具类中组装对应数据项的数据到集合中
+        trafficChartItemList = (List<TrafficChartItem>) queryServiceUtil.exchangeDatas(
+                DateUtil.strYmdhmsChangeDate(startTime),
+                DateUtil.strYmdhmsChangeDate(endTime),
+                trafficChartItemList
+        );
+        return Result.ok(trafficChartItemList);
+    }
 }

+ 12 - 8
industry-system/industry-da/src/main/resources/mapper/DeviceLedgerDao.xml

@@ -489,14 +489,18 @@
     </select>
 
     <select id="getItemDataModel" resultType="com.example.opc_common.entity.DataModel">
-        select
-        id
-        , model_type, math_parameter, operation_rule, replacing_value, operation_rule_two, replacing_value_two, user_id,
-        remark, user_id, remark, create_time
-        from t_data_model where id in
-        <foreach collection="deviceLedgerItemList" item="deviceLedgerItem" index="index" open="(" close=")" separator=",">
-            #{deviceLedgerItem.dataModelId}
-        </foreach>
+        <if test="deviceLedgerItemList != null and deviceLedgerItemList.size > 0">
+            select
+            id
+            , model_type, math_parameter, operation_rule, replacing_value, operation_rule_two, replacing_value_two,
+            user_id,
+            remark, user_id, remark, create_time
+            from t_data_model where id in
+            <foreach collection="deviceLedgerItemList" item="deviceLedgerItem" index="index" open="(" close=")"
+                     separator=",">
+                #{deviceLedgerItem.dataModelId}
+            </foreach>
+        </if>
     </select>
 
 </mapper>

+ 18 - 0
industry-system/industry-da/src/main/resources/mapper/SystemDao.xml

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.example.opc_da.dao.SystemDao">
+
+    <insert id="addCode">
+        insert into sys_register_code(register_code, create_time)
+            value (#{code},now())
+    </insert>
+    <update id="clearCode">
+        TRUNCATE TABLE sys_register_code
+    </update>
+
+
+    <select id="getCode" resultType="java.lang.String">
+        select register_code
+        from sys_register_code limit 1
+    </select>
+</mapper>

File diff suppressed because it is too large
+ 1 - 1
industry-system/industry-da/src/main/resources/static/page/index.html


File diff suppressed because it is too large
+ 0 - 0
industry-system/industry-da/src/main/resources/static/page/static/js/app.7aa6b13b.js


File diff suppressed because it is too large
+ 0 - 0
industry-system/industry-da/src/main/resources/static/page/static/js/chunk-3ead4208.303a87bb.js


File diff suppressed because it is too large
+ 0 - 0
industry-system/industry-da/src/main/resources/static/page/static/js/chunk-79903d7d.6593b48e.js


File diff suppressed because it is too large
+ 0 - 0
industry-system/industry-da/src/main/resources/static/page/static/js/chunk-df471c44.07450a07.js


File diff suppressed because it is too large
+ 0 - 0
industry-system/industry-da/src/main/resources/static/page/static/js/chunk-eba4d76c.45d9a77d.js


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