xusonglin 4 gadi atpakaļ
vecāks
revīzija
547487531a
28 mainītis faili ar 1511 papildinājumiem un 0 dzēšanām
  1. 310 0
      mvnw
  2. 182 0
      mvnw.cmd
  3. 142 0
      pom.xml
  4. 13 0
      src/main/java/com/jkcredit/data/datastorage/DataStorageApplication.java
  5. 39 0
      src/main/java/com/jkcredit/data/datastorage/config/MybatisPlusConfigurer.java
  6. 25 0
      src/main/java/com/jkcredit/data/datastorage/controller/IdentityInfoController.java
  7. 29 0
      src/main/java/com/jkcredit/data/datastorage/controller/ResultInfoController.java
  8. 16 0
      src/main/java/com/jkcredit/data/datastorage/mapper/IdentityInfoMapper.java
  9. 14 0
      src/main/java/com/jkcredit/data/datastorage/mapper/ResultInfoMapper.java
  10. 20 0
      src/main/java/com/jkcredit/data/datastorage/model/dto/IdentityInfoDto.java
  11. 30 0
      src/main/java/com/jkcredit/data/datastorage/model/dto/ResultFromFileDto.java
  12. 22 0
      src/main/java/com/jkcredit/data/datastorage/model/dto/ResultInfoDto.java
  13. 31 0
      src/main/java/com/jkcredit/data/datastorage/model/po/IdentityInfoPo.java
  14. 32 0
      src/main/java/com/jkcredit/data/datastorage/model/po/ResultInfoPo.java
  15. 40 0
      src/main/java/com/jkcredit/data/datastorage/model/vo/CommonResponseVo.java
  16. 17 0
      src/main/java/com/jkcredit/data/datastorage/service/identityInfoService/IdentityInfoService.java
  17. 85 0
      src/main/java/com/jkcredit/data/datastorage/service/identityInfoService/IdentityInfoServiceImpl.java
  18. 16 0
      src/main/java/com/jkcredit/data/datastorage/service/resultInfoService/ResultInfoService.java
  19. 145 0
      src/main/java/com/jkcredit/data/datastorage/service/resultInfoService/ResultInfoServiceImpl.java
  20. 19 0
      src/main/java/com/jkcredit/data/datastorage/util/CommonUtil.java
  21. 106 0
      src/main/java/com/jkcredit/data/datastorage/util/DESedeUtil.java
  22. 23 0
      src/main/resources/application-dev.yml
  23. 23 0
      src/main/resources/application-prod.yml
  24. 18 0
      src/main/resources/application.yml
  25. 62 0
      src/main/resources/logback-spring.xml
  26. 21 0
      src/main/resources/mapper/IdentityInfoMapper.xml
  27. 18 0
      src/main/resources/mapper/ResultInfoMapper.xml
  28. 13 0
      src/test/java/com/jkcredit/data/datastorage/DataStorageApplicationTests.java

+ 310 - 0
mvnw

@@ -0,0 +1,310 @@
+#!/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.
+# ----------------------------------------------------------------------------
+
+# ----------------------------------------------------------------------------
+# Maven Start Up Batch script
+#
+# Required ENV vars:
+# ------------------
+#   JAVA_HOME - location of a JDK home dir
+#
+# Optional ENV vars
+# -----------------
+#   M2_HOME - location of maven2's installed home dir
+#   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 /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
+        export JAVA_HOME="`/usr/libexec/java_home`"
+      else
+        export JAVA_HOME="/Library/Java/Home"
+      fi
+    fi
+    ;;
+esac
+
+if [ -z "$JAVA_HOME" ] ; then
+  if [ -r /etc/gentoo-release ] ; then
+    JAVA_HOME=`java-config --jre-home`
+  fi
+fi
+
+if [ -z "$M2_HOME" ] ; then
+  ## resolve links - $0 may be a link to maven's home
+  PRG="$0"
+
+  # need this for relative symlinks
+  while [ -h "$PRG" ] ; do
+    ls=`ls -ld "$PRG"`
+    link=`expr "$ls" : '.*-> \(.*\)$'`
+    if expr "$link" : '/.*' > /dev/null; then
+      PRG="$link"
+    else
+      PRG="`dirname "$PRG"`/$link"
+    fi
+  done
+
+  saveddir=`pwd`
+
+  M2_HOME=`dirname "$PRG"`/..
+
+  # make it fully qualified
+  M2_HOME=`cd "$M2_HOME" && pwd`
+
+  cd "$saveddir"
+  # echo Using m2 at $M2_HOME
+fi
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched
+if $cygwin ; then
+  [ -n "$M2_HOME" ] &&
+    M2_HOME=`cygpath --unix "$M2_HOME"`
+  [ -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 "$M2_HOME" ] &&
+    M2_HOME="`(cd "$M2_HOME"; pwd)`"
+  [ -n "$JAVA_HOME" ] &&
+    JAVA_HOME="`(cd "$JAVA_HOME"; 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="`which 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
+
+CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
+
+# 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/.."; pwd`
+    fi
+    # end of workaround
+  done
+  echo "${basedir}"
+}
+
+# concatenates all lines of a file
+concat_lines() {
+  if [ -f "$1" ]; then
+    echo "$(tr -s '\n' ' ' < "$1")"
+  fi
+}
+
+BASE_DIR=`find_maven_basedir "$(pwd)"`
+if [ -z "$BASE_DIR" ]; then
+  exit 1;
+fi
+
+##########################################################################################
+# 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.
+##########################################################################################
+if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
+    if [ "$MVNW_VERBOSE" = true ]; then
+      echo "Found .mvn/wrapper/maven-wrapper.jar"
+    fi
+else
+    if [ "$MVNW_VERBOSE" = true ]; then
+      echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
+    fi
+    if [ -n "$MVNW_REPOURL" ]; then
+      jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+    else
+      jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+    fi
+    while IFS="=" read key value; do
+      case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
+      esac
+    done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
+    if [ "$MVNW_VERBOSE" = true ]; then
+      echo "Downloading from: $jarUrl"
+    fi
+    wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
+    if $cygwin; then
+      wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
+    fi
+
+    if command -v wget > /dev/null; then
+        if [ "$MVNW_VERBOSE" = true ]; then
+          echo "Found wget ... using wget"
+        fi
+        if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
+            wget "$jarUrl" -O "$wrapperJarPath"
+        else
+            wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
+        fi
+    elif command -v curl > /dev/null; then
+        if [ "$MVNW_VERBOSE" = true ]; then
+          echo "Found curl ... using curl"
+        fi
+        if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
+            curl -o "$wrapperJarPath" "$jarUrl" -f
+        else
+            curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
+        fi
+
+    else
+        if [ "$MVNW_VERBOSE" = true ]; then
+          echo "Falling back to using Java to download"
+        fi
+        javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
+        # For Cygwin, switch paths to Windows format before running javac
+        if $cygwin; then
+          javaClass=`cygpath --path --windows "$javaClass"`
+        fi
+        if [ -e "$javaClass" ]; then
+            if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
+                if [ "$MVNW_VERBOSE" = true ]; then
+                  echo " - Compiling MavenWrapperDownloader.java ..."
+                fi
+                # Compiling the Java class
+                ("$JAVA_HOME/bin/javac" "$javaClass")
+            fi
+            if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
+                # Running the downloader
+                if [ "$MVNW_VERBOSE" = true ]; then
+                  echo " - Running MavenWrapperDownloader.java ..."
+                fi
+                ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
+            fi
+        fi
+    fi
+fi
+##########################################################################################
+# End of extension
+##########################################################################################
+
+export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
+if [ "$MVNW_VERBOSE" = true ]; then
+  echo $MAVEN_PROJECTBASEDIR
+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 "$M2_HOME" ] &&
+    M2_HOME=`cygpath --path --windows "$M2_HOME"`
+  [ -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
+
+exec "$JAVACMD" \
+  $MAVEN_OPTS \
+  -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
+  "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
+  ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

+ 182 - 0
mvnw.cmd

@@ -0,0 +1,182 @@
+@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 Maven Start Up Batch script
+@REM
+@REM Required ENV vars:
+@REM JAVA_HOME - location of a JDK home dir
+@REM
+@REM Optional ENV vars
+@REM M2_HOME - location of maven2's installed home dir
+@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 "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
+if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\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 DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+
+FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
+    IF "%%A"=="wrapperUrl" SET DOWNLOAD_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 DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+    )
+    if "%MVNW_VERBOSE%" == "true" (
+        echo Couldn't find %WRAPPER_JAR%, downloading it ...
+        echo Downloading from: %DOWNLOAD_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('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
+		"}"
+    if "%MVNW_VERBOSE%" == "true" (
+        echo Finished downloading %WRAPPER_JAR%
+    )
+)
+@REM End of extension
+
+@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 "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
+if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\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%
+
+exit /B %ERROR_CODE%

+ 142 - 0
pom.xml

@@ -0,0 +1,142 @@
+<?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.1.RELEASE</version>
+        <relativePath/> <!-- lookup parent from repository -->
+    </parent>
+    <groupId>com.jkcredit.data</groupId>
+    <artifactId>data-storage</artifactId>
+    <version>1.0.0</version>
+    <name>data-storage</name>
+    <description>Demo project for Spring Boot</description>
+
+    <properties>
+        <java.version>1.8</java.version>
+        <mybatis-plus.version>3.1.0</mybatis-plus.version>
+        <model-mapper.version>2.3.0</model-mapper.version>
+        <zalando.version>0.23.0</zalando.version>
+        <fastjson.version>1.2.51</fastjson.version>
+        <mybatis.starter.version>2.1.1</mybatis.starter.version>
+        <fluent-validator.version>1.0.9</fluent-validator.version>
+        <commons.beanutils.version>1.9.4</commons.beanutils.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>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.junit.vintage</groupId>
+                    <artifactId>junit-vintage-engine</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.modelmapper</groupId>
+            <artifactId>modelmapper</artifactId>
+            <version>${model-mapper.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+            <version>${mybatis-plus.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.zalando</groupId>
+            <artifactId>problem-spring-web</artifactId>
+            <version>${zalando.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>${fastjson.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.mybatis.spring.boot</groupId>
+            <artifactId>mybatis-spring-boot-starter</artifactId>
+            <version>${mybatis.starter.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-configuration-processor</artifactId>
+            <optional>true</optional>
+        </dependency>
+
+        <dependency>
+            <groupId>com.baidu.unbiz</groupId>
+            <artifactId>fluent-validator-jsr303</artifactId>
+            <version>${fluent-validator.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-beanutils</groupId>
+            <artifactId>commons-beanutils</artifactId>
+            <version>${commons.beanutils.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>javax.persistence</groupId>
+            <artifactId>persistence-api</artifactId>
+            <version>1.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>commons-lang</groupId>
+            <artifactId>commons-lang</artifactId>
+            <version>2.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>cn.afterturn</groupId>
+            <artifactId>easypoi-base</artifactId>
+            <version>3.2.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>cn.afterturn</groupId>
+            <artifactId>easypoi-web</artifactId>
+            <version>3.2.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>cn.afterturn</groupId>
+            <artifactId>easypoi-annotation</artifactId>
+            <version>3.2.0</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

+ 13 - 0
src/main/java/com/jkcredit/data/datastorage/DataStorageApplication.java

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

+ 39 - 0
src/main/java/com/jkcredit/data/datastorage/config/MybatisPlusConfigurer.java

@@ -0,0 +1,39 @@
+package com.jkcredit.data.datastorage.config;
+
+import com.baomidou.mybatisplus.core.injector.ISqlInjector;
+import com.baomidou.mybatisplus.extension.injector.LogicSqlInjector;
+import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * @description:
+ * @author: xusonglin
+ * @create: 2019/2/28 9:06 AM
+ * @version: V1.0
+ **/
+@Configuration
+@MapperScan("com.jkcredit.data.datastorage.mapper")
+public class MybatisPlusConfigurer {
+    /**
+     * 分页插件
+     *
+     * @return PaginationInterceptor
+     */
+    @Bean
+    public PaginationInterceptor paginationInterceptor() {
+        return new PaginationInterceptor();
+    }
+
+
+    /**
+     * 逻辑删除
+     *
+     * @return
+     */
+    @Bean
+    public ISqlInjector sqlInjector() {
+        return new LogicSqlInjector();
+    }
+}

+ 25 - 0
src/main/java/com/jkcredit/data/datastorage/controller/IdentityInfoController.java

@@ -0,0 +1,25 @@
+package com.jkcredit.data.datastorage.controller;
+
+import com.jkcredit.data.datastorage.model.vo.CommonResponseVo;
+import com.jkcredit.data.datastorage.service.identityInfoService.IdentityInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @description:
+ * @author: xusonglin
+ * @create: 2020/7/7 9:48
+ * @version: V1.0
+ **/
+@RestController
+public class IdentityInfoController {
+    @Autowired
+    IdentityInfoService identityInfoService;
+
+    @PostMapping("identityInfo")
+    public CommonResponseVo identityInfo(@RequestBody String param) {
+        return identityInfoService.saveIdentityInfo(param);
+    }
+}

+ 29 - 0
src/main/java/com/jkcredit/data/datastorage/controller/ResultInfoController.java

@@ -0,0 +1,29 @@
+package com.jkcredit.data.datastorage.controller;
+
+import com.jkcredit.data.datastorage.model.vo.CommonResponseVo;
+import com.jkcredit.data.datastorage.service.resultInfoService.ResultInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+/**
+ * @description:
+ * @author: xusonglin
+ * @create: 2020/7/16 9:43
+ * @version: V1.0
+ **/
+@RestController
+public class ResultInfoController {
+    @Autowired
+    ResultInfoService resultInfoService;
+
+    @PostMapping("/getResult")
+    public CommonResponseVo getResult(@RequestBody String param) {
+        return resultInfoService.getResultInfo(param);
+    }
+
+    @PutMapping("/result")
+    public CommonResponseVo saveResult(@RequestParam MultipartFile file) {
+        return resultInfoService.saveResultInfo(file);
+    }
+}

+ 16 - 0
src/main/java/com/jkcredit/data/datastorage/mapper/IdentityInfoMapper.java

@@ -0,0 +1,16 @@
+package com.jkcredit.data.datastorage.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jkcredit.data.datastorage.model.po.IdentityInfoPo;
+
+import java.util.List;
+
+/**
+ * @description:
+ * @author: xusonglin
+ * @create: 2020/7/6 15:28
+ * @version: V1.0
+ **/
+public interface IdentityInfoMapper extends BaseMapper<IdentityInfoPo> {
+    List<String> getRequestIdByIdInfo(String idCode, String name);
+}

+ 14 - 0
src/main/java/com/jkcredit/data/datastorage/mapper/ResultInfoMapper.java

@@ -0,0 +1,14 @@
+package com.jkcredit.data.datastorage.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jkcredit.data.datastorage.model.po.ResultInfoPo;
+
+/**
+ * @description:
+ * @author: xusonglin
+ * @create: 2020/7/15 14:17
+ * @version: V1.0
+ **/
+public interface ResultInfoMapper extends BaseMapper<ResultInfoPo> {
+    ResultInfoPo getResultInfoByRequestId(String requestId);
+}

+ 20 - 0
src/main/java/com/jkcredit/data/datastorage/model/dto/IdentityInfoDto.java

@@ -0,0 +1,20 @@
+package com.jkcredit.data.datastorage.model.dto;
+
+import lombok.Data;
+import lombok.ToString;
+
+import java.io.Serializable;
+
+/**
+ * @description:
+ * @author: xusonglin
+ * @create: 2020/7/6 17:44
+ * @version: V1.0
+ **/
+@Data
+@ToString
+public class IdentityInfoDto implements Serializable {
+    private static final long serialVersionUID = 3900805944375125445L;
+    private String idCode;
+    private String name;
+}

+ 30 - 0
src/main/java/com/jkcredit/data/datastorage/model/dto/ResultFromFileDto.java

@@ -0,0 +1,30 @@
+package com.jkcredit.data.datastorage.model.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import cn.afterturn.easypoi.excel.annotation.ExcelTarget;
+import lombok.Data;
+import lombok.ToString;
+
+import java.io.Serializable;
+
+/**
+ * @description:
+ * @author: xusonglin
+ * @create: 2020/7/15 15:00
+ * @version: V1.0
+ **/
+@Data
+@ToString
+@ExcelTarget("resultFromFileDto")
+public class ResultFromFileDto implements Serializable {
+    private static final long serialVersionUID = 818009066277912659L;
+
+    @Excel(name = "idCode")
+    private String idCode;
+
+    @Excel(name = "name")
+    private String name;
+
+    @Excel(name = "result")
+    private String result;
+}

+ 22 - 0
src/main/java/com/jkcredit/data/datastorage/model/dto/ResultInfoDto.java

@@ -0,0 +1,22 @@
+package com.jkcredit.data.datastorage.model.dto;
+
+import lombok.Data;
+import lombok.ToString;
+
+import java.io.Serializable;
+
+/**
+ * @description:
+ * @author: xusonglin
+ * @create: 2020/7/15 14:15
+ * @version: V1.0
+ **/
+@Data
+@ToString
+public class ResultInfoDto implements Serializable {
+    private static final long serialVersionUID = 3703413772374816969L;
+
+    private String requestId;
+
+    private String result;
+}

+ 31 - 0
src/main/java/com/jkcredit/data/datastorage/model/po/IdentityInfoPo.java

@@ -0,0 +1,31 @@
+package com.jkcredit.data.datastorage.model.po;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.ToString;
+
+import javax.persistence.Entity;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @description:
+ * @author: xusonglin
+ * @create: 2020/7/6 14:54
+ * @version: V1.0
+ **/
+@Data
+@ToString
+@Entity
+@TableName("identity_info")
+public class IdentityInfoPo implements Serializable {
+    private static final long serialVersionUID = -7197517720723948221L;
+
+    private String idCode;
+
+    private String name;
+
+    private Date createTime;
+
+    private String requestId;
+}

+ 32 - 0
src/main/java/com/jkcredit/data/datastorage/model/po/ResultInfoPo.java

@@ -0,0 +1,32 @@
+package com.jkcredit.data.datastorage.model.po;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.ToString;
+
+import javax.persistence.Entity;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @description:
+ * @author: xusonglin
+ * @create: 2020/7/15 14:13
+ * @version: V1.0
+ **/
+@Data
+@ToString
+@Entity
+@TableName("result_info")
+public class ResultInfoPo implements Serializable {
+    private static final long serialVersionUID = -422782781868732298L;
+
+    @TableId
+    private String requestId;
+
+    private String result;
+
+    private Date createTime;
+
+}

+ 40 - 0
src/main/java/com/jkcredit/data/datastorage/model/vo/CommonResponseVo.java

@@ -0,0 +1,40 @@
+package com.jkcredit.data.datastorage.model.vo;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * @description:
+ * @author: xusonglin
+ * @create: 2020/7/6 15:54
+ * @version: V1.0
+ **/
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class CommonResponseVo implements Serializable {
+    private static final long serialVersionUID = 7502591346072011846L;
+
+    public static Integer SUCCESS = 1;
+    public static Integer FAILED = 2;
+    public static Integer NO_RESULT = 3;
+
+    private int code;
+    private String msg;
+    private String requestId;
+
+    public static CommonResponseVo success(String msg, String requestId) {
+        return new CommonResponseVo(SUCCESS, msg, requestId);
+    }
+
+    public static CommonResponseVo failure(String msg, String requestId) {
+        return new CommonResponseVo(FAILED, msg, requestId);
+    }
+
+    public static CommonResponseVo noResult(String msg, String requestId) {
+        return new CommonResponseVo(NO_RESULT, msg, requestId);
+    }
+}

+ 17 - 0
src/main/java/com/jkcredit/data/datastorage/service/identityInfoService/IdentityInfoService.java

@@ -0,0 +1,17 @@
+package com.jkcredit.data.datastorage.service.identityInfoService;
+
+import com.jkcredit.data.datastorage.model.vo.CommonResponseVo;
+
+import java.util.List;
+
+/**
+ * @description:
+ * @author: xusonglin
+ * @create: 2020/7/6 15:33
+ * @version: V1.0
+ **/
+public interface IdentityInfoService {
+    CommonResponseVo saveIdentityInfo(String encodeParam);
+
+    List<String> getRequestIdByIdInfo(String idCode, String name);
+}

+ 85 - 0
src/main/java/com/jkcredit/data/datastorage/service/identityInfoService/IdentityInfoServiceImpl.java

@@ -0,0 +1,85 @@
+package com.jkcredit.data.datastorage.service.identityInfoService;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.jkcredit.data.datastorage.mapper.IdentityInfoMapper;
+import com.jkcredit.data.datastorage.model.dto.IdentityInfoDto;
+import com.jkcredit.data.datastorage.model.po.IdentityInfoPo;
+import com.jkcredit.data.datastorage.model.vo.CommonResponseVo;
+import com.jkcredit.data.datastorage.util.CommonUtil;
+import com.jkcredit.data.datastorage.util.DESedeUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @description:
+ * @author: xusonglin
+ * @create: 2020/7/6 15:33
+ * @version: V1.0
+ **/
+@Slf4j
+@Service
+public class IdentityInfoServiceImpl implements IdentityInfoService {
+    @Value("${project.decryptKey}")
+    private String decryptKey;
+    @Resource
+    IdentityInfoMapper mapper;
+
+    @Override
+    public CommonResponseVo saveIdentityInfo(String encodeParam) {
+        String requestId = CommonUtil.getRequestId();
+        log.info("requestId:{}, param:{}", requestId, encodeParam);
+
+        JSONObject requestObject = JSON.parseObject(encodeParam);
+        if (StringUtils.isBlank(requestObject.getString("param"))) {
+            log.error("requestId:{}, result:{}", requestId, "参数为空");
+            return CommonResponseVo.failure("参数为空", requestId);
+        }
+        String requestParam = DESedeUtil.decryptMode(requestObject.getString("param"), decryptKey);
+
+        // 参数校验
+        if (StringUtils.isBlank(requestParam)) {
+            log.error("requestId:{}, result:{}", requestId, "参数解密失败");
+            return CommonResponseVo.failure("参数解密失败", requestId);
+        }
+
+        IdentityInfoDto identityInfoDto = JSON.toJavaObject(JSON.parseObject(requestParam), IdentityInfoDto.class);
+        log.info("requestId:{},解密后参数:{}", requestId, identityInfoDto.toString());
+
+        if (StringUtils.isBlank(identityInfoDto.getIdCode()) || StringUtils.isBlank(identityInfoDto.getName())) {
+            log.error("requestId:{}, result:{}", requestId, "身份证号或姓名为空");
+            return CommonResponseVo.failure("身份证号或姓名为空", requestId);
+        }
+
+        IdentityInfoPo po = new IdentityInfoPo();
+        BeanUtils.copyProperties(identityInfoDto, po);
+        po.setCreateTime(new Date());
+        po.setRequestId(requestId);
+
+        try {
+            int result = mapper.insert(po);
+            if (result == 1) {
+                log.info("requestId:{}, result:{}", requestId, "成功");
+                return CommonResponseVo.success("成功", requestId);
+            } else {
+                log.error("requestId:{}, result:{}", requestId, "新增失败");
+                return CommonResponseVo.failure("新增失败", requestId);
+            }
+        } catch (Exception e) {
+            log.error("requestId:{}, result:{}, 异常:{}", requestId, "新增失败", e.getMessage());
+            return CommonResponseVo.failure("新增失败", requestId);
+        }
+    }
+
+    @Override
+    public List<String> getRequestIdByIdInfo(String idCode, String name) {
+        return mapper.getRequestIdByIdInfo(idCode, name);
+    }
+}

+ 16 - 0
src/main/java/com/jkcredit/data/datastorage/service/resultInfoService/ResultInfoService.java

@@ -0,0 +1,16 @@
+package com.jkcredit.data.datastorage.service.resultInfoService;
+
+import com.jkcredit.data.datastorage.model.vo.CommonResponseVo;
+import org.springframework.web.multipart.MultipartFile;
+
+/**
+ * @description:
+ * @author: xusonglin
+ * @create: 2020/7/15 14:19
+ * @version: V1.0
+ **/
+public interface ResultInfoService {
+    CommonResponseVo getResultInfo(String encodeParam);
+
+    CommonResponseVo saveResultInfo(MultipartFile resultFile);
+}

+ 145 - 0
src/main/java/com/jkcredit/data/datastorage/service/resultInfoService/ResultInfoServiceImpl.java

@@ -0,0 +1,145 @@
+package com.jkcredit.data.datastorage.service.resultInfoService;
+
+import cn.afterturn.easypoi.excel.ExcelImportUtil;
+import cn.afterturn.easypoi.excel.entity.ImportParams;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.google.common.util.concurrent.ThreadFactoryBuilder;
+import com.jkcredit.data.datastorage.mapper.ResultInfoMapper;
+import com.jkcredit.data.datastorage.model.dto.ResultFromFileDto;
+import com.jkcredit.data.datastorage.model.dto.ResultInfoDto;
+import com.jkcredit.data.datastorage.model.po.ResultInfoPo;
+import com.jkcredit.data.datastorage.model.vo.CommonResponseVo;
+import com.jkcredit.data.datastorage.service.identityInfoService.IdentityInfoService;
+import com.jkcredit.data.datastorage.util.CommonUtil;
+import com.jkcredit.data.datastorage.util.DESedeUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.PlatformTransactionManager;
+import org.springframework.transaction.TransactionDefinition;
+import org.springframework.transaction.TransactionStatus;
+import org.springframework.transaction.support.DefaultTransactionDefinition;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.annotation.Resource;
+import java.io.InputStream;
+import java.util.Date;
+import java.util.List;
+import java.util.concurrent.*;
+
+/**
+ * @description:
+ * @author: xusonglin
+ * @create: 2020/7/15 14:20
+ * @version: V1.0
+ **/
+@Slf4j
+@Service
+public class ResultInfoServiceImpl implements ResultInfoService {
+    @Value("${project.decryptKey}")
+    private String decryptKey;
+    @Resource
+    ResultInfoMapper mapper;
+    @Autowired
+    IdentityInfoService identityInfoService;
+    @Autowired
+    private PlatformTransactionManager transactionManager;
+
+    @Override
+    public CommonResponseVo getResultInfo(String encodeParam) {
+        String requestId = CommonUtil.getRequestId();
+
+        JSONObject requestObject = JSON.parseObject(encodeParam);
+        if (StringUtils.isBlank(requestObject.getString("param"))) {
+            log.error("getIdentityInfo -- tempRequestId:{}, result:{}", requestId, "参数为空");
+            return CommonResponseVo.failure("参数为空", requestId);
+        }
+        String requestParam = DESedeUtil.decryptMode(requestObject.getString("param"), decryptKey);
+
+        // 参数校验
+        if (StringUtils.isBlank(requestParam)) {
+            log.error("getIdentityInfo -- tempRequestId:{}, result:{}", requestId, "参数解密失败");
+            return CommonResponseVo.failure("参数解密失败", requestId);
+        }
+
+        ResultInfoDto resultInfoDto = JSON.toJavaObject(JSON.parseObject(requestParam), ResultInfoDto.class);
+        log.info("getIdentityInfo -- tempRequestId:{},解密后参数:{}", requestId, resultInfoDto.toString());
+
+        if (StringUtils.isBlank(resultInfoDto.getRequestId())) {
+            log.error("getIdentityInfo -- tempRequestId:{}, result:{}", requestId, "请求参数requestId为空");
+            return CommonResponseVo.failure("requestId为空", requestId);
+        }
+
+        requestId = resultInfoDto.getRequestId();
+        ResultInfoPo resultInfoPo = mapper.getResultInfoByRequestId(requestId);
+        if (resultInfoPo == null) {
+            return CommonResponseVo.noResult("暂无结果", requestId);
+        } else {
+            return CommonResponseVo.success(resultInfoPo.getResult(), requestId);
+        }
+    }
+
+    @Override
+    public CommonResponseVo saveResultInfo(MultipartFile resultFile) {
+        String requestId = CommonUtil.getRequestId();
+        ImportParams params = new ImportParams();
+        List<ResultFromFileDto> importList;
+        // 读取excel
+        try {
+            InputStream inputStream = resultFile.getInputStream();
+            importList = ExcelImportUtil.importExcel(inputStream, ResultFromFileDto.class, params);
+        } catch (Exception e) {
+            return CommonResponseVo.failure("读取excel失败", requestId);
+        }
+
+        int threadSize = 10;
+        int count = importList.size() / 10;
+        ThreadFactory namedThreadFactory = new ThreadFactoryBuilder().setNameFormat("thread-resultInfo-%d").build();
+
+        ExecutorService executor = new ThreadPoolExecutor(threadSize, threadSize, 200L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(), namedThreadFactory);
+
+        CountDownLatch countDownLatch = new CountDownLatch(threadSize);
+
+        List<ResultFromFileDto> newList;
+        try {
+            for (int i = 0; i < threadSize; i++) {
+                DefaultTransactionDefinition def = new DefaultTransactionDefinition();
+                def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
+                TransactionStatus status = transactionManager.getTransaction(def);
+                if ((i + 1) == threadSize) {
+                    int startIndex = (i * count);
+                    int endIndex = importList.size();
+                    newList = importList.subList(startIndex, endIndex);
+                } else {
+                    int startIndex = i * count;
+                    int endIndex = (i + 1) * count;
+                    newList = importList.subList(startIndex, endIndex);
+                }
+
+                List<ResultFromFileDto> finalNewList = newList;
+                executor.execute(new Thread(() -> {
+                    if (null != finalNewList) {
+                        for (ResultFromFileDto dto : finalNewList) {
+                            List<String> requestIds = identityInfoService.getRequestIdByIdInfo(dto.getIdCode(), dto.getName());
+                            ResultInfoPo po = new ResultInfoPo();
+                            po.setCreateTime(new Date());
+                            po.setRequestId(requestIds.get(0));
+                            po.setResult(dto.getResult());
+                            mapper.insert(po);
+                        }
+                    }
+                    countDownLatch.countDown();
+                }));
+                transactionManager.commit(status);
+            }
+        } catch (Exception e) {
+            log.error("requestId:{}, result:{}, 异常:{}", requestId, "新增结果失败", e.getMessage());
+            return CommonResponseVo.failure("新增结果失败", requestId);
+        }
+
+        return CommonResponseVo.success("操作完成", requestId);
+    }
+}

+ 19 - 0
src/main/java/com/jkcredit/data/datastorage/util/CommonUtil.java

@@ -0,0 +1,19 @@
+package com.jkcredit.data.datastorage.util;
+
+import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * @description:
+ * @author: xusonglin
+ * @create: 2020/1/9 21:01
+ * @version: V1.0
+ **/
+public class CommonUtil {
+    // 生成requestId
+    public static String getRequestId() {
+        return new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date()) + "-"
+                + UUID.randomUUID().toString();
+    }
+}

+ 106 - 0
src/main/java/com/jkcredit/data/datastorage/util/DESedeUtil.java

@@ -0,0 +1,106 @@
+package com.jkcredit.data.datastorage.util;
+
+import lombok.extern.slf4j.Slf4j;
+
+import javax.crypto.Cipher;
+import javax.crypto.SecretKey;
+import javax.crypto.spec.SecretKeySpec;
+import java.io.UnsupportedEncodingException;
+
+@Slf4j
+public class DESedeUtil {
+    //定义加密算法,有DES、DESede(即3DES)、Blowfish
+    private static final String Algorithm = "DESede";
+
+    /**
+     * 加密方法
+     *
+     * @param src 源数据的字节数组
+     * @return
+     */
+    public static String encryptMode(String src, String key) {
+        try {
+            log.info("开始加密");
+            SecretKey deskey = new SecretKeySpec(build3DesKey(key), Algorithm);    //生成密钥
+            Cipher c1 = Cipher.getInstance(Algorithm);    //实例化负责加密/解密的Cipher工具类
+            c1.init(Cipher.ENCRYPT_MODE, deskey);    //初始化为加密模式
+            return byteToHexString(c1.doFinal(src.getBytes()));
+
+        } catch (Exception e) {
+            log.error("加密失败:src={},key={}", src,key,e);
+        }
+        return "";
+    }
+
+
+
+    /**
+     * 解密函数
+     *
+     * @param src 密文的字节数组
+     * @return
+     */
+    public static String decryptMode(String src, String key) {
+        String result="";
+        try {
+            byte[] srcArray = hexStringToBytes(src);
+            SecretKey deskey = new SecretKeySpec(build3DesKey(key), Algorithm);
+            Cipher c1 = Cipher.getInstance(Algorithm);
+            c1.init(Cipher.DECRYPT_MODE, deskey); //初始化为解密模式
+            result= new String(c1.doFinal(srcArray));
+        } catch (Exception e) {
+            log.error("解密失败:src={},key={}", src,key,e);
+        }
+        return result;
+    }
+
+    public static String byteToHexString(byte[] b) {
+        String a = "";
+
+        for(int i = 0; i < b.length; ++i) {
+            String hex = Integer.toHexString(b[i] & 255);
+            if(hex.length() == 1) {
+                hex = '0' + hex;
+            }
+
+            a = a + hex;
+        }
+
+        return a;
+    }
+
+    public static byte[] build3DesKey(String keyStr) throws UnsupportedEncodingException {
+        byte[] key = new byte[24];    //声明一个24位的字节数组,默认里面都是0
+        byte[] temp = keyStr.getBytes("UTF-8");    //将字符串转成字节数组
+        if (key.length > temp.length) {
+            //如果temp不够24位,则拷贝temp数组整个长度的内容到key数组中
+            System.arraycopy(temp, 0, key, 0, temp.length);
+        } else {
+            //如果temp大于24位,则拷贝temp数组24个长度的内容到key数组中
+            System.arraycopy(temp, 0, key, 0, key.length);
+        }
+        return key;
+    }
+
+    public static byte[] hexStringToBytes(String hexString) {
+        if (hexString != null && !hexString.equals("")) {
+            hexString = hexString.toUpperCase();
+            int length = hexString.length() / 2;
+            char[] hexChars = hexString.toCharArray();
+            byte[] d = new byte[length];
+
+            for (int i = 0; i < length; ++i) {
+                int pos = i * 2;
+                d[i] = (byte) (charToByte(hexChars[pos]) << 4 | charToByte(hexChars[pos + 1]));
+            }
+            return d;
+        } else {
+            return null;
+        }
+    }
+
+    static byte charToByte(char c) {
+        return (byte) "0123456789ABCDEF".indexOf(c);
+    }
+
+}

+ 23 - 0
src/main/resources/application-dev.yml

@@ -0,0 +1,23 @@
+server:
+  port: 18082
+spring:
+  datasource:
+    url: jdbc:mysql://172.31.1.7:3306/identity_source?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
+    username: id_src
+    password: id_Src_p0ss
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    platform: mysql
+    hikari:
+      maximum-pool-size: 100
+      idle-timeout: 60000
+      connection-timeout: 60000
+      validation-timeout: 3000
+      login-timeout: 5
+      max-lifetime: 60000
+mybatis-plus:
+  mapper-locations: classpath:mapper/*Mapper.xml
+  global-config:
+    db-config:
+      table-prefix: h_
+project:
+  decryptKey: JK490FG2829

+ 23 - 0
src/main/resources/application-prod.yml

@@ -0,0 +1,23 @@
+server:
+  port: 18082
+spring:
+  datasource:
+    url: jdbc:mysql://127.0.0.1:3306/identity_source?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
+    username: id_src
+    password: id_Src_p0ss
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    platform: mysql
+    hikari:
+      maximum-pool-size: 100
+      idle-timeout: 60000
+      connection-timeout: 60000
+      validation-timeout: 3000
+      login-timeout: 5
+      max-lifetime: 60000
+mybatis-plus:
+  mapper-locations: classpath:mapper/*Mapper.xml
+  global-config:
+    db-config:
+      table-prefix: h_
+project:
+  decryptKey: JK490FG2829

+ 18 - 0
src/main/resources/application.yml

@@ -0,0 +1,18 @@
+spring:
+  application:
+    name: data-storage
+  servlet:
+    multipart:
+      enabled: true
+      max-file-size: 200MB
+      max-request-size: 200MB
+  profiles:
+    active: prod
+  jpa:
+    show-sql: true
+  resources:
+    static-locations: classpath:static/,file:static/
+server:
+  servlet:
+    session:
+      timeout: 600

+ 62 - 0
src/main/resources/logback-spring.xml

@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration debug="false" scan="false">
+    <springProperty scop="context" name="spring.application.name" source="spring.application.name" defaultValue=""/>
+    <property name="log.path" value="logs"/>
+    <!-- 彩色日志格式 -->
+    <property name="CONSOLE_LOG_PATTERN"
+              value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
+    <!-- 彩色日志依赖的渲染类 -->
+    <conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>
+    <conversionRule conversionWord="wex"
+                    converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
+    <conversionRule conversionWord="wEx"
+                    converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
+    <!-- Console log output -->
+    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>${CONSOLE_LOG_PATTERN}</pattern>
+        </encoder>
+    </appender>
+
+    <!-- Log file error output -->
+    <appender name="errorLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/error/error.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <fileNamePattern>${log.path}/error/error-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
+            <maxFileSize>50MB</maxFileSize>
+            <maxHistory>30</maxHistory>
+        </rollingPolicy>
+        <encoder>
+            <pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+            <level>ERROR</level>
+        </filter>
+    </appender>
+
+    <!-- Log file debug output -->
+    <appender name="sourceLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <!-- 过滤器,只记录WARN级别的日志 -->
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>INFO</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+        <file>${log.path}/source/source.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <fileNamePattern>${log.path}/source/source-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
+            <maxFileSize>50MB</maxFileSize>
+            <maxHistory>30</maxHistory>
+        </rollingPolicy>
+        <encoder>
+            <pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
+        </encoder>
+    </appender>
+
+    <!-- Level: FATAL 0  ERROR 3  WARN 4  INFO 6  DEBUG 7 -->
+    <root level="INFO">
+        <appender-ref ref="console"/>
+        <appender-ref ref="sourceLog"/>
+        <appender-ref ref="errorLog"/>
+    </root>
+</configuration>

+ 21 - 0
src/main/resources/mapper/IdentityInfoMapper.xml

@@ -0,0 +1,21 @@
+<?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.jkcredit.data.datastorage.mapper.IdentityInfoMapper">
+    <!-- 通用查询映射结果 -->
+    <resultMap id="baseResultMap" type="com.jkcredit.data.datastorage.model.po.IdentityInfoPo">
+        <result column="request_id" property="requestId"/>
+        <result column="id_code" property="idCode"/>
+        <result column="name" property="name"/>
+        <result column="create_time" property="createTime"/>
+    </resultMap>
+    <select id="getRequestIdByIdInfo" resultType="java.lang.String">
+        SELECT
+            request_id
+        FROM
+            identity_info
+        WHERE
+            id_code = #{idCode} and name = #{name}
+        ORDER BY
+            create_time desc
+    </select>
+</mapper>

+ 18 - 0
src/main/resources/mapper/ResultInfoMapper.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.jkcredit.data.datastorage.mapper.ResultInfoMapper">
+    <!-- 通用查询映射结果 -->
+    <resultMap id="baseResultMap" type="com.jkcredit.data.datastorage.model.po.ResultInfoPo">
+        <id column="request_id" property="requestId"/>
+        <result column="result" property="result"/>
+        <result column="create_time" property="createTime"/>
+    </resultMap>
+    <select id="getResultInfoByRequestId" resultMap="baseResultMap">
+        SELECT
+            *
+        FROM
+            result_info
+        WHERE
+            request_id = #{requestId}
+    </select>
+</mapper>

+ 13 - 0
src/test/java/com/jkcredit/data/datastorage/DataStorageApplicationTests.java

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