Ver código fonte

Merge branch '2.0.0' of http://git.ycjcjy.com/fuxingfan/smartCommunity into 2.0.0

张延森 6 anos atrás
pai
commit
59882a73df
100 arquivos alterados com 6684 adições e 0 exclusões
  1. 29
    0
      CODE/foreign-service/.gitignore
  2. 114
    0
      CODE/foreign-service/.mvn/wrapper/MavenWrapperDownloader.java
  3. BIN
      CODE/foreign-service/.mvn/wrapper/maven-wrapper.jar
  4. 1
    0
      CODE/foreign-service/.mvn/wrapper/maven-wrapper.properties
  5. 286
    0
      CODE/foreign-service/mvnw
  6. 161
    0
      CODE/foreign-service/mvnw.cmd
  7. 166
    0
      CODE/foreign-service/pom.xml
  8. 33
    0
      CODE/foreign-service/src/main/java/com/community/huiju/ForeignServiceApplication.java
  9. 92
    0
      CODE/foreign-service/src/main/java/com/community/huiju/aop/LogAOP.java
  10. 4
    0
      CODE/foreign-service/src/main/java/com/community/huiju/common/base/BaseController.java
  11. 72
    0
      CODE/foreign-service/src/main/java/com/community/huiju/common/base/ResponseBean.java
  12. 26
    0
      CODE/foreign-service/src/main/java/com/community/huiju/common/perproties/DaSuProperties.java
  13. 44
    0
      CODE/foreign-service/src/main/java/com/community/huiju/common/perproties/FuShiProperties.java
  14. 85
    0
      CODE/foreign-service/src/main/java/com/community/huiju/common/sign/DaSuSign.java
  15. 40
    0
      CODE/foreign-service/src/main/java/com/community/huiju/config/FuShiConfig.java
  16. 40
    0
      CODE/foreign-service/src/main/java/com/community/huiju/config/Swagger2.java
  17. 167
    0
      CODE/foreign-service/src/main/java/com/community/huiju/controller/FSController.java
  18. 111
    0
      CODE/foreign-service/src/main/java/com/community/huiju/controller/TaFceController.java
  19. 101
    0
      CODE/foreign-service/src/main/java/com/community/huiju/controller/TaUserController.java
  20. 113
    0
      CODE/foreign-service/src/main/java/com/community/huiju/controller/TaUserVerifyController.java
  21. 81
    0
      CODE/foreign-service/src/main/java/com/community/huiju/controller/TpAddressController.java
  22. 20
    0
      CODE/foreign-service/src/main/java/com/community/huiju/controller/TpBuildingController.java
  23. 20
    0
      CODE/foreign-service/src/main/java/com/community/huiju/controller/TpBuildingOwnerInfoController.java
  24. 20
    0
      CODE/foreign-service/src/main/java/com/community/huiju/controller/TpConfigurationController.java
  25. 52
    0
      CODE/foreign-service/src/main/java/com/community/huiju/controller/TpEquipmentController.java
  26. 20
    0
      CODE/foreign-service/src/main/java/com/community/huiju/controller/TpEquipmentTreeController.java
  27. 20
    0
      CODE/foreign-service/src/main/java/com/community/huiju/controller/TpLevelController.java
  28. 20
    0
      CODE/foreign-service/src/main/java/com/community/huiju/controller/TpPhaseController.java
  29. 20
    0
      CODE/foreign-service/src/main/java/com/community/huiju/controller/TpRoomNoController.java
  30. 20
    0
      CODE/foreign-service/src/main/java/com/community/huiju/controller/TpUnitController.java
  31. 38
    0
      CODE/foreign-service/src/main/java/com/community/huiju/dao/TaFaceMapper.java
  32. 16
    0
      CODE/foreign-service/src/main/java/com/community/huiju/dao/TaSysRoleMapper.java
  33. 16
    0
      CODE/foreign-service/src/main/java/com/community/huiju/dao/TaTemporaryLicenseOrderMapper.java
  34. 16
    0
      CODE/foreign-service/src/main/java/com/community/huiju/dao/TaUserLicenseOrderMapper.java
  35. 16
    0
      CODE/foreign-service/src/main/java/com/community/huiju/dao/TaUserMapper.java
  36. 97
    0
      CODE/foreign-service/src/main/java/com/community/huiju/dao/TaUserVerifyMapper.java
  37. 16
    0
      CODE/foreign-service/src/main/java/com/community/huiju/dao/TpBuildingMapper.java
  38. 16
    0
      CODE/foreign-service/src/main/java/com/community/huiju/dao/TpBuildingOwnerInfoMapper.java
  39. 16
    0
      CODE/foreign-service/src/main/java/com/community/huiju/dao/TpConfigurationMapper.java
  40. 71
    0
      CODE/foreign-service/src/main/java/com/community/huiju/dao/TpEquipmentMapper.java
  41. 27
    0
      CODE/foreign-service/src/main/java/com/community/huiju/dao/TpEquipmentTreeMapper.java
  42. 16
    0
      CODE/foreign-service/src/main/java/com/community/huiju/dao/TpLevelMapper.java
  43. 16
    0
      CODE/foreign-service/src/main/java/com/community/huiju/dao/TpPhaseMapper.java
  44. 16
    0
      CODE/foreign-service/src/main/java/com/community/huiju/dao/TpRoomNoMapper.java
  45. 16
    0
      CODE/foreign-service/src/main/java/com/community/huiju/dao/TpUnitMapper.java
  46. 76
    0
      CODE/foreign-service/src/main/java/com/community/huiju/enums/ResponseErrorsMessages.java
  47. 52
    0
      CODE/foreign-service/src/main/java/com/community/huiju/exception/ExceptionHandleAdice.java
  48. 35
    0
      CODE/foreign-service/src/main/java/com/community/huiju/exception/WisdomException.java
  49. 123
    0
      CODE/foreign-service/src/main/java/com/community/huiju/filter/SignFilter.java
  50. 58
    0
      CODE/foreign-service/src/main/java/com/community/huiju/jwt/JwtUtil.java
  51. 32
    0
      CODE/foreign-service/src/main/java/com/community/huiju/log/LogAnnotation.java
  52. 43
    0
      CODE/foreign-service/src/main/java/com/community/huiju/log/LogEnums.java
  53. 101
    0
      CODE/foreign-service/src/main/java/com/community/huiju/log/LogFactory.java
  54. 46
    0
      CODE/foreign-service/src/main/java/com/community/huiju/log/LogFileManager.java
  55. 69
    0
      CODE/foreign-service/src/main/java/com/community/huiju/model/TaFace.java
  56. 64
    0
      CODE/foreign-service/src/main/java/com/community/huiju/model/TaSysRole.java
  57. 119
    0
      CODE/foreign-service/src/main/java/com/community/huiju/model/TaTemporaryLicenseOrder.java
  58. 155
    0
      CODE/foreign-service/src/main/java/com/community/huiju/model/TaUser.java
  59. 124
    0
      CODE/foreign-service/src/main/java/com/community/huiju/model/TaUserLicenseOrder.java
  60. 119
    0
      CODE/foreign-service/src/main/java/com/community/huiju/model/TaUserVerify.java
  61. 64
    0
      CODE/foreign-service/src/main/java/com/community/huiju/model/TpBuilding.java
  62. 149
    0
      CODE/foreign-service/src/main/java/com/community/huiju/model/TpBuildingOwnerInfo.java
  63. 93
    0
      CODE/foreign-service/src/main/java/com/community/huiju/model/TpConfiguration.java
  64. 148
    0
      CODE/foreign-service/src/main/java/com/community/huiju/model/TpEquipment.java
  65. 99
    0
      CODE/foreign-service/src/main/java/com/community/huiju/model/TpEquipmentTree.java
  66. 84
    0
      CODE/foreign-service/src/main/java/com/community/huiju/model/TpLevel.java
  67. 56
    0
      CODE/foreign-service/src/main/java/com/community/huiju/model/TpPhase.java
  68. 94
    0
      CODE/foreign-service/src/main/java/com/community/huiju/model/TpRoomNo.java
  69. 74
    0
      CODE/foreign-service/src/main/java/com/community/huiju/model/TpUnit.java
  70. 45
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/FaceServiceI.java
  71. 77
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/IFuShiService.java
  72. 32
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/IHKService.java
  73. 16
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/ITaSysRoleService.java
  74. 18
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/ITaTemporaryLicenseOrderService.java
  75. 16
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/ITaUserLicenseOrderService.java
  76. 68
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/ITaUserService.java
  77. 55
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/ITaUserVerifyService.java
  78. 16
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/ITpBuildingOwnerInfoService.java
  79. 25
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/ITpBuildingService.java
  80. 16
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/ITpConfigurationService.java
  81. 26
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/ITpEquipmentService.java
  82. 16
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/ITpEquipmentTreeService.java
  83. 27
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/ITpLevelService.java
  84. 24
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/ITpPhaseService.java
  85. 28
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/ITpRoomNoService.java
  86. 26
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/ITpUnitService.java
  87. 15
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/ImageServiceI.java
  88. 440
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/impl/FaceServicelimpl.java
  89. 277
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/impl/FuShiServiceImpl.java
  90. 369
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/impl/HKServiceImpl.java
  91. 46
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/impl/ImageServiceimpl.java
  92. 20
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/impl/TaSysRoleServiceImpl.java
  93. 20
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/impl/TaTemporaryLicenseOrderServiceImpl.java
  94. 20
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/impl/TaUserLicenseOrderServiceImpl.java
  95. 139
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/impl/TaUserServiceImpl.java
  96. 267
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/impl/TaUserVerifyServiceImpl.java
  97. 20
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/impl/TpBuildingOwnerInfoServiceImpl.java
  98. 36
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/impl/TpBuildingServiceImpl.java
  99. 20
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/impl/TpConfigurationServiceImpl.java
  100. 0
    0
      CODE/foreign-service/src/main/java/com/community/huiju/service/impl/TpEquipmentServiceImpl.java

+ 29
- 0
CODE/foreign-service/.gitignore Ver arquivo

@@ -0,0 +1,29 @@
1
+HELP.md
2
+/target/
3
+!.mvn/wrapper/maven-wrapper.jar
4
+
5
+### STS ###
6
+.apt_generated
7
+.classpath
8
+.factorypath
9
+.project
10
+.settings
11
+.springBeans
12
+.sts4-cache
13
+
14
+### IntelliJ IDEA ###
15
+.idea
16
+*.iws
17
+*.iml
18
+*.ipr
19
+
20
+### NetBeans ###
21
+/nbproject/private/
22
+/nbbuild/
23
+/dist/
24
+/nbdist/
25
+/.nb-gradle/
26
+/build/
27
+
28
+### VS Code ###
29
+.vscode/

+ 114
- 0
CODE/foreign-service/.mvn/wrapper/MavenWrapperDownloader.java Ver arquivo

@@ -0,0 +1,114 @@
1
+/*
2
+Licensed to the Apache Software Foundation (ASF) under one
3
+or more contributor license agreements.  See the NOTICE file
4
+distributed with this work for additional information
5
+regarding copyright ownership.  The ASF licenses this file
6
+to you under the Apache License, Version 2.0 (the
7
+"License"); you may not use this file except in compliance
8
+with the License.  You may obtain a copy of the License at
9
+
10
+  https://www.apache.org/licenses/LICENSE-2.0
11
+
12
+Unless required by applicable law or agreed to in writing,
13
+software distributed under the License is distributed on an
14
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+KIND, either express or implied.  See the License for the
16
+specific language governing permissions and limitations
17
+under the License.
18
+*/
19
+
20
+import java.io.File;
21
+import java.io.FileInputStream;
22
+import java.io.FileOutputStream;
23
+import java.io.IOException;
24
+import java.net.URL;
25
+import java.nio.channels.Channels;
26
+import java.nio.channels.ReadableByteChannel;
27
+import java.util.Properties;
28
+
29
+public class MavenWrapperDownloader {
30
+
31
+    /**
32
+     * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
33
+     */
34
+    private static final String DEFAULT_DOWNLOAD_URL =
35
+            "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar";
36
+
37
+    /**
38
+     * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
39
+     * use instead of the default one.
40
+     */
41
+    private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
42
+            ".mvn/wrapper/maven-wrapper.properties";
43
+
44
+    /**
45
+     * Path where the maven-wrapper.jar will be saved to.
46
+     */
47
+    private static final String MAVEN_WRAPPER_JAR_PATH =
48
+            ".mvn/wrapper/maven-wrapper.jar";
49
+
50
+    /**
51
+     * Name of the property which should be used to override the default download url for the wrapper.
52
+     */
53
+    private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
54
+
55
+    public static void main(String args[]) {
56
+        System.out.println("- Downloader started");
57
+        File baseDirectory = new File(args[0]);
58
+        System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
59
+
60
+        // If the maven-wrapper.properties exists, read it and check if it contains a custom
61
+        // wrapperUrl parameter.
62
+        File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
63
+        String url = DEFAULT_DOWNLOAD_URL;
64
+        if (mavenWrapperPropertyFile.exists()) {
65
+            FileInputStream mavenWrapperPropertyFileInputStream = null;
66
+            try {
67
+                mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
68
+                Properties mavenWrapperProperties = new Properties();
69
+                mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
70
+                url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
71
+            } catch (IOException e) {
72
+                System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
73
+            } finally {
74
+                try {
75
+                    if (mavenWrapperPropertyFileInputStream != null) {
76
+                        mavenWrapperPropertyFileInputStream.close();
77
+                    }
78
+                } catch (IOException e) {
79
+                    // Ignore ...
80
+                }
81
+            }
82
+        }
83
+        System.out.println("- Downloading from: : " + url);
84
+
85
+        File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
86
+        if (!outputFile.getParentFile().exists()) {
87
+            if (!outputFile.getParentFile().mkdirs()) {
88
+                System.out.println(
89
+                        "- ERROR creating output direcrory '" + outputFile.getParentFile().getAbsolutePath() + "'");
90
+            }
91
+        }
92
+        System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
93
+        try {
94
+            downloadFileFromURL(url, outputFile);
95
+            System.out.println("Done");
96
+            System.exit(0);
97
+        } catch (Throwable e) {
98
+            System.out.println("- Error downloading");
99
+            e.printStackTrace();
100
+            System.exit(1);
101
+        }
102
+    }
103
+
104
+    private static void downloadFileFromURL(String urlString, File destination) throws Exception {
105
+        URL website = new URL(urlString);
106
+        ReadableByteChannel rbc;
107
+        rbc = Channels.newChannel(website.openStream());
108
+        FileOutputStream fos = new FileOutputStream(destination);
109
+        fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
110
+        fos.close();
111
+        rbc.close();
112
+    }
113
+
114
+}

BIN
CODE/foreign-service/.mvn/wrapper/maven-wrapper.jar Ver arquivo


+ 1
- 0
CODE/foreign-service/.mvn/wrapper/maven-wrapper.properties Ver arquivo

@@ -0,0 +1 @@
1
+distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip

+ 286
- 0
CODE/foreign-service/mvnw Ver arquivo

@@ -0,0 +1,286 @@
1
+#!/bin/sh
2
+# ----------------------------------------------------------------------------
3
+# Licensed to the Apache Software Foundation (ASF) under one
4
+# or more contributor license agreements.  See the NOTICE file
5
+# distributed with this work for additional information
6
+# regarding copyright ownership.  The ASF licenses this file
7
+# to you under the Apache License, Version 2.0 (the
8
+# "License"); you may not use this file except in compliance
9
+# with the License.  You may obtain a copy of the License at
10
+#
11
+#    https://www.apache.org/licenses/LICENSE-2.0
12
+#
13
+# Unless required by applicable law or agreed to in writing,
14
+# software distributed under the License is distributed on an
15
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+# KIND, either express or implied.  See the License for the
17
+# specific language governing permissions and limitations
18
+# under the License.
19
+# ----------------------------------------------------------------------------
20
+
21
+# ----------------------------------------------------------------------------
22
+# Maven2 Start Up Batch script
23
+#
24
+# Required ENV vars:
25
+# ------------------
26
+#   JAVA_HOME - location of a JDK home dir
27
+#
28
+# Optional ENV vars
29
+# -----------------
30
+#   M2_HOME - location of maven2's installed home dir
31
+#   MAVEN_OPTS - parameters passed to the Java VM when running Maven
32
+#     e.g. to debug Maven itself, use
33
+#       set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
34
+#   MAVEN_SKIP_RC - flag to disable loading of mavenrc files
35
+# ----------------------------------------------------------------------------
36
+
37
+if [ -z "$MAVEN_SKIP_RC" ] ; then
38
+
39
+  if [ -f /etc/mavenrc ] ; then
40
+    . /etc/mavenrc
41
+  fi
42
+
43
+  if [ -f "$HOME/.mavenrc" ] ; then
44
+    . "$HOME/.mavenrc"
45
+  fi
46
+
47
+fi
48
+
49
+# OS specific support.  $var _must_ be set to either true or false.
50
+cygwin=false;
51
+darwin=false;
52
+mingw=false
53
+case "`uname`" in
54
+  CYGWIN*) cygwin=true ;;
55
+  MINGW*) mingw=true;;
56
+  Darwin*) darwin=true
57
+    # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
58
+    # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
59
+    if [ -z "$JAVA_HOME" ]; then
60
+      if [ -x "/usr/libexec/java_home" ]; then
61
+        export JAVA_HOME="`/usr/libexec/java_home`"
62
+      else
63
+        export JAVA_HOME="/Library/Java/Home"
64
+      fi
65
+    fi
66
+    ;;
67
+esac
68
+
69
+if [ -z "$JAVA_HOME" ] ; then
70
+  if [ -r /etc/gentoo-release ] ; then
71
+    JAVA_HOME=`java-config --jre-home`
72
+  fi
73
+fi
74
+
75
+if [ -z "$M2_HOME" ] ; then
76
+  ## resolve links - $0 may be a link to maven's home
77
+  PRG="$0"
78
+
79
+  # need this for relative symlinks
80
+  while [ -h "$PRG" ] ; do
81
+    ls=`ls -ld "$PRG"`
82
+    link=`expr "$ls" : '.*-> \(.*\)$'`
83
+    if expr "$link" : '/.*' > /dev/null; then
84
+      PRG="$link"
85
+    else
86
+      PRG="`dirname "$PRG"`/$link"
87
+    fi
88
+  done
89
+
90
+  saveddir=`pwd`
91
+
92
+  M2_HOME=`dirname "$PRG"`/..
93
+
94
+  # make it fully qualified
95
+  M2_HOME=`cd "$M2_HOME" && pwd`
96
+
97
+  cd "$saveddir"
98
+  # echo Using m2 at $M2_HOME
99
+fi
100
+
101
+# For Cygwin, ensure paths are in UNIX format before anything is touched
102
+if $cygwin ; then
103
+  [ -n "$M2_HOME" ] &&
104
+    M2_HOME=`cygpath --unix "$M2_HOME"`
105
+  [ -n "$JAVA_HOME" ] &&
106
+    JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
107
+  [ -n "$CLASSPATH" ] &&
108
+    CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
109
+fi
110
+
111
+# For Mingw, ensure paths are in UNIX format before anything is touched
112
+if $mingw ; then
113
+  [ -n "$M2_HOME" ] &&
114
+    M2_HOME="`(cd "$M2_HOME"; pwd)`"
115
+  [ -n "$JAVA_HOME" ] &&
116
+    JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
117
+  # TODO classpath?
118
+fi
119
+
120
+if [ -z "$JAVA_HOME" ]; then
121
+  javaExecutable="`which javac`"
122
+  if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
123
+    # readlink(1) is not available as standard on Solaris 10.
124
+    readLink=`which readlink`
125
+    if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
126
+      if $darwin ; then
127
+        javaHome="`dirname \"$javaExecutable\"`"
128
+        javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
129
+      else
130
+        javaExecutable="`readlink -f \"$javaExecutable\"`"
131
+      fi
132
+      javaHome="`dirname \"$javaExecutable\"`"
133
+      javaHome=`expr "$javaHome" : '\(.*\)/bin'`
134
+      JAVA_HOME="$javaHome"
135
+      export JAVA_HOME
136
+    fi
137
+  fi
138
+fi
139
+
140
+if [ -z "$JAVACMD" ] ; then
141
+  if [ -n "$JAVA_HOME"  ] ; then
142
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
143
+      # IBM's JDK on AIX uses strange locations for the executables
144
+      JAVACMD="$JAVA_HOME/jre/sh/java"
145
+    else
146
+      JAVACMD="$JAVA_HOME/bin/java"
147
+    fi
148
+  else
149
+    JAVACMD="`which java`"
150
+  fi
151
+fi
152
+
153
+if [ ! -x "$JAVACMD" ] ; then
154
+  echo "Error: JAVA_HOME is not defined correctly." >&2
155
+  echo "  We cannot execute $JAVACMD" >&2
156
+  exit 1
157
+fi
158
+
159
+if [ -z "$JAVA_HOME" ] ; then
160
+  echo "Warning: JAVA_HOME environment variable is not set."
161
+fi
162
+
163
+CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
164
+
165
+# traverses directory structure from process work directory to filesystem root
166
+# first directory with .mvn subdirectory is considered project base directory
167
+find_maven_basedir() {
168
+
169
+  if [ -z "$1" ]
170
+  then
171
+    echo "Path not specified to find_maven_basedir"
172
+    return 1
173
+  fi
174
+
175
+  basedir="$1"
176
+  wdir="$1"
177
+  while [ "$wdir" != '/' ] ; do
178
+    if [ -d "$wdir"/.mvn ] ; then
179
+      basedir=$wdir
180
+      break
181
+    fi
182
+    # workaround for JBEAP-8937 (on Solaris 10/Sparc)
183
+    if [ -d "${wdir}" ]; then
184
+      wdir=`cd "$wdir/.."; pwd`
185
+    fi
186
+    # end of workaround
187
+  done
188
+  echo "${basedir}"
189
+}
190
+
191
+# concatenates all lines of a file
192
+concat_lines() {
193
+  if [ -f "$1" ]; then
194
+    echo "$(tr -s '\n' ' ' < "$1")"
195
+  fi
196
+}
197
+
198
+BASE_DIR=`find_maven_basedir "$(pwd)"`
199
+if [ -z "$BASE_DIR" ]; then
200
+  exit 1;
201
+fi
202
+
203
+##########################################################################################
204
+# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
205
+# This allows using the maven wrapper in projects that prohibit checking in binary data.
206
+##########################################################################################
207
+if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
208
+    if [ "$MVNW_VERBOSE" = true ]; then
209
+      echo "Found .mvn/wrapper/maven-wrapper.jar"
210
+    fi
211
+else
212
+    if [ "$MVNW_VERBOSE" = true ]; then
213
+      echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
214
+    fi
215
+    jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"
216
+    while IFS="=" read key value; do
217
+      case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
218
+      esac
219
+    done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
220
+    if [ "$MVNW_VERBOSE" = true ]; then
221
+      echo "Downloading from: $jarUrl"
222
+    fi
223
+    wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
224
+
225
+    if command -v wget > /dev/null; then
226
+        if [ "$MVNW_VERBOSE" = true ]; then
227
+          echo "Found wget ... using wget"
228
+        fi
229
+        wget "$jarUrl" -O "$wrapperJarPath"
230
+    elif command -v curl > /dev/null; then
231
+        if [ "$MVNW_VERBOSE" = true ]; then
232
+          echo "Found curl ... using curl"
233
+        fi
234
+        curl -o "$wrapperJarPath" "$jarUrl"
235
+    else
236
+        if [ "$MVNW_VERBOSE" = true ]; then
237
+          echo "Falling back to using Java to download"
238
+        fi
239
+        javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
240
+        if [ -e "$javaClass" ]; then
241
+            if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
242
+                if [ "$MVNW_VERBOSE" = true ]; then
243
+                  echo " - Compiling MavenWrapperDownloader.java ..."
244
+                fi
245
+                # Compiling the Java class
246
+                ("$JAVA_HOME/bin/javac" "$javaClass")
247
+            fi
248
+            if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
249
+                # Running the downloader
250
+                if [ "$MVNW_VERBOSE" = true ]; then
251
+                  echo " - Running MavenWrapperDownloader.java ..."
252
+                fi
253
+                ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
254
+            fi
255
+        fi
256
+    fi
257
+fi
258
+##########################################################################################
259
+# End of extension
260
+##########################################################################################
261
+
262
+export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
263
+if [ "$MVNW_VERBOSE" = true ]; then
264
+  echo $MAVEN_PROJECTBASEDIR
265
+fi
266
+MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
267
+
268
+# For Cygwin, switch paths to Windows format before running java
269
+if $cygwin; then
270
+  [ -n "$M2_HOME" ] &&
271
+    M2_HOME=`cygpath --path --windows "$M2_HOME"`
272
+  [ -n "$JAVA_HOME" ] &&
273
+    JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
274
+  [ -n "$CLASSPATH" ] &&
275
+    CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
276
+  [ -n "$MAVEN_PROJECTBASEDIR" ] &&
277
+    MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
278
+fi
279
+
280
+WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
281
+
282
+exec "$JAVACMD" \
283
+  $MAVEN_OPTS \
284
+  -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
285
+  "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
286
+  ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

+ 161
- 0
CODE/foreign-service/mvnw.cmd Ver arquivo

@@ -0,0 +1,161 @@
1
+@REM ----------------------------------------------------------------------------
2
+@REM Licensed to the Apache Software Foundation (ASF) under one
3
+@REM or more contributor license agreements.  See the NOTICE file
4
+@REM distributed with this work for additional information
5
+@REM regarding copyright ownership.  The ASF licenses this file
6
+@REM to you under the Apache License, Version 2.0 (the
7
+@REM "License"); you may not use this file except in compliance
8
+@REM with the License.  You may obtain a copy of the License at
9
+@REM
10
+@REM    https://www.apache.org/licenses/LICENSE-2.0
11
+@REM
12
+@REM Unless required by applicable law or agreed to in writing,
13
+@REM software distributed under the License is distributed on an
14
+@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+@REM KIND, either express or implied.  See the License for the
16
+@REM specific language governing permissions and limitations
17
+@REM under the License.
18
+@REM ----------------------------------------------------------------------------
19
+
20
+@REM ----------------------------------------------------------------------------
21
+@REM Maven2 Start Up Batch script
22
+@REM
23
+@REM Required ENV vars:
24
+@REM JAVA_HOME - location of a JDK home dir
25
+@REM
26
+@REM Optional ENV vars
27
+@REM M2_HOME - location of maven2's installed home dir
28
+@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
29
+@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
30
+@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
31
+@REM     e.g. to debug Maven itself, use
32
+@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
33
+@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
34
+@REM ----------------------------------------------------------------------------
35
+
36
+@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
37
+@echo off
38
+@REM set title of command window
39
+title %0
40
+@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
41
+@if "%MAVEN_BATCH_ECHO%" == "on"  echo %MAVEN_BATCH_ECHO%
42
+
43
+@REM set %HOME% to equivalent of $HOME
44
+if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
45
+
46
+@REM Execute a user defined script before this one
47
+if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
48
+@REM check for pre script, once with legacy .bat ending and once with .cmd ending
49
+if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
50
+if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
51
+:skipRcPre
52
+
53
+@setlocal
54
+
55
+set ERROR_CODE=0
56
+
57
+@REM To isolate internal variables from possible post scripts, we use another setlocal
58
+@setlocal
59
+
60
+@REM ==== START VALIDATION ====
61
+if not "%JAVA_HOME%" == "" goto OkJHome
62
+
63
+echo.
64
+echo Error: JAVA_HOME not found in your environment. >&2
65
+echo Please set the JAVA_HOME variable in your environment to match the >&2
66
+echo location of your Java installation. >&2
67
+echo.
68
+goto error
69
+
70
+:OkJHome
71
+if exist "%JAVA_HOME%\bin\java.exe" goto init
72
+
73
+echo.
74
+echo Error: JAVA_HOME is set to an invalid directory. >&2
75
+echo JAVA_HOME = "%JAVA_HOME%" >&2
76
+echo Please set the JAVA_HOME variable in your environment to match the >&2
77
+echo location of your Java installation. >&2
78
+echo.
79
+goto error
80
+
81
+@REM ==== END VALIDATION ====
82
+
83
+:init
84
+
85
+@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
86
+@REM Fallback to current working directory if not found.
87
+
88
+set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
89
+IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
90
+
91
+set EXEC_DIR=%CD%
92
+set WDIR=%EXEC_DIR%
93
+:findBaseDir
94
+IF EXIST "%WDIR%"\.mvn goto baseDirFound
95
+cd ..
96
+IF "%WDIR%"=="%CD%" goto baseDirNotFound
97
+set WDIR=%CD%
98
+goto findBaseDir
99
+
100
+:baseDirFound
101
+set MAVEN_PROJECTBASEDIR=%WDIR%
102
+cd "%EXEC_DIR%"
103
+goto endDetectBaseDir
104
+
105
+:baseDirNotFound
106
+set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
107
+cd "%EXEC_DIR%"
108
+
109
+:endDetectBaseDir
110
+
111
+IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
112
+
113
+@setlocal EnableExtensions EnableDelayedExpansion
114
+for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
115
+@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
116
+
117
+:endReadAdditionalConfig
118
+
119
+SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
120
+set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
121
+set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
122
+
123
+set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"
124
+FOR /F "tokens=1,2 delims==" %%A IN (%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties) DO (
125
+	IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B 
126
+)
127
+
128
+@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
129
+@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
130
+if exist %WRAPPER_JAR% (
131
+    echo Found %WRAPPER_JAR%
132
+) else (
133
+    echo Couldn't find %WRAPPER_JAR%, downloading it ...
134
+	echo Downloading from: %DOWNLOAD_URL%
135
+    powershell -Command "(New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"
136
+    echo Finished downloading %WRAPPER_JAR%
137
+)
138
+@REM End of extension
139
+
140
+%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
141
+if ERRORLEVEL 1 goto error
142
+goto end
143
+
144
+:error
145
+set ERROR_CODE=1
146
+
147
+:end
148
+@endlocal & set ERROR_CODE=%ERROR_CODE%
149
+
150
+if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
151
+@REM check for post script, once with legacy .bat ending and once with .cmd ending
152
+if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
153
+if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
154
+:skipRcPost
155
+
156
+@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
157
+if "%MAVEN_BATCH_PAUSE%" == "on" pause
158
+
159
+if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
160
+
161
+exit /B %ERROR_CODE%

+ 166
- 0
CODE/foreign-service/pom.xml Ver arquivo

@@ -0,0 +1,166 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4
+    <modelVersion>4.0.0</modelVersion>
5
+    <parent>
6
+        <groupId>org.springframework.boot</groupId>
7
+        <artifactId>spring-boot-starter-parent</artifactId>
8
+        <version>2.1.4.RELEASE</version>
9
+        <relativePath/> <!-- lookup parent from repository -->
10
+    </parent>
11
+    <groupId>com.example</groupId>
12
+    <artifactId>foreign-service</artifactId>
13
+    <version>0.0.1-SNAPSHOT</version>
14
+    <name>foreign-service</name>
15
+    <description>对外访问服务</description>
16
+
17
+    <properties>
18
+        <java.version>1.8</java.version>
19
+        <mybatis.plus.version>3.1.1</mybatis.plus.version>
20
+        <fastjson.version>1.2.58</fastjson.version>
21
+        <springfox-swagger2.version>2.7.0</springfox-swagger2.version>
22
+        <commons.logging.version>1.2</commons.logging.version>
23
+    </properties>
24
+
25
+    <dependencies>
26
+        <dependency>
27
+            <groupId>org.springframework.boot</groupId>
28
+            <artifactId>spring-boot-starter-web</artifactId>
29
+        </dependency>
30
+
31
+        <dependency>
32
+            <groupId>mysql</groupId>
33
+            <artifactId>mysql-connector-java</artifactId>
34
+            <version>6.0.6</version>
35
+            <scope>runtime</scope>
36
+        </dependency>
37
+        <dependency>
38
+            <groupId>org.projectlombok</groupId>
39
+            <artifactId>lombok</artifactId>
40
+            <optional>true</optional>
41
+        </dependency>
42
+
43
+        <dependency>
44
+            <groupId>com.baomidou</groupId>
45
+            <artifactId>mybatis-plus-boot-starter</artifactId>
46
+            <version>${mybatis.plus.version}</version>
47
+        </dependency>
48
+
49
+        <!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
50
+        <dependency>
51
+            <groupId>com.alibaba</groupId>
52
+            <artifactId>fastjson</artifactId>
53
+            <version>${fastjson.version}</version>
54
+        </dependency>
55
+
56
+        <dependency>
57
+            <groupId>io.springfox</groupId>
58
+            <artifactId>springfox-swagger2</artifactId>
59
+            <version>${springfox-swagger2.version}</version>
60
+        </dependency>
61
+
62
+        <dependency>
63
+            <groupId>io.springfox</groupId>
64
+            <artifactId>springfox-swagger-ui</artifactId>
65
+            <version>${springfox-swagger2.version}</version>
66
+        </dependency>
67
+
68
+        <dependency>
69
+            <groupId>commons-logging</groupId>
70
+            <artifactId>commons-logging</artifactId>
71
+            <version>${commons.logging.version}</version>
72
+        </dependency>
73
+
74
+        <!-- https://mvnrepository.com/artifact/com.alibaba/druid-spring-boot-starter -->
75
+        <dependency>
76
+            <groupId>com.alibaba</groupId>
77
+            <artifactId>druid-spring-boot-starter</artifactId>
78
+            <version>1.1.16</version>
79
+        </dependency>
80
+
81
+
82
+        <!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
83
+        <dependency>
84
+            <groupId>com.google.guava</groupId>
85
+            <artifactId>guava</artifactId>
86
+            <version>26.0-jre</version>
87
+        </dependency>
88
+
89
+        <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
90
+        <dependency>
91
+            <groupId>org.apache.commons</groupId>
92
+            <artifactId>commons-lang3</artifactId>
93
+            <version>3.8.1</version>
94
+        </dependency>
95
+
96
+        <!-- https://mvnrepository.com/artifact/commons-lang/commons-lang -->
97
+        <dependency>
98
+            <groupId>commons-lang</groupId>
99
+            <artifactId>commons-lang</artifactId>
100
+            <version>2.6</version>
101
+        </dependency>
102
+
103
+        <!-- https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp -->
104
+        <dependency>
105
+            <groupId>com.squareup.okhttp3</groupId>
106
+            <artifactId>okhttp</artifactId>
107
+            <version>3.11.0</version>
108
+        </dependency>
109
+
110
+        <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-collections4 -->
111
+        <dependency>
112
+            <groupId>org.apache.commons</groupId>
113
+            <artifactId>commons-collections4</artifactId>
114
+            <version>4.1</version>
115
+        </dependency>
116
+
117
+        <dependency>
118
+            <groupId>commons-httpclient</groupId>
119
+            <artifactId>commons-httpclient</artifactId>
120
+            <version>3.1</version>
121
+        </dependency>
122
+
123
+        <!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
124
+        <dependency>
125
+            <groupId>commons-io</groupId>
126
+            <artifactId>commons-io</artifactId>
127
+            <version>1.4</version>
128
+        </dependency>
129
+
130
+        <!-- JWT -->
131
+        <dependency>
132
+            <groupId>org.bitbucket.b_c</groupId>
133
+            <artifactId>jose4j</artifactId>
134
+            <version>0.6.5</version>
135
+        </dependency>
136
+
137
+        <dependency>
138
+            <groupId>com.community</groupId>
139
+            <artifactId>community-common</artifactId>
140
+            <version>0.0.1</version>
141
+        </dependency>
142
+
143
+        <dependency>
144
+            <groupId>org.springframework.boot</groupId>
145
+            <artifactId>spring-boot-starter-test</artifactId>
146
+            <scope>test</scope>
147
+        </dependency>
148
+
149
+        <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-aop -->
150
+        <dependency>
151
+            <groupId>org.springframework.boot</groupId>
152
+            <artifactId>spring-boot-starter-aop</artifactId>
153
+            <version>2.0.4.RELEASE</version>
154
+        </dependency>
155
+    </dependencies>
156
+
157
+    <build>
158
+        <plugins>
159
+            <plugin>
160
+                <groupId>org.springframework.boot</groupId>
161
+                <artifactId>spring-boot-maven-plugin</artifactId>
162
+            </plugin>
163
+        </plugins>
164
+    </build>
165
+
166
+</project>

+ 33
- 0
CODE/foreign-service/src/main/java/com/community/huiju/ForeignServiceApplication.java Ver arquivo

@@ -0,0 +1,33 @@
1
+package com.community.huiju;
2
+
3
+import com.alibaba.fastjson.serializer.SerializerFeature;
4
+import com.alibaba.fastjson.support.config.FastJsonConfig;
5
+import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
6
+import org.mybatis.spring.annotation.MapperScan;
7
+import org.springframework.boot.SpringApplication;
8
+import org.springframework.boot.autoconfigure.SpringBootApplication;
9
+import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
10
+import org.springframework.context.annotation.Bean;
11
+import org.springframework.transaction.annotation.EnableTransactionManagement;
12
+
13
+@SpringBootApplication
14
+@MapperScan("com.community.huiju.dao")
15
+@EnableTransactionManagement
16
+public class ForeignServiceApplication {
17
+
18
+    public static void main(String[] args) {
19
+        SpringApplication.run(ForeignServiceApplication.class, args);
20
+    }
21
+
22
+    @Bean
23
+    public HttpMessageConverters fastJsonConfigure(){
24
+        FastJsonHttpMessageConverter converter = new FastJsonHttpMessageConverter();
25
+        FastJsonConfig fastJsonConfig = new FastJsonConfig();
26
+        fastJsonConfig.setSerializerFeatures(SerializerFeature.BrowserCompatible, SerializerFeature.PrettyFormat,SerializerFeature.DisableCircularReferenceDetect,SerializerFeature.WriteMapNullValue);
27
+        //日期格式化
28
+        fastJsonConfig.setDateFormat("yyyy-MM-dd HH:mm:ss");
29
+        converter.setFastJsonConfig(fastJsonConfig);
30
+        return new HttpMessageConverters(converter);
31
+    }
32
+
33
+}

+ 92
- 0
CODE/foreign-service/src/main/java/com/community/huiju/aop/LogAOP.java Ver arquivo

@@ -0,0 +1,92 @@
1
+package com.community.huiju.aop;
2
+
3
+import com.alibaba.fastjson.JSONObject;
4
+import com.community.commom.fushi.error.FuShiException;
5
+import com.community.huiju.log.LogAnnotation;
6
+import com.community.huiju.log.LogEnums;
7
+import com.community.huiju.log.LogFactory;
8
+import com.community.huiju.log.LogFileManager;
9
+import lombok.extern.slf4j.Slf4j;
10
+import org.aspectj.lang.JoinPoint;
11
+import org.aspectj.lang.ProceedingJoinPoint;
12
+import org.aspectj.lang.Signature;
13
+import org.aspectj.lang.annotation.AfterThrowing;
14
+import org.aspectj.lang.annotation.Around;
15
+import org.aspectj.lang.annotation.Aspect;
16
+import org.aspectj.lang.annotation.Pointcut;
17
+import org.aspectj.lang.reflect.MethodSignature;
18
+import org.springframework.stereotype.Component;
19
+
20
+import java.lang.reflect.Method;
21
+
22
+@Aspect
23
+@Component
24
+@Slf4j
25
+public class LogAOP {
26
+
27
+    @Pointcut("@annotation(com.community.huiju.log.LogAnnotation)")
28
+    public void pointLog() {
29
+
30
+    }
31
+
32
+    @Around("pointLog()")
33
+    public Object logAround(ProceedingJoinPoint point) throws Throwable {
34
+
35
+        // 获取切面的点的实例
36
+        Object target = point.getTarget();
37
+        // 获取反射对象
38
+        Class<?> zClass = target.getClass();
39
+        // 获取切面点
40
+        Signature signature = point.getSignature();
41
+
42
+        // 判断日志注解是否用在方法上
43
+        if (!(signature instanceof MethodSignature)) {
44
+            throw new RuntimeException("该注解只允许在方法上使用!");
45
+        }
46
+
47
+        // 方法名称
48
+        String methodName = signature.getName();
49
+        // 获取方法参数类型
50
+        Class<?>[] parameterTypes = ((MethodSignature) signature).getMethod().getParameterTypes();
51
+
52
+        // 通过方法名称和方法参数类型
53
+        // 获取当前正在执行切面的方法
54
+        Method method = zClass.getMethod(methodName, parameterTypes);
55
+
56
+        // 所有方法输入参数
57
+        Object[] args = point.getArgs();
58
+        // 执行方法的返回值
59
+        Object result = null;
60
+        if (null != method && method.isAnnotationPresent(LogAnnotation.class)) {
61
+
62
+            // 获取这个注解
63
+            LogAnnotation logAnnotation = method.getAnnotation(LogAnnotation.class);
64
+            // 大苏操作
65
+            if (logAnnotation.record() && logAnnotation.value() == LogEnums.DA_SU) {
66
+                String alias = "".equals(logAnnotation.alias()) ? "未设置别名" : logAnnotation.alias();
67
+                    log.info("AOP拦截----大苏操作----执行方法:{},方法别名:{}, 请求参数:{}", methodName, alias,args);
68
+                    // 方法返回值
69
+                    result = point.proceed();
70
+                    log.info("AOP拦截----大苏操作----执行方法:{},方法别名:{},请求参数:{},返回结果:{}", methodName, alias,args, result);
71
+
72
+                    String strPararmeter = String.format( "AOP拦截----大苏操作----执行方法:%s,方法别名:%s,请求参数:%s", methodName, alias, JSONObject.toJSONString(args));
73
+                    String strReturn = String.format("AOP拦截----大苏操作----执行方法:%s,方法别名:%s, 请求参数:%s,返回结果:%s", methodName, alias , JSONObject.toJSONString(args), JSONObject.toJSONString(result));
74
+
75
+                    LogFileManager.getInstance().executeLog(LogFactory.parametersAndReturn(strPararmeter, strReturn));
76
+
77
+            }
78
+
79
+        }
80
+
81
+        return result;
82
+    }
83
+
84
+    @AfterThrowing(value = "pointLog()", throwing = "cause")
85
+    public void doException(JoinPoint joinPoint, Throwable cause) {
86
+        if (null != cause && cause instanceof FuShiException) {
87
+            FuShiException fuShiException = (FuShiException)cause;
88
+            throw new FuShiException(fuShiException.getCode(), fuShiException.getMessage());
89
+        }
90
+    }
91
+
92
+}

+ 4
- 0
CODE/foreign-service/src/main/java/com/community/huiju/common/base/BaseController.java Ver arquivo

@@ -0,0 +1,4 @@
1
+package com.community.huiju.common.base;
2
+
3
+public class BaseController {
4
+}

+ 72
- 0
CODE/foreign-service/src/main/java/com/community/huiju/common/base/ResponseBean.java Ver arquivo

@@ -0,0 +1,72 @@
1
+package com.community.huiju.common.base;
2
+
3
+import java.io.Serializable;
4
+
5
+/**
6
+ * 接口统一状态返回BEAN.
7
+ */
8
+public class ResponseBean<T> implements Serializable {
9
+
10
+    private static final long serialVersionUID = 3593827217136880822L;
11
+
12
+    private Integer code = 0;
13
+
14
+    private String message = "成功";
15
+
16
+    private T data;
17
+
18
+    public ResponseBean() {
19
+    }
20
+
21
+    public void addError(Integer code, String message) {
22
+        this.code = code;
23
+        this.message = message;
24
+    }
25
+
26
+    public void addSuccess(String message) {
27
+        this.code = 0;
28
+        this.message = message;
29
+    }
30
+
31
+    public void addSuccess(Integer code, T data) {
32
+        this.code = code;
33
+        this.message = "成功";
34
+        this.data = data;
35
+    }
36
+
37
+    public void addSuccess(Integer code, String message, T data) {
38
+        this.code = code;
39
+        this.message = message;
40
+        this.data = data;
41
+    }
42
+
43
+    public void addSuccess(String message, T data) {
44
+        this.code = 0;
45
+        this.message = message;
46
+        this.data = data;
47
+    }
48
+
49
+    public void addSuccess(T data) {
50
+        this.code = 0;
51
+        this.message = "成功";
52
+        this.data = data;
53
+    }
54
+
55
+    public T getData() {
56
+        return this.data;
57
+    }
58
+
59
+    public Integer getCode() {
60
+        return this.code;
61
+    }
62
+
63
+    public String getMessage() {
64
+        return this.message;
65
+    }
66
+
67
+    @Override
68
+    public String toString() {
69
+        return "ResponseBaseBean [code=" + this.code + ", message=" + this.message + ", data=" + this.data + "]";
70
+    }
71
+
72
+}

+ 26
- 0
CODE/foreign-service/src/main/java/com/community/huiju/common/perproties/DaSuProperties.java Ver arquivo

@@ -0,0 +1,26 @@
1
+package com.community.huiju.common.perproties;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Data;
5
+import lombok.NoArgsConstructor;
6
+import org.springframework.boot.context.properties.ConfigurationProperties;
7
+import org.springframework.stereotype.Component;
8
+
9
+/**
10
+ * 提供给 大苏 的 appid 和 appsecret
11
+ * @author weiximei
12
+ */
13
+@Component
14
+@ConfigurationProperties(prefix = "da-su")
15
+@Data
16
+@AllArgsConstructor
17
+@NoArgsConstructor
18
+public class DaSuProperties {
19
+
20
+    private String appid;
21
+
22
+    private String appSecret;
23
+
24
+    private String communityId;
25
+
26
+}

+ 44
- 0
CODE/foreign-service/src/main/java/com/community/huiju/common/perproties/FuShiProperties.java Ver arquivo

@@ -0,0 +1,44 @@
1
+package com.community.huiju.common.perproties;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Data;
5
+import lombok.NoArgsConstructor;
6
+import org.springframework.boot.context.properties.ConfigurationProperties;
7
+import org.springframework.stereotype.Component;
8
+
9
+/**
10
+ * 富士配置类
11
+ * @author weiximei
12
+ */
13
+@AllArgsConstructor
14
+@NoArgsConstructor
15
+@Data
16
+@Component
17
+@ConfigurationProperties(prefix = "fu-shi")
18
+public class FuShiProperties {
19
+
20
+    /**
21
+     * 富士云 请求地址
22
+     */
23
+    private String url;
24
+
25
+    /**
26
+     * 富士云 appid
27
+     */
28
+    private String appid;
29
+
30
+    /**
31
+     * 富士云 appSecret
32
+     */
33
+    private String appSecret;
34
+
35
+    /**
36
+     * 富士云 私钥 privateKey
37
+     */
38
+    private String privateKey;
39
+
40
+    /**
41
+     * 停车场编码
42
+     */
43
+    private String parkingCode;
44
+}

+ 85
- 0
CODE/foreign-service/src/main/java/com/community/huiju/common/sign/DaSuSign.java Ver arquivo

@@ -0,0 +1,85 @@
1
+package com.community.huiju.common.sign;
2
+
3
+import com.alibaba.fastjson.JSONObject;
4
+import com.google.common.collect.Maps;
5
+import lombok.extern.slf4j.Slf4j;
6
+import org.apache.commons.codec.digest.DigestUtils;
7
+import org.apache.commons.lang3.StringUtils;
8
+
9
+import java.io.UnsupportedEncodingException;
10
+import java.util.Map;
11
+import java.util.Set;
12
+import java.util.TreeMap;
13
+
14
+/**
15
+ * 大苏签名校验
16
+ */
17
+@Slf4j
18
+public class DaSuSign {
19
+
20
+    /**
21
+     * 校验签名是否相等
22
+     * @param val_1
23
+     * @param val_2
24
+     * @return true 相等  false 不相等
25
+     */
26
+    public static boolean isMD5Sign(String val_1, String val_2) {
27
+        return StringUtils.equals(val_1, val_2);
28
+    }
29
+
30
+    /**
31
+     *
32
+     * 创建签名
33
+     * 对请求参数进行签名
34
+     *
35
+     *
36
+     *      参考参数
37
+     *      * @param appid
38
+     *      * @param appSecret
39
+     *      * @param datetime 时间戳
40
+     *      * @param encrypt 加密方式(目前就 MD5)
41
+     *      * @param communityId 小区id
42
+     *
43
+     * @return
44
+     */
45
+    public static String createSign(TreeMap<String ,Object> treeMap, String appSecret){
46
+
47
+        String sign = "";
48
+
49
+        StringBuilder sb = new StringBuilder();
50
+        Set<Map.Entry<String, Object>> entries = treeMap.entrySet();
51
+        entries.forEach(e-> {
52
+            sb.append(e.getKey());
53
+            sb.append("=");
54
+            sb.append(e.getValue());
55
+            sb.append("&");
56
+        });
57
+
58
+        sign = sb.toString();
59
+        sign = sign.substring(0, sign.lastIndexOf("&"));
60
+
61
+        log.info("签名之前参数: {}, appSecret: {}" , JSONObject.toJSONString(treeMap), appSecret);
62
+
63
+        try {
64
+            String str = new String(sign.getBytes("UTF-8"), "UTF-8");
65
+            sign = DigestUtils.md5Hex( str + appSecret);
66
+        } catch (UnsupportedEncodingException e) {
67
+            e.printStackTrace();
68
+        }
69
+
70
+        log.info("签名: {}" , sign);
71
+
72
+        return sign;
73
+    }
74
+
75
+    public static void main(String[] args) {
76
+
77
+        Long timeMillis = System.currentTimeMillis();
78
+        System.out.println(timeMillis);
79
+        TreeMap<String, Object> treeMap = new TreeMap<>();
80
+        treeMap.put("appid", "dssdw2576sd997");
81
+        treeMap.put("communityId", "100");
82
+        String sign = createSign(treeMap, "fgexhd855sf4");
83
+    }
84
+
85
+}

+ 40
- 0
CODE/foreign-service/src/main/java/com/community/huiju/config/FuShiConfig.java Ver arquivo

@@ -0,0 +1,40 @@
1
+package com.community.huiju.config;
2
+
3
+import com.community.commom.fushi.FuShiHttpClient;
4
+import com.community.commom.fushi.FuShiRequestAPI;
5
+import com.community.huiju.common.perproties.FuShiProperties;
6
+import org.springframework.beans.factory.annotation.Autowired;
7
+import org.springframework.context.annotation.Bean;
8
+import org.springframework.context.annotation.Configuration;
9
+
10
+/**
11
+ * 富士配置类
12
+ * @author weiximei
13
+ */
14
+@Configuration
15
+public class FuShiConfig {
16
+
17
+    @Autowired
18
+    private FuShiProperties fuShiProperties;
19
+
20
+
21
+    /**
22
+     * 初始化富士HTTP客户端
23
+     * @return FuShiHttpClient
24
+     */
25
+    @Bean
26
+    public FuShiHttpClient fuShiHttpClient() {
27
+        return new FuShiHttpClient(fuShiProperties.getUrl(), fuShiProperties.getAppid(), fuShiProperties.getAppSecret(), fuShiProperties.getPrivateKey());
28
+    }
29
+
30
+    /**
31
+     * 初始化富士请求 API
32
+     * @param fuShiHttpClient
33
+     * @return
34
+     */
35
+    @Bean
36
+    public FuShiRequestAPI fuShiRequestAPI(FuShiHttpClient fuShiHttpClient) {
37
+        return new FuShiRequestAPI(fuShiHttpClient);
38
+    }
39
+
40
+}

+ 40
- 0
CODE/foreign-service/src/main/java/com/community/huiju/config/Swagger2.java Ver arquivo

@@ -0,0 +1,40 @@
1
+package com.community.huiju.config;
2
+
3
+import org.springframework.context.annotation.Bean;
4
+import org.springframework.context.annotation.Configuration;
5
+import springfox.documentation.builders.ApiInfoBuilder;
6
+import springfox.documentation.builders.PathSelectors;
7
+import springfox.documentation.builders.RequestHandlerSelectors;
8
+import springfox.documentation.service.ApiInfo;
9
+import springfox.documentation.service.Contact;
10
+import springfox.documentation.spi.DocumentationType;
11
+import springfox.documentation.spring.web.plugins.Docket;
12
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
13
+
14
+/**
15
+ * @author FXF
16
+ * @date 2018-09-27
17
+ */
18
+@Configuration
19
+@EnableSwagger2
20
+public class Swagger2 {
21
+    @Bean
22
+    public Docket docket(){
23
+        return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).select()
24
+                .apis(RequestHandlerSelectors.basePackage("com.community.huiju.controller"))
25
+                .paths(PathSelectors.any()).build();
26
+    }
27
+    //构建api文档的详细信息函数
28
+    private ApiInfo apiInfo(){
29
+        return new ApiInfoBuilder()
30
+                //页面标题
31
+                .title("对外接口 的 RESTful API")
32
+                //创建人
33
+                .contact(new Contact("fuxingfan","","fuxingfan@dingtalk.com"))
34
+                //版本号
35
+                .version("1.0")
36
+                //描述
37
+                .description("API 描述")
38
+                .build();
39
+    }
40
+}

+ 167
- 0
CODE/foreign-service/src/main/java/com/community/huiju/controller/FSController.java Ver arquivo

@@ -0,0 +1,167 @@
1
+package com.community.huiju.controller;
2
+
3
+import com.alibaba.fastjson.JSONObject;
4
+import com.community.commom.mode.ResponseBean;
5
+import com.community.huiju.common.base.BaseController;
6
+import com.community.huiju.service.IFuShiService;
7
+import io.swagger.annotations.Api;
8
+import io.swagger.annotations.ApiImplicitParam;
9
+import io.swagger.annotations.ApiImplicitParams;
10
+import io.swagger.annotations.ApiOperation;
11
+import org.springframework.beans.factory.annotation.Autowired;
12
+import org.springframework.web.bind.annotation.*;
13
+
14
+@RestController
15
+@RequestMapping("/")
16
+@Api(value = "车辆操作API", description = "车辆操作API")
17
+public class FSController extends BaseController {
18
+
19
+    @Autowired
20
+    private IFuShiService iFuShiService;
21
+
22
+    @RequestMapping(value = "/car/getParkInfoByCarNo/{carNo}", method = RequestMethod.GET)
23
+    @ApiOperation(value = "获取停车信息(通过车牌号)", notes = "获取停车信息(通过车牌号)")
24
+    @ApiImplicitParams({
25
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "path", name = "carNo", value = "车牌号"),
26
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "query", name = "communityId", value = "小区Id"),
27
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "appid", value = "appid"),
28
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "datetime", value = "时间戳"),
29
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "encrypt", value = "加密方式"),
30
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "sign", value = "签名"),
31
+    })
32
+    public ResponseBean getParkInfoByCarNo(@PathVariable("carNo") String carNo,
33
+                                           @RequestParam(value = "communityId") Integer communityId) {
34
+        ResponseBean responseBean = new ResponseBean();
35
+        responseBean = iFuShiService.getParkInfoByCarNo(carNo, communityId);
36
+        return responseBean;
37
+    }
38
+
39
+    @RequestMapping(value = "/car/parkGetMonthCardInfoByCarNo/{carNo}", method = RequestMethod.GET)
40
+    @ApiOperation(value = "获取月租车信息(通过车牌号)", notes = "获取月租车信息(通过车牌号)")
41
+    @ApiImplicitParams({
42
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "path", name = "carNo", value = "车牌号"),
43
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "query", name = "communityId", value = "小区Id"),
44
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "appid", value = "appid"),
45
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "datetime", value = "时间戳"),
46
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "encrypt", value = "加密方式"),
47
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "sign", value = "签名"),
48
+    })
49
+    public ResponseBean parkGetMonthCardInfoByCarNo(@PathVariable("carNo") String carNo,
50
+                                                    @RequestParam(value = "communityId") Integer communityId) {
51
+        ResponseBean responseBean = new ResponseBean();
52
+        responseBean = iFuShiService.parkGetMonthCardInfoByCarNo(carNo, communityId);
53
+        return responseBean;
54
+    }
55
+
56
+    @RequestMapping(value = "/car/parkGetTempCarPaymentInfoByCarNo/{carNo}", method = RequestMethod.GET)
57
+    @ApiOperation(value = "获取临时车信息(通过车牌号)", notes = "获取临时车信息(通过车牌号)")
58
+    @ApiImplicitParams({
59
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "path", name = "carNo", value = "车牌号"),
60
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "query", name = "communityId", value = "小区Id"),
61
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "appid", value = "appid"),
62
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "datetime", value = "时间戳"),
63
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "encrypt", value = "加密方式"),
64
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "sign", value = "签名"),
65
+    })
66
+    public ResponseBean parkGetTempCarPaymentInfoByCarNo(@PathVariable("carNo") String carNo,
67
+                                                         @RequestParam(value = "communityId") Integer communityId) {
68
+        ResponseBean responseBean = new ResponseBean();
69
+        responseBean = iFuShiService.parkGetTempCarPaymentInfoByCarNo(carNo, communityId);
70
+        return responseBean;
71
+    }
72
+
73
+    @RequestMapping(value = "/car/apiThirdPartyMonthCardPay", method = RequestMethod.POST)
74
+    @ApiOperation(value = "月卡续费", notes = "月卡续费")
75
+    @ApiImplicitParams({
76
+//            @ApiImplicitParam(dataTypeClass = String.class, paramType = "body", name = "parameter", value = "Phone手机号;RenewDayType续费日期类型( 3:年 2:月 1:日, 选入对应的数字);" +
77
+//                    "RenewDay续费日期数目;" +
78
+//                    "PayStyle交易方式(中文描述),例如:微信、 支付宝、 银联;" +
79
+//                    "CarNo车牌号;" +
80
+//                    "CardNo停车卡号;" +
81
+//                    "RechargeAmt充值续费金额;"),
82
+//            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "appid", value = "appid"),
83
+//            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "datetime", value = "时间戳"),
84
+//            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "encrypt", value = "加密方式"),
85
+//            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "sign", value = "签名"),
86
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "Phone", value = "手机号"),
87
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "RenewDayType", value = "续费日期类型( 3:年 2:月 1:日, 选入对应的数字)"),
88
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "RenewDay", value = "续费日期数目"),
89
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "PayStyle", value = "交易方式(中文描述),例如:微信、 支付宝、 银联"),
90
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "CarNo", value = "车牌号"),
91
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "CardNo", value = "停车卡号"),
92
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "RechargeAmt", value = "充值续费金额"),
93
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "form", name = "communityId", value = "小区Id"),
94
+    })
95
+    public ResponseBean apiThirdPartyMonthCardPay(@RequestParam(value = "Phone") String Phone,
96
+                                                  @RequestParam(value = "RenewDayType") String RenewDayType,
97
+                                                  @RequestParam(value = "RenewDay") String RenewDay,
98
+                                                  @RequestParam(value = "PayStyle") String PayStyle,
99
+                                                  @RequestParam(value = "CarNo") String CarNo,
100
+                                                  @RequestParam(value = "CardNo", required = false) String CardNo,
101
+                                                  @RequestParam(value = "RechargeAmt") String RechargeAmt,
102
+                                                  @RequestParam(value = "communityId") Integer communityId) {
103
+        ResponseBean responseBean = new ResponseBean();
104
+        responseBean = iFuShiService.apiThirdPartyMonthCardPay(Phone, RenewDayType,
105
+                RenewDay, PayStyle, CarNo, CardNo, RechargeAmt, communityId);
106
+        return responseBean;
107
+    }
108
+
109
+    @RequestMapping(value = "/car/apiThirdPartyTemporaryCardPay", method = RequestMethod.POST)
110
+    @ApiOperation(value = "第三方临时卡上发缴费", notes = "第三方临时卡上发缴费")
111
+    @ApiImplicitParams({
112
+//            @ApiImplicitParam(dataTypeClass = String.class, paramType = "body", name = "parameter", value = "Amount应缴金额(单位元);" +
113
+//                    "ActualAmount实缴金额(单位元);" +
114
+//                    "DeductionAmount抵扣金额(单位元);" +
115
+//                    "Reason抵扣原因;" +
116
+//                    "PayStyle交易方式(汉字描述),例如:微信、支付宝、银联;" +
117
+//                    "CarNo车牌号;" +
118
+//                    "CardNo停车卡号;" +
119
+//                    "CouponList使用的优惠券列表"),
120
+//            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "appid", value = "appid"),
121
+//            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "datetime", value = "时间戳"),
122
+//            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "encrypt", value = "加密方式"),
123
+//            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "sign", value = "签名"),
124
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "Amount", value = "应缴金额(单位元)"),
125
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "ActualAmount", value = "实缴金额(单位元)"),
126
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "DeductionAmount", value = "抵扣金额(单位元)"),
127
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "Reason", value = "抵扣原因"),
128
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "PayStyle", value = "交易方式(汉字描述),例如:微信、支付宝、银联"),
129
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "CarNo", value = "车牌号"),
130
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "CardNo", value = "停车卡号"),
131
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "CouponList", value = "使用的优惠券列表"),
132
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "form", name = "communityId", value = "小区Id"),
133
+    })
134
+    public ResponseBean apiThirdPartyTemporaryCardPay(@RequestParam(value = "Amount") String Amount,
135
+                                                      @RequestParam(value = "ActualAmount") String ActualAmount,
136
+                                                      @RequestParam(value = "DeductionAmount") String DeductionAmount,
137
+                                                      @RequestParam(value = "Reason", required = false) String Reason,
138
+                                                      @RequestParam(value = "PayStyle") String PayStyle,
139
+                                                      @RequestParam(value = "CarNo") String CarNo,
140
+                                                      @RequestParam(value = "CardNo",  required = false) String CardNo,
141
+                                                      @RequestParam(value = "CouponList", required = false) String CouponList,
142
+                                                      @RequestParam(value = "communityId") Integer communityId) {
143
+        ResponseBean responseBean = new ResponseBean();
144
+        responseBean = iFuShiService.apiThirdPartyTemporaryCardPay(Amount, ActualAmount, DeductionAmount,
145
+                Reason, PayStyle, CarNo, CardNo, CouponList, communityId);
146
+        return responseBean;
147
+    }
148
+
149
+
150
+    @RequestMapping(value = "/car/apiGetOfflineFee/{carNoOrCardNo}", method = RequestMethod.GET)
151
+    @ApiOperation(value = "获取线下算费结果", notes = "获取线下算费结果")
152
+    @ApiImplicitParams({
153
+            @ApiImplicitParam(paramType = "path", dataTypeClass = String.class, name = "carNoOrCardNo" , value = "车牌号码或卡号"),
154
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "appid", value = "appid"),
155
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "datetime", value = "时间戳"),
156
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "encrypt", value = "加密方式"),
157
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "sign", value = "签名"),
158
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "form", name = "communityId", value = "小区Id"),
159
+    })
160
+    public ResponseBean apiGetOfflineFee(@PathVariable("carNoOrCardNo") String carNoOrCardNo,
161
+                                         @RequestParam(value = "communityId") Integer communityId) {
162
+        ResponseBean responseBean = new ResponseBean();
163
+        responseBean = iFuShiService.apiGetOfflineFee(carNoOrCardNo, communityId);
164
+        return responseBean;
165
+    }
166
+
167
+}

+ 111
- 0
CODE/foreign-service/src/main/java/com/community/huiju/controller/TaFceController.java Ver arquivo

@@ -0,0 +1,111 @@
1
+package com.community.huiju.controller;
2
+
3
+import com.community.huiju.common.base.BaseController;
4
+import com.community.huiju.common.base.ResponseBean;
5
+import com.community.huiju.service.FaceServiceI;
6
+import io.swagger.annotations.Api;
7
+import io.swagger.annotations.ApiImplicitParam;
8
+import io.swagger.annotations.ApiImplicitParams;
9
+import io.swagger.annotations.ApiOperation;
10
+import org.springframework.beans.factory.annotation.Autowired;
11
+import org.springframework.web.bind.annotation.RequestMapping;
12
+import org.springframework.web.bind.annotation.RequestMethod;
13
+import org.springframework.web.bind.annotation.RequestParam;
14
+import org.springframework.web.bind.annotation.RestController;
15
+import org.springframework.web.multipart.MultipartFile;
16
+
17
+/**
18
+ * weiximei on 2019-05-17
19
+ */
20
+
21
+@RestController
22
+@RequestMapping("/")
23
+@Api(value = "人脸操作 API", description = "人脸操作 API")
24
+public class TaFceController extends BaseController {
25
+
26
+    @Autowired
27
+    private FaceServiceI faceServiceI;
28
+
29
+    @RequestMapping(value = "/face", method = RequestMethod.POST)
30
+    @ApiOperation(value = "录入人脸" , notes = "录入人脸")
31
+    @ApiImplicitParams({
32
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "form", name = "userId", value = "用户Id"),
33
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "form", name = "userVerifyId", value = "房产审核Id"),
34
+            @ApiImplicitParam(dataTypeClass = MultipartFile.class, paramType = "form", name = "uploadFile", value = "图片"),
35
+//            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "appid", value = "appid"),
36
+//            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "datetime", value = "时间戳"),
37
+//            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "encrypt", value = "加密方式"),
38
+//            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "sign", value = "签名"),
39
+    })
40
+    public ResponseBean addFace(@RequestParam(value = "userId") Integer userId,
41
+                                @RequestParam(value = "userVerifyId") Integer userVerifyId,
42
+                                @RequestParam(value = "uploadFile") MultipartFile uploadFile) {
43
+
44
+        ResponseBean responseBean = new ResponseBean();
45
+        responseBean = faceServiceI.addFace(userId, userVerifyId, uploadFile);
46
+        return responseBean;
47
+
48
+    }
49
+
50
+
51
+    @RequestMapping(value = "/face", method = RequestMethod.PUT)
52
+    @ApiOperation(value = "修改人脸" , notes = "修改人脸")
53
+    @ApiImplicitParams({
54
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "form", name = "userId", value = "用户Id"),
55
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "form", name = "userVerifyId", value = "房产审核Id"),
56
+            @ApiImplicitParam(dataTypeClass = MultipartFile.class, paramType = "form", name = "uploadFile", value = "图片"),
57
+//            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "appid", value = "appid"),
58
+//            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "datetime", value = "时间戳"),
59
+//            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "encrypt", value = "加密方式"),
60
+//            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "sign", value = "签名"),
61
+    })
62
+    public ResponseBean updateFace(@RequestParam(value = "userId") Integer userId,
63
+                                @RequestParam(value = "userVerifyId") Integer userVerifyId,
64
+                                @RequestParam(value = "uploadFile") MultipartFile uploadFile) {
65
+
66
+        ResponseBean responseBean = new ResponseBean();
67
+        responseBean = faceServiceI.updateFace(userId, userVerifyId, uploadFile);
68
+        return responseBean;
69
+
70
+    }
71
+
72
+    @RequestMapping(value = "/face", method = RequestMethod.DELETE)
73
+    @ApiOperation(value = "删除人脸" , notes = "删除人脸")
74
+    @ApiImplicitParams({
75
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "form", name = "userId", value = "用户Id"),
76
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "form", name = "userVerifyId", value = "房产审核Id"),
77
+//            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "appid", value = "appid"),
78
+//            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "datetime", value = "时间戳"),
79
+//            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "encrypt", value = "加密方式"),
80
+//            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "sign", value = "签名"),
81
+    })
82
+    public ResponseBean deleteFace(@RequestParam(value = "userId") Integer userId,
83
+                                   @RequestParam(value = "userVerifyId") Integer userVerifyId) {
84
+
85
+        ResponseBean responseBean = new ResponseBean();
86
+        responseBean = faceServiceI.deleteFace(userId, userVerifyId);
87
+        return responseBean;
88
+
89
+    }
90
+
91
+
92
+    @RequestMapping(value = "/face", method = RequestMethod.GET)
93
+    @ApiOperation(value = "查询人脸信息" , notes = "查询人脸信息")
94
+    @ApiImplicitParams({
95
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "query", name = "userId", value = "用户Id"),
96
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "query", name = "userVerifyId", value = "房产审核Id"),
97
+//            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "appid", value = "appid"),
98
+//            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "datetime", value = "时间戳"),
99
+//            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "encrypt", value = "加密方式"),
100
+//            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "sign", value = "签名"),
101
+    })
102
+    public ResponseBean getTaFaceByUserId(@RequestParam(value = "userId") Integer userId,
103
+                                   @RequestParam(value = "userVerifyId") Integer userVerifyId) {
104
+
105
+        ResponseBean responseBean = new ResponseBean();
106
+        responseBean = faceServiceI.getTaFaceByUserId(userId, userVerifyId);
107
+        return responseBean;
108
+
109
+    }
110
+
111
+}

+ 101
- 0
CODE/foreign-service/src/main/java/com/community/huiju/controller/TaUserController.java Ver arquivo

@@ -0,0 +1,101 @@
1
+package com.community.huiju.controller;
2
+
3
+
4
+import com.community.huiju.common.base.BaseController;
5
+import com.community.huiju.common.base.ResponseBean;
6
+import com.community.huiju.service.ITaUserService;
7
+import io.swagger.annotations.Api;
8
+import io.swagger.annotations.ApiImplicitParam;
9
+import io.swagger.annotations.ApiImplicitParams;
10
+import io.swagger.annotations.ApiOperation;
11
+import org.springframework.beans.factory.annotation.Autowired;
12
+import org.springframework.web.bind.annotation.*;
13
+
14
+/**
15
+ * <p>
16
+ * 住户app端用户表 前端控制器
17
+ * </p>
18
+ *
19
+ * @author jobob
20
+ * @since 2019-05-15
21
+ */
22
+@RestController
23
+@RequestMapping("/")
24
+@Api(value = "用户操作 API", description = "用户操作 API")
25
+public class TaUserController extends BaseController {
26
+
27
+    @Autowired
28
+    private ITaUserService iTaUserService;
29
+
30
+
31
+    @RequestMapping(value = "/user", method = RequestMethod.POST)
32
+    @ApiOperation(value = "添加用户", notes = "添加用户")
33
+    @ApiImplicitParams({
34
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "userName", value = "用户名"),
35
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "idCard", value = "身份证"),
36
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "gender", value = "性别 1:男   2:女"),
37
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "phone", value = "手机号"),
38
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "appid", value = "appid"),
39
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "datetime", value = "时间戳"),
40
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "encrypt", value = "加密方式"),
41
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "sign", value = "签名"),
42
+    })
43
+    public ResponseBean addUser(@RequestParam(value = "userName") String userName,
44
+                                @RequestParam(value = "idCard") String idCard,
45
+                                @RequestParam(value = "gender") String gender,
46
+                                @RequestParam(value = "phone") String phone){
47
+        ResponseBean responseBean = iTaUserService.addTaUser(userName, idCard, gender, phone);
48
+        return responseBean;
49
+    }
50
+
51
+    @RequestMapping(value = "/user/{userId}", method = RequestMethod.PUT)
52
+    @ApiOperation(value = "修改用户", notes = "修改用户")
53
+    @ApiImplicitParams({
54
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "path", name = "userId", value = "用户id"),
55
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "userName", value = "用户名"),
56
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "idCard", value = "身份证"),
57
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "gender", value = "性别 1:男   2:女"),
58
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "phone", value = "手机号"),
59
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "appid", value = "appid"),
60
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "datetime", value = "时间戳"),
61
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "encrypt", value = "加密方式"),
62
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "sign", value = "签名"),
63
+    })
64
+    public ResponseBean updateUser(@PathVariable(value = "userId") Integer userId,
65
+                                @RequestParam(value = "userName", required = false) String userName,
66
+                                @RequestParam(value = "idCard", required = false) String idCard,
67
+                                @RequestParam(value = "gender", required = false) String gender,
68
+                                @RequestParam(value = "phone", required = false) String phone){
69
+        ResponseBean responseBean = iTaUserService.updateTaUser(userId,userName, idCard, gender, phone);
70
+        return responseBean;
71
+    }
72
+
73
+    @RequestMapping(value = "/user/{userId}", method = RequestMethod.GET)
74
+    @ApiOperation(value = "根据用户ID查询", notes = "根据用户ID查询")
75
+    @ApiImplicitParams({
76
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "path", name = "userId", value = "用户id"),
77
+//            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "appid", value = "appid"),
78
+//            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "datetime", value = "时间戳"),
79
+//            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "encrypt", value = "加密方式"),
80
+//            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "sign", value = "签名"),
81
+    })
82
+    public ResponseBean updateUser(@PathVariable(value = "userId") Integer userId){
83
+        ResponseBean responseBean = iTaUserService.getTaUser(userId);
84
+        return responseBean;
85
+    }
86
+
87
+    @RequestMapping(value = "/user", method = RequestMethod.GET)
88
+    @ApiOperation(value = "根据用户手机号查询", notes = "根据用户手机号查询")
89
+    @ApiImplicitParams({
90
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "phone", value = "手机号"),
91
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "appid", value = "appid"),
92
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "datetime", value = "时间戳"),
93
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "encrypt", value = "加密方式"),
94
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "sign", value = "签名"),
95
+    })
96
+    public ResponseBean updateUser(@RequestParam(value = "phone") String phone){
97
+        ResponseBean responseBean = iTaUserService.getTaUserByPhone(phone);
98
+        return responseBean;
99
+    }
100
+
101
+}

+ 113
- 0
CODE/foreign-service/src/main/java/com/community/huiju/controller/TaUserVerifyController.java Ver arquivo

@@ -0,0 +1,113 @@
1
+package com.community.huiju.controller;
2
+
3
+
4
+import com.community.huiju.common.base.BaseController;
5
+import com.community.huiju.common.base.ResponseBean;
6
+import com.community.huiju.service.ITaUserVerifyService;
7
+import io.swagger.annotations.Api;
8
+import io.swagger.annotations.ApiImplicitParam;
9
+import io.swagger.annotations.ApiImplicitParams;
10
+import io.swagger.annotations.ApiOperation;
11
+import org.springframework.beans.factory.annotation.Autowired;
12
+import org.springframework.web.bind.annotation.*;
13
+
14
+/**
15
+ * <p>
16
+ * app端用户审核表,存放用户的角色还有房产信息 前端控制器
17
+ * </p>
18
+ *
19
+ * @author jobob
20
+ * @since 2019-05-16
21
+ */
22
+@RestController
23
+@RequestMapping("/")
24
+@Api(value = "用户审核 API", description = "用户审核 API")
25
+public class TaUserVerifyController extends BaseController {
26
+
27
+    @Autowired
28
+    private ITaUserVerifyService iTaUserVerifyService;
29
+
30
+
31
+    @RequestMapping(value = "/user/verify",method = RequestMethod.POST)
32
+    @ApiOperation(value = "添加房产关联", notes = "添加房产关联")
33
+    @ApiImplicitParams({
34
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "form", name = "userId", value = "用户Id"),
35
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "form", name = "roleId", value = "角色Id:1 户主 2 租客 3 家属"),
36
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "form", name = "communityId", value = "小区Id"),
37
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "form", name = "phaseId", value = "期Id"),
38
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "form", name = "buildingId", value = "栋Id"),
39
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "form", name = "unitId", value = "单元Id"),
40
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "form", name = "levelId", value = "楼层Id"),
41
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "form", name = "roomNoId", value = "房间号Id"),
42
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "appid", value = "appid"),
43
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "datetime", value = "时间戳"),
44
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "encrypt", value = "加密方式"),
45
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "sign", value = "签名"),
46
+
47
+    })
48
+    public ResponseBean addUserVerify(@RequestParam(value = "userId") Integer userId,
49
+                                      @RequestParam(value = "roleId") Integer roleId,
50
+                                      @RequestParam(value = "communityId") Integer communityId,
51
+                                      @RequestParam(value = "phaseId") Integer phaseId,
52
+                                      @RequestParam(value = "buildingId") Integer buildingId,
53
+                                      @RequestParam(value = "unitId") Integer unitId,
54
+                                      @RequestParam(value = "levelId") Integer levelId,
55
+                                      @RequestParam(value = "roomNoId") Integer roomNoId) {
56
+        ResponseBean responseBean = new ResponseBean();
57
+        responseBean = iTaUserVerifyService.addUserVerify(userId, roleId, communityId, phaseId, buildingId, unitId, levelId, roomNoId);
58
+        return responseBean;
59
+    }
60
+
61
+    @RequestMapping(value = "/user/verify/{userVerifyId}", method = RequestMethod.DELETE)
62
+    @ApiOperation(value = "用户删除房产关联关系", notes = "用户删除房产关联关系")
63
+    @ApiImplicitParams({
64
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "form", name = "userId", value = "用户Id"),
65
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "path", name = "userVerifyId", value = "房产审核Id"),
66
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "appid", value = "appid"),
67
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "datetime", value = "时间戳"),
68
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "encrypt", value = "加密方式"),
69
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "form", name = "sign", value = "签名"),
70
+    })
71
+    public ResponseBean deleteUserVerify(@RequestParam(value = "userId") Integer userId,
72
+                                         @PathVariable(value = "userVerifyId") Integer userVerifyId) {
73
+        ResponseBean responseBean = new ResponseBean();
74
+        responseBean = iTaUserVerifyService.deleteUserVerify(userId, userVerifyId);
75
+        return responseBean;
76
+    }
77
+
78
+    @RequestMapping(value = "/user/verify/list", method = RequestMethod.GET)
79
+    @ApiOperation(value = "查询用户的房产关联关系列表", notes = "查询用户的房产关联关系列表")
80
+    @ApiImplicitParams({
81
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "query", name = "userId", value = "用户Id"),
82
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "query", name = "communityId", value = "小区Id"),
83
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "appid", value = "appid"),
84
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "datetime", value = "时间戳"),
85
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "encrypt", value = "加密方式"),
86
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "sign", value = "签名"),
87
+    })
88
+    public ResponseBean getUserVerify(@RequestParam(value = "userId") Integer userId,
89
+                                      @RequestParam(value = "communityId") Integer communityId) {
90
+        ResponseBean responseBean = new ResponseBean();
91
+        responseBean = iTaUserVerifyService.getUserVerifyByUserIdAndCommunityId(userId, communityId);
92
+        return responseBean;
93
+    }
94
+
95
+
96
+    @RequestMapping(value = "/user/verify/{userVerifyId}", method = RequestMethod.GET)
97
+    @ApiOperation(value = "根据 用户id 和 房产审核id ", notes = "根据 用户id 和 房产审核id ")
98
+    @ApiImplicitParams({
99
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "query", name = "userId", value = "用户Id"),
100
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "path", name = "userVerifyId", value = "房产审核Id"),
101
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "appid", value = "appid"),
102
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "datetime", value = "时间戳"),
103
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "encrypt", value = "加密方式"),
104
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "sign", value = "签名"),
105
+    })
106
+    public ResponseBean getUserVerifyByByUserIdAndUserVerifyId(@RequestParam(value = "userId") Integer userId,
107
+                                         @PathVariable(value = "userVerifyId") Integer userVerifyId) {
108
+        ResponseBean responseBean = new ResponseBean();
109
+        responseBean = iTaUserVerifyService.getUserVerifyByByUserIdAndUserVerifyId(userId, userVerifyId);
110
+        return responseBean;
111
+    }
112
+
113
+}

+ 81
- 0
CODE/foreign-service/src/main/java/com/community/huiju/controller/TpAddressController.java Ver arquivo

@@ -0,0 +1,81 @@
1
+package com.community.huiju.controller;
2
+
3
+
4
+import com.community.huiju.common.base.BaseController;
5
+import com.community.huiju.common.base.ResponseBean;
6
+import com.community.huiju.service.*;
7
+import io.swagger.annotations.Api;
8
+import io.swagger.annotations.ApiImplicitParam;
9
+import io.swagger.annotations.ApiImplicitParams;
10
+import io.swagger.annotations.ApiOperation;
11
+import org.springframework.beans.factory.annotation.Autowired;
12
+import org.springframework.web.bind.annotation.RequestMapping;
13
+import org.springframework.web.bind.annotation.RequestMethod;
14
+import org.springframework.web.bind.annotation.RequestParam;
15
+import org.springframework.web.bind.annotation.RestController;
16
+
17
+/**
18
+ * <p>
19
+ * 小区楼栋资料表 前端控制器
20
+ * </p>
21
+ *
22
+ * @author jobob
23
+ * @since 2019-05-15
24
+ */
25
+@RestController
26
+@RequestMapping("/")
27
+@Api(value = "楼栋资料 API", description = "楼栋资料 API")
28
+public class TpAddressController extends BaseController {
29
+
30
+    @Autowired
31
+    private ITpPhaseService iTpPhaseService;
32
+
33
+    @Autowired
34
+    private ITpBuildingService iTpBuildingService;
35
+
36
+    @Autowired
37
+    private ITpLevelService iTpLevelService;
38
+
39
+    @Autowired
40
+    private ITpUnitService iTpUnitService;
41
+
42
+    @Autowired
43
+    private ITpRoomNoService iTpRoomNoService;
44
+
45
+    @RequestMapping(value = "/building/info", method = RequestMethod.GET)
46
+    @ApiOperation(value = "查询 期/栋/单元/楼层/户号 列表", notes = "查询 期/栋/单元/楼层/户号 列表")
47
+    @ApiImplicitParams({
48
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "query", name = "communityId", value = "小区id"),
49
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "query", name = "phaseId", value = "期id"),
50
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "query", name = "buildingId", value = "楼栋id"),
51
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "query", name = "unitId", value = "单元id"),
52
+            @ApiImplicitParam(dataTypeClass = Integer.class, paramType = "query", name = "levelId", value = "楼层id"),
53
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "appid", value = "appid"),
54
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "datetime", value = "时间戳"),
55
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "encrypt", value = "加密方式"),
56
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "sign", value = "签名"),
57
+    })
58
+    public ResponseBean getBuildingInfo(@RequestParam("communityId") Integer communityId,
59
+                                        @RequestParam(value = "phaseId", required = false) Integer phaseId,
60
+                                        @RequestParam(value = "buildingId", required = false) Integer buildingId,
61
+                                        @RequestParam(value = "unitId", required = false) Integer unitId,
62
+                                        @RequestParam(value = "levelId", required = false) Integer levelId) {
63
+
64
+        ResponseBean responseBean = new ResponseBean();
65
+        if (null == phaseId && null == buildingId && null == unitId && null == levelId) {
66
+            responseBean = iTpPhaseService.getPhase(communityId);
67
+        } else if (null == buildingId && null == unitId && null == levelId) {
68
+            responseBean = iTpBuildingService.getBuilding(communityId, phaseId);
69
+        } else if (null == unitId && null == levelId) {
70
+            responseBean = iTpUnitService.getUnit(communityId, phaseId, buildingId);
71
+        } else if (null == levelId) {
72
+            responseBean = iTpLevelService.getLevel(communityId, phaseId, buildingId, unitId);
73
+        } else {
74
+            responseBean = iTpRoomNoService.getRoomNo(communityId, phaseId, buildingId, unitId, levelId);
75
+        }
76
+
77
+        return responseBean;
78
+
79
+    }
80
+
81
+}

+ 20
- 0
CODE/foreign-service/src/main/java/com/community/huiju/controller/TpBuildingController.java Ver arquivo

@@ -0,0 +1,20 @@
1
+package com.community.huiju.controller;
2
+
3
+
4
+import com.community.huiju.common.base.BaseController;
5
+import org.springframework.web.bind.annotation.RequestMapping;
6
+import org.springframework.web.bind.annotation.RestController;
7
+
8
+/**
9
+ * <p>
10
+ * 小区楼栋资料表 前端控制器
11
+ * </p>
12
+ *
13
+ * @author jobob
14
+ * @since 2019-05-15
15
+ */
16
+@RestController
17
+@RequestMapping("/")
18
+public class TpBuildingController extends BaseController {
19
+
20
+}

+ 20
- 0
CODE/foreign-service/src/main/java/com/community/huiju/controller/TpBuildingOwnerInfoController.java Ver arquivo

@@ -0,0 +1,20 @@
1
+package com.community.huiju.controller;
2
+
3
+
4
+import com.community.huiju.common.base.BaseController;
5
+import org.springframework.web.bind.annotation.RequestMapping;
6
+import org.springframework.web.bind.annotation.RestController;
7
+
8
+/**
9
+ * <p>
10
+ * 楼栋业主资料信息表(户号信息也在里面相当于tp_room_no   PS:共用一张表) 前端控制器
11
+ * </p>
12
+ *
13
+ * @author jobob
14
+ * @since 2019-05-16
15
+ */
16
+@RestController
17
+@RequestMapping("/")
18
+public class TpBuildingOwnerInfoController extends BaseController {
19
+
20
+}

+ 20
- 0
CODE/foreign-service/src/main/java/com/community/huiju/controller/TpConfigurationController.java Ver arquivo

@@ -0,0 +1,20 @@
1
+package com.community.huiju.controller;
2
+
3
+
4
+import com.community.huiju.common.base.BaseController;
5
+import org.springframework.web.bind.annotation.RequestMapping;
6
+import org.springframework.web.bind.annotation.RestController;
7
+
8
+/**
9
+ * <p>
10
+ * 设备配置表 前端控制器
11
+ * </p>
12
+ *
13
+ * @author jobob
14
+ * @since 2019-05-16
15
+ */
16
+@RestController
17
+@RequestMapping("/")
18
+public class TpConfigurationController extends BaseController {
19
+
20
+}

+ 52
- 0
CODE/foreign-service/src/main/java/com/community/huiju/controller/TpEquipmentController.java Ver arquivo

@@ -0,0 +1,52 @@
1
+package com.community.huiju.controller;
2
+
3
+
4
+import com.community.huiju.common.base.BaseController;
5
+import com.community.huiju.common.base.ResponseBean;
6
+import com.community.huiju.service.ITpEquipmentService;
7
+import io.swagger.annotations.Api;
8
+import io.swagger.annotations.ApiImplicitParam;
9
+import io.swagger.annotations.ApiImplicitParams;
10
+import io.swagger.annotations.ApiOperation;
11
+import org.springframework.beans.factory.annotation.Autowired;
12
+import org.springframework.web.bind.annotation.*;
13
+
14
+/**
15
+ * <p>
16
+ * 设备表 前端控制器
17
+ * </p>
18
+ *
19
+ * @author jobob
20
+ * @since 2019-05-16
21
+ */
22
+@RestController
23
+@RequestMapping("/")
24
+@Api(value = "设备 API", description = "设备 API")
25
+public class TpEquipmentController extends BaseController {
26
+
27
+    @Autowired
28
+    private ITpEquipmentService iTpEquipmentService;
29
+
30
+
31
+    @ApiOperation(value = "获取监控列表数据 HLS",notes = "根据小区ID获取")
32
+    @ApiImplicitParams({
33
+            @ApiImplicitParam(paramType = "path",dataTypeClass = Integer.class, name = "communityId",value = "小区ID"),
34
+            @ApiImplicitParam(paramType = "query",dataTypeClass = Integer.class,name = "pageNo",value = "第几页"),
35
+            @ApiImplicitParam(paramType = "query",dataTypeClass = Integer.class,name = "pageSize",value = "一页多少行"),
36
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "appid", value = "appid"),
37
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "datetime", value = "时间戳"),
38
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "encrypt", value = "加密方式"),
39
+            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "sign", value = "签名"),
40
+    })
41
+    @RequestMapping(value = "/equipment/monitoring/{communityId}",method = RequestMethod.GET)
42
+    public ResponseBean getListHLS(@PathVariable("communityId") Integer communityId,
43
+                                   @RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
44
+                                   @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize) {
45
+
46
+        ResponseBean responseBean = new ResponseBean();
47
+        responseBean = iTpEquipmentService.getMonitoringByCommunityId(communityId, pageNo, pageSize);
48
+        return responseBean;
49
+    }
50
+
51
+
52
+}

+ 20
- 0
CODE/foreign-service/src/main/java/com/community/huiju/controller/TpEquipmentTreeController.java Ver arquivo

@@ -0,0 +1,20 @@
1
+package com.community.huiju.controller;
2
+
3
+
4
+import com.community.huiju.common.base.BaseController;
5
+import org.springframework.web.bind.annotation.RequestMapping;
6
+import org.springframework.web.bind.annotation.RestController;
7
+
8
+/**
9
+ * <p>
10
+ * 设备树 前端控制器
11
+ * </p>
12
+ *
13
+ * @author jobob
14
+ * @since 2019-05-16
15
+ */
16
+@RestController
17
+@RequestMapping("/")
18
+public class TpEquipmentTreeController extends BaseController {
19
+
20
+}

+ 20
- 0
CODE/foreign-service/src/main/java/com/community/huiju/controller/TpLevelController.java Ver arquivo

@@ -0,0 +1,20 @@
1
+package com.community.huiju.controller;
2
+
3
+
4
+import com.community.huiju.common.base.BaseController;
5
+import org.springframework.web.bind.annotation.RequestMapping;
6
+import org.springframework.web.bind.annotation.RestController;
7
+
8
+/**
9
+ * <p>
10
+ * 小区楼层资料表 前端控制器
11
+ * </p>
12
+ *
13
+ * @author jobob
14
+ * @since 2019-05-15
15
+ */
16
+@RestController
17
+@RequestMapping("/")
18
+public class TpLevelController extends BaseController {
19
+
20
+}

+ 20
- 0
CODE/foreign-service/src/main/java/com/community/huiju/controller/TpPhaseController.java Ver arquivo

@@ -0,0 +1,20 @@
1
+package com.community.huiju.controller;
2
+
3
+
4
+import com.community.huiju.common.base.BaseController;
5
+import org.springframework.web.bind.annotation.RequestMapping;
6
+import org.springframework.web.bind.annotation.RestController;
7
+
8
+/**
9
+ * <p>
10
+ * 小区期区资料表 前端控制器
11
+ * </p>
12
+ *
13
+ * @author jobob
14
+ * @since 2019-05-15
15
+ */
16
+@RestController
17
+@RequestMapping("/")
18
+public class TpPhaseController extends BaseController {
19
+
20
+}

+ 20
- 0
CODE/foreign-service/src/main/java/com/community/huiju/controller/TpRoomNoController.java Ver arquivo

@@ -0,0 +1,20 @@
1
+package com.community.huiju.controller;
2
+
3
+
4
+import com.community.huiju.common.base.BaseController;
5
+import org.springframework.web.bind.annotation.RequestMapping;
6
+import org.springframework.web.bind.annotation.RestController;
7
+
8
+/**
9
+ * <p>
10
+ * 户号信息表 前端控制器
11
+ * </p>
12
+ *
13
+ * @author jobob
14
+ * @since 2019-05-15
15
+ */
16
+@RestController
17
+@RequestMapping("/")
18
+public class TpRoomNoController extends BaseController {
19
+
20
+}

+ 20
- 0
CODE/foreign-service/src/main/java/com/community/huiju/controller/TpUnitController.java Ver arquivo

@@ -0,0 +1,20 @@
1
+package com.community.huiju.controller;
2
+
3
+
4
+import com.community.huiju.common.base.BaseController;
5
+import org.springframework.web.bind.annotation.RequestMapping;
6
+import org.springframework.web.bind.annotation.RestController;
7
+
8
+/**
9
+ * <p>
10
+ * 小区单元资料表 前端控制器
11
+ * </p>
12
+ *
13
+ * @author jobob
14
+ * @since 2019-05-15
15
+ */
16
+@RestController
17
+@RequestMapping("/")
18
+public class TpUnitController extends BaseController {
19
+
20
+}

+ 38
- 0
CODE/foreign-service/src/main/java/com/community/huiju/dao/TaFaceMapper.java Ver arquivo

@@ -0,0 +1,38 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.community.huiju.model.TaFace;
5
+import com.community.huiju.model.TpEquipment;
6
+import org.apache.ibatis.annotations.Param;
7
+import org.apache.ibatis.annotations.ResultMap;
8
+import org.apache.ibatis.annotations.ResultType;
9
+import org.apache.ibatis.annotations.Select;
10
+
11
+import java.util.List;
12
+
13
+/**
14
+ * <p>
15
+ * 人脸检测图片 Mapper 接口
16
+ * </p>
17
+ *
18
+ * @author jobob
19
+ * @since 2019-05-16
20
+ */
21
+public interface TaFaceMapper extends BaseMapper<TaFace> {
22
+
23
+
24
+    /**
25
+     * 查看当前房产信息
26
+     * @param userVerifyId
27
+     * @return
28
+     */
29
+    TaFace getByUserVerifyId(@Param("userVerifyId") Integer userVerifyId);
30
+
31
+
32
+    /**
33
+     * 根据审核ID删除人脸信息
34
+     * @param verifyId
35
+     */
36
+    void deleteFace(@Param("verifyId") Integer verifyId);
37
+
38
+}

+ 16
- 0
CODE/foreign-service/src/main/java/com/community/huiju/dao/TaSysRoleMapper.java Ver arquivo

@@ -0,0 +1,16 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.community.huiju.model.TaSysRole;
5
+
6
+/**
7
+ * <p>
8
+ * app端角色 Mapper 接口
9
+ * </p>
10
+ *
11
+ * @author jobob
12
+ * @since 2019-05-16
13
+ */
14
+public interface TaSysRoleMapper extends BaseMapper<TaSysRole> {
15
+
16
+}

+ 16
- 0
CODE/foreign-service/src/main/java/com/community/huiju/dao/TaTemporaryLicenseOrderMapper.java Ver arquivo

@@ -0,0 +1,16 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.community.huiju.model.TaTemporaryLicenseOrder;
5
+
6
+/**
7
+ * <p>
8
+ * 临时车缴费表 Mapper 接口
9
+ * </p>
10
+ *
11
+ * @author jobob
12
+ * @since 2019-05-28
13
+ */
14
+public interface TaTemporaryLicenseOrderMapper extends BaseMapper<TaTemporaryLicenseOrder> {
15
+
16
+}

+ 16
- 0
CODE/foreign-service/src/main/java/com/community/huiju/dao/TaUserLicenseOrderMapper.java Ver arquivo

@@ -0,0 +1,16 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.community.huiju.model.TaUserLicenseOrder;
5
+
6
+/**
7
+ * <p>
8
+ * 月租车缴费订单表 Mapper 接口
9
+ * </p>
10
+ *
11
+ * @author jobob
12
+ * @since 2019-05-28
13
+ */
14
+public interface TaUserLicenseOrderMapper extends BaseMapper<TaUserLicenseOrder> {
15
+
16
+}

+ 16
- 0
CODE/foreign-service/src/main/java/com/community/huiju/dao/TaUserMapper.java Ver arquivo

@@ -0,0 +1,16 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.community.huiju.model.TaUser;
5
+
6
+/**
7
+ * <p>
8
+ * 住户app端用户表 Mapper 接口
9
+ * </p>
10
+ *
11
+ * @author jobob
12
+ * @since 2019-05-15
13
+ */
14
+public interface TaUserMapper extends BaseMapper<TaUser> {
15
+
16
+}

+ 97
- 0
CODE/foreign-service/src/main/java/com/community/huiju/dao/TaUserVerifyMapper.java Ver arquivo

@@ -0,0 +1,97 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.community.huiju.model.TaUserVerify;
5
+import org.apache.ibatis.annotations.Param;
6
+import org.apache.ibatis.annotations.ResultType;
7
+import org.apache.ibatis.annotations.Select;
8
+
9
+import java.util.List;
10
+
11
+/**
12
+ * <p>
13
+ * app端用户审核表,存放用户的角色还有房产信息 Mapper 接口
14
+ * </p>
15
+ *
16
+ * @author jobob
17
+ * @since 2019-05-16
18
+ */
19
+public interface TaUserVerifyMapper extends BaseMapper<TaUserVerify> {
20
+
21
+    /**
22
+     * 根据 小区id 、 期、栋、单元、楼层、户号 进行条件查询出 已审核通过的并且是业主
23
+     * @param communityId
24
+     * @param phaseId
25
+     * @param buildingId
26
+     * @param unitId
27
+     * @param levelId
28
+     * @param roomNoId
29
+     * @return
30
+     */
31
+    @ResultType(TaUserVerify.class)
32
+    @Select("select  *  from ta_user_verify " +
33
+            "where community_id = #{communityId} " +
34
+            "and phase_id = #{phaseId} " +
35
+            "and building_id = #{buildingId} " +
36
+            "and unit_id = #{unitId} " +
37
+            "and level_id = #{levelId} " +
38
+            "and room_no_id = #{roomNoId} " +
39
+            "and verify_status = 1 " +
40
+            "and role_id = 1")
41
+    TaUserVerify selectCommunityAndAddress(@Param("communityId") Integer communityId, @Param("phaseId") Integer phaseId, @Param("buildingId") Integer buildingId, @Param("unitId") Integer unitId, @Param("levelId") Integer levelId, @Param("roomNoId") Integer roomNoId);
42
+
43
+    /**
44
+     * 根据 用户id, 小区id 、 期、栋、单元、楼层、户号 进行条件查询出 已审核通过的身份
45
+     * @param userId
46
+     * @param communityId
47
+     * @param phaseId
48
+     * @param buildingId
49
+     * @param unitId
50
+     * @param levelId
51
+     * @param roomNoId
52
+     * @return
53
+     */
54
+    @ResultType(TaUserVerify.class)
55
+    @Select("select  *  from ta_user_verify " +
56
+            "where community_id = #{communityId} " +
57
+            "and phase_id = #{phaseId} " +
58
+            "and building_id = #{buildingId} " +
59
+            "and unit_id = #{unitId} " +
60
+            "and level_id = #{levelId} " +
61
+            "and room_no_id = #{roomNoId} " +
62
+            "and user_id = #{userId} " +
63
+            "and verify_status = 1 ")
64
+    List<TaUserVerify> selectAddress(@Param("userId") Integer userId, @Param("communityId") Integer communityId, @Param("phaseId") Integer phaseId, @Param("buildingId") Integer buildingId, @Param("unitId") Integer unitId, @Param("levelId") Integer levelId, @Param("roomNoId") Integer roomNoId);
65
+
66
+    /**
67
+     * 根据 用户id, 审核id 查询
68
+     * @param userId
69
+     * @param userVerifyId
70
+     * @return
71
+     */
72
+    @ResultType(TaUserVerify.class)
73
+    @Select("select  *  from ta_user_verify " +
74
+            "where user_id = #{userId} " +
75
+            "and id = #{userVerifyId} ")
76
+    TaUserVerify selectByUserIdAndUserVerifyId(Integer userId, Integer userVerifyId);
77
+
78
+    /**
79
+     * 根据 用户id、小区id 、 期、栋、单元、楼层、户号、审核状态  进行条件查询
80
+     * @param communityId
81
+     * @param phaseId
82
+     * @param buildingId
83
+     * @param unitId
84
+     * @param levelId
85
+     * @param roomNoId
86
+     * @param verifyStatus
87
+     * @return
88
+     */
89
+    List<TaUserVerify> selectCommunityAndAddressAndVerifyStatus(@Param("userId") Integer userId,
90
+                                                                @Param("communityId") Integer communityId,
91
+                                                                @Param("phaseId") Integer phaseId,
92
+                                                                @Param("buildingId") Integer buildingId,
93
+                                                                @Param("unitId") Integer unitId,
94
+                                                                @Param("levelId") Integer levelId,
95
+                                                                @Param("roomNoId") Integer roomNoId,
96
+                                                                @Param("verifyStatus") Integer verifyStatus);
97
+}

+ 16
- 0
CODE/foreign-service/src/main/java/com/community/huiju/dao/TpBuildingMapper.java Ver arquivo

@@ -0,0 +1,16 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.community.huiju.model.TpBuilding;
5
+
6
+/**
7
+ * <p>
8
+ * 小区楼栋资料表 Mapper 接口
9
+ * </p>
10
+ *
11
+ * @author jobob
12
+ * @since 2019-05-15
13
+ */
14
+public interface TpBuildingMapper extends BaseMapper<TpBuilding> {
15
+
16
+}

+ 16
- 0
CODE/foreign-service/src/main/java/com/community/huiju/dao/TpBuildingOwnerInfoMapper.java Ver arquivo

@@ -0,0 +1,16 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.community.huiju.model.TpBuildingOwnerInfo;
5
+
6
+/**
7
+ * <p>
8
+ * 楼栋业主资料信息表(户号信息也在里面相当于tp_room_no   PS:共用一张表) Mapper 接口
9
+ * </p>
10
+ *
11
+ * @author jobob
12
+ * @since 2019-05-16
13
+ */
14
+public interface TpBuildingOwnerInfoMapper extends BaseMapper<TpBuildingOwnerInfo> {
15
+
16
+}

+ 16
- 0
CODE/foreign-service/src/main/java/com/community/huiju/dao/TpConfigurationMapper.java Ver arquivo

@@ -0,0 +1,16 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.community.huiju.model.TpConfiguration;
5
+
6
+/**
7
+ * <p>
8
+ * 设备配置表 Mapper 接口
9
+ * </p>
10
+ *
11
+ * @author jobob
12
+ * @since 2019-05-16
13
+ */
14
+public interface TpConfigurationMapper extends BaseMapper<TpConfiguration> {
15
+
16
+}

+ 71
- 0
CODE/foreign-service/src/main/java/com/community/huiju/dao/TpEquipmentMapper.java Ver arquivo

@@ -0,0 +1,71 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.community.huiju.model.TpEquipment;
6
+import org.apache.ibatis.annotations.Param;
7
+import org.apache.ibatis.annotations.ResultMap;
8
+import org.apache.ibatis.annotations.ResultType;
9
+import org.apache.ibatis.annotations.Select;
10
+
11
+import java.util.List;
12
+
13
+/**
14
+ * <p>
15
+ * 设备表 Mapper 接口
16
+ * </p>
17
+ *
18
+ * @author jobob
19
+ * @since 2019-05-16
20
+ */
21
+public interface TpEquipmentMapper extends BaseMapper<TpEquipment> {
22
+
23
+    /**
24
+     * 根据小区获取 监控列表 HLS
25
+     * @param communityId
26
+     * @return
27
+     */
28
+    @ResultType(TpEquipment.class)
29
+    @Select("select " +
30
+            "tm.*, " +
31
+            "(select `key` FROM tp_configuration WHERE id = tm.url_id) as monitoringUrl, " +
32
+            "(select configuration_value FROM tp_configuration WHERE id = tm.security_guard_tel_id) as securityGuardTel, " +
33
+            "(select configuration_value FROM tp_configuration WHERE id = tm.security_room_tel_id) as securityRoomTel, " +
34
+            "(select configuration_value FROM tp_configuration WHERE id = tm.address_id) as monitoringAddress " +
35
+            "FROM " +
36
+            "tp_equipment tm " +
37
+            "where tm.community_id = #{communityId} and tm.equipment_type = 1")
38
+    IPage<TpEquipment> selectMonitoringByCommunityId(IPage<TpEquipment> page, @Param("communityId") Integer communityId);
39
+
40
+    /**
41
+     * 根据小区 和 单元号 查询所有设备
42
+     * @param communityId
43
+     * @param unitId
44
+     * @return
45
+     */
46
+    @ResultType(TpEquipment.class)
47
+    @Select("select " +
48
+            "te.* " +
49
+            "from tp_unit_equipment trne left join tp_equipment te " +
50
+            "on trne.equipment_id = te.id " +
51
+            "where trne.community_id=#{communityId} and trne.unit_id=#{unitId} and te.equipment_type=#{equipmentType}")
52
+    List<TpEquipment> selectByCommunityIdAndUnitId(Integer communityId, Integer unitId, Integer equipmentType);
53
+
54
+
55
+    /**
56
+     * 根据小区 和 单元号 查询所有人脸设备
57
+     * @param communityId
58
+     * @param unitId
59
+     * @return
60
+     */
61
+    @ResultType(TpEquipment.class)
62
+    @Select("select " +
63
+            "te.* " +
64
+            "from tp_unit_equipment trne left join tp_equipment te " +
65
+            "on trne.equipment_id = te.id " +
66
+            "LEFT JOIN tp_configuration tc ON te.uuid_id = tc.id " +
67
+            "where trne.community_id=#{communityId} and trne.unit_id=#{unitId} and te.equipment_type=#{equipmentType} " +
68
+            "AND tc.device_type = 1")
69
+    List<TpEquipment> selectByCommunityIdAndUnitIdAndFace(@Param("communityId") Integer communityId, @Param("unitId") Integer unitId, @Param("equipmentType") Integer equipmentType);
70
+
71
+}

+ 27
- 0
CODE/foreign-service/src/main/java/com/community/huiju/dao/TpEquipmentTreeMapper.java Ver arquivo

@@ -0,0 +1,27 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.community.huiju.model.TpEquipmentTree;
5
+import org.apache.ibatis.annotations.Param;
6
+import org.apache.ibatis.annotations.ResultType;
7
+import org.apache.ibatis.annotations.Select;
8
+
9
+/**
10
+ * <p>
11
+ * 设备树 Mapper 接口
12
+ * </p>
13
+ *
14
+ * @author jobob
15
+ * @since 2019-05-16
16
+ */
17
+public interface TpEquipmentTreeMapper extends BaseMapper<TpEquipmentTree> {
18
+
19
+    /**
20
+     * 根据小区id 查询
21
+     * @param communityId
22
+     * @return
23
+     */
24
+    @ResultType(TpEquipmentTree.class)
25
+    @Select("select * from tp_equipment_tree where community_id = #{communityId}")
26
+    TpEquipmentTree selectByCommunityId(@Param("communityId") Integer communityId);
27
+}

+ 16
- 0
CODE/foreign-service/src/main/java/com/community/huiju/dao/TpLevelMapper.java Ver arquivo

@@ -0,0 +1,16 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.community.huiju.model.TpLevel;
5
+
6
+/**
7
+ * <p>
8
+ * 小区楼层资料表 Mapper 接口
9
+ * </p>
10
+ *
11
+ * @author jobob
12
+ * @since 2019-05-15
13
+ */
14
+public interface TpLevelMapper extends BaseMapper<TpLevel> {
15
+
16
+}

+ 16
- 0
CODE/foreign-service/src/main/java/com/community/huiju/dao/TpPhaseMapper.java Ver arquivo

@@ -0,0 +1,16 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.community.huiju.model.TpPhase;
5
+
6
+/**
7
+ * <p>
8
+ * 小区期区资料表 Mapper 接口
9
+ * </p>
10
+ *
11
+ * @author jobob
12
+ * @since 2019-05-15
13
+ */
14
+public interface TpPhaseMapper extends BaseMapper<TpPhase> {
15
+
16
+}

+ 16
- 0
CODE/foreign-service/src/main/java/com/community/huiju/dao/TpRoomNoMapper.java Ver arquivo

@@ -0,0 +1,16 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.community.huiju.model.TpRoomNo;
5
+
6
+/**
7
+ * <p>
8
+ * 户号信息表 Mapper 接口
9
+ * </p>
10
+ *
11
+ * @author jobob
12
+ * @since 2019-05-15
13
+ */
14
+public interface TpRoomNoMapper extends BaseMapper<TpRoomNo> {
15
+
16
+}

+ 16
- 0
CODE/foreign-service/src/main/java/com/community/huiju/dao/TpUnitMapper.java Ver arquivo

@@ -0,0 +1,16 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.community.huiju.model.TpUnit;
5
+
6
+/**
7
+ * <p>
8
+ * 小区单元资料表 Mapper 接口
9
+ * </p>
10
+ *
11
+ * @author jobob
12
+ * @since 2019-05-15
13
+ */
14
+public interface TpUnitMapper extends BaseMapper<TpUnit> {
15
+
16
+}

+ 76
- 0
CODE/foreign-service/src/main/java/com/community/huiju/enums/ResponseErrorsMessages.java Ver arquivo

@@ -0,0 +1,76 @@
1
+package com.community.huiju.enums;
2
+
3
+/**
4
+ * 错误消息定义
5
+ * @author weiximei
6
+ */
7
+public enum ResponseErrorsMessages {
8
+
9
+    SYSTEM_ERRORS (500, "服务断网了!"),
10
+    NOT_PHONE(1000, "请输入正确的手机号!"),
11
+    NOT_USER_NAME(1001, "用户名不能为空!"),
12
+    NOT_ID_CARD(1002, "身份证不能为空!"),
13
+    NOT_GENDER(1003, "性别不能为空!"),
14
+    EXISTING_GENDER(1004, "手机号已存在!"),
15
+    NOT_USER(1004, "用户不存在!"),
16
+    NOT_LICENSE(44036, "未找到该车辆的月卡信息!"),
17
+    EXIST_OWNER(1005, "已存在业主!"),
18
+    EXIST_BUIDDING_ROLE(1006, "您已在该房产中!"),
19
+    NO_ROLE(1007, "角色不存在!"),
20
+    NO_PHASE(1008, "期/区 不存在!"),
21
+    NO_BUILDING(1009, "楼栋不存在!"),
22
+    NO_UNIT(1010, "单元不存在!"),
23
+    NO_LEVEL(1011, "楼层不存在!"),
24
+    NO_ROOM_NO(1012, "户号不存在!"),
25
+    NOT_USER_VERIFY(1013, "无房产关联关系!"),
26
+    NOT_USER_FACE(1014, "未录入人脸信息!"),
27
+    NOT_PUSH_FACE(1015, "人脸推送失敗!"),
28
+    NOT_VERIFY(1016, "当前房产审核记录不存在!"),
29
+    NOT_IDENTITY_VERIFY(1017, "您的身份已停用!"),
30
+    EXIST_FACE(1018, "人脸信息已存在!"),
31
+    NOT_USER_VERIFY_1(1019, "房产审核未通过!"),
32
+    DELETE_FACE(1020, "人脸删除失败!"),
33
+    FACE_ERROR(1021, "请录入正确的人脸图片!"),
34
+    SIGN_ERROR(1022, "签名错误!"),
35
+    SIGN_DATETIME_ERROR(1023, "签名已过期!"),
36
+    SIGN_ENCRYPT_MD5_ERROR(1024, "未使用md5加密方式加密!"),
37
+    NOT_EQUIPMENT(1025, "系统设备未设置!")
38
+    ;
39
+
40
+
41
+    ResponseErrorsMessages(Integer code, String msg) {
42
+        this.code = code;
43
+        this.msg = msg;
44
+    }
45
+
46
+
47
+    private Integer code;
48
+
49
+    private String msg;
50
+
51
+    public Integer getCode() {
52
+        return code;
53
+    }
54
+
55
+    public void setCode(Integer code) {
56
+        this.code = code;
57
+    }
58
+
59
+    public String getMsg() {
60
+        return msg;
61
+    }
62
+
63
+    public void setMsg(String msg) {
64
+        this.msg = msg;
65
+    }
66
+
67
+    @Override
68
+    public String toString() {
69
+        return "ResponseErrorsMessages{" +
70
+                "code=" + code +
71
+                ", msg='" + msg + '\'' +
72
+                '}';
73
+    }
74
+
75
+
76
+}

+ 52
- 0
CODE/foreign-service/src/main/java/com/community/huiju/exception/ExceptionHandleAdice.java Ver arquivo

@@ -0,0 +1,52 @@
1
+package com.community.huiju.exception;
2
+
3
+import com.community.commom.constant.Constant;
4
+import com.community.commom.fushi.error.FuShiException;
5
+import com.community.huiju.common.base.ResponseBean;
6
+import com.community.huiju.enums.ResponseErrorsMessages;
7
+import lombok.extern.slf4j.Slf4j;
8
+import org.springframework.validation.ObjectError;
9
+import org.springframework.web.bind.MethodArgumentNotValidException;
10
+import org.springframework.web.bind.annotation.ControllerAdvice;
11
+import org.springframework.web.bind.annotation.ExceptionHandler;
12
+import org.springframework.web.bind.annotation.ResponseBody;
13
+
14
+import java.util.List;
15
+
16
+/**
17
+ * 统一异常出口
18
+ * @author weiximei
19
+ */
20
+@ControllerAdvice
21
+@ResponseBody
22
+@Slf4j
23
+public class ExceptionHandleAdice {
24
+
25
+
26
+    @ExceptionHandler(Exception.class)
27
+    public ResponseBean handleException(Exception e){
28
+        log.error(e.getMessage(),e);
29
+        ResponseBean response = new ResponseBean();
30
+        response.addError(ResponseErrorsMessages.SYSTEM_ERRORS.getCode(),ResponseErrorsMessages.SYSTEM_ERRORS.getMsg());
31
+        return response;
32
+    }
33
+
34
+
35
+    @ExceptionHandler(WisdomException.class)
36
+    public ResponseBean handleException(WisdomException e) {
37
+        log.error(e.getMessage(),e);
38
+        ResponseBean response = new ResponseBean();
39
+        response.addError(e.getCode(),e.getMessage());
40
+        return response;
41
+    }
42
+
43
+    @ExceptionHandler(FuShiException.class)
44
+    public ResponseBean handleException(FuShiException e) {
45
+        log.error(e.getMessage(),e);
46
+        ResponseBean response = new ResponseBean();
47
+        response.addError(e.getCode(),e.getMessage());
48
+        return response;
49
+    }
50
+
51
+
52
+}

+ 35
- 0
CODE/foreign-service/src/main/java/com/community/huiju/exception/WisdomException.java Ver arquivo

@@ -0,0 +1,35 @@
1
+package com.community.huiju.exception;
2
+
3
+
4
+import lombok.Data;
5
+
6
+/**
7
+ * @author weiximei
8
+ */
9
+@Data
10
+public class WisdomException extends RuntimeException {
11
+
12
+    private String mes;
13
+
14
+    private Integer code;
15
+
16
+    public WisdomException(String msg, Throwable t) {
17
+        super(msg, t);
18
+    }
19
+
20
+    public WisdomException(Integer code,String msg, Throwable t) {
21
+        super(msg, t);
22
+        this.mes = msg;
23
+        this.code = code;
24
+    }
25
+
26
+    public WisdomException(Integer code,String msg) {
27
+        super(msg);
28
+        this.mes = msg;
29
+        this.code = code;
30
+    }
31
+
32
+    public WisdomException(String msg) {
33
+        super(msg);
34
+    }
35
+}

+ 123
- 0
CODE/foreign-service/src/main/java/com/community/huiju/filter/SignFilter.java Ver arquivo

@@ -0,0 +1,123 @@
1
+package com.community.huiju.filter;
2
+
3
+import com.alibaba.fastjson.JSONObject;
4
+import com.community.huiju.common.base.ResponseBean;
5
+import com.community.huiju.common.perproties.DaSuProperties;
6
+import com.community.huiju.common.sign.DaSuSign;
7
+import com.community.huiju.enums.ResponseErrorsMessages;
8
+import com.community.huiju.exception.WisdomException;
9
+import com.google.common.collect.Maps;
10
+import lombok.extern.slf4j.Slf4j;
11
+import org.apache.commons.lang3.StringUtils;
12
+import org.springframework.beans.factory.annotation.Autowired;
13
+import org.springframework.stereotype.Component;
14
+import org.springframework.util.AntPathMatcher;
15
+
16
+import javax.servlet.*;
17
+import javax.servlet.http.HttpServletRequest;
18
+import java.io.IOException;
19
+import java.io.PrintWriter;
20
+import java.time.LocalDateTime;
21
+import java.time.ZoneId;
22
+import java.time.ZoneOffset;
23
+import java.util.Map;
24
+import java.util.TreeMap;
25
+
26
+/**
27
+ *
28
+ * 签名拦截器
29
+ *
30
+ * @author weiximei on 2019-05-17
31
+ */
32
+//@Component
33
+@Slf4j
34
+public class SignFilter implements Filter {
35
+
36
+    private String [] urls = new String[]{
37
+            "/**/swagger-ui.html/**","/**/springfox-swagger-ui/**",
38
+            "/**/swagger-resources/**","/**/v2/api-docs/**",
39
+            "/**/swagger-resources/**"
40
+    };
41
+
42
+    private AntPathMatcher antPathMatcher = new AntPathMatcher();
43
+
44
+    @Autowired
45
+    private DaSuProperties daSuProperties;
46
+
47
+    @Override
48
+    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
49
+
50
+        HttpServletRequest httpServletRequest = (HttpServletRequest) request;
51
+        for (String url : urls) {
52
+            if (antPathMatcher.match(url ,httpServletRequest.getRequestURI())) {
53
+                chain.doFilter(request, response);
54
+                return;
55
+            }
56
+        }
57
+
58
+        ResponseBean responseBean = new ResponseBean();
59
+        TreeMap<String, Object> treeMap = Maps.newTreeMap();
60
+
61
+        try {
62
+            // 加密方式
63
+            String encrypt = request.getParameter("encrypt");
64
+            if (!"md5".equals(encrypt.toLowerCase())) {
65
+                responseBean.addError(ResponseErrorsMessages.SIGN_ENCRYPT_MD5_ERROR.getCode(), ResponseErrorsMessages.SIGN_ENCRYPT_MD5_ERROR.getMsg());
66
+                responseWriter(response, responseBean);
67
+                return;
68
+            }
69
+
70
+            String datetime = request.getParameter("datetime");
71
+            LocalDateTime localDateTime =LocalDateTime.ofEpochSecond(Long.valueOf(datetime),0, ZoneOffset.ofHours(8));
72
+            localDateTime.plusMinutes(10);
73
+
74
+            // 校验签名是否过期
75
+            if (StringUtils.isBlank(datetime) || System.currentTimeMillis() > Long.valueOf(datetime)) {
76
+                responseBean.addError(ResponseErrorsMessages.SIGN_DATETIME_ERROR.getCode(), ResponseErrorsMessages.SIGN_DATETIME_ERROR.getMsg());
77
+                responseWriter(response, responseBean);
78
+                return;
79
+            }
80
+        } catch (Exception e) {
81
+            responseBean.addError(ResponseErrorsMessages.SIGN_ERROR.getCode(), ResponseErrorsMessages.SIGN_ERROR.getMsg());
82
+            responseWriter(response, responseBean);
83
+            return;
84
+        }
85
+
86
+
87
+
88
+
89
+        // 获取请求的所有参数
90
+        Map<String, String[]> parameterMap = request.getParameterMap();
91
+        parameterMap.entrySet().forEach(e-> {
92
+            String key = e.getKey();
93
+            String [] value = e.getValue();
94
+            if (!"sign".equals(key) && !"appSecret".equals(key)) {
95
+                treeMap.put(key, value[0]);
96
+            }
97
+        });
98
+
99
+        String sign = DaSuSign.createSign(treeMap, daSuProperties.getAppSecret());
100
+        String parameterSign = request.getParameter("sign");
101
+
102
+        if (DaSuSign.isMD5Sign(sign, parameterSign)) {
103
+            chain.doFilter(request, response);
104
+        } else {
105
+            responseBean.addError(ResponseErrorsMessages.SIGN_ERROR.getCode(), ResponseErrorsMessages.SIGN_ERROR.getMsg());
106
+            responseWriter(response, responseBean);
107
+        }
108
+
109
+    }
110
+
111
+    private void responseWriter(ServletResponse response, ResponseBean responseBean) {
112
+        response.setContentType("application/json;charset=UTF-8");
113
+        PrintWriter writer = null;
114
+        try {
115
+            writer = response.getWriter();
116
+        } catch (IOException e) {
117
+            e.printStackTrace();
118
+        }
119
+        writer.write(JSONObject.toJSONString(responseBean));
120
+        writer.flush();
121
+        writer.close();
122
+    }
123
+}

+ 58
- 0
CODE/foreign-service/src/main/java/com/community/huiju/jwt/JwtUtil.java Ver arquivo

@@ -0,0 +1,58 @@
1
+package com.community.huiju.jwt;
2
+
3
+
4
+import lombok.extern.slf4j.Slf4j;
5
+import org.jose4j.jwa.AlgorithmConstraints;
6
+import org.jose4j.jwe.ContentEncryptionAlgorithmIdentifiers;
7
+import org.jose4j.jwe.JsonWebEncryption;
8
+import org.jose4j.jwe.KeyManagementAlgorithmIdentifiers;
9
+import org.jose4j.keys.AesKey;
10
+import org.jose4j.lang.ByteUtil;
11
+import org.jose4j.lang.JoseException;
12
+
13
+import javax.crypto.SecretKey;
14
+import java.security.Key;
15
+import java.util.Date;
16
+import java.util.HashMap;
17
+import java.util.Map;
18
+
19
+@Slf4j
20
+public class JwtUtil {
21
+
22
+    public static String sigin() {
23
+        Key key = new AesKey(ByteUtil.randomBytes(16));
24
+        JsonWebEncryption jwe = new JsonWebEncryption();
25
+        jwe.setPayload("Hello World!");
26
+        jwe.setAlgorithmHeaderValue(KeyManagementAlgorithmIdentifiers.A128KW);
27
+        jwe.setEncryptionMethodHeaderParameter(ContentEncryptionAlgorithmIdentifiers.AES_128_CBC_HMAC_SHA_256);
28
+        jwe.setKey(key);
29
+        String sigin = null;
30
+        try {
31
+            sigin = jwe.getCompactSerialization();
32
+        } catch (JoseException e) {
33
+            e.printStackTrace();
34
+        }
35
+
36
+        log.info("创建签名: " + sigin);
37
+
38
+        jwe = new JsonWebEncryption();
39
+        jwe.setAlgorithmConstraints(new AlgorithmConstraints(AlgorithmConstraints.ConstraintType.WHITELIST,
40
+                KeyManagementAlgorithmIdentifiers.A128KW));
41
+        jwe.setContentEncryptionAlgorithmConstraints(new AlgorithmConstraints(AlgorithmConstraints.ConstraintType.WHITELIST,
42
+                ContentEncryptionAlgorithmIdentifiers.AES_128_CBC_HMAC_SHA_256));
43
+        jwe.setKey(key);
44
+        try {
45
+            jwe.setCompactSerialization(sigin);
46
+            log.info("解密:: " + jwe.getPayload());
47
+        } catch (JoseException e) {
48
+            e.printStackTrace();
49
+        }
50
+
51
+        return sigin;
52
+    }
53
+
54
+
55
+    public static void main(String[] args) {
56
+        sigin();
57
+    }
58
+}

+ 32
- 0
CODE/foreign-service/src/main/java/com/community/huiju/log/LogAnnotation.java Ver arquivo

@@ -0,0 +1,32 @@
1
+package com.community.huiju.log;
2
+
3
+import java.lang.annotation.*;
4
+
5
+/**
6
+ * 日志注解
7
+ * @author weiximei
8
+ */
9
+@Retention(RetentionPolicy.RUNTIME) // 在运行时使用
10
+@Target({ ElementType.METHOD }) // 在方法上使用
11
+@Documented
12
+public @interface LogAnnotation {
13
+
14
+    /**
15
+     * 日志类型
16
+     * @return
17
+     */
18
+    LogEnums value() default LogEnums.NOT;
19
+
20
+    /**
21
+     * 是否记录
22
+     * @return
23
+     */
24
+    boolean record() default true;
25
+
26
+    /**
27
+     * 别名, 作为注释用
28
+     * @return
29
+     */
30
+    String alias() default "";
31
+
32
+}

+ 43
- 0
CODE/foreign-service/src/main/java/com/community/huiju/log/LogEnums.java Ver arquivo

@@ -0,0 +1,43 @@
1
+package com.community.huiju.log;
2
+
3
+/**
4
+ * 日志类型
5
+ *
6
+ * @author weiximei
7
+ */
8
+public enum LogEnums {
9
+
10
+    NOT(8000, "无类型"),
11
+
12
+    DA_SU(8001, "大苏")
13
+
14
+    ;
15
+
16
+    private Integer code;
17
+
18
+    private String value;
19
+
20
+
21
+    LogEnums(Integer code, String value) {
22
+        this.code = code;
23
+        this.value = value;
24
+    }
25
+
26
+    public Integer getCode() {
27
+        return code;
28
+    }
29
+
30
+    public void setCode(Integer code) {
31
+        this.code = code;
32
+    }
33
+
34
+    public String getValue() {
35
+        return value;
36
+    }
37
+
38
+    public void setValue(String value) {
39
+        this.value = value;
40
+    }
41
+
42
+
43
+}

+ 101
- 0
CODE/foreign-service/src/main/java/com/community/huiju/log/LogFactory.java Ver arquivo

@@ -0,0 +1,101 @@
1
+package com.community.huiju.log;
2
+
3
+import java.io.File;
4
+import java.io.RandomAccessFile;
5
+import java.nio.ByteBuffer;
6
+import java.nio.channels.FileChannel;
7
+import java.nio.channels.FileLock;
8
+import java.time.LocalDate;
9
+import java.time.LocalDateTime;
10
+import java.time.format.DateTimeFormatter;
11
+import java.util.TimerTask;
12
+
13
+/**
14
+ * 日志工厂
15
+ * @author weiximei
16
+ */
17
+public class LogFactory {
18
+
19
+    public static File getFile() {
20
+        LocalDate localDate = LocalDate.now();
21
+        String pathMkdir = "";
22
+
23
+        String os = System.getProperty("os.name");
24
+        if(os.toLowerCase().startsWith("win")){
25
+            pathMkdir = "E:" + File.separator + "log" + File.separator + "foreign-log" + File.separator + localDate.getYear() + "-" + localDate.getMonthValue() + "-" + localDate.getDayOfMonth();
26
+        } else {
27
+            pathMkdir = "/home/fxf/smart-community" + File.separator + "log" + File.separator + "foreign-log" + File.separator + localDate.getYear() + "-" + localDate.getMonthValue() + "-" + localDate.getDayOfMonth();
28
+        }
29
+
30
+        File file = new File(pathMkdir);
31
+        if (!file.exists()) {
32
+            file.mkdirs();
33
+        }
34
+        file = new File(pathMkdir + File.separator + "foreign-log.log");
35
+
36
+        return file;
37
+    }
38
+
39
+    /**
40
+     * 记录请求参数和返回值
41
+     * @param parameters
42
+     * @param returnValue
43
+     * @return
44
+     */
45
+    public static TimerTask parametersAndReturn(String parameters, String returnValue){
46
+        return new TimerTask() {
47
+            @Override
48
+            public void run() {
49
+
50
+                RandomAccessFile accessFile = null;
51
+                FileChannel fileChannel = null;
52
+                FileLock fileLock = null;
53
+                try {
54
+                    // 获取这个文件的读和写的权限
55
+                    accessFile = new RandomAccessFile(getFile(), "rw");
56
+                    // 文件通道
57
+                    fileChannel = accessFile.getChannel();
58
+                    fileLock = null;
59
+                    while (true) {
60
+                        try {
61
+                            // 获取锁,如果失败,继续尝试
62
+                            fileLock = fileChannel.tryLock();
63
+                            break;
64
+                        } catch (Exception e) {
65
+                            Thread.sleep(100);
66
+                        }
67
+                    }
68
+
69
+                    // 获取当前这个文件的大小
70
+                    long length = accessFile.length();
71
+                    // 设置写入的指针, 设置到这个文件的末尾
72
+                    accessFile.seek(length);
73
+                    // 开始写入文件
74
+                    LocalDateTime localDateTime = LocalDateTime.now();
75
+                    DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd hh:mm:ss");
76
+                    String str = dateTimeFormatter.format(localDateTime) + " === " + Thread.currentThread().getName() + "  : " + parameters + "\n";
77
+                    fileChannel.write(ByteBuffer.wrap(str.getBytes()));
78
+                    str = dateTimeFormatter.format(localDateTime) + " === " + Thread.currentThread().getName() + "  : " + returnValue + "\n";
79
+                    fileChannel.write(ByteBuffer.wrap(str.getBytes()));
80
+
81
+                } catch (Exception e) {
82
+                    e.printStackTrace();
83
+                } finally {
84
+                    if (fileLock != null && fileChannel != null && accessFile != null) {
85
+                        // 释放锁
86
+                        try {
87
+                            fileLock.release();
88
+                            fileChannel.close();
89
+                            accessFile.close();
90
+                        } catch (Exception e) {
91
+                            e.printStackTrace();
92
+                        }
93
+                    }
94
+                }
95
+
96
+
97
+            }
98
+        };
99
+    }
100
+
101
+}

+ 46
- 0
CODE/foreign-service/src/main/java/com/community/huiju/log/LogFileManager.java Ver arquivo

@@ -0,0 +1,46 @@
1
+package com.community.huiju.log;
2
+
3
+import java.util.TimerTask;
4
+import java.util.concurrent.ScheduledThreadPoolExecutor;
5
+
6
+/**
7
+ * 日志文件记录
8
+ * @author weiximei
9
+ */
10
+public class LogFileManager {
11
+
12
+    // 记录日志的线程池
13
+    private ScheduledThreadPoolExecutor scheduledThreadPoolExecutor = new ScheduledThreadPoolExecutor(10);
14
+
15
+    private LogFileManager() {}
16
+
17
+    public static LogFileManager getInstance() {
18
+        return LogSingleton.INSTANCE.getInstance();
19
+    }
20
+
21
+    /**
22
+     * 记录日志
23
+     * @param timerTask 任务
24
+     */
25
+    public void executeLog(TimerTask timerTask){
26
+        // 日志记录
27
+        scheduledThreadPoolExecutor.execute(timerTask);
28
+    }
29
+
30
+    /**
31
+     * 枚举
32
+     */
33
+    private static enum LogSingleton {
34
+        INSTANCE;
35
+
36
+        private LogFileManager logFileManager;
37
+        private LogSingleton() {
38
+            logFileManager = new LogFileManager();
39
+        }
40
+
41
+        public LogFileManager getInstance() {
42
+            return logFileManager;
43
+        }
44
+
45
+    }
46
+}

+ 69
- 0
CODE/foreign-service/src/main/java/com/community/huiju/model/TaFace.java Ver arquivo

@@ -0,0 +1,69 @@
1
+package com.community.huiju.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import com.baomidou.mybatisplus.annotation.TableName;
6
+import lombok.Data;
7
+import lombok.EqualsAndHashCode;
8
+import lombok.experimental.Accessors;
9
+
10
+import java.io.Serializable;
11
+import java.time.LocalDateTime;
12
+import java.util.Date;
13
+
14
+/**
15
+ * <p>
16
+ * 人脸检测图片
17
+ * </p>
18
+ *
19
+ * @author jobob
20
+ * @since 2019-05-16
21
+ */
22
+@Data
23
+@EqualsAndHashCode(callSuper = false)
24
+@Accessors(chain = true)
25
+@TableName("ta_face")
26
+public class TaFace implements Serializable {
27
+
28
+    private static final long serialVersionUID = 1L;
29
+
30
+    @TableId(value = "id", type = IdType.AUTO)
31
+    private Integer faceId;
32
+
33
+    /**
34
+     * 小区id
35
+     */
36
+    private Integer communityId;
37
+
38
+    /**
39
+     * 用户审核表id
40
+     */
41
+    private Integer taUserVerifyId;
42
+
43
+    /**
44
+     * 上传的图片
45
+     */
46
+    private String faceImg;
47
+
48
+    /**
49
+     * 创建人
50
+     */
51
+    private Integer createUser;
52
+
53
+    /**
54
+     * 创建时间
55
+     */
56
+    private Date createDate;
57
+
58
+    /**
59
+     * 更新人
60
+     */
61
+    private Integer updateUser;
62
+
63
+    /**
64
+     * 更新时间
65
+     */
66
+    private Date updateDate;
67
+
68
+
69
+}

+ 64
- 0
CODE/foreign-service/src/main/java/com/community/huiju/model/TaSysRole.java Ver arquivo

@@ -0,0 +1,64 @@
1
+package com.community.huiju.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import com.baomidou.mybatisplus.annotation.TableName;
6
+import lombok.Data;
7
+import lombok.EqualsAndHashCode;
8
+import lombok.experimental.Accessors;
9
+
10
+import java.io.Serializable;
11
+import java.time.LocalDateTime;
12
+import java.util.Date;
13
+
14
+/**
15
+ * <p>
16
+ * app端角色
17
+ * </p>
18
+ *
19
+ * @author jobob
20
+ * @since 2019-05-16
21
+ */
22
+@Data
23
+@EqualsAndHashCode(callSuper = false)
24
+@Accessors(chain = true)
25
+@TableName("ta_sys_role")
26
+public class TaSysRole implements Serializable {
27
+
28
+    private static final long serialVersionUID = 1L;
29
+
30
+    @TableId(value = "id", type = IdType.AUTO)
31
+    private Integer roleId;
32
+
33
+    /**
34
+     * 角色名称
35
+     */
36
+    private String roleName;
37
+
38
+    /**
39
+     * 描述
40
+     */
41
+    private String description;
42
+
43
+    /**
44
+     * 创建人
45
+     */
46
+    private Integer createUser;
47
+
48
+    /**
49
+     * 创建时间
50
+     */
51
+    private Date createDate;
52
+
53
+    /**
54
+     * 更新人
55
+     */
56
+    private Integer updateUser;
57
+
58
+    /**
59
+     * 更新时间
60
+     */
61
+    private Date updateDate;
62
+
63
+
64
+}

+ 119
- 0
CODE/foreign-service/src/main/java/com/community/huiju/model/TaTemporaryLicenseOrder.java Ver arquivo

@@ -0,0 +1,119 @@
1
+package com.community.huiju.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import com.baomidou.mybatisplus.annotation.TableName;
6
+import lombok.Data;
7
+import lombok.EqualsAndHashCode;
8
+import lombok.experimental.Accessors;
9
+
10
+import java.io.Serializable;
11
+import java.time.LocalDateTime;
12
+import java.util.Date;
13
+
14
+/**
15
+ * <p>
16
+ * 临时车缴费表
17
+ * </p>
18
+ *
19
+ * @author jobob
20
+ * @since 2019-05-28
21
+ */
22
+@Data
23
+@EqualsAndHashCode(callSuper = false)
24
+@Accessors(chain = true)
25
+@TableName("ta_temporary_license_order")
26
+public class TaTemporaryLicenseOrder implements Serializable {
27
+
28
+    private static final long serialVersionUID = 1L;
29
+
30
+    @TableId(value = "id", type = IdType.AUTO)
31
+    private Integer id;
32
+
33
+    /**
34
+     * 小区ID
35
+     */
36
+    private Integer communityId;
37
+
38
+    /**
39
+     * 人员ID
40
+     */
41
+    private Integer taUserId;
42
+
43
+    /**
44
+     * 订单号
45
+     */
46
+    private String orderNumber;
47
+
48
+    /**
49
+     * 支付状态  0:未支付  1: 已支付 2: 正在支付中
50
+     */
51
+    private String orderStatus;
52
+
53
+    /**
54
+     * 创建人
55
+     */
56
+    private Integer createUser;
57
+
58
+    /**
59
+     * 创建时间
60
+     */
61
+    private Date createDate;
62
+
63
+    /**
64
+     * 更新人
65
+     */
66
+    private Integer updateUser;
67
+
68
+    /**
69
+     * 更新时间
70
+     */
71
+    private Date updateDate;
72
+
73
+    /**
74
+     * 缴费手机号
75
+     */
76
+    private String paymentTel;
77
+
78
+    /**
79
+     * 缴费人姓名
80
+     */
81
+    private String paymentName;
82
+
83
+    /**
84
+     * 缴费方式 1是支付宝 2是微信支付
85
+     */
86
+    private String paymentType;
87
+
88
+    /**
89
+     * 实缴金额
90
+     */
91
+    private String actualAmount;
92
+
93
+    /**
94
+     * 抵扣金额
95
+     */
96
+    private String deductionAmount;
97
+
98
+    /**
99
+     * 应缴金额
100
+     */
101
+    private String amount;
102
+
103
+    /**
104
+     * 停车场
105
+     */
106
+    private String parkingLot;
107
+
108
+    /**
109
+     * 车牌号
110
+     */
111
+    private String licensePlate;
112
+
113
+    /**
114
+     * 来源
115
+     */
116
+    private String sourceFrom;
117
+
118
+
119
+}

+ 155
- 0
CODE/foreign-service/src/main/java/com/community/huiju/model/TaUser.java Ver arquivo

@@ -0,0 +1,155 @@
1
+package com.community.huiju.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableField;
5
+import com.baomidou.mybatisplus.annotation.TableId;
6
+import com.baomidou.mybatisplus.annotation.TableName;
7
+import lombok.Data;
8
+import lombok.EqualsAndHashCode;
9
+import lombok.experimental.Accessors;
10
+
11
+import java.io.Serializable;
12
+import java.time.LocalDateTime;
13
+import java.util.Date;
14
+
15
+/**
16
+ * <p>
17
+ * 住户app端用户表
18
+ * </p>
19
+ *
20
+ * @author jobob
21
+ * @since 2019-05-15
22
+ */
23
+@Data
24
+@EqualsAndHashCode(callSuper = false)
25
+@Accessors(chain = true)
26
+@TableName("ta_user")
27
+public class TaUser implements Serializable {
28
+
29
+    private static final long serialVersionUID = 1L;
30
+
31
+    @TableId(value = "id", type = IdType.AUTO)
32
+    private Integer userId;
33
+
34
+    /**
35
+     * 小区id
36
+     */
37
+    private Integer communityId;
38
+
39
+    /**
40
+     * 楼栋业主资料信息id
41
+     */
42
+    private Integer buildingOwnerInfoId;
43
+
44
+    /**
45
+     * 头像
46
+     */
47
+    private String headPortrait;
48
+
49
+    /**
50
+     * 用户姓名
51
+     */
52
+    private String userName;
53
+
54
+    /**
55
+     * 登录账号就是手机号确保唯一
56
+     */
57
+    private String loginName;
58
+
59
+    /**
60
+     * 登录密码
61
+     */
62
+    private String loginPassword;
63
+
64
+    /**
65
+     * 邮箱
66
+     */
67
+    private String email;
68
+
69
+    /**
70
+     * 性别 1:男   2:女 0: 未选择性别
71
+     */
72
+    private String gender;
73
+
74
+    /**
75
+     * 1 有效 0 无效(逻辑删除) 2 拉黑(运营端用)
76
+     */
77
+    private String status;
78
+
79
+    /**
80
+     * 备注
81
+     */
82
+    private String remark;
83
+
84
+    /**
85
+     * 上级目录id存在,表示是这个id下的租客或家属
86
+     */
87
+    private Integer parentId;
88
+
89
+    /**
90
+     * 接受协议状态  0 是未接受 1是已接受
91
+     */
92
+    private String acceptAgreementStatus;
93
+
94
+    /**
95
+     * 认证状态  0 是未认证    1是认证通过   2是已作废
96
+     */
97
+    private String verifyStatus;
98
+
99
+    /**
100
+     * 创建人
101
+     */
102
+    private Integer createUser;
103
+
104
+    /**
105
+     * 创建时间
106
+     */
107
+    private Date createDate;
108
+
109
+    /**
110
+     * 更新人
111
+     */
112
+    private Integer updateUser;
113
+
114
+    /**
115
+     * 更新时间
116
+     */
117
+    private Date updateDate;
118
+
119
+    /**
120
+     * 海康人员编号
121
+     */
122
+    private Long hkPersonNo;
123
+
124
+    /**
125
+     * 海康人员ID   personId
126
+     */
127
+    private Integer hkUserId;
128
+
129
+    /**
130
+     * 海康 卡片号码
131
+     */
132
+    private String hkCardNo;
133
+
134
+    /**
135
+     * (以房产为准,这个字段不维护)人脸状态  0 是未上传   1是已上传   register/unregister
136
+     */
137
+    private String faceStatus;
138
+
139
+    /**
140
+     * 微信openid
141
+     */
142
+    private String openid;
143
+
144
+    /**
145
+     * 身份证
146
+     */
147
+    private String idCard;
148
+
149
+    /**
150
+     * 微信昵称
151
+     */
152
+    private String nickname;
153
+
154
+
155
+}

+ 124
- 0
CODE/foreign-service/src/main/java/com/community/huiju/model/TaUserLicenseOrder.java Ver arquivo

@@ -0,0 +1,124 @@
1
+package com.community.huiju.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import com.baomidou.mybatisplus.annotation.TableName;
6
+import lombok.Data;
7
+import lombok.EqualsAndHashCode;
8
+import lombok.experimental.Accessors;
9
+
10
+import java.io.Serializable;
11
+import java.time.LocalDateTime;
12
+import java.util.Date;
13
+
14
+/**
15
+ * <p>
16
+ * 月租车缴费订单表
17
+ * </p>
18
+ *
19
+ * @author jobob
20
+ * @since 2019-05-28
21
+ */
22
+@Data
23
+@EqualsAndHashCode(callSuper = false)
24
+@Accessors(chain = true)
25
+@TableName("ta_user_license_order")
26
+public class TaUserLicenseOrder implements Serializable {
27
+
28
+    private static final long serialVersionUID = 1L;
29
+
30
+    @TableId(value = "id", type = IdType.AUTO)
31
+    private Integer id;
32
+
33
+    /**
34
+     * 小区ID
35
+     */
36
+    private Integer communityId;
37
+
38
+    /**
39
+     * 人员ID
40
+     */
41
+    private Integer taUserId;
42
+
43
+    /**
44
+     * 订单号
45
+     */
46
+    private String orderNumber;
47
+
48
+    /**
49
+     * 支付状态  0:未支付  1: 已支付 2: 正在支付中 3:已关闭
50
+     */
51
+    private String orderStatus;
52
+
53
+    /**
54
+     * 创建人
55
+     */
56
+    private Integer createUser;
57
+
58
+    /**
59
+     * 创建时间
60
+     */
61
+    private Date createDate;
62
+
63
+    /**
64
+     * 更新人
65
+     */
66
+    private Integer updateUser;
67
+
68
+    /**
69
+     * 更新时间
70
+     */
71
+    private Date updateDate;
72
+
73
+    /**
74
+     * 延期月份
75
+     */
76
+    private Integer extensionMonth;
77
+
78
+    /**
79
+     * 延期费用
80
+     */
81
+    private String extensionPrice;
82
+
83
+    /**
84
+     * 缴费手机号
85
+     */
86
+    private String paymentTel;
87
+
88
+    /**
89
+     * 缴费人姓名
90
+     */
91
+    private String paymentName;
92
+
93
+    /**
94
+     * 缴费方式 0是微信支付 2是支付宝 
95
+     */
96
+    private String paymentType;
97
+
98
+    /**
99
+     * 到期时间
100
+     */
101
+    private Date expireDate;
102
+
103
+    /**
104
+     * 单价费用
105
+     */
106
+    private String unitPrice;
107
+
108
+    /**
109
+     * 停车场
110
+     */
111
+    private String parkingLot;
112
+
113
+    /**
114
+     * 车牌号
115
+     */
116
+    private String licensePlate;
117
+
118
+    /**
119
+     * 来源
120
+     */
121
+    private String sourceFrom;
122
+
123
+
124
+}

+ 119
- 0
CODE/foreign-service/src/main/java/com/community/huiju/model/TaUserVerify.java Ver arquivo

@@ -0,0 +1,119 @@
1
+package com.community.huiju.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import com.baomidou.mybatisplus.annotation.TableName;
6
+import lombok.Data;
7
+import lombok.EqualsAndHashCode;
8
+import lombok.experimental.Accessors;
9
+
10
+import java.io.Serializable;
11
+import java.time.LocalDateTime;
12
+import java.util.Date;
13
+
14
+/**
15
+ * <p>
16
+ * app端用户审核表,存放用户的角色还有房产信息
17
+ * </p>
18
+ *
19
+ * @author jobob
20
+ * @since 2019-05-16
21
+ */
22
+@Data
23
+@EqualsAndHashCode(callSuper = false)
24
+@Accessors(chain = true)
25
+@TableName("ta_user_verify")
26
+public class TaUserVerify implements Serializable {
27
+
28
+    private static final long serialVersionUID = 1L;
29
+
30
+    @TableId(value = "id", type = IdType.AUTO)
31
+    private Integer userVerifyId;
32
+
33
+    /**
34
+     * 用户ID
35
+     */
36
+    private Integer userId;
37
+
38
+    /**
39
+     * 小区id
40
+     */
41
+    private Integer communityId;
42
+
43
+    /**
44
+     * 角色ID
45
+     */
46
+    private Integer roleId;
47
+
48
+    /**
49
+     * 期ID
50
+     */
51
+    private Integer phaseId;
52
+
53
+    /**
54
+     * 期
55
+     */
56
+    private String phaseName;
57
+
58
+    /**
59
+     * 楼栋ID
60
+     */
61
+    private Integer buildingId;
62
+
63
+    /**
64
+     * 楼栋
65
+     */
66
+    private String buildingName;
67
+
68
+    /**
69
+     * 单元
70
+     */
71
+    private Integer unitId;
72
+
73
+    /**
74
+     * 单元
75
+     */
76
+    private String unitName;
77
+
78
+    /**
79
+     * 楼层id
80
+     */
81
+    private Integer levelId;
82
+
83
+    /**
84
+     * 楼层
85
+     */
86
+    private String levelName;
87
+
88
+    /**
89
+     * 户号ID
90
+     */
91
+    private Integer roomNoId;
92
+
93
+    /**
94
+     * 户号
95
+     */
96
+    private String roomNoName;
97
+
98
+    /**
99
+     * 认证状态  0 是未审核   1是审核通过   2是审核不通过
100
+     */
101
+    private String verifyStatus;
102
+
103
+    /**
104
+     * 创建时间
105
+     */
106
+    private Date createDate;
107
+
108
+    /**
109
+     * 审核人的姓名
110
+     */
111
+    private String verifyName;
112
+
113
+    /**
114
+     * 备注
115
+     */
116
+    private String remark;
117
+
118
+
119
+}

+ 64
- 0
CODE/foreign-service/src/main/java/com/community/huiju/model/TpBuilding.java Ver arquivo

@@ -0,0 +1,64 @@
1
+package com.community.huiju.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import com.baomidou.mybatisplus.annotation.TableName;
6
+import java.time.LocalDateTime;
7
+import java.io.Serializable;
8
+import java.util.Date;
9
+
10
+import lombok.Data;
11
+import lombok.EqualsAndHashCode;
12
+import lombok.experimental.Accessors;
13
+
14
+/**
15
+ * <p>
16
+ * 小区楼栋资料表
17
+ * </p>
18
+ *
19
+ * @author jobob
20
+ * @since 2019-05-15
21
+ */
22
+@Data
23
+@EqualsAndHashCode(callSuper = false)
24
+@Accessors(chain = true)
25
+@TableName("tp_building")
26
+public class TpBuilding implements Serializable {
27
+
28
+    private static final long serialVersionUID = 1L;
29
+
30
+    @TableId(value = "id", type = IdType.AUTO)
31
+    private Integer buildingId;
32
+
33
+    /**
34
+     * 小区ID
35
+     */
36
+    private Integer communityId;
37
+
38
+    /**
39
+     * 期区id
40
+     */
41
+    private Integer phaseId;
42
+
43
+    /**
44
+     * 期区名称
45
+     */
46
+    private String phaseName;
47
+
48
+    /**
49
+     * 楼栋名称
50
+     */
51
+    private String name;
52
+
53
+    /**
54
+     * 排序
55
+     */
56
+    private String sort;
57
+
58
+    /**
59
+     * 创建时间
60
+     */
61
+    private Date createDate;
62
+
63
+
64
+}

+ 149
- 0
CODE/foreign-service/src/main/java/com/community/huiju/model/TpBuildingOwnerInfo.java Ver arquivo

@@ -0,0 +1,149 @@
1
+package com.community.huiju.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import com.baomidou.mybatisplus.annotation.TableName;
6
+import lombok.Data;
7
+import lombok.EqualsAndHashCode;
8
+import lombok.experimental.Accessors;
9
+
10
+import java.io.Serializable;
11
+import java.time.LocalDateTime;
12
+import java.util.Date;
13
+
14
+/**
15
+ * <p>
16
+ * 楼栋业主资料信息表(户号信息也在里面相当于tp_room_no   PS:共用一张表)
17
+ * </p>
18
+ *
19
+ * @author jobob
20
+ * @since 2019-05-16
21
+ */
22
+@Data
23
+@EqualsAndHashCode(callSuper = false)
24
+@Accessors(chain = true)
25
+@TableName("tp_building_owner_info")
26
+public class TpBuildingOwnerInfo implements Serializable {
27
+
28
+    private static final long serialVersionUID = 1L;
29
+
30
+    @TableId(value = "id", type = IdType.AUTO)
31
+    private Integer buildingOwnerInfoId;
32
+
33
+    /**
34
+     * 小区id
35
+     */
36
+    private Integer communityId;
37
+
38
+    /**
39
+     * 身份证号码
40
+     */
41
+    private String idCard;
42
+
43
+    /**
44
+     * 期区ID
45
+     */
46
+    private Integer phaseId;
47
+
48
+    /**
49
+     * 期区名称
50
+     */
51
+    private String phaseName;
52
+
53
+    /**
54
+     * 楼栋ID
55
+     */
56
+    private Integer buildingId;
57
+
58
+    /**
59
+     * 楼栋姓名
60
+     */
61
+    private String buildingName;
62
+
63
+    /**
64
+     * 单元ID
65
+     */
66
+    private Integer unitId;
67
+
68
+    /**
69
+     * 单元名称
70
+     */
71
+    private String unitName;
72
+
73
+    /**
74
+     * 楼层ID
75
+     */
76
+    private Integer levelId;
77
+
78
+    /**
79
+     * 楼层名字
80
+     */
81
+    private String levelName;
82
+
83
+    /**
84
+     * 户号ID
85
+     */
86
+    private Integer roomNoId;
87
+
88
+    /**
89
+     * 户号姓名
90
+     */
91
+    private String roomNoName;
92
+
93
+    /**
94
+     * 业主姓名
95
+     */
96
+    private String ownerName;
97
+
98
+    /**
99
+     * 业主手机号
100
+     */
101
+    private String ownerTel;
102
+
103
+    /**
104
+     * 性别 1:男   2:女
105
+     */
106
+    private String gender;
107
+
108
+    /**
109
+     * 关联状态   0 未关联  1 是已关联
110
+     */
111
+    private String pairStatus;
112
+
113
+    /**
114
+     * 认证状态  0 是未认证    1是认证通过   2是已作废
115
+     */
116
+    private String verifyStatus;
117
+
118
+    /**
119
+     * 排序
120
+     */
121
+    private String sort;
122
+
123
+    /**
124
+     * 创建人
125
+     */
126
+    private Integer createUser;
127
+
128
+    /**
129
+     * 创建时间
130
+     */
131
+    private Date createDate;
132
+
133
+    /**
134
+     * 更新人
135
+     */
136
+    private Integer updateUser;
137
+
138
+    /**
139
+     * 更新时间
140
+     */
141
+    private Date updateDate;
142
+
143
+    /**
144
+     * 审核id
145
+     */
146
+    private Integer taUserVerifyId;
147
+
148
+
149
+}

+ 93
- 0
CODE/foreign-service/src/main/java/com/community/huiju/model/TpConfiguration.java Ver arquivo

@@ -0,0 +1,93 @@
1
+package com.community.huiju.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableField;
5
+import com.baomidou.mybatisplus.annotation.TableId;
6
+import com.baomidou.mybatisplus.annotation.TableName;
7
+import lombok.Data;
8
+import lombok.EqualsAndHashCode;
9
+import lombok.experimental.Accessors;
10
+
11
+import java.io.Serializable;
12
+import java.time.LocalDateTime;
13
+import java.util.Date;
14
+
15
+/**
16
+ * <p>
17
+ * 设备配置表
18
+ * </p>
19
+ *
20
+ * @author jobob
21
+ * @since 2019-05-16
22
+ */
23
+@Data
24
+@EqualsAndHashCode(callSuper = false)
25
+@Accessors(chain = true)
26
+@TableName("tp_configuration")
27
+public class TpConfiguration implements Serializable {
28
+
29
+    private static final long serialVersionUID = 1L;
30
+
31
+    @TableId(value = "id", type = IdType.AUTO)
32
+    private Integer configurationId;
33
+
34
+    /**
35
+     * 配置key
36
+     */
37
+    @TableField(value = "`key`")
38
+    private String key;
39
+
40
+    /**
41
+     * 配置项名称
42
+     */
43
+    private String configurationName;
44
+
45
+    /**
46
+     * 配置类型: 1字符串  2多列值
47
+     */
48
+    private Integer configurationType;
49
+
50
+    /**
51
+     * 配置值
52
+     */
53
+    private String configurationValue;
54
+
55
+    /**
56
+     * 创建时间
57
+     */
58
+    private Date createTiem;
59
+
60
+    /**
61
+     * 创建人
62
+     */
63
+    private Integer createUser;
64
+
65
+    /**
66
+     * 修改时间
67
+     */
68
+    private Date updateTime;
69
+
70
+    /**
71
+     * 修改人
72
+     */
73
+    private Integer updateUser;
74
+
75
+    /**
76
+     * 小区id
77
+     */
78
+    private Integer communityId;
79
+
80
+    /**
81
+     * 门禁点UUID
82
+     */
83
+    @TableField("doorUuid")
84
+    private String doorUuid;
85
+
86
+    /**
87
+     * 门禁设备UUID
88
+     */
89
+    @TableField("deviceUuid")
90
+    private String deviceUuid;
91
+
92
+
93
+}

+ 148
- 0
CODE/foreign-service/src/main/java/com/community/huiju/model/TpEquipment.java Ver arquivo

@@ -0,0 +1,148 @@
1
+package com.community.huiju.model;
2
+
3
+import com.alibaba.fastjson.annotation.JSONField;
4
+import com.baomidou.mybatisplus.annotation.IdType;
5
+import com.baomidou.mybatisplus.annotation.TableField;
6
+import com.baomidou.mybatisplus.annotation.TableId;
7
+import com.baomidou.mybatisplus.annotation.TableName;
8
+import lombok.Data;
9
+import lombok.EqualsAndHashCode;
10
+import lombok.experimental.Accessors;
11
+
12
+import java.io.Serializable;
13
+import java.time.LocalDateTime;
14
+import java.util.Date;
15
+
16
+/**
17
+ * <p>
18
+ * 设备表
19
+ * </p>
20
+ *
21
+ * @author jobob
22
+ * @since 2019-05-16
23
+ */
24
+@Data
25
+@EqualsAndHashCode(callSuper = false)
26
+@Accessors(chain = true)
27
+@TableName("tp_equipment")
28
+public class TpEquipment implements Serializable {
29
+
30
+    private static final long serialVersionUID = 1L;
31
+
32
+    @TableId(value = "id", type = IdType.AUTO)
33
+    private Integer equipmentId;
34
+
35
+    /**
36
+     * 设备url地址,对应 配置tp_configuration 表id
37
+     */
38
+    private Integer urlId;
39
+
40
+    /**
41
+     * 小区id
42
+     */
43
+    private Integer communityId;
44
+
45
+    /**
46
+     * 安保人员电话,对应 配置tp_configuration 表id
47
+     */
48
+    private Integer securityGuardTelId;
49
+
50
+    /**
51
+     * 保安室电话,对应 配置tp_configuration 表id
52
+     */
53
+    private Integer securityRoomTelId;
54
+
55
+    /**
56
+     * 设备地址,对应 配置tp_configuration 表id
57
+     */
58
+    private Integer addressId;
59
+
60
+    /**
61
+     * 创建时间
62
+     */
63
+    private Date createTime;
64
+
65
+    /**
66
+     * 创建人
67
+     */
68
+    private Integer createUser;
69
+
70
+    /**
71
+     * 修改时间
72
+     */
73
+    private Date updateTime;
74
+
75
+    /**
76
+     * 修改人
77
+     */
78
+    private Integer updateUser;
79
+
80
+    /**
81
+     * 设备UUID ,对应 配置tp_configuration 表id
82
+     */
83
+    private Integer uuidId;
84
+
85
+    /**
86
+     * 设备类型,1 监控 2 访客机 3 可是对讲 4 门禁设备(看字典表)
87
+     */
88
+    private String equipmentType;
89
+
90
+    /**
91
+     * 设备树id,对应 tp_equipment_tree 表id
92
+     */
93
+    private Integer equipmentTreeId;
94
+
95
+    /**
96
+     * appkey(第三方平台)
97
+     */
98
+    @JSONField(serialize = false)
99
+    private String appkey;
100
+
101
+    /**
102
+     * secret(第三方平台)
103
+     */
104
+    @JSONField(serialize = false)
105
+    private String secret;
106
+
107
+    /**
108
+     * op_user_uuid(第三方平台操作人员uuid)
109
+     */
110
+    @JSONField(serialize = false)
111
+    private String opUserUuid;
112
+
113
+    /**
114
+     * http_server第三方服务器请求地址
115
+     */
116
+    @JSONField(serialize = false)
117
+    private String httpServer;
118
+
119
+    /**
120
+     * unit_uuids组织中心
121
+     */
122
+    @JSONField(serialize = false)
123
+    private String unitUuids;
124
+
125
+    /**
126
+     * 监控URL
127
+     */
128
+    @TableField(exist = false)
129
+    private String monitoringUrl;
130
+
131
+    /**
132
+     * 保安人员电话
133
+     */
134
+    @TableField(exist = false)
135
+    private String securityGuardTel;
136
+
137
+    /**
138
+     * 安保室电话
139
+     */
140
+    @TableField(exist = false)
141
+    private String securityRoomTel;
142
+
143
+    /**
144
+     * 监控地址
145
+     */
146
+    @TableField(exist = false)
147
+    private String monitoringAddress;
148
+}

+ 99
- 0
CODE/foreign-service/src/main/java/com/community/huiju/model/TpEquipmentTree.java Ver arquivo

@@ -0,0 +1,99 @@
1
+package com.community.huiju.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import com.baomidou.mybatisplus.annotation.TableName;
6
+import lombok.Data;
7
+import lombok.EqualsAndHashCode;
8
+import lombok.experimental.Accessors;
9
+
10
+import java.io.Serializable;
11
+import java.time.LocalDateTime;
12
+import java.util.Date;
13
+
14
+/**
15
+ * <p>
16
+ * 设备树
17
+ * </p>
18
+ *
19
+ * @author jobob
20
+ * @since 2019-05-16
21
+ */
22
+@Data
23
+@EqualsAndHashCode(callSuper = false)
24
+@Accessors(chain = true)
25
+@TableName("tp_equipment_tree")
26
+public class TpEquipmentTree implements Serializable {
27
+
28
+    private static final long serialVersionUID = 1L;
29
+
30
+    @TableId(value = "id", type = IdType.AUTO)
31
+    private Integer equipmentTreeId;
32
+
33
+    /**
34
+     * 小区id
35
+     */
36
+    private Integer communityId;
37
+
38
+    /**
39
+     * 名称
40
+     */
41
+    private String equipmentName;
42
+
43
+    /**
44
+     * 父节点id
45
+     */
46
+    private Integer pid;
47
+
48
+    /**
49
+     * 排序
50
+     */
51
+    private Integer sort;
52
+
53
+    /**
54
+     * 创建时间
55
+     */
56
+    private Date createTime;
57
+
58
+    /**
59
+     * 创建人
60
+     */
61
+    private Integer createUser;
62
+
63
+    /**
64
+     * 修改时间
65
+     */
66
+    private Date updateTime;
67
+
68
+    /**
69
+     * 修改人
70
+     */
71
+    private Integer updateUser;
72
+
73
+    /**
74
+     * appkey(第三方平台)
75
+     */
76
+    private String appkey;
77
+
78
+    /**
79
+     * secret(第三方平台)
80
+     */
81
+    private String secret;
82
+
83
+    /**
84
+     * 第三方平台操作人员uuid
85
+     */
86
+    private String opUserUuid;
87
+
88
+    /**
89
+     * 第三方平台请求地址
90
+     */
91
+    private String httpServer;
92
+
93
+    /**
94
+     * 组织中心(简称区域编号)
95
+     */
96
+    private String unitUuids;
97
+
98
+
99
+}

+ 84
- 0
CODE/foreign-service/src/main/java/com/community/huiju/model/TpLevel.java Ver arquivo

@@ -0,0 +1,84 @@
1
+package com.community.huiju.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import com.baomidou.mybatisplus.annotation.TableName;
6
+import lombok.Data;
7
+import lombok.EqualsAndHashCode;
8
+import lombok.experimental.Accessors;
9
+
10
+import java.io.Serializable;
11
+import java.time.LocalDateTime;
12
+import java.util.Date;
13
+
14
+/**
15
+ * <p>
16
+ * 小区楼层资料表
17
+ * </p>
18
+ *
19
+ * @author jobob
20
+ * @since 2019-05-15
21
+ */
22
+@Data
23
+@EqualsAndHashCode(callSuper = false)
24
+@Accessors(chain = true)
25
+@TableName("tp_level")
26
+public class TpLevel implements Serializable {
27
+
28
+    private static final long serialVersionUID = 1L;
29
+
30
+    @TableId(value = "id", type = IdType.AUTO)
31
+    private Integer levelId;
32
+
33
+    /**
34
+     * 小区ID
35
+     */
36
+    private Integer communityId;
37
+
38
+    /**
39
+     * 期区ID
40
+     */
41
+    private Integer phaseId;
42
+
43
+    /**
44
+     * 期区名称
45
+     */
46
+    private String phaseName;
47
+
48
+    /**
49
+     * 楼栋ID
50
+     */
51
+    private Integer buildingId;
52
+
53
+    /**
54
+     * 楼栋名称
55
+     */
56
+    private String buildingName;
57
+
58
+    /**
59
+     * 单元ID
60
+     */
61
+    private Integer unitId;
62
+
63
+    /**
64
+     * 单元名称
65
+     */
66
+    private String unitName;
67
+
68
+    /**
69
+     * 楼层名称
70
+     */
71
+    private String name;
72
+
73
+    /**
74
+     * 排序
75
+     */
76
+    private String sort;
77
+
78
+    /**
79
+     * 创建时间
80
+     */
81
+    private Date createDate;
82
+
83
+
84
+}

+ 56
- 0
CODE/foreign-service/src/main/java/com/community/huiju/model/TpPhase.java Ver arquivo

@@ -0,0 +1,56 @@
1
+package com.community.huiju.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableField;
5
+import com.baomidou.mybatisplus.annotation.TableId;
6
+import com.baomidou.mybatisplus.annotation.TableName;
7
+import lombok.Data;
8
+import lombok.EqualsAndHashCode;
9
+import lombok.experimental.Accessors;
10
+
11
+import java.io.Serializable;
12
+import java.time.LocalDateTime;
13
+import java.util.Date;
14
+
15
+/**
16
+ * <p>
17
+ * 小区期区资料表
18
+ * </p>
19
+ *
20
+ * @author jobob
21
+ * @since 2019-05-15
22
+ */
23
+@Data
24
+@EqualsAndHashCode(callSuper = false)
25
+@Accessors(chain = true)
26
+@TableName("tp_phase")
27
+public class TpPhase implements Serializable {
28
+
29
+    private static final long serialVersionUID = 1L;
30
+
31
+    @TableId(value = "id", type = IdType.AUTO)
32
+    private Integer phaseId;
33
+
34
+    /**
35
+     * 小区ID
36
+     */
37
+    private Integer communityId;
38
+
39
+    /**
40
+     * 期区名称
41
+     */
42
+    @TableField("NAME")
43
+    private String name;
44
+
45
+    /**
46
+     * 排序
47
+     */
48
+    private String sort;
49
+
50
+    /**
51
+     * 创建时间
52
+     */
53
+    private Date createDate;
54
+
55
+
56
+}

+ 94
- 0
CODE/foreign-service/src/main/java/com/community/huiju/model/TpRoomNo.java Ver arquivo

@@ -0,0 +1,94 @@
1
+package com.community.huiju.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import com.baomidou.mybatisplus.annotation.TableName;
6
+import lombok.Data;
7
+import lombok.EqualsAndHashCode;
8
+import lombok.experimental.Accessors;
9
+
10
+import java.io.Serializable;
11
+import java.time.LocalDateTime;
12
+import java.util.Date;
13
+
14
+/**
15
+ * <p>
16
+ * 户号信息表
17
+ * </p>
18
+ *
19
+ * @author jobob
20
+ * @since 2019-05-15
21
+ */
22
+@Data
23
+@EqualsAndHashCode(callSuper = false)
24
+@Accessors(chain = true)
25
+@TableName("tp_room_no")
26
+public class TpRoomNo implements Serializable {
27
+
28
+    private static final long serialVersionUID = 1L;
29
+
30
+    @TableId(value = "id", type = IdType.AUTO)
31
+    private Integer roomNoId;
32
+
33
+    /**
34
+     * 小区id
35
+     */
36
+    private Integer communityId;
37
+
38
+    /**
39
+     * 期区ID
40
+     */
41
+    private Integer phaseId;
42
+
43
+    /**
44
+     * 期区名称
45
+     */
46
+    private String phaseName;
47
+
48
+    /**
49
+     * 楼栋ID
50
+     */
51
+    private Integer buildingId;
52
+
53
+    /**
54
+     * 楼栋姓名
55
+     */
56
+    private String buildingName;
57
+
58
+    /**
59
+     * 单元ID
60
+     */
61
+    private Integer unitId;
62
+
63
+    /**
64
+     * 单元名称
65
+     */
66
+    private String unitName;
67
+
68
+    /**
69
+     * 楼层ID
70
+     */
71
+    private Integer levelId;
72
+
73
+    /**
74
+     * 楼层名字
75
+     */
76
+    private String levelName;
77
+
78
+    /**
79
+     * 户号
80
+     */
81
+    private String name;
82
+
83
+    /**
84
+     * 排序
85
+     */
86
+    private String sort;
87
+
88
+    /**
89
+     * 创建时间
90
+     */
91
+    private Date createDate;
92
+
93
+
94
+}

+ 74
- 0
CODE/foreign-service/src/main/java/com/community/huiju/model/TpUnit.java Ver arquivo

@@ -0,0 +1,74 @@
1
+package com.community.huiju.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import com.baomidou.mybatisplus.annotation.TableName;
6
+import lombok.Data;
7
+import lombok.EqualsAndHashCode;
8
+import lombok.experimental.Accessors;
9
+
10
+import java.io.Serializable;
11
+import java.time.LocalDateTime;
12
+import java.util.Date;
13
+
14
+/**
15
+ * <p>
16
+ * 小区单元资料表
17
+ * </p>
18
+ *
19
+ * @author jobob
20
+ * @since 2019-05-15
21
+ */
22
+@Data
23
+@EqualsAndHashCode(callSuper = false)
24
+@Accessors(chain = true)
25
+@TableName("tp_unit")
26
+public class TpUnit implements Serializable {
27
+
28
+    private static final long serialVersionUID = 1L;
29
+
30
+    @TableId(value = "id", type = IdType.AUTO)
31
+    private Integer unitId;
32
+
33
+    /**
34
+     * 小区ID
35
+     */
36
+    private Integer communityId;
37
+
38
+    /**
39
+     * 期区ID
40
+     */
41
+    private Integer phaseId;
42
+
43
+    /**
44
+     * 期区名称
45
+     */
46
+    private String phaseName;
47
+
48
+    /**
49
+     * 楼栋ID
50
+     */
51
+    private Integer buildingId;
52
+
53
+    /**
54
+     * 楼栋名称
55
+     */
56
+    private String buildingName;
57
+
58
+    /**
59
+     * 单元名称
60
+     */
61
+    private String name;
62
+
63
+    /**
64
+     * 排序
65
+     */
66
+    private String sort;
67
+
68
+    /**
69
+     * 创建时间
70
+     */
71
+    private Date createDate;
72
+
73
+
74
+}

+ 45
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/FaceServiceI.java Ver arquivo

@@ -0,0 +1,45 @@
1
+package com.community.huiju.service;
2
+
3
+
4
+import com.baomidou.mybatisplus.extension.service.IService;
5
+import com.community.commom.session.UserElement;
6
+import com.community.huiju.common.base.ResponseBean;
7
+import com.community.huiju.model.TaFace;
8
+import com.community.huiju.model.TaUser;
9
+import org.springframework.web.multipart.MultipartFile;
10
+
11
+public interface FaceServiceI extends IService<TaFace> {
12
+    /**
13
+     * 添加人脸
14
+     * @param userId 用户Id
15
+     *  @param  uploadFile
16
+     *  @param userVerifyId 审核id
17
+     * @return
18
+     */
19
+    ResponseBean addFace(Integer userId, Integer userVerifyId, MultipartFile uploadFile);
20
+
21
+    /**
22
+     * 更新当前人脸
23
+     *  @param userId 用户Id
24
+     *  @param  uploadFile
25
+     *  @param userVerifyId 审核id
26
+     * @return
27
+     */
28
+    ResponseBean updateFace(Integer userId, Integer userVerifyId, MultipartFile uploadFile);
29
+
30
+    /**
31
+     * 当前登入人是否有人脸信息
32
+     * @param userId
33
+     * @param userVerifyId
34
+     * @return
35
+     */
36
+    ResponseBean getTaFaceByUserId(Integer userId, Integer userVerifyId);
37
+
38
+    /**
39
+     * 删除人脸
40
+     * @param userId
41
+     * @param userVerifyId
42
+     * @return
43
+     */
44
+    ResponseBean deleteFace(Integer userId, Integer userVerifyId);
45
+}

+ 77
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/IFuShiService.java Ver arquivo

@@ -0,0 +1,77 @@
1
+package com.community.huiju.service;
2
+
3
+import com.community.commom.mode.ResponseBean;
4
+
5
+/**
6
+ * 富士 业务接口
7
+ */
8
+public interface IFuShiService {
9
+
10
+    /**
11
+     * 获取停车信息(通过车牌号)
12
+     *
13
+     * @param carNo
14
+     * @return
15
+     */
16
+    ResponseBean getParkInfoByCarNo(String carNo, Integer communityId);
17
+
18
+    /**
19
+     * 第三方月卡上发续费
20
+     * @param Phone 车主手机号
21
+     * @param RenewDayType 续费日期类型: 3:年; 2:月; 1:日;
22
+     * @param RenewDay 续费日期数目
23
+     * @param PayStyle 交易方式(中文描述),例如:微信、 支付宝、 银联
24
+     * @param CarNo 车牌号
25
+     * @param CardNo 停车卡号
26
+     * @param RechargeAmt 充值续费金额
27
+     * @return
28
+     */
29
+    ResponseBean apiThirdPartyMonthCardPay(String Phone, String RenewDayType, String RenewDay, String PayStyle, String CarNo, String CardNo, String RechargeAmt, Integer communityId);
30
+
31
+
32
+    /**
33
+     * 第三方临时卡上发缴费
34
+     * @param Amount 应缴金额(单位元)
35
+     * @param ActualAmount 实缴金额(单位元)
36
+     * @param DeductionAmount 抵扣金额(单位元)
37
+     * @param Reason 抵扣原因
38
+     * @param PayStyle 交易方式(汉字描述),例如:微信、支付宝、银联
39
+     * @param CarNo 车牌号
40
+     * @param CardNo 停车卡号
41
+     * @param CouponList 使用的优惠券列表(JSON字符串)
42
+     *               MerchantName: 商户名称
43
+     *               CouponType: 优惠券优惠类型1全免2减免金额3减免时长4减免百分比
44
+     *               CouponValue: 对应优惠券类型的值 金额/时间/折扣
45
+     *               CouponCode: 优惠券编码
46
+     *               FavorableType: 优惠券类型1 纸质券 2 电子券 3 活动券
47
+     *               UseStatus:标识优惠券是线上或线下使用的状态 1只在线上使用 2只在线下使用 3线上线下都可以使用
48
+     *               IsAuto: 是否自动使用优惠券1是2否
49
+     *               EndTime: 截至时间
50
+     *               CouponDescribe: 优惠券描述
51
+     *               CouponName: 优惠券名称
52
+     *
53
+     * @return
54
+     */
55
+    ResponseBean apiThirdPartyTemporaryCardPay(String Amount, String ActualAmount, String DeductionAmount, String Reason, String PayStyle, String CarNo, String CardNo, String CouponList, Integer communityId);
56
+
57
+    /**
58
+     * 获取线下算费结果
59
+     * @param CarNoOrCardNo 车牌号码或卡号
60
+     * @return
61
+     */
62
+    ResponseBean apiGetOfflineFee(String CarNoOrCardNo, Integer communityId);
63
+
64
+    /**
65
+     * 获取月租车信息(通过车牌号)
66
+     * @param CarNo
67
+     * @return
68
+     */
69
+    ResponseBean parkGetMonthCardInfoByCarNo(String CarNo, Integer communityId);
70
+
71
+    /**
72
+     * 获取临时车信息(通过车牌号)
73
+     * @param CarNo
74
+     * @return
75
+     */
76
+    ResponseBean parkGetTempCarPaymentInfoByCarNo(String CarNo, Integer communityId);
77
+}

+ 32
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/IHKService.java Ver arquivo

@@ -0,0 +1,32 @@
1
+package com.community.huiju.service;
2
+
3
+import com.community.commom.mode.ResponseBean;
4
+
5
+/**
6
+ * 海康 业务
7
+ * @author weiximei
8
+ */
9
+public interface IHKService {
10
+
11
+    /**
12
+     * 推送海康人员
13
+     * @param appUserId
14
+     * @return
15
+     */
16
+    ResponseBean pushPerson(String appUserId, Integer userVerifyId);
17
+
18
+    /**
19
+     * 下发门禁权限
20
+     * @return
21
+     */
22
+    ResponseBean downloadAuthorityByDeviceUuids();
23
+
24
+    /**
25
+     * 异步反控开门 (远程开门)
26
+     *
27
+     * @param userVerifyId 审核ID
28
+     * @return
29
+     */
30
+    ResponseBean syncControl(Integer userVerifyId);
31
+
32
+}

+ 16
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/ITaSysRoleService.java Ver arquivo

@@ -0,0 +1,16 @@
1
+package com.community.huiju.service;
2
+
3
+import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.community.huiju.model.TaSysRole;
5
+
6
+/**
7
+ * <p>
8
+ * app端角色 服务类
9
+ * </p>
10
+ *
11
+ * @author jobob
12
+ * @since 2019-05-16
13
+ */
14
+public interface ITaSysRoleService extends IService<TaSysRole> {
15
+
16
+}

+ 18
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/ITaTemporaryLicenseOrderService.java Ver arquivo

@@ -0,0 +1,18 @@
1
+package com.community.huiju.service;
2
+
3
+import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.community.huiju.common.base.ResponseBean;
5
+import com.community.huiju.model.TaTemporaryLicenseOrder;
6
+
7
+/**
8
+ * <p>
9
+ * 临时车缴费表 服务类
10
+ * </p>
11
+ *
12
+ * @author jobob
13
+ * @since 2019-05-28
14
+ */
15
+public interface ITaTemporaryLicenseOrderService extends IService<TaTemporaryLicenseOrder> {
16
+
17
+
18
+}

+ 16
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/ITaUserLicenseOrderService.java Ver arquivo

@@ -0,0 +1,16 @@
1
+package com.community.huiju.service;
2
+
3
+import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.community.huiju.model.TaUserLicenseOrder;
5
+
6
+/**
7
+ * <p>
8
+ * 月租车缴费订单表 服务类
9
+ * </p>
10
+ *
11
+ * @author jobob
12
+ * @since 2019-05-28
13
+ */
14
+public interface ITaUserLicenseOrderService extends IService<TaUserLicenseOrder> {
15
+
16
+}

+ 68
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/ITaUserService.java Ver arquivo

@@ -0,0 +1,68 @@
1
+package com.community.huiju.service;
2
+
3
+import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.community.commom.utils.AccountValidatorUtil;
5
+import com.community.huiju.common.base.ResponseBean;
6
+import com.community.huiju.enums.ResponseErrorsMessages;
7
+import com.community.huiju.exception.WisdomException;
8
+import com.community.huiju.model.TaUser;
9
+import lombok.extern.slf4j.Slf4j;
10
+import org.slf4j.Logger;
11
+import org.slf4j.LoggerFactory;
12
+
13
+/**
14
+ * <p>
15
+ * 住户app端用户表 服务类
16
+ * </p>
17
+ *
18
+ * @author jobob
19
+ * @since 2019-05-15
20
+ */
21
+public interface ITaUserService extends IService<TaUser> {
22
+
23
+    Logger log = LoggerFactory.getLogger(ITaUserService.class);
24
+
25
+    /**
26
+     * 检验手机号
27
+     * @param phone
28
+     */
29
+    default void checkPhone(String phone) {
30
+        log.info("{} 手机号校验结果: {}",phone, AccountValidatorUtil.isPhone(phone));
31
+        if (!AccountValidatorUtil.isPhone(phone)){
32
+            throw new WisdomException(ResponseErrorsMessages.NOT_PHONE.getCode(), ResponseErrorsMessages.NOT_PHONE.getMsg());
33
+        }
34
+    }
35
+
36
+
37
+    /**
38
+     * 添加用户
39
+     * @param userName
40
+     * @param idCard
41
+     * @param gender
42
+     * @return
43
+     */
44
+    ResponseBean addTaUser(String userName, String idCard, String gender, String phone);
45
+
46
+    /**
47
+     * 修改用户
48
+     * @param userName
49
+     * @param idCard
50
+     * @param gender
51
+     * @return
52
+     */
53
+    ResponseBean updateTaUser(Integer userId, String userName, String idCard, String gender, String phone);
54
+
55
+    /**
56
+     * 查询用户
57
+     * @param userId
58
+     * @return
59
+     */
60
+    ResponseBean getTaUser(Integer userId);
61
+
62
+    /**
63
+     * 查询用户
64
+     * @param phone
65
+     * @return
66
+     */
67
+    ResponseBean getTaUserByPhone(String phone);
68
+}

+ 55
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/ITaUserVerifyService.java Ver arquivo

@@ -0,0 +1,55 @@
1
+package com.community.huiju.service;
2
+
3
+import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.community.huiju.common.base.ResponseBean;
5
+import com.community.huiju.model.TaUserVerify;
6
+
7
+/**
8
+ * <p>
9
+ * app端用户审核表,存放用户的角色还有房产信息 服务类
10
+ * </p>
11
+ *
12
+ * @author jobob
13
+ * @since 2019-05-16
14
+ */
15
+public interface ITaUserVerifyService extends IService<TaUserVerify> {
16
+
17
+    /**
18
+     * 添加 房产关联
19
+     * @param userId
20
+     * @param communityId
21
+     * @param phaseId
22
+     * @param buildingId
23
+     * @param unitId
24
+     * @param levelId
25
+     * @param roomNoId
26
+     * @return
27
+     */
28
+    ResponseBean addUserVerify(Integer userId, Integer roleId,Integer communityId, Integer phaseId, Integer buildingId, Integer unitId, Integer levelId, Integer roomNoId);
29
+
30
+    /**
31
+     * 删除房产关联关系
32
+     * @param userId
33
+     * @param userVerifyId
34
+     * @return
35
+     */
36
+    ResponseBean deleteUserVerify(Integer userId, Integer userVerifyId);
37
+
38
+    /**
39
+     * 查询 房产关联关系列表,根据 用户Id 和 小区Id
40
+     * @param userId
41
+     * @param communityId
42
+     * @return
43
+     */
44
+    ResponseBean getUserVerifyByUserIdAndCommunityId(Integer userId, Integer communityId);
45
+
46
+
47
+    /**
48
+     * 查询 房产信息, 根据 用户id 和 房产审核id
49
+     * @param userId
50
+     * @param userVerifyId
51
+     * @return
52
+     */
53
+    ResponseBean getUserVerifyByByUserIdAndUserVerifyId(Integer userId, Integer userVerifyId);
54
+
55
+}

+ 16
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/ITpBuildingOwnerInfoService.java Ver arquivo

@@ -0,0 +1,16 @@
1
+package com.community.huiju.service;
2
+
3
+import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.community.huiju.model.TpBuildingOwnerInfo;
5
+
6
+/**
7
+ * <p>
8
+ * 楼栋业主资料信息表(户号信息也在里面相当于tp_room_no   PS:共用一张表) 服务类
9
+ * </p>
10
+ *
11
+ * @author jobob
12
+ * @since 2019-05-16
13
+ */
14
+public interface ITpBuildingOwnerInfoService extends IService<TpBuildingOwnerInfo> {
15
+
16
+}

+ 25
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/ITpBuildingService.java Ver arquivo

@@ -0,0 +1,25 @@
1
+package com.community.huiju.service;
2
+
3
+import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.community.huiju.common.base.ResponseBean;
5
+import com.community.huiju.model.TpBuilding;
6
+
7
+/**
8
+ * <p>
9
+ * 小区楼栋资料表 服务类
10
+ * </p>
11
+ *
12
+ * @author jobob
13
+ * @since 2019-05-15
14
+ */
15
+public interface ITpBuildingService extends IService<TpBuilding> {
16
+
17
+    /**
18
+     * 查询 栋
19
+     * @param communityId
20
+     * @param phaseId
21
+     * @return
22
+     */
23
+    ResponseBean getBuilding(Integer communityId, Integer phaseId);
24
+
25
+}

+ 16
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/ITpConfigurationService.java Ver arquivo

@@ -0,0 +1,16 @@
1
+package com.community.huiju.service;
2
+
3
+import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.community.huiju.model.TpConfiguration;
5
+
6
+/**
7
+ * <p>
8
+ * 设备配置表 服务类
9
+ * </p>
10
+ *
11
+ * @author jobob
12
+ * @since 2019-05-16
13
+ */
14
+public interface ITpConfigurationService extends IService<TpConfiguration> {
15
+
16
+}

+ 26
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/ITpEquipmentService.java Ver arquivo

@@ -0,0 +1,26 @@
1
+package com.community.huiju.service;
2
+
3
+import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.community.huiju.common.base.ResponseBean;
5
+import com.community.huiju.model.TpEquipment;
6
+
7
+/**
8
+ * <p>
9
+ * 设备表 服务类
10
+ * </p>
11
+ *
12
+ * @author jobob
13
+ * @since 2019-05-16
14
+ */
15
+public interface ITpEquipmentService extends IService<TpEquipment> {
16
+
17
+    /**
18
+     * 获取监控列表
19
+     * @param communityId
20
+     * @param pageNum
21
+     * @param pageSize
22
+     * @return
23
+     */
24
+    ResponseBean getMonitoringByCommunityId(Integer communityId, Integer pageNum, Integer pageSize);
25
+
26
+}

+ 16
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/ITpEquipmentTreeService.java Ver arquivo

@@ -0,0 +1,16 @@
1
+package com.community.huiju.service;
2
+
3
+import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.community.huiju.model.TpEquipmentTree;
5
+
6
+/**
7
+ * <p>
8
+ * 设备树 服务类
9
+ * </p>
10
+ *
11
+ * @author jobob
12
+ * @since 2019-05-16
13
+ */
14
+public interface ITpEquipmentTreeService extends IService<TpEquipmentTree> {
15
+
16
+}

+ 27
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/ITpLevelService.java Ver arquivo

@@ -0,0 +1,27 @@
1
+package com.community.huiju.service;
2
+
3
+import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.community.huiju.common.base.ResponseBean;
5
+import com.community.huiju.model.TpLevel;
6
+
7
+/**
8
+ * <p>
9
+ * 小区楼层资料表 服务类
10
+ * </p>
11
+ *
12
+ * @author jobob
13
+ * @since 2019-05-15
14
+ */
15
+public interface ITpLevelService extends IService<TpLevel> {
16
+
17
+    /**
18
+     * 获取 楼层
19
+     * @param communityId
20
+     * @param phaseId
21
+     * @param buildingId
22
+     * @param unitId
23
+     * @return
24
+     */
25
+    ResponseBean getLevel(Integer communityId, Integer phaseId, Integer buildingId, Integer unitId);
26
+
27
+}

+ 24
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/ITpPhaseService.java Ver arquivo

@@ -0,0 +1,24 @@
1
+package com.community.huiju.service;
2
+
3
+import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.community.huiju.common.base.ResponseBean;
5
+import com.community.huiju.model.TpPhase;
6
+
7
+/**
8
+ * <p>
9
+ * 小区期区资料表 服务类
10
+ * </p>
11
+ *
12
+ * @author jobob
13
+ * @since 2019-05-15
14
+ */
15
+public interface ITpPhaseService extends IService<TpPhase> {
16
+
17
+    /**
18
+     * 获取 期
19
+     * @param communityId
20
+     * @return
21
+     */
22
+    ResponseBean getPhase(Integer communityId);
23
+
24
+}

+ 28
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/ITpRoomNoService.java Ver arquivo

@@ -0,0 +1,28 @@
1
+package com.community.huiju.service;
2
+
3
+import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.community.huiju.common.base.ResponseBean;
5
+import com.community.huiju.model.TpRoomNo;
6
+
7
+/**
8
+ * <p>
9
+ * 户号信息表 服务类
10
+ * </p>
11
+ *
12
+ * @author jobob
13
+ * @since 2019-05-15
14
+ */
15
+public interface ITpRoomNoService extends IService<TpRoomNo> {
16
+
17
+    /**
18
+     * 获取 户号
19
+     * @param communityId
20
+     * @param phaseId
21
+     * @param buildingId
22
+     * @param unitId
23
+     * @param levelId
24
+     * @return
25
+     */
26
+    ResponseBean getRoomNo(Integer communityId, Integer phaseId, Integer buildingId, Integer unitId, Integer levelId);
27
+
28
+}

+ 26
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/ITpUnitService.java Ver arquivo

@@ -0,0 +1,26 @@
1
+package com.community.huiju.service;
2
+
3
+import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.community.huiju.common.base.ResponseBean;
5
+import com.community.huiju.model.TpUnit;
6
+
7
+/**
8
+ * <p>
9
+ * 小区单元资料表 服务类
10
+ * </p>
11
+ *
12
+ * @author jobob
13
+ * @since 2019-05-15
14
+ */
15
+public interface ITpUnitService extends IService<TpUnit> {
16
+
17
+    /**
18
+     * 查询 单元
19
+     * @param communityId
20
+     * @param phaseId
21
+     * @param buildingId
22
+     * @return
23
+     */
24
+    ResponseBean getUnit(Integer communityId, Integer phaseId, Integer buildingId);
25
+
26
+}

+ 15
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/ImageServiceI.java Ver arquivo

@@ -0,0 +1,15 @@
1
+package com.community.huiju.service;
2
+
3
+import org.springframework.web.multipart.MultipartFile;
4
+
5
+import java.io.IOException;
6
+
7
+/**
8
+ * @author admin
9
+ * @Title: ImageServiceI
10
+ * @Description: TODO
11
+ * @date 2018/11/5
12
+ */
13
+public interface ImageServiceI {
14
+    String getImageUrl(MultipartFile uploadFile) throws IOException;
15
+}

+ 440
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/impl/FaceServicelimpl.java Ver arquivo

@@ -0,0 +1,440 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.alibaba.fastjson.JSONObject;
4
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5
+import com.community.commom.ailiyun.AESDecode;
6
+import com.community.commom.constant.Constant;
7
+import com.community.commom.hk.HKOpenApi;
8
+import com.community.commom.session.UserElement;
9
+import com.community.huiju.common.base.ResponseBean;
10
+import com.community.huiju.dao.*;
11
+import com.community.huiju.enums.ResponseErrorsMessages;
12
+import com.community.huiju.exception.WisdomException;
13
+import com.community.huiju.model.*;
14
+import com.community.huiju.service.FaceServiceI;
15
+import com.community.huiju.service.IHKService;
16
+import com.community.huiju.service.ImageServiceI;
17
+import com.google.common.collect.Maps;
18
+import lombok.extern.slf4j.Slf4j;
19
+import org.apache.commons.collections.CollectionUtils;
20
+import org.springframework.beans.factory.annotation.Autowired;
21
+import org.springframework.http.HttpEntity;
22
+import org.springframework.http.HttpHeaders;
23
+import org.springframework.http.HttpMethod;
24
+import org.springframework.http.MediaType;
25
+import org.springframework.stereotype.Service;
26
+import org.springframework.transaction.annotation.Transactional;
27
+import org.springframework.web.client.RestTemplate;
28
+import org.springframework.web.multipart.MultipartFile;
29
+
30
+import java.io.IOException;
31
+import java.util.ArrayList;
32
+import java.util.Date;
33
+import java.util.List;
34
+import java.util.Map;
35
+import java.util.stream.Collectors;
36
+
37
+@Service("faceServicel")
38
+@Transactional(rollbackFor = Exception.class)
39
+@Slf4j
40
+public class FaceServicelimpl  extends ServiceImpl<TaFaceMapper, TaFace> implements FaceServiceI {
41
+
42
+
43
+    @Autowired
44
+    private TaFaceMapper taFaceMapper;
45
+
46
+    @Autowired
47
+    private TaUserMapper taUserMapper;
48
+
49
+    @Autowired
50
+    private TaSysRoleMapper taSysRoleMapper;
51
+
52
+    @Autowired
53
+    private ImageServiceI imageServiceI;
54
+
55
+    @Autowired
56
+    private TaUserVerifyMapper taUserVerifyMapper;
57
+
58
+    @Autowired
59
+    private IHKService ihkService;
60
+
61
+    @Autowired
62
+    private TpEquipmentMapper tpEquipmentMapper;
63
+
64
+    @Autowired
65
+    private TpConfigurationMapper tpConfigurationMapper;
66
+
67
+    @Autowired
68
+    private TpEquipmentTreeMapper tpEquipmentTreeMapper;
69
+
70
+    @Override
71
+    @Transactional(rollbackFor = Exception.class)
72
+    public ResponseBean addFace(Integer userId, Integer userVerifyId, MultipartFile uploadFile) {
73
+        ResponseBean responseBean = new ResponseBean();
74
+        // 判断房产是否存在关联关系
75
+        TaUserVerify userVerify = taUserVerifyMapper.selectByUserIdAndUserVerifyId(userId, userVerifyId);
76
+        if (null == userVerify) {
77
+            responseBean.addError(ResponseErrorsMessages.NOT_USER_VERIFY.getCode(), ResponseErrorsMessages.NOT_USER_VERIFY.getMsg());
78
+            return responseBean;
79
+        }
80
+
81
+        TpEquipmentTree tpEquipmentTree = tpEquipmentTreeMapper.selectByCommunityId(userVerify.getCommunityId());
82
+
83
+        // 当前人脸图片url
84
+        String faceImg = img(uploadFile);
85
+
86
+        /**
87
+         * 删除的时候,将所有的海康设备的关联关系删除了,需要重新下发一次
88
+         */
89
+        // 下发门禁
90
+        ihkService.pushPerson(userId + "", userVerifyId);
91
+
92
+        TaUser user = taUserMapper.selectById(userId);
93
+        TaFace taFace = new TaFace();
94
+        taFace.setFaceImg(faceImg);
95
+        taFace.setCommunityId(user.getCommunityId());
96
+        taFace.setTaUserVerifyId(userVerifyId);
97
+        taFace.setCreateUser(userId);
98
+        taFace.setUpdateUser(userId);
99
+        taFace.setCreateDate(new Date());
100
+        taFace.setUpdateDate(new Date());
101
+
102
+        /*验证身份*/
103
+        responseBean = addVerify(userId, userVerifyId, uploadFile, faceImg, taFace, tpEquipmentTree);
104
+        return responseBean;
105
+    }
106
+
107
+    /**
108
+     * 修改人脸信息
109
+     *
110
+     * @param userId 登入人ID
111
+     * @param userVerifyId 房产审核id
112
+     * @param uploadFile
113
+     * @return
114
+     */
115
+    @Override
116
+    @Transactional(rollbackFor = Exception.class)
117
+    public ResponseBean updateFace(Integer userId, Integer userVerifyId, MultipartFile uploadFile) {
118
+        ResponseBean responseBean = new ResponseBean();
119
+        // 判断房产是否存在关联关系
120
+        TaUserVerify userVerify = taUserVerifyMapper.selectByUserIdAndUserVerifyId(userId, userVerifyId);
121
+        if (null == userVerify) {
122
+            responseBean.addError(ResponseErrorsMessages.NOT_USER_VERIFY.getCode(), ResponseErrorsMessages.NOT_USER_VERIFY.getMsg());
123
+            return responseBean;
124
+        }
125
+
126
+        TpEquipmentTree tpEquipmentTree = tpEquipmentTreeMapper.selectByCommunityId(userVerify.getCommunityId());
127
+        // 人脸图片地址url
128
+        String faceImg = img(uploadFile);
129
+
130
+        /**
131
+         * 删除的时候,将所有的海康设备的关联关系删除了,需要重新下发一次
132
+         */
133
+        // 下发门禁
134
+        ihkService.pushPerson(userId + "", userVerifyId);
135
+
136
+        //当前修改的id否存在
137
+        TaFace face = taFaceMapper.getByUserVerifyId(userVerifyId);
138
+        if (null == face) {
139
+            responseBean.addError(ResponseErrorsMessages.NOT_USER_FACE.getCode(), ResponseErrorsMessages.NOT_USER_FACE.getMsg());
140
+            return responseBean;
141
+        }
142
+
143
+        face.setTaUserVerifyId(userVerifyId);
144
+        face.setFaceImg(faceImg);
145
+        face.setUpdateUser(userId);
146
+        face.setUpdateDate(new Date());
147
+        ResponseBean resps = checKout(faceImg, face, false, uploadFile, userId, userVerify.getCommunityId(), userVerify.getRoomNoId(), userVerify.getUnitId(), tpEquipmentTree.getAppkey(), tpEquipmentTree.getSecret(), tpEquipmentTree.getHttpServer());
148
+        if (resps.getCode().equals("0")) {
149
+            resps.addSuccess(face);
150
+        } else {
151
+            resps.addError(resps.getCode(), resps.getMessage());
152
+        }
153
+        return resps;
154
+    }
155
+
156
+    /**
157
+     * 验证图片是否为人脸,推送海康
158
+     * @param faceImg
159
+     * @param taFace
160
+     * @param isA
161
+     * @param uploadFile
162
+     * @param userId
163
+     * @param communityId
164
+     * @param roomNoId
165
+     * @param unitId
166
+     * @param appkey
167
+     * @param secret
168
+     * @param openapi_ip_port_http 海康服务器地址
169
+     * @return
170
+     */
171
+    public ResponseBean checKout(String faceImg, TaFace taFace, boolean isA, MultipartFile uploadFile, Integer userId, Integer communityId, Integer roomNoId, Integer unitId, String  appkey, String secret, String openapi_ip_port_http) {
172
+        ResponseBean responseBean = new ResponseBean();
173
+        TaUser user = taUserMapper.selectById(userId);
174
+        if (user.getHkUserId() == null) {
175
+            log.error("本地库人员ID:{}  的海康人员ID不存在", userId);
176
+            throw new WisdomException(ResponseErrorsMessages.NOT_PUSH_FACE.getCode(), ResponseErrorsMessages.NOT_PUSH_FACE.getMsg());
177
+        }
178
+        AESDecode aesd = new AESDecode();
179
+        String body = "{\"type\": \"0\", \"image_url\":\"" + faceImg + "\"}";
180
+        try {
181
+            com.community.commom.mode.ResponseBean send = aesd.send(body);
182
+            JSONObject jsonObject = JSONObject.parseObject(send.getMessage());
183
+            Integer type = (Integer) jsonObject.get("errno");
184
+            Integer faceNum = (Integer) jsonObject.get("face_num");
185
+
186
+            /*推送海康*/
187
+            String data = HKOpenApi.HKpersonGroupId(uploadFile, user.getHkUserId(), user.getHkPersonNo(), user.getUserName(), user.getHkCardNo(), appkey, secret, openapi_ip_port_http);
188
+            /*boolean isA为true进行添加,为false进行修改*/
189
+            if (0 == type && 1 == faceNum) {
190
+                if (null == data) {
191
+                    log.error("未得到,海康数据反馈!");
192
+                    throw new WisdomException(ResponseErrorsMessages.NOT_PUSH_FACE.getCode(), ResponseErrorsMessages.NOT_PUSH_FACE.getMsg());
193
+                }
194
+                if (isA) {
195
+                    taFaceMapper.insert(taFace);
196
+                } else {
197
+                    taFaceMapper.updateById(taFace);
198
+                }
199
+                responseBean.addSuccess(taFace);
200
+
201
+                // 设备树
202
+                TpEquipmentTree tpEquipmentTree = tpEquipmentTreeMapper.selectByCommunityId(communityId);
203
+                // 所有设备
204
+                //List<TpEquipment> tpEquipments = tpEquipmentMapper.selectByCommunityIdAndUnitId(communityId, unitId, 4);
205
+                List<TpEquipment> tpEquipments = tpEquipmentMapper.selectByCommunityIdAndUnitIdAndFace(communityId, unitId, 4);
206
+                if (CollectionUtils.isNotEmpty(tpEquipments)) {
207
+                    List<Map<String, Object>> equipmentUUID = getEquipmentUUID(tpEquipments);
208
+                    StringBuilder doorUuids = new StringBuilder();
209
+                    StringBuilder deviceUuids = new StringBuilder();
210
+                    equipmentUUID.forEach(e-> {
211
+                        doorUuids.append(e.get("doorUuid"));
212
+                        doorUuids.append(",");
213
+                        deviceUuids.append(e.get("deviceUuid"));
214
+                        deviceUuids.append(",");
215
+                    });
216
+                    Map<String,Object> map = Maps.newHashMap();
217
+                    map.put("appkey", tpEquipmentTree.getAppkey());
218
+                    map.put("opUserUuid", tpEquipmentTree.getOpUserUuid());
219
+                    map.put("personIds", String.valueOf(user.getHkUserId()));
220
+                    map.put("deviceUuids", deviceUuids.substring(0, deviceUuids.lastIndexOf(",")));
221
+                    map.put("type", 1);
222
+                    map.put("openapi_ip_port_http", tpEquipmentTree.getHttpServer());
223
+                    HKOpenApi.downloadFaceAndFingerInfos(map);
224
+                }
225
+
226
+                // 单元门口机
227
+                List<TpEquipment> visualEquipments = tpEquipmentMapper.selectByCommunityIdAndUnitId(communityId, unitId, 3);
228
+                if (CollectionUtils.isNotEmpty(visualEquipments)) {
229
+                    List<String> visualList = visualEquipments.stream()
230
+                            .map(e-> tpConfigurationMapper.selectById(e.getUuidId()).getConfigurationValue())
231
+                            .collect(Collectors.toList());
232
+//                List<String> visualList = new ArrayList<>();
233
+//                visualList.add("10010100000");
234
+
235
+                    //可视对讲时 指定人员人脸权限下载
236
+                    List<Integer> userIdList = new ArrayList<>();
237
+                    userIdList.add(user.getHkUserId());
238
+                    //临时设备编号
239
+                    // TODO 根据期楼栋号,来查询出门口机
240
+                    HKOpenApi.visualIntercom(tpEquipmentTree.getOpUserUuid(), 1, userIdList, visualList, tpEquipmentTree.getAppkey(), tpEquipmentTree.getSecret(), tpEquipmentTree.getHttpServer());
241
+                }
242
+
243
+            } else {
244
+                responseBean.addError(ResponseErrorsMessages.FACE_ERROR.getCode(), ResponseErrorsMessages.FACE_ERROR.getMsg());
245
+            }
246
+        } catch (Exception e) {
247
+            e.printStackTrace();
248
+            log.error("海康人脸推送失敗! {}", e);
249
+            throw new WisdomException(ResponseErrorsMessages.NOT_PUSH_FACE.getCode(), ResponseErrorsMessages.NOT_PUSH_FACE.getMsg());
250
+        }
251
+        return responseBean;
252
+    }
253
+
254
+    /**
255
+     * 获取设备UUID
256
+     * @param equipmentList
257
+     * @return
258
+     */
259
+    private List<Map<String,Object>> getEquipmentUUID(List<TpEquipment> equipmentList) {
260
+        return equipmentList.stream().map(equipment -> {
261
+            TpConfiguration tpConfiguration = tpConfigurationMapper.selectById(equipment.getUuidId());
262
+            Map<String,Object> map = Maps.newHashMap();
263
+            map.put("doorUuid", tpConfiguration.getDoorUuid());
264
+            map.put("deviceUuid", tpConfiguration.getDeviceUuid());
265
+            return map;
266
+        }).collect(Collectors.toList());
267
+    }
268
+
269
+    /**
270
+     * 当前登入人是否有人脸信息
271
+     */
272
+    @Override
273
+    public ResponseBean getTaFaceByUserId(Integer userId, Integer userVerifyId) {
274
+        ResponseBean responseBean = new ResponseBean();
275
+
276
+        TaUserVerify userVerify = taUserVerifyMapper.selectByUserIdAndUserVerifyId(userId, userVerifyId);
277
+        if (null == userVerify) {
278
+            responseBean.addError(ResponseErrorsMessages.NOT_USER_VERIFY.getCode(), ResponseErrorsMessages.NOT_USER_VERIFY.getMsg());
279
+            return responseBean;
280
+        }
281
+
282
+
283
+        TaFace face = taFaceMapper.getByUserVerifyId(userVerifyId);
284
+        if (null != face) {
285
+            responseBean.addSuccess(face);
286
+            return responseBean;
287
+        }
288
+        responseBean.addError(ResponseErrorsMessages.NOT_USER_FACE.getCode(), ResponseErrorsMessages.NOT_USER_FACE.getMsg());
289
+        return responseBean;
290
+
291
+    }
292
+
293
+
294
+    /**
295
+     * 得到当前图片
296
+     */
297
+    private String img(MultipartFile uploadFile) {
298
+        String faceImg = null;
299
+        try {
300
+            faceImg = imageServiceI.getImageUrl(uploadFile);
301
+        } catch (IOException e) {
302
+            e.printStackTrace();
303
+        }
304
+        return faceImg;
305
+    }
306
+
307
+    /**
308
+     * 各种身份校验
309
+     */
310
+    public ResponseBean addVerify(Integer userid, Integer userVerifyId, MultipartFile uploadFile, String faceImg, TaFace taFace, TpEquipmentTree tpEquipmentTree) {
311
+        ResponseBean response = new ResponseBean();
312
+
313
+        TaUserVerify userVerify = taUserVerifyMapper.selectById(userVerifyId);
314
+        if (null == userVerify) {
315
+            response.addError(ResponseErrorsMessages.NOT_VERIFY.getCode(), ResponseErrorsMessages.NOT_VERIFY.getMsg());
316
+            return response;
317
+        }
318
+        TaUser taUser = taUserMapper.selectById(userid);
319
+
320
+        //身份为家属租客,状态为已停用
321
+        if (null != taUser && !Constant.EFFECTIVE_STATUS.equals(taUser.getStatus())) {
322
+            response.addError(ResponseErrorsMessages.NOT_IDENTITY_VERIFY.getCode(), ResponseErrorsMessages.NOT_IDENTITY_VERIFY.getMsg());
323
+            return response;
324
+        }
325
+
326
+        //查询当前用户是否有人脸记录
327
+        TaFace face = taFaceMapper.getByUserVerifyId(userVerifyId);
328
+        if (null == face) {
329
+            boolean isA = true;
330
+            if (Constant.EFFECTIVE_STATUS.equals(taUser.getStatus())) {
331
+                ResponseBean responseBean = checKout(faceImg, taFace, isA, uploadFile, userid, userVerify.getCommunityId(), userVerify.getRoomNoId(), userVerify.getUnitId(),tpEquipmentTree.getAppkey(), tpEquipmentTree.getSecret(), tpEquipmentTree.getHttpServer());
332
+                if (responseBean.getCode().equals("0")) {
333
+                    responseBean.addSuccess("人脸录入成功");
334
+                } else {
335
+                    responseBean.addError(responseBean.getCode(),responseBean.getMessage());
336
+                }
337
+                return responseBean;
338
+            }
339
+        }
340
+        response.addError(ResponseErrorsMessages.EXIST_FACE.getCode(), ResponseErrorsMessages.EXIST_FACE.getMsg());
341
+        return response;
342
+    }
343
+
344
+    @Override
345
+    public ResponseBean deleteFace(Integer userId, Integer userVerifyId) {
346
+        ResponseBean responseBean= new ResponseBean();
347
+        TaUserVerify taUserVerify= infoExist(userVerifyId);
348
+        if (null ==taUserVerify) {
349
+            responseBean.addError(ResponseErrorsMessages.NOT_USER_VERIFY_1.getCode(), ResponseErrorsMessages.NOT_USER_VERIFY_1.getMsg());
350
+            return responseBean;
351
+        }
352
+        TaUser taUser = taUserMapper.selectById(taUserVerify.getUserId());
353
+
354
+        // 设备树
355
+        TpEquipmentTree tpEquipmentTree = tpEquipmentTreeMapper.selectByCommunityId(taUserVerify.getCommunityId());
356
+        // 所有设备
357
+        List<TpEquipment> tpEquipments = tpEquipmentMapper.selectByCommunityIdAndUnitId(taUserVerify.getCommunityId(), taUserVerify.getUnitId(), 4);
358
+        if (CollectionUtils.isEmpty(tpEquipments)) {
359
+            responseBean.addError(ResponseErrorsMessages.NOT_EQUIPMENT.getCode(), ResponseErrorsMessages.NOT_EQUIPMENT.getMsg());
360
+            return responseBean;
361
+        }
362
+        List<Map<String, Object>> equipmentUUID = getEquipmentUUID(tpEquipments);
363
+        StringBuilder doorUuids = new StringBuilder();
364
+        StringBuilder deviceUuids = new StringBuilder();
365
+        equipmentUUID.forEach(e-> {
366
+            doorUuids.append(e.get("doorUuid"));
367
+            doorUuids.append(",");
368
+            deviceUuids.append(e.get("deviceUuid"));
369
+            deviceUuids.append(",");
370
+        });
371
+
372
+
373
+        // TODO 删除人脸,是否删除海康
374
+        // 修改人脸(图片为null时。海康删除人脸)
375
+//        HKOpenApi.HKpersonGroupId(null, taUser.getHkUserId(), taUser.getHkPersonNo(), taUser.getUserName(), taUser.getHkCardNo(), tpEquipmentTree.getAppkey(), tpEquipmentTree.getSecret());
376
+        // 删除 权限
377
+        Map<String,Object> selectUserFaceMap = Maps.newHashMap();
378
+        selectUserFaceMap.put("personIds", taUser.getHkUserId()+"");
379
+        selectUserFaceMap.put("opUserUuid", tpEquipmentTree.getOpUserUuid());
380
+        selectUserFaceMap.put("appkey", tpEquipmentTree.getAppkey());
381
+        selectUserFaceMap.put("secret", tpEquipmentTree.getSecret());
382
+        selectUserFaceMap.put("openapi_ip_port_http", tpEquipmentTree.getHttpServer());
383
+        // 查询人脸信息
384
+        HKOpenApi.selectUserFace(selectUserFaceMap);
385
+
386
+        Map<String,Object> deleteUserMap = Maps.newHashMap();
387
+        deleteUserMap.put("personIds", taUser.getHkUserId()+"");
388
+        deleteUserMap.put("opUserUuid", tpEquipmentTree.getOpUserUuid());
389
+        deleteUserMap.put("doorUuids", doorUuids.substring(0, doorUuids.lastIndexOf(",")));
390
+        deleteUserMap.put("appkey", tpEquipmentTree.getAppkey());
391
+        deleteUserMap.put("secret", tpEquipmentTree.getSecret());
392
+        deleteUserMap.put("openapi_ip_port_http", tpEquipmentTree.getHttpServer());
393
+        // 删除当前人脸设备信息
394
+        String data= HKOpenApi.deleteUser(deleteUserMap);
395
+        JSONObject object= JSONObject.parseObject(data);
396
+
397
+        if (object.get("errorCode").equals(1)){
398
+            String errorMessage=  object.getString("errorMessage");
399
+            log.info("删除人脸信息异常:{}", data);
400
+            responseBean.addError(ResponseErrorsMessages.DELETE_FACE.getCode(), ResponseErrorsMessages.DELETE_FACE.getMsg());
401
+            return responseBean;
402
+        }
403
+
404
+        taFaceMapper.deleteFace(userVerifyId);
405
+        // 异动同步到设备
406
+        Map<String,Object> appointJurisdictionMap = Maps.newHashMap();
407
+        appointJurisdictionMap.put("appkey", tpEquipmentTree.getAppkey());
408
+        appointJurisdictionMap.put("secret", tpEquipmentTree.getSecret());
409
+        appointJurisdictionMap.put("opUserUuid", tpEquipmentTree.getOpUserUuid());
410
+        appointJurisdictionMap.put("personIds", taUser.getHkUserId()+"" );
411
+        appointJurisdictionMap.put("doorUuids", doorUuids.substring(0, doorUuids.lastIndexOf(",")));
412
+        appointJurisdictionMap.put("operateType",3);
413
+        appointJurisdictionMap.put("includeFinger",0);
414
+        appointJurisdictionMap.put("openapi_ip_port_http", tpEquipmentTree.getHttpServer());
415
+
416
+         HKOpenApi.appointJurisdiction(appointJurisdictionMap);
417
+        // HKOpenApi.selectUserSynchronization();
418
+        // ihkService.downloadAuthorityByDeviceUuids();
419
+        return responseBean;
420
+
421
+    }
422
+
423
+    /**
424
+     * 校验房产是否审核通过
425
+     * @param verifyID
426
+     * @return
427
+     */
428
+    public TaUserVerify infoExist(Integer verifyID){
429
+      TaUserVerify taUserVerify = null;
430
+      if (null != verifyID) {
431
+        taUserVerify = taUserVerifyMapper.selectById(verifyID);
432
+      }
433
+      if (null!= taUserVerify && taUserVerify.getVerifyStatus().equals("1")) {
434
+          return taUserVerify;
435
+      }
436
+      return  taUserVerify;
437
+    }
438
+}
439
+
440
+

+ 277
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/impl/FuShiServiceImpl.java Ver arquivo

@@ -0,0 +1,277 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.alibaba.fastjson.JSONObject;
4
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5
+import com.community.commom.fushi.FuShiRequestAPI;
6
+import com.community.commom.fushi.error.FuShiException;
7
+import com.community.commom.mode.ResponseBean;
8
+import com.community.commom.uuid.IdGen;
9
+import com.community.huiju.common.perproties.FuShiProperties;
10
+import com.community.huiju.dao.TaTemporaryLicenseOrderMapper;
11
+import com.community.huiju.dao.TaUserLicenseOrderMapper;
12
+import com.community.huiju.dao.TaUserMapper;
13
+import com.community.huiju.log.LogAnnotation;
14
+import com.community.huiju.log.LogEnums;
15
+import com.community.huiju.model.TaTemporaryLicenseOrder;
16
+import com.community.huiju.model.TaUser;
17
+import com.community.huiju.model.TaUserLicenseOrder;
18
+import com.community.huiju.service.IFuShiService;
19
+import com.google.common.collect.Maps;
20
+import lombok.extern.slf4j.Slf4j;
21
+import org.springframework.beans.factory.annotation.Autowired;
22
+import org.springframework.stereotype.Service;
23
+
24
+import java.math.BigDecimal;
25
+import java.text.ParseException;
26
+import java.text.SimpleDateFormat;
27
+import java.time.LocalDateTime;
28
+import java.time.format.DateTimeFormatter;
29
+import java.util.Date;
30
+import java.util.Map;
31
+
32
+/**
33
+ * 富士业务实现
34
+ * @author weiximei
35
+ */
36
+@Slf4j
37
+@Service
38
+public class FuShiServiceImpl implements IFuShiService {
39
+
40
+    @Autowired
41
+    private FuShiRequestAPI fuShiRequestAPI;
42
+
43
+    @Autowired
44
+    private FuShiProperties fuShiProperties;
45
+
46
+    private IdGen idGen = IdGen.get();
47
+
48
+    @Autowired
49
+    private TaTemporaryLicenseOrderMapper taTemporaryLicenseOrderMapper;
50
+
51
+    @Autowired
52
+    private TaUserLicenseOrderMapper taUserLicenseOrderMapper;
53
+
54
+    @Autowired
55
+    private TaUserMapper taUserMapper;
56
+
57
+    /**
58
+     * 获取 富士 json 值
59
+     * @param jsonString
60
+     * @return
61
+     */
62
+    private Map<String,Object> getFuShiInfo(String jsonString) {
63
+        JSONObject jsonObject = JSONObject.parseObject(jsonString);
64
+        Map<String, Object> map = Maps.newHashMap();
65
+        Map<String, Object> jsonParam = jsonObject.getJSONObject("JsonParam").getInnerMap();
66
+        // 移除优惠券
67
+        jsonParam.remove("CouponList");
68
+        map.put("JsonParam", jsonParam);
69
+        map.put("Redirect", jsonObject.getString("Redirect"));
70
+        map.put("DataType", jsonObject.getInteger("DataType"));
71
+        return map;
72
+    }
73
+
74
+    @LogAnnotation(value = LogEnums.DA_SU, alias = "获取停车信息(通过车牌号)")
75
+    @Override
76
+    public ResponseBean getParkInfoByCarNo(String carNo, Integer communityId) {
77
+        ResponseBean responseBean = new ResponseBean();
78
+        String parkInfo = fuShiRequestAPI.getParkInfoByCarNo(fuShiProperties.getParkingCode(), carNo);
79
+        Map<String, Object> fuShiInfo = getFuShiInfo(parkInfo);
80
+        responseBean.addSuccess(fuShiInfo);
81
+        return responseBean;
82
+    }
83
+
84
+    @LogAnnotation(value = LogEnums.DA_SU, alias = "第三方月卡上发续费")
85
+    @Override
86
+    public ResponseBean apiThirdPartyMonthCardPay(String Phone, String RenewDayType, String RenewDay, String PayStyle, String CarNo, String CardNo, String RechargeAmt, Integer communityId) {
87
+        ResponseBean responseBean = new ResponseBean();
88
+        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd hh:mm:ss");
89
+        // 交易编码
90
+        String dealNo = idGen.nextId() + "";
91
+        // 第三方交易日期
92
+        String dateTime = dateTimeFormatter.format(LocalDateTime.now());
93
+        // 富士云请求
94
+        String partyMonthCardPay = fuShiRequestAPI.apiThirdPartyMonthCardPay(RenewDayType, RenewDay, dealNo, PayStyle, CarNo, fuShiProperties.getParkingCode(), CardNo, RechargeAmt, dateTime);
95
+        String tradeNo = JSONObject.parseObject(partyMonthCardPay).getString("TradeNo");
96
+        Map<String, Object> map = Maps.newHashMap();
97
+        map.put("TradeNo", tradeNo);
98
+        responseBean.addSuccess(map);
99
+
100
+        QueryWrapper<TaUser> userQueryWrapper = new QueryWrapper<>();
101
+        userQueryWrapper.eq("login_name", Phone);
102
+        TaUser user = taUserMapper.selectOne(userQueryWrapper);
103
+
104
+        // 月租车缴费记录
105
+        TaUserLicenseOrder taUserLicenseOrder = new TaUserLicenseOrder();
106
+        taUserLicenseOrder.setCommunityId(communityId);
107
+        taUserLicenseOrder.setTaUserId(user.getUserId());
108
+        taUserLicenseOrder.setOrderNumber(dealNo);
109
+        taUserLicenseOrder.setOrderStatus("1");
110
+        taUserLicenseOrder.setCreateUser(user.getUserId());
111
+        taUserLicenseOrder.setCreateDate(new Date());
112
+        taUserLicenseOrder.setExtensionMonth(Integer.valueOf(RenewDay));
113
+        taUserLicenseOrder.setExtensionPrice(RechargeAmt);
114
+        taUserLicenseOrder.setPaymentTel(user.getLoginName());
115
+        taUserLicenseOrder.setPaymentName(user.getUserName());
116
+        // 缴费方式 1是支付宝 2是微信支付
117
+        if (PayStyle.contains("微信")) {
118
+            taUserLicenseOrder.setPaymentType("0");
119
+        } else if (PayStyle.contains("支付宝")){
120
+            taUserLicenseOrder.setPaymentType("2");
121
+        }
122
+
123
+        // 查询这个交费后的车牌
124
+        String parkGetMonthCardInfoByCarNo = fuShiRequestAPI.parkGetMonthCardInfoByCarNo(fuShiProperties.getParkingCode(), CarNo);
125
+        JSONObject jsonObject = JSONObject.parseObject(parkGetMonthCardInfoByCarNo);
126
+        Map<String, Object> innerMap = jsonObject.getInnerMap();
127
+        Integer messageCode = (Integer) innerMap.get("MessageCode");
128
+        if (200 != messageCode.intValue()) {
129
+            log.error("月租车缴费记录错误:{}", parkGetMonthCardInfoByCarNo);
130
+            String messageContent = jsonObject.getString("MessageContent");
131
+            throw new FuShiException(messageCode, messageContent);
132
+        }
133
+
134
+        Map<String, Object> result = (Map<String, Object>) innerMap.get("Result");
135
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
136
+        try {
137
+            taUserLicenseOrder.setExpireDate(format.parse(String.valueOf(result.get("EndTime"))));
138
+        } catch (ParseException e) {
139
+            e.printStackTrace();
140
+        }
141
+
142
+        Object cost = result.get("Cost");
143
+        String costValue = String.valueOf(Double.valueOf(((BigDecimal) cost).toString()) * 100);
144
+
145
+        taUserLicenseOrder.setUnitPrice(costValue.substring(0, costValue.lastIndexOf(".")));
146
+        taUserLicenseOrder.setParkingLot(String.valueOf(result.get("ParkingName")));
147
+        taUserLicenseOrder.setLicensePlate(CarNo);
148
+        taUserLicenseOrder.setSourceFrom("大苏");
149
+        taUserLicenseOrderMapper.insert(taUserLicenseOrder);
150
+
151
+        return responseBean;
152
+    }
153
+
154
+    /**
155
+     * 第三方临时卡上发缴费
156
+     * @param Amount 应缴金额(单位元)
157
+     * @param ActualAmount 实缴金额(单位元)
158
+     * @param DeductionAmount 抵扣金额(单位元)
159
+     * @param Reason 抵扣原因
160
+     * @param PayStyle 交易方式(汉字描述),例如:微信、支付宝、银联
161
+     * @param CarNo 车牌号
162
+     * @param CardNo 停车卡号
163
+     * @param CouponList 使用的优惠券列表(JSON字符串)
164
+     *               MerchantName: 商户名称
165
+     *               CouponType: 优惠券优惠类型1全免2减免金额3减免时长4减免百分比
166
+     *               CouponValue: 对应优惠券类型的值 金额/时间/折扣
167
+     *               CouponCode: 优惠券编码
168
+     *               FavorableType: 优惠券类型1 纸质券 2 电子券 3 活动券
169
+     *               UseStatus:标识优惠券是线上或线下使用的状态 1只在线上使用 2只在线下使用 3线上线下都可以使用
170
+     *               IsAuto: 是否自动使用优惠券1是2否
171
+     *               EndTime: 截至时间
172
+     *               CouponDescribe: 优惠券描述
173
+     *               CouponName: 优惠券名称
174
+     *
175
+     * @return
176
+     */
177
+    @LogAnnotation(value = LogEnums.DA_SU, alias = "第三方临时卡上发缴费")
178
+    @Override
179
+    public ResponseBean apiThirdPartyTemporaryCardPay(String Amount, String ActualAmount, String DeductionAmount, String Reason, String PayStyle, String CarNo, String CardNo, String CouponList, Integer communityId) {
180
+        ResponseBean responseBean = new ResponseBean();
181
+        // 交易编号
182
+        String dealNo = idGen.nextId() + "";
183
+        String apiThirdPartyTemporaryCardPay = fuShiRequestAPI.apiThirdPartyTemporaryCardPay(Amount, ActualAmount, DeductionAmount, Reason, dealNo, PayStyle, CarNo, fuShiProperties.getParkingCode(), CardNo, "", CouponList);
184
+        String tradeNo = JSONObject.parseObject(apiThirdPartyTemporaryCardPay).getString("TradeNo");
185
+        Map<String, Object> map = Maps.newHashMap();
186
+        map.put("TradeNo", tradeNo);
187
+        responseBean.addSuccess(map);
188
+
189
+        // 临时车缴费记录
190
+        TaTemporaryLicenseOrder taTemporaryLicenseOrder = new TaTemporaryLicenseOrder();
191
+        taTemporaryLicenseOrder.setCommunityId(communityId);
192
+        taTemporaryLicenseOrder.setOrderNumber(dealNo);
193
+        taTemporaryLicenseOrder.setOrderStatus("1");
194
+        taTemporaryLicenseOrder.setCreateDate(new Date());
195
+        taTemporaryLicenseOrder.setUpdateDate(new Date());
196
+        // 缴费方式 1是支付宝 2是微信支付
197
+        if (PayStyle.contains("微信")) {
198
+            taTemporaryLicenseOrder.setPaymentType("2");
199
+        } else if (PayStyle.contains("支付宝")){
200
+            taTemporaryLicenseOrder.setPaymentType("1");
201
+        }
202
+        taTemporaryLicenseOrder.setActualAmount(ActualAmount);
203
+        taTemporaryLicenseOrder.setDeductionAmount(DeductionAmount);
204
+        taTemporaryLicenseOrder.setAmount(Amount);
205
+
206
+        String parkGetMonthCardInfoByCarNo = fuShiRequestAPI.parkGetTempCarPaymentInfoByCarNo(fuShiProperties.getParkingCode(), CarNo);
207
+        JSONObject jsonObject = JSONObject.parseObject(parkGetMonthCardInfoByCarNo);
208
+        Map<String, Object> innerMap = jsonObject.getInnerMap();
209
+        Integer messageCode = (Integer) innerMap.get("MessageCode");
210
+        if (200 != messageCode.intValue()) {
211
+            log.error("临时车缴费记录错误:{}", parkGetMonthCardInfoByCarNo);
212
+            String messageContent = jsonObject.getString("MessageContent");
213
+            throw new FuShiException(messageCode, messageContent);
214
+        }
215
+
216
+        Map<String, Object> result = (Map<String, Object>) innerMap.get("Result");
217
+        taTemporaryLicenseOrder.setParkingLot(String.valueOf(result.get("ParkingName")));
218
+        taTemporaryLicenseOrder.setLicensePlate(CarNo);
219
+        taTemporaryLicenseOrder.setSourceFrom("大苏");
220
+
221
+        taTemporaryLicenseOrderMapper.insert(taTemporaryLicenseOrder);
222
+
223
+
224
+
225
+        return responseBean;
226
+    }
227
+
228
+    @LogAnnotation(value = LogEnums.DA_SU, alias = "获取线下算费结果")
229
+    @Override
230
+    public ResponseBean apiGetOfflineFee(String CarNoOrCardNo, Integer communityId) {
231
+        ResponseBean responseBean = new ResponseBean();
232
+        String apiGetOfflineFee = fuShiRequestAPI.apiGetOfflineFee(fuShiProperties.getParkingCode(), CarNoOrCardNo);
233
+        String result = JSONObject.parseObject(apiGetOfflineFee).getString("Result");
234
+        Map<String, Object> map = Maps.newHashMap();
235
+        map.put("Result", result);
236
+        responseBean.addSuccess(map);
237
+        return responseBean;
238
+    }
239
+
240
+    /**
241
+     * 获取月租车信息(通过车牌号)
242
+     * @param CarNo
243
+     * @return
244
+     */
245
+    @LogAnnotation(value = LogEnums.DA_SU, alias = "获取月租车信息(通过车牌号)")
246
+    @Override
247
+    public ResponseBean parkGetMonthCardInfoByCarNo(String CarNo, Integer communityId) {
248
+        ResponseBean responseBean = new ResponseBean();
249
+        String parkGetMonthCardInfoByCarNo = fuShiRequestAPI.parkGetMonthCardInfoByCarNo(fuShiProperties.getParkingCode(), CarNo);
250
+        JSONObject jsonObject = JSONObject.parseObject(parkGetMonthCardInfoByCarNo);
251
+        Map<String, Object> map = Maps.newHashMap();
252
+        Map<String, Object> result = jsonObject.getJSONObject("Result").getInnerMap();
253
+        result.remove("CouponList");
254
+        map.put("Result", result);
255
+        responseBean.addSuccess(map);
256
+        return responseBean;
257
+    }
258
+
259
+    /**
260
+     * 获取临时车信息(通过车牌号)
261
+     * @param CarNo
262
+     * @return
263
+     */
264
+    @LogAnnotation(value = LogEnums.DA_SU, alias = "获取临时车信息(通过车牌号)")
265
+    @Override
266
+    public ResponseBean parkGetTempCarPaymentInfoByCarNo(String CarNo,Integer communityId) {
267
+        ResponseBean responseBean = new ResponseBean();
268
+        String parkGetMonthCardInfoByCarNo = fuShiRequestAPI.parkGetTempCarPaymentInfoByCarNo(fuShiProperties.getParkingCode(), CarNo);
269
+        JSONObject jsonObject = JSONObject.parseObject(parkGetMonthCardInfoByCarNo);
270
+        Map<String, Object> map = Maps.newHashMap();
271
+        Map<String, Object> result = jsonObject.getJSONObject("Result").getInnerMap();
272
+        result.remove("CouponList");
273
+        map.put("Result", result);
274
+        responseBean.addSuccess(map);
275
+        return responseBean;
276
+    }
277
+}

+ 369
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/impl/HKServiceImpl.java Ver arquivo

@@ -0,0 +1,369 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.alibaba.fastjson.JSONArray;
4
+import com.alibaba.fastjson.JSONObject;
5
+import com.community.commom.constant.Constant;
6
+import com.community.commom.hk.HKOpenApi;
7
+import com.community.commom.mode.ResponseBean;
8
+import com.community.commom.uuid.IdGen;
9
+import com.community.huiju.dao.*;
10
+import com.community.huiju.enums.ResponseErrorsMessages;
11
+import com.community.huiju.exception.WisdomException;
12
+import com.community.huiju.model.*;
13
+import com.community.huiju.service.IHKService;
14
+import com.google.common.collect.Lists;
15
+import com.google.common.collect.Maps;
16
+import lombok.extern.slf4j.Slf4j;
17
+import org.apache.commons.collections.CollectionUtils;
18
+import org.springframework.beans.factory.annotation.Autowired;
19
+import org.springframework.stereotype.Service;
20
+import org.springframework.transaction.annotation.Transactional;
21
+
22
+import java.text.ParseException;
23
+import java.text.SimpleDateFormat;
24
+import java.time.LocalDate;
25
+import java.util.Arrays;
26
+import java.util.HashMap;
27
+import java.util.List;
28
+import java.util.Map;
29
+import java.util.stream.Collectors;
30
+
31
+/**
32
+ * 海康 业务实现
33
+ * @author weiximei
34
+ */
35
+@Service
36
+@Slf4j
37
+public class HKServiceImpl implements IHKService {
38
+
39
+    @Autowired
40
+    private TaUserMapper taUserMapper;
41
+
42
+    private IdGen idGen = IdGen.get();
43
+
44
+    @Autowired
45
+    private TpEquipmentMapper tpEquipmentMapper;
46
+
47
+    @Autowired
48
+    private TpConfigurationMapper tpConfigurationMapper;
49
+
50
+    @Autowired
51
+    private TpEquipmentTreeMapper tpEquipmentTreeMapper;
52
+
53
+    @Autowired
54
+    private TaUserVerifyMapper taUserVerifyMapper;
55
+
56
+    /**
57
+     * 获取设备UUID
58
+     * @param equipmentList
59
+     * @return
60
+     */
61
+    private List<Map<String,Object>> getEquipmentUUID(List<TpEquipment> equipmentList) {
62
+        return equipmentList.stream().map(equipment -> {
63
+            TpConfiguration tpConfiguration = tpConfigurationMapper.selectById(equipment.getUuidId());
64
+            Map<String,Object> map = Maps.newHashMap();
65
+            map.put("doorUuid", tpConfiguration.getDoorUuid());
66
+            map.put("deviceUuid", tpConfiguration.getDeviceUuid());
67
+            return map;
68
+        }).collect(Collectors.toList());
69
+    }
70
+
71
+    @Override
72
+    @Transactional(rollbackFor = Exception.class)
73
+    public ResponseBean pushPerson(String appUserId, Integer userVerifyId) {
74
+        ResponseBean responseBean = new ResponseBean();
75
+        TaUser user = taUserMapper.selectById(Integer.parseInt(appUserId));
76
+
77
+        TaUserVerify userVerify = taUserVerifyMapper.selectById(userVerifyId);
78
+        if (null == userVerify) {
79
+            throw new WisdomException("审核数据不存在!");
80
+        }
81
+        TpEquipmentTree tpEquipmentTree = tpEquipmentTreeMapper.selectByCommunityId(userVerify.getCommunityId());
82
+
83
+        // 这两个值一般都是同时存在的
84
+        // 当这两个值不存在的时候,就添加海康人员
85
+        if (null == user.getHkUserId() && null == user.getHkPersonNo()) {
86
+            // 设置 海康id
87
+            user.setHkPersonNo(idGen.nextId());
88
+            /**
89
+             * 1.获取部门(比如 住户)
90
+             * 2.根据部门编号推送 海康
91
+             */
92
+            taUserMapper.updateById(user);
93
+            addUserAndOpenCard(responseBean, user, tpEquipmentTree);
94
+        }
95
+
96
+
97
+        // 推送海康
98
+
99
+        // 给用户添加 海康门禁权限
100
+
101
+        List<TpEquipment> tpEquipments = tpEquipmentMapper.selectByCommunityIdAndUnitId(userVerify.getCommunityId(), userVerify.getUnitId(), 4);
102
+        if (CollectionUtils.isEmpty(tpEquipments)) {
103
+            throw new WisdomException(ResponseErrorsMessages.NOT_EQUIPMENT.getCode(), ResponseErrorsMessages.NOT_EQUIPMENT.getMsg());
104
+        }
105
+        List<Map<String, Object>> equipmentUUID = getEquipmentUUID(tpEquipments);
106
+        StringBuilder doorUuids = new StringBuilder();
107
+        StringBuilder deviceUuids = new StringBuilder();
108
+        equipmentUUID.forEach(e-> {
109
+            doorUuids.append(e.get("doorUuid"));
110
+            doorUuids.append(",");
111
+            deviceUuids.append(e.get("deviceUuid"));
112
+            deviceUuids.append(",");
113
+        });
114
+
115
+        Map<String, Object> map = Maps.newHashMap();
116
+        map.put("personIds",String.valueOf(user.getHkUserId()));
117
+        map.put("doorUuids", doorUuids.substring(0, doorUuids.lastIndexOf(",")));
118
+        map.put("secret", tpEquipmentTree.getSecret());
119
+        map.put("appkey", tpEquipmentTree.getAppkey());
120
+        map.put("openapi_ip_port_http", tpEquipmentTree.getHttpServer());
121
+        HKOpenApi.addAuthoritiesByPersonIds(map);
122
+
123
+        // 下发门禁权限
124
+        Map<String, Object> downloadAuthorityByPersonIdsMap = Maps.newHashMap();
125
+        downloadAuthorityByPersonIdsMap.put("personIds",String.valueOf(user.getHkUserId()));
126
+        downloadAuthorityByPersonIdsMap.put("doorUuids", doorUuids.substring(0, doorUuids.lastIndexOf(",")));
127
+        downloadAuthorityByPersonIdsMap.put("operateType",1);
128
+        downloadAuthorityByPersonIdsMap.put("includeFinger",1);
129
+        downloadAuthorityByPersonIdsMap.put("secret", tpEquipmentTree.getSecret());
130
+        downloadAuthorityByPersonIdsMap.put("appkey", tpEquipmentTree.getAppkey());
131
+        downloadAuthorityByPersonIdsMap.put("openapi_ip_port_http", tpEquipmentTree.getHttpServer());
132
+        HKOpenApi.downloadAuthorityByPersonIds(downloadAuthorityByPersonIdsMap);
133
+
134
+        //--------- 可视对讲 ----------
135
+
136
+        Map<String,Object> addOutDoorAuthMap = Maps.newHashMap();
137
+        addOutDoorAuthMap.put("authName", "荟居");
138
+        addOutDoorAuthMap.put("personIds", Arrays.asList(user.getHkUserId()));
139
+        addOutDoorAuthMap.put("secret", tpEquipmentTree.getSecret());
140
+        addOutDoorAuthMap.put("appkey", tpEquipmentTree.getAppkey());
141
+
142
+        // 单元门口机
143
+        List<TpEquipment> visualEquipments = tpEquipmentMapper.selectByCommunityIdAndUnitId(userVerify.getCommunityId(), userVerify.getUnitId(), 3);
144
+        List<String> visualList = visualEquipments.stream()
145
+                .map(e-> tpConfigurationMapper.selectById(e.getUuidId()).getConfigurationValue())
146
+                .collect(Collectors.toList());
147
+//        List<String> visualList = new ArrayList<>();
148
+//        visualList.add("10010100000");
149
+        addOutDoorAuthMap.put("longNums", visualList);
150
+        // 可视对讲下发 权限
151
+        visualIntercomPermissions(addOutDoorAuthMap);
152
+        if ("0".equals(responseBean.getCode())) {
153
+            responseBean.addSuccess("操作成功!");
154
+            return responseBean;
155
+        }
156
+        throw new WisdomException("操作失败!");
157
+    }
158
+
159
+    @Override
160
+    @Deprecated
161
+    public ResponseBean downloadAuthorityByDeviceUuids() {
162
+        ResponseBean responseBean = new ResponseBean();
163
+        // 下发门禁权限
164
+        HKOpenApi.downloadAuthorityByDeviceUuids(Maps.newHashMap());
165
+        responseBean.addSuccess("操作成功!");
166
+        return responseBean;
167
+    }
168
+
169
+    /**
170
+     * 公共方法
171
+     * 添加人员, 开卡
172
+     *
173
+     * @param response
174
+     * @param user
175
+     */
176
+    private void addUserAndOpenCard(ResponseBean response, TaUser user, TpEquipmentTree tpEquipmentTree) {
177
+        Map<String, Object> parDept = Maps.newHashMap();
178
+        parDept.put("pageNo", 1);
179
+        parDept.put("pageSize", 100);
180
+        parDept.put("deptName", Constant.DEPT_RESIDENTS);
181
+        parDept.put("openapi_ip_port_http", tpEquipmentTree.getHttpServer());
182
+        // 部门UUID
183
+        String deptUuid = getDeptUUID(parDept);
184
+
185
+        // 添加人员
186
+        Map<String, Object> parUser = Maps.newHashMap();
187
+        parUser.put("personNo", user.getHkPersonNo());
188
+        parUser.put("personName", user.getUserName());
189
+        parUser.put("phoneNo", user.getLoginName());
190
+        parUser.put("deptUuid", deptUuid);
191
+        parUser.put("secret", tpEquipmentTree.getSecret());
192
+        parUser.put("appkey", tpEquipmentTree.getAppkey());
193
+        parUser.put("openapi_ip_port_http", tpEquipmentTree.getHttpServer());
194
+        Map<String, Object> resultMap = JSONObject.parseObject(HKOpenApi.addUser(parUser), HashMap.class);
195
+        int errorCode = (int) resultMap.get("errorCode");
196
+        if (errorCode == 0) {
197
+            Map<String, Object> resultDataMap = (Map<String, Object>) resultMap.get("data");
198
+            // 开卡 卡号
199
+            long cardNo = System.currentTimeMillis();
200
+            // 海康人员ID
201
+            Integer personId = (Integer) resultDataMap.get("personId");
202
+            TaUser tempUser = taUserMapper.selectById(user.getUserId());
203
+            tempUser.setHkUserId(personId);
204
+            tempUser.setHkCardNo(cardNo + "");
205
+
206
+            user.setHkUserId(personId);
207
+            // 存储海康人员ID
208
+            int row = taUserMapper.updateById(tempUser);
209
+            if (row > 0) {
210
+                response.addSuccess("操作成功!");
211
+            } else {
212
+                response.addError("操作失败");
213
+                throw new RuntimeException("数据库添加 家属/租客 人员失败!");
214
+            }
215
+
216
+            // 开卡
217
+            List<String> cardAndPersonList = Lists.newArrayList();
218
+            cardAndPersonList.add(cardNo + "," + personId);
219
+            response = openCard(cardAndPersonList, null, tpEquipmentTree);
220
+        } else {
221
+            String errorMessage = String.valueOf(resultMap.get("errorMessage"));
222
+            response.addError(errorMessage);
223
+            log.error("海康添加人员失败! {}", errorMessage);
224
+            throw new RuntimeException(errorMessage);
225
+        }
226
+    }
227
+
228
+    /**
229
+     * 批量开卡
230
+     *
231
+     * @param cardIdAndHKUserID list.add("卡号,人员ID")
232
+     * @param expirationTime    有效期为多少? 单位为 年
233
+     * @return
234
+     */
235
+    private ResponseBean openCard(List<String> cardIdAndHKUserID, Integer expirationTime, TpEquipmentTree tpEquipmentTree) {
236
+        ResponseBean response = new ResponseBean();
237
+
238
+        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
239
+        LocalDate today = LocalDate.now();
240
+        int year = today.getYear();
241
+        // 加上20, 表示加上20年,默认
242
+        if (null == expirationTime || expirationTime <= 0) {
243
+            year += 20;
244
+        } else {
245
+            year += expirationTime;
246
+        }
247
+        int month = today.getMonthValue();
248
+        int day = today.getDayOfMonth();
249
+
250
+        Long time = null;
251
+        try {
252
+            time = formatter.parse(year + "-" + month + "-" + day).getTime();
253
+        } catch (ParseException e) {
254
+            e.printStackTrace();
255
+        }
256
+
257
+        // 开卡
258
+        Map<String, Object> parOpenCard = Maps.newHashMap();
259
+        parOpenCard.put("cardAndPerson", cardIdAndHKUserID);
260
+        parOpenCard.put("startTime", System.currentTimeMillis());
261
+        parOpenCard.put("endTime", time);
262
+        parOpenCard.put("secret", tpEquipmentTree.getSecret());
263
+        parOpenCard.put("appkey", tpEquipmentTree.getAppkey());
264
+        parOpenCard.put("openapi_ip_port_http", tpEquipmentTree.getHttpServer());
265
+        JSONObject openCardJSON = JSONObject.parseObject(HKOpenApi.openCard(parOpenCard));
266
+        int code = (int) openCardJSON.get("errorCode");
267
+        if (code == 0) {
268
+            response.addSuccess("操作成功!");
269
+        } else {
270
+            String errorMessage = String.valueOf(openCardJSON.get("errorMessage"));
271
+            response.addError(errorMessage);
272
+            log.error("开卡失败! {}", errorMessage);
273
+            throw new RuntimeException(errorMessage);
274
+        }
275
+
276
+        return response;
277
+    }
278
+
279
+    /**
280
+     * 获取部门 uuid
281
+     * <p>
282
+     * 这里的部门相当于 小区
283
+     *
284
+     * @return
285
+     */
286
+    private String getDeptUUID(Map<String, Object> parDept) {
287
+        Map<String, Object> deptMap = JSONObject.parseObject(HKOpenApi.getDeptName(parDept), HashMap.class);
288
+        Map<String, Object> deptDataMap = (Map<String, Object>) deptMap.get("data");
289
+        JSONArray jsonArray = (JSONArray) deptDataMap.get("list");
290
+        Map<String, Object> deptListData = (Map<String, Object>) jsonArray.get(0);
291
+        // 部门UUID
292
+        String deptUuid = (String) deptListData.get("deptUuid");
293
+        return deptUuid;
294
+    }
295
+
296
+    /**
297
+     * 可视对讲下发 权限
298
+     *
299
+     * @param map
300
+     */
301
+    private void visualIntercomPermissions(Map<String,Object> map) {
302
+        // TODO 目前下发的 authName权限组是我们自定义的, 后面肯定是按照小区的 期楼栋号来设置的
303
+        // TODO longNums设备编号, 可视对讲的机器编号, 应该根据 期楼栋号 下面的机器编号来设置的
304
+
305
+        //--------- 可视对讲 ----------
306
+
307
+        // 可视对讲 根据人员 ID 集添加权限并下发
308
+        HKOpenApi.addOutDoorAuth(map);
309
+
310
+    }
311
+
312
+    /**
313
+     * 可视对讲 指定人员指纹权限下载
314
+     * @param map
315
+     */
316
+    private void visualIntercomFingerprint(Map<String,Object> map) {
317
+        // 可视对讲 指定人员指纹权限下载
318
+        Map<String, Object> downloadFingerMap = new HashMap<>();
319
+        // opType 操作类型 Integer 是 1 为下发权限;2 为删除权限
320
+        downloadFingerMap.put("opType", 1);
321
+        downloadFingerMap.put("personIds", map.get("personIds"));
322
+        downloadFingerMap.put("longNums", map.get("longNums"));
323
+        downloadFingerMap.put("openapi_ip_port_http", map.get("openapi_ip_port_http"));
324
+        // 可视对讲 指定人员指纹权限下载
325
+        HKOpenApi.downloadFinger(downloadFingerMap);
326
+    }
327
+
328
+    @Override
329
+    public ResponseBean syncControl(Integer userVerifyId) {
330
+        // TODO 暂时只支持开单元门
331
+
332
+        ResponseBean responseBean = new ResponseBean();
333
+
334
+        // 查询当前的房产
335
+        TaUserVerify userVerify = taUserVerifyMapper.selectById(userVerifyId);
336
+        TpEquipmentTree tpEquipmentTree = tpEquipmentTreeMapper.selectByCommunityId(userVerify.getCommunityId());
337
+        // 单元门口机
338
+        List<TpEquipment> tpEquipments = tpEquipmentMapper.selectByCommunityIdAndUnitId(userVerify.getCommunityId(), userVerify.getUnitId(), 3);
339
+
340
+         if (CollectionUtils.isEmpty(tpEquipments)) {
341
+             responseBean.addError("无设备信息!");
342
+             return responseBean;
343
+         }
344
+
345
+         String str = "";
346
+         for (TpEquipment e : tpEquipments) {
347
+             TpConfiguration tpConfiguration = tpConfigurationMapper.selectById(e.getUuidId());
348
+             str += tpConfiguration.getConfigurationValue();
349
+             str += ",";
350
+         }
351
+
352
+        // 查询设备编号
353
+
354
+        Map<String,Object> parMap = com.beust.jcommander.internal.Maps.newHashMap();
355
+        parMap.put("longNums", str);
356
+        parMap.put("openapi_ip_port_http", tpEquipmentTree.getHttpServer());
357
+        parMap.put("secret", tpEquipmentTree.getSecret());
358
+        parMap.put("appkey", tpEquipmentTree.getAppkey());
359
+        String data = HKOpenApi.syncControl(parMap);
360
+        JSONObject jsonObject = JSONObject.parseObject(data);
361
+        int errorCode = jsonObject.getInteger("errorCode");
362
+        if (errorCode == 0) {
363
+            responseBean.addSuccess("操作成功!");
364
+            return responseBean;
365
+        }
366
+        responseBean.addError("操作失败!");
367
+        return responseBean;
368
+    }
369
+}

+ 46
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/impl/ImageServiceimpl.java Ver arquivo

@@ -0,0 +1,46 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.aliyun.oss.OSSClient;
4
+import com.community.huiju.service.ImageServiceI;
5
+import org.springframework.stereotype.Service;
6
+import org.springframework.web.multipart.MultipartFile;
7
+
8
+import java.io.ByteArrayInputStream;
9
+import java.io.IOException;
10
+import java.util.Date;
11
+
12
+/**
13
+ * @author weichaochao
14
+ * @Title: ImageServiceimpl
15
+ * @Description: 获取图片地址实现类
16
+ * @date 2018/11/5
17
+ */
18
+@Service("ImageService")
19
+public class ImageServiceimpl implements ImageServiceI {
20
+
21
+    private static String endpoint = "http://oss-cn-shanghai.aliyuncs.com";
22
+    private static String accessKeyId = "LTAIkc75dpkJw8Lb";
23
+    private static String accessKeySecret = "v4bvXCaix6vSDTCFfwSAdqV53iFEQw";
24
+    private static String bucketName = "jingcheng-h5temp";
25
+
26
+    @Override
27
+    public String getImageUrl(MultipartFile uploadFile) throws IOException {
28
+
29
+        String imgName = System.currentTimeMillis() + ".png";
30
+        // 创建OSSClient实例
31
+        OSSClient ossClient = new OSSClient(endpoint, accessKeyId, accessKeySecret);
32
+        // 上传
33
+        long time = System.currentTimeMillis();
34
+
35
+        ossClient.putObject(bucketName, imgName, new ByteArrayInputStream(uploadFile.getBytes()));
36
+
37
+        // 关闭client
38
+        ossClient.shutdown();
39
+        Date expiration = new Date(time + 3600 * 1000 * 24 * 365 * 10);
40
+        String url = ossClient.generatePresignedUrl(bucketName, imgName, expiration).toString();
41
+
42
+        // 截取掉签名
43
+        url = url.substring(0, url.lastIndexOf("&Signature"));
44
+        return url;
45
+    }
46
+}

+ 20
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/impl/TaSysRoleServiceImpl.java Ver arquivo

@@ -0,0 +1,20 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4
+import com.community.huiju.model.TaSysRole;
5
+import com.community.huiju.dao.TaSysRoleMapper;
6
+import com.community.huiju.service.ITaSysRoleService;
7
+import org.springframework.stereotype.Service;
8
+
9
+/**
10
+ * <p>
11
+ * app端角色 服务实现类
12
+ * </p>
13
+ *
14
+ * @author jobob
15
+ * @since 2019-05-16
16
+ */
17
+@Service
18
+public class TaSysRoleServiceImpl extends ServiceImpl<TaSysRoleMapper, TaSysRole> implements ITaSysRoleService {
19
+
20
+}

+ 20
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/impl/TaTemporaryLicenseOrderServiceImpl.java Ver arquivo

@@ -0,0 +1,20 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4
+import com.community.huiju.dao.TaTemporaryLicenseOrderMapper;
5
+import com.community.huiju.model.TaTemporaryLicenseOrder;
6
+import com.community.huiju.service.ITaTemporaryLicenseOrderService;
7
+import org.springframework.stereotype.Service;
8
+
9
+/**
10
+ * <p>
11
+ * 临时车缴费表 服务实现类
12
+ * </p>
13
+ *
14
+ * @author jobob
15
+ * @since 2019-05-28
16
+ */
17
+@Service
18
+public class TaTemporaryLicenseOrderServiceImpl extends ServiceImpl<TaTemporaryLicenseOrderMapper, TaTemporaryLicenseOrder> implements ITaTemporaryLicenseOrderService {
19
+
20
+}

+ 20
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/impl/TaUserLicenseOrderServiceImpl.java Ver arquivo

@@ -0,0 +1,20 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4
+import com.community.huiju.dao.TaUserLicenseOrderMapper;
5
+import com.community.huiju.model.TaUserLicenseOrder;
6
+import com.community.huiju.service.ITaUserLicenseOrderService;
7
+import org.springframework.stereotype.Service;
8
+
9
+/**
10
+ * <p>
11
+ * 月租车缴费订单表 服务实现类
12
+ * </p>
13
+ *
14
+ * @author jobob
15
+ * @since 2019-05-28
16
+ */
17
+@Service
18
+public class TaUserLicenseOrderServiceImpl extends ServiceImpl<TaUserLicenseOrderMapper, TaUserLicenseOrder> implements ITaUserLicenseOrderService {
19
+
20
+}

+ 139
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/impl/TaUserServiceImpl.java Ver arquivo

@@ -0,0 +1,139 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
5
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
6
+import com.community.huiju.common.base.ResponseBean;
7
+import com.community.huiju.enums.ResponseErrorsMessages;
8
+import com.community.huiju.model.TaUser;
9
+import com.community.huiju.dao.TaUserMapper;
10
+import com.community.huiju.service.ITaUserService;
11
+import org.apache.commons.lang3.StringUtils;
12
+import org.springframework.beans.factory.annotation.Autowired;
13
+import org.springframework.stereotype.Service;
14
+import org.springframework.transaction.annotation.Transactional;
15
+
16
+import java.time.LocalDateTime;
17
+import java.util.Date;
18
+
19
+/**
20
+ * <p>
21
+ * 住户app端用户表 服务实现类
22
+ * </p>
23
+ *
24
+ * @author jobob
25
+ * @since 2019-05-15
26
+ */
27
+@Service
28
+public class TaUserServiceImpl extends ServiceImpl<TaUserMapper, TaUser> implements ITaUserService {
29
+
30
+    @Autowired
31
+    private TaUserMapper taUserMapper;
32
+
33
+    @Override
34
+    @Transactional(rollbackFor = Exception.class)
35
+    public ResponseBean addTaUser(String userName, String idCard, String gender, String phone) {
36
+        ResponseBean responseBean = new ResponseBean();
37
+
38
+        // 校验手机号 -> 是否重复
39
+        checkPhone(phone);
40
+
41
+        if (StringUtils.isBlank(userName)) {
42
+            responseBean.addError(ResponseErrorsMessages.NOT_USER_NAME.getCode(), ResponseErrorsMessages.NOT_USER_NAME.getMsg());
43
+            return responseBean;
44
+        }
45
+        if (StringUtils.isBlank(idCard)) {
46
+            responseBean.addError(ResponseErrorsMessages.NOT_ID_CARD.getCode(), ResponseErrorsMessages.NOT_ID_CARD.getMsg());
47
+            return responseBean;
48
+        }
49
+        if (StringUtils.isBlank(gender)) {
50
+            responseBean.addError(ResponseErrorsMessages.NOT_GENDER.getCode(), ResponseErrorsMessages.NOT_GENDER.getMsg());
51
+            return responseBean;
52
+        }
53
+
54
+        TaUser one = getByPhone(phone);
55
+        if (null != one) {
56
+            responseBean.addError(ResponseErrorsMessages.EXISTING_GENDER.getCode(), ResponseErrorsMessages.EXISTING_GENDER.getMsg());
57
+            return responseBean;
58
+        }
59
+
60
+        TaUser taUser = new TaUser();
61
+        taUser.setUserName(userName);
62
+        taUser.setIdCard(idCard);
63
+        taUser.setLoginName(phone);
64
+        taUser.setCreateDate(new Date());
65
+
66
+        boolean saveBool = this.save(taUser);
67
+        if (saveBool) {
68
+            taUser.setCreateUser(taUser.getUserId());
69
+            this.updateById(taUser);
70
+            responseBean.addSuccess(taUser);
71
+        }
72
+        return responseBean;
73
+    }
74
+
75
+    private TaUser getByPhone(String phone) {
76
+        QueryWrapper<TaUser> queryWrapper = new QueryWrapper<>();
77
+        queryWrapper.eq("login_name", phone);
78
+        TaUser one = this.getOne(queryWrapper);
79
+       return one;
80
+    }
81
+
82
+    @Override
83
+    @Transactional(rollbackFor = Exception.class)
84
+    public ResponseBean updateTaUser(Integer userId, String userName, String idCard, String gender, String phone) {
85
+        ResponseBean responseBean = new ResponseBean();
86
+        TaUser user = this.getById(userId);
87
+        if (null == user) {
88
+            responseBean.addError(ResponseErrorsMessages.NOT_USER.getCode(), ResponseErrorsMessages.NOT_USER.getMsg());
89
+            return responseBean;
90
+        }
91
+
92
+        TaUser one = getByPhone(phone);
93
+        if (null != one) {
94
+            responseBean.addError(ResponseErrorsMessages.EXISTING_GENDER.getCode(), ResponseErrorsMessages.EXISTING_GENDER.getMsg());
95
+            return responseBean;
96
+        }
97
+
98
+        UpdateWrapper<TaUser> userUpdateWrapper = new UpdateWrapper<>();
99
+        userUpdateWrapper.eq("id", userId);
100
+        userUpdateWrapper.set(StringUtils.isNotBlank(userName), "user_name", userName);
101
+        userUpdateWrapper.set(StringUtils.isNotBlank(idCard), "id_card", idCard);
102
+        userUpdateWrapper.set(StringUtils.isNotBlank(gender), "gender", gender);
103
+        userUpdateWrapper.set(StringUtils.isNotBlank(phone), "login_name", phone);
104
+        userUpdateWrapper.set("update_user", userId);
105
+        userUpdateWrapper.set("update_date", new Date());
106
+
107
+        this.update(userUpdateWrapper);
108
+        user = this.getById(userId);
109
+        responseBean.addSuccess(user);
110
+        return responseBean;
111
+    }
112
+
113
+    @Override
114
+    public ResponseBean getTaUser(Integer userId) {
115
+        ResponseBean responseBean = new ResponseBean();
116
+        TaUser user = this.getById(userId);
117
+        if (null == user) {
118
+            responseBean.addError(ResponseErrorsMessages.NOT_USER.getCode(), ResponseErrorsMessages.NOT_USER.getMsg());
119
+            return responseBean;
120
+        }
121
+
122
+        responseBean.addSuccess(user);
123
+        return responseBean;
124
+    }
125
+
126
+    @Override
127
+    public ResponseBean getTaUserByPhone(String phone) {
128
+        ResponseBean responseBean = new ResponseBean();
129
+        checkPhone(phone);
130
+        TaUser user = getByPhone(phone);
131
+        if (null == user) {
132
+            responseBean.addError(ResponseErrorsMessages.NOT_USER.getCode(), ResponseErrorsMessages.NOT_USER.getMsg());
133
+            return responseBean;
134
+        }
135
+
136
+        responseBean.addSuccess(user);
137
+        return responseBean;
138
+    }
139
+}

+ 267
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/impl/TaUserVerifyServiceImpl.java Ver arquivo

@@ -0,0 +1,267 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5
+import com.community.huiju.common.base.ResponseBean;
6
+import com.community.huiju.dao.*;
7
+import com.community.huiju.enums.ResponseErrorsMessages;
8
+import com.community.huiju.exception.WisdomException;
9
+import com.community.huiju.model.*;
10
+import com.community.huiju.service.ITaUserVerifyService;
11
+import org.apache.commons.collections.CollectionUtils;
12
+import org.apache.http.util.Asserts;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.stereotype.Service;
15
+import org.springframework.transaction.annotation.Transactional;
16
+
17
+import java.util.Date;
18
+import java.util.List;
19
+
20
+/**
21
+ * <p>
22
+ * app端用户审核表,存放用户的角色还有房产信息 服务实现类
23
+ * </p>
24
+ *
25
+ * @author jobob
26
+ * @since 2019-05-16
27
+ */
28
+@Service
29
+public class TaUserVerifyServiceImpl extends ServiceImpl<TaUserVerifyMapper, TaUserVerify> implements ITaUserVerifyService {
30
+
31
+    @Autowired
32
+    private TaUserVerifyMapper taUserVerifyMapper;
33
+
34
+    @Autowired
35
+    private TaUserMapper taUserMapper;
36
+
37
+    @Autowired
38
+    private TaSysRoleMapper taSysRoleMapper;
39
+
40
+    @Autowired
41
+    private TpPhaseMapper tpPhaseMapper;
42
+
43
+    @Autowired
44
+    private TpBuildingMapper tpBuildingMapper;
45
+
46
+    @Autowired
47
+    private TpUnitMapper tpUnitMapper;
48
+
49
+    @Autowired
50
+    private TpLevelMapper tpLevelMapper;
51
+
52
+    @Autowired
53
+    private TpRoomNoMapper tpRoomNoMapper;
54
+
55
+    @Autowired
56
+    private TpBuildingOwnerInfoMapper tpBuildingOwnerInfoMapper;
57
+
58
+    @Override
59
+    @Transactional(rollbackFor = Exception.class)
60
+    public ResponseBean addUserVerify(Integer userId, Integer roleId, Integer communityId, Integer phaseId, Integer buildingId, Integer unitId, Integer levelId, Integer roomNoId) {
61
+        ResponseBean responseBean = new ResponseBean();
62
+
63
+        TaUser taUser = taUserMapper.selectById(userId);
64
+        if (null == taUser) {
65
+            responseBean.addError(ResponseErrorsMessages.NOT_USER.getCode(), ResponseErrorsMessages.NOT_USER.getMsg());
66
+            return responseBean;
67
+        }
68
+
69
+        TaSysRole taSysRole = taSysRoleMapper.selectById(roleId);
70
+        if (null == taSysRole) {
71
+            responseBean.addError(ResponseErrorsMessages.NO_ROLE.getCode(), ResponseErrorsMessages.NO_ROLE.getMsg());
72
+            return responseBean;
73
+        }
74
+
75
+        QueryWrapper<TpPhase> phaseQueryWrapper = new QueryWrapper<>();
76
+        phaseQueryWrapper.eq("community_id", communityId);
77
+        phaseQueryWrapper.eq("id", phaseId);
78
+        TpPhase tpPhase = tpPhaseMapper.selectOne(phaseQueryWrapper);
79
+        if (null == tpPhase) {
80
+            responseBean.addError(ResponseErrorsMessages.NO_PHASE.getCode(), ResponseErrorsMessages.NO_PHASE.getMsg());
81
+            return responseBean;
82
+        }
83
+
84
+        QueryWrapper<TpBuilding> buildingQueryWrapper = new QueryWrapper<>();
85
+        buildingQueryWrapper.eq("community_id", communityId);
86
+        buildingQueryWrapper.eq("phase_id", phaseId);
87
+        buildingQueryWrapper.eq("id", buildingId);
88
+        TpBuilding tpBuilding = tpBuildingMapper.selectOne(buildingQueryWrapper);
89
+        if (null == tpBuilding) {
90
+            responseBean.addError(ResponseErrorsMessages.NO_BUILDING.getCode(), ResponseErrorsMessages.NO_BUILDING.getMsg());
91
+            return responseBean;
92
+        }
93
+
94
+        QueryWrapper<TpUnit> unitQueryWrapper = new QueryWrapper<>();
95
+        unitQueryWrapper.eq("community_id", communityId);
96
+        unitQueryWrapper.eq("phase_id", phaseId);
97
+        unitQueryWrapper.eq("building_id", buildingId);
98
+        unitQueryWrapper.eq("id", unitId);
99
+        TpUnit tpUnit = tpUnitMapper.selectOne(unitQueryWrapper);
100
+        if (null == tpUnit) {
101
+            responseBean.addError(ResponseErrorsMessages.NO_UNIT.getCode(), ResponseErrorsMessages.NO_UNIT.getMsg());
102
+            return responseBean;
103
+        }
104
+
105
+        QueryWrapper<TpLevel> levelQueryWrapper = new QueryWrapper<>();
106
+        levelQueryWrapper.eq("community_id", communityId);
107
+        levelQueryWrapper.eq("phase_id", phaseId);
108
+        levelQueryWrapper.eq("building_id", buildingId);
109
+        levelQueryWrapper.eq("unit_id", unitId);
110
+        levelQueryWrapper.eq("id", levelId);
111
+        TpLevel tpLevel = tpLevelMapper.selectOne(levelQueryWrapper);
112
+        if (null == tpLevel) {
113
+            responseBean.addError(ResponseErrorsMessages.NO_LEVEL.getCode(), ResponseErrorsMessages.NO_LEVEL.getMsg());
114
+            return responseBean;
115
+        }
116
+
117
+        QueryWrapper<TpRoomNo> roomNoQueryWrapper = new QueryWrapper<>();
118
+        roomNoQueryWrapper.eq("community_id", communityId);
119
+        roomNoQueryWrapper.eq("phase_id", phaseId);
120
+        roomNoQueryWrapper.eq("building_id", buildingId);
121
+        roomNoQueryWrapper.eq("unit_id", unitId);
122
+        roomNoQueryWrapper.eq("level_id", levelId);
123
+        roomNoQueryWrapper.eq("id", roomNoId);
124
+        TpRoomNo tpRoomNo = tpRoomNoMapper.selectOne(roomNoQueryWrapper);
125
+        if (null == tpRoomNo) {
126
+            responseBean.addError(ResponseErrorsMessages.NO_ROOM_NO.getCode(), ResponseErrorsMessages.NO_ROOM_NO.getMsg());
127
+            return responseBean;
128
+        }
129
+
130
+
131
+        // 校验身份
132
+        verifyBuidingRole(userId, roleId, true,communityId, phaseId, buildingId, unitId, levelId, roomNoId);
133
+
134
+        // 插入房产审核表,默认审核通过
135
+        TaUserVerify taUserVerify = new TaUserVerify();
136
+        taUserVerify.setUserId(taUser.getUserId());
137
+        taUserVerify.setCommunityId(communityId);
138
+        taUserVerify.setRoleId(taSysRole.getRoleId());
139
+        taUserVerify.setPhaseId(tpPhase.getPhaseId());
140
+        taUserVerify.setPhaseName(tpPhase.getName());
141
+        taUserVerify.setBuildingId(tpBuilding.getBuildingId());
142
+        taUserVerify.setBuildingName(tpBuilding.getName());
143
+        taUserVerify.setUnitId(tpUnit.getUnitId());
144
+        taUserVerify.setUnitName(tpUnit.getName());
145
+        taUserVerify.setLevelId(tpLevel.getLevelId());
146
+        taUserVerify.setLevelName(tpLevel.getName());
147
+        taUserVerify.setRoomNoId(tpRoomNo.getRoomNoId());
148
+        taUserVerify.setRoomNoName(tpRoomNo.getName());
149
+        taUserVerify.setVerifyStatus("1");
150
+        taUserVerify.setCreateDate(new Date());
151
+        taUserVerify.setVerifyName("大苏");
152
+
153
+        taUserVerifyMapper.insert(taUserVerify);
154
+
155
+        // 开始插入 楼栋资料库
156
+        TpBuildingOwnerInfo tpBuildingOwnerInfo = new TpBuildingOwnerInfo();
157
+        tpBuildingOwnerInfo.setCommunityId(communityId);
158
+        tpBuildingOwnerInfo.setPhaseId(tpPhase.getPhaseId());
159
+        tpBuildingOwnerInfo.setPhaseName(tpPhase.getName());
160
+        tpBuildingOwnerInfo.setBuildingId(tpBuilding.getBuildingId());
161
+        tpBuildingOwnerInfo.setBuildingName(tpBuilding.getName());
162
+        tpBuildingOwnerInfo.setUnitId(tpUnit.getUnitId());
163
+        tpBuildingOwnerInfo.setUnitName(tpUnit.getName());
164
+        tpBuildingOwnerInfo.setLevelId(tpLevel.getLevelId());
165
+        tpBuildingOwnerInfo.setLevelName(tpLevel.getName());
166
+        tpBuildingOwnerInfo.setRoomNoId(tpRoomNo.getRoomNoId());
167
+        tpBuildingOwnerInfo.setRoomNoName(tpRoomNo.getName());
168
+        tpBuildingOwnerInfo.setOwnerName(taUser.getUserName());
169
+        tpBuildingOwnerInfo.setOwnerTel(taUser.getLoginName());
170
+        tpBuildingOwnerInfo.setGender(taUser.getGender());
171
+        tpBuildingOwnerInfo.setPairStatus("1");
172
+        tpBuildingOwnerInfo.setVerifyStatus("1");
173
+        tpBuildingOwnerInfo.setCreateDate(new Date());
174
+        // tpBuildingOwnerInfo.setCreateUser(taUser.getUserId());
175
+        tpBuildingOwnerInfo.setTaUserVerifyId(taUserVerify.getUserVerifyId());
176
+
177
+        tpBuildingOwnerInfoMapper.insert(tpBuildingOwnerInfo);
178
+
179
+        responseBean.addSuccess(taUserVerify);
180
+        return responseBean;
181
+    }
182
+
183
+    /**
184
+     * 检查房产是否存在业主
185
+     * 检查这个用户是否在这个房产存在合法角色
186
+     *
187
+     * @param userId
188
+     * @param roleId
189
+     * @param hasOwner 是否执行业主校验
190
+     * @param communityId
191
+     * @param phaseId
192
+     * @param buildingId
193
+     * @param unitId
194
+     * @param levelId
195
+     * @param roomNoId
196
+     */
197
+    private void verifyBuidingRole(Integer userId, Integer roleId, boolean hasOwner, Integer communityId, Integer phaseId, Integer buildingId, Integer unitId, Integer levelId, Integer roomNoId){
198
+        if (roleId == 1 && hasOwner) {
199
+            // 查询这个房产是否存在业主
200
+            TaUserVerify userVerify = taUserVerifyMapper.selectCommunityAndAddress(communityId, phaseId, buildingId, unitId, levelId, roomNoId);
201
+            if (null != userVerify) {
202
+                throw new WisdomException(ResponseErrorsMessages.EXIST_OWNER.getCode(), ResponseErrorsMessages.EXIST_OWNER.getMsg());
203
+            }
204
+        }
205
+
206
+        List<TaUserVerify> userVerifyList = taUserVerifyMapper.selectAddress(userId, communityId, phaseId, buildingId, unitId, levelId, roomNoId);
207
+        if (CollectionUtils.isNotEmpty(userVerifyList) && userVerifyList.size() > 0) {
208
+            throw new WisdomException(ResponseErrorsMessages.EXIST_BUIDDING_ROLE.getCode(), ResponseErrorsMessages.EXIST_BUIDDING_ROLE.getMsg());
209
+        }
210
+    }
211
+
212
+    @Override
213
+    @Transactional(rollbackFor = Exception.class)
214
+    public ResponseBean deleteUserVerify(Integer userId, Integer userVerifyId) {
215
+        ResponseBean responseBean = new ResponseBean();
216
+
217
+        // 判断用户是否存在
218
+        // 判断是否是这个用户关联房产
219
+        // 删除楼栋资料库
220
+
221
+        TaUser taUser = taUserMapper.selectById(userId);
222
+        if (null == taUser) {
223
+            responseBean.addError(ResponseErrorsMessages.NOT_USER.getCode(), ResponseErrorsMessages.NOT_USER.getMsg());
224
+            return responseBean;
225
+        }
226
+
227
+        TaUserVerify hasUserVerify = taUserVerifyMapper.selectByUserIdAndUserVerifyId(userId, userVerifyId);
228
+        if (null == hasUserVerify) {
229
+            responseBean.addError(ResponseErrorsMessages.NOT_USER_VERIFY.getCode(), ResponseErrorsMessages.NOT_USER_VERIFY.getMsg());
230
+            return responseBean;
231
+        }
232
+
233
+        this.removeById(userVerifyId);
234
+
235
+        QueryWrapper<TpBuildingOwnerInfo> buildingOwnerInfoQueryWrapper = new QueryWrapper<>();
236
+        buildingOwnerInfoQueryWrapper.eq("ta_user_verify_id", userVerifyId);
237
+        tpBuildingOwnerInfoMapper.delete(buildingOwnerInfoQueryWrapper);
238
+
239
+        responseBean.addSuccess("操作成功!");
240
+        return responseBean;
241
+    }
242
+
243
+    @Override
244
+    public ResponseBean getUserVerifyByUserIdAndCommunityId(Integer userId, Integer communityId) {
245
+        ResponseBean responseBean = new ResponseBean();
246
+        QueryWrapper<TaUserVerify> taUserVerifyQueryWrapper = new QueryWrapper<>();
247
+        taUserVerifyQueryWrapper.eq("community_id", communityId);
248
+        taUserVerifyQueryWrapper.eq("user_id", userId);
249
+        List<TaUserVerify> list = this.list(taUserVerifyQueryWrapper);
250
+        responseBean.addSuccess(list);
251
+        return responseBean;
252
+    }
253
+
254
+
255
+    @Override
256
+    public ResponseBean getUserVerifyByByUserIdAndUserVerifyId(Integer userId, Integer userVerifyId) {
257
+        ResponseBean responseBean = new ResponseBean();
258
+        TaUserVerify hasUserVerify = taUserVerifyMapper.selectByUserIdAndUserVerifyId(userId, userVerifyId);
259
+        if (null == hasUserVerify) {
260
+            responseBean.addError(ResponseErrorsMessages.NOT_USER_VERIFY.getCode(), ResponseErrorsMessages.NOT_USER_VERIFY.getMsg());
261
+            return responseBean;
262
+        }
263
+
264
+        responseBean.addSuccess(hasUserVerify);
265
+        return responseBean;
266
+    }
267
+}

+ 20
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/impl/TpBuildingOwnerInfoServiceImpl.java Ver arquivo

@@ -0,0 +1,20 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4
+import com.community.huiju.model.TpBuildingOwnerInfo;
5
+import com.community.huiju.dao.TpBuildingOwnerInfoMapper;
6
+import com.community.huiju.service.ITpBuildingOwnerInfoService;
7
+import org.springframework.stereotype.Service;
8
+
9
+/**
10
+ * <p>
11
+ * 楼栋业主资料信息表(户号信息也在里面相当于tp_room_no   PS:共用一张表) 服务实现类
12
+ * </p>
13
+ *
14
+ * @author jobob
15
+ * @since 2019-05-16
16
+ */
17
+@Service
18
+public class TpBuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInfoMapper, TpBuildingOwnerInfo> implements ITpBuildingOwnerInfoService {
19
+
20
+}

+ 36
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/impl/TpBuildingServiceImpl.java Ver arquivo

@@ -0,0 +1,36 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5
+import com.community.huiju.common.base.ResponseBean;
6
+import com.community.huiju.model.TpBuilding;
7
+import com.community.huiju.dao.TpBuildingMapper;
8
+import com.community.huiju.service.ITpBuildingService;
9
+import org.springframework.stereotype.Service;
10
+
11
+import java.util.List;
12
+
13
+/**
14
+ * <p>
15
+ * 小区楼栋资料表 服务实现类
16
+ * </p>
17
+ *
18
+ * @author jobob
19
+ * @since 2019-05-15
20
+ */
21
+@Service
22
+public class TpBuildingServiceImpl extends ServiceImpl<TpBuildingMapper, TpBuilding> implements ITpBuildingService {
23
+
24
+
25
+    @Override
26
+    public ResponseBean getBuilding(Integer communityId, Integer phaseId) {
27
+        ResponseBean responseBean = new ResponseBean();
28
+
29
+        QueryWrapper<TpBuilding> buildingQueryWrapper = new QueryWrapper<>();
30
+        buildingQueryWrapper.eq("community_id", communityId);
31
+        buildingQueryWrapper.eq("phase_id", phaseId);
32
+        List<TpBuilding> list = this.list(buildingQueryWrapper);
33
+        responseBean.addSuccess(list);
34
+        return responseBean;
35
+    }
36
+}

+ 20
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/impl/TpConfigurationServiceImpl.java Ver arquivo

@@ -0,0 +1,20 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
4
+import com.community.huiju.model.TpConfiguration;
5
+import com.community.huiju.dao.TpConfigurationMapper;
6
+import com.community.huiju.service.ITpConfigurationService;
7
+import org.springframework.stereotype.Service;
8
+
9
+/**
10
+ * <p>
11
+ * 设备配置表 服务实现类
12
+ * </p>
13
+ *
14
+ * @author jobob
15
+ * @since 2019-05-16
16
+ */
17
+@Service
18
+public class TpConfigurationServiceImpl extends ServiceImpl<TpConfigurationMapper, TpConfiguration> implements ITpConfigurationService {
19
+
20
+}

+ 0
- 0
CODE/foreign-service/src/main/java/com/community/huiju/service/impl/TpEquipmentServiceImpl.java Ver arquivo


Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff