瀏覽代碼

Merge branch 'branch-nt-1.0.0' into branch-nt-1.0.1

humuyu 3 年之前
父節點
當前提交
058801f90b
共有 54 個文件被更改,包括 1712 次插入774 次删除
  1. 5 1
      eladmin-security/src/main/java/me/zhengjie/security/security/TokenProvider.java
  2. 84 0
      eladmin-sign/pom.xml
  3. 253 0
      eladmin-sign/src/main/java/me/zhengjie/sign/connector/HttpClient.java
  4. 202 0
      eladmin-sign/src/main/java/me/zhengjie/sign/connector/HttpConnector.java
  5. 13 0
      eladmin-sign/src/main/java/me/zhengjie/sign/constant/MIMEType.java
  6. 9 0
      eladmin-sign/src/main/java/me/zhengjie/sign/constant/Request.java
  7. 5 0
      eladmin-sign/src/main/java/me/zhengjie/sign/constant/SystemConst.java
  8. 38 0
      eladmin-sign/src/main/java/me/zhengjie/sign/converter/JsonObjectMapper.java
  9. 130 0
      eladmin-sign/src/main/java/me/zhengjie/sign/util/CommonUtil.java
  10. 97 0
      eladmin-sign/src/main/java/me/zhengjie/sign/util/PdfUtil.java
  11. 161 0
      eladmin-sign/src/main/java/me/zhengjie/sign/util/SecurityUtil.java
  12. 38 0
      eladmin-sign/src/main/java/me/zhengjie/sign/util/TimeUtil.java
  13. 二進制
      eladmin-sign/src/main/resources/anxinqian.jks
  14. 二進制
      eladmin-sign/src/main/resources/anxinsign-test.jks
  15. 6 48
      eladmin-system/pom.xml
  16. 14 83
      eladmin-system/src/main/java/me/zhengjie/application/admin/controller/DemoController.java
  17. 1 0
      eladmin-system/src/main/java/me/zhengjie/application/admin/controller/vo/OrderDetailDto.java
  18. 3 4
      eladmin-system/src/main/java/me/zhengjie/application/admin/job/GenerateNotarizationJob.java
  19. 0 20
      eladmin-system/src/main/java/me/zhengjie/application/admin/service/impl/NotaryNoteServiceImpl.java
  20. 10 22
      eladmin-system/src/main/java/me/zhengjie/application/admin/service/impl/NotaryOfficeServiceImpl.java
  21. 14 5
      eladmin-system/src/main/java/me/zhengjie/application/admin/service/impl/OrderCochainServiceImpl.java
  22. 25 4
      eladmin-system/src/main/java/me/zhengjie/application/admin/service/impl/SmsTemplateServiceImpl.java
  23. 11 23
      eladmin-system/src/main/java/me/zhengjie/application/admin/service/impl/UserServiceImpl.java
  24. 13 1
      eladmin-system/src/main/java/me/zhengjie/application/bank/controller/BankLoginController.java
  25. 2 1
      eladmin-system/src/main/java/me/zhengjie/application/bank/controller/BankNotarizeController.java
  26. 2 1
      eladmin-system/src/main/java/me/zhengjie/application/bank/controller/BankNoteVideoController.java
  27. 41 0
      eladmin-system/src/main/java/me/zhengjie/application/bank/controller/BankUserController.java
  28. 2 2
      eladmin-system/src/main/java/me/zhengjie/application/bank/controller/vo/BankOrderVO.java
  29. 9 0
      eladmin-system/src/main/java/me/zhengjie/application/bank/controller/vo/BankUserPwdVO.java
  30. 1 42
      eladmin-system/src/main/java/me/zhengjie/application/bank/mq/RedisReceiver.java
  31. 8 0
      eladmin-system/src/main/java/me/zhengjie/application/bank/service/BankLoginService.java
  32. 10 0
      eladmin-system/src/main/java/me/zhengjie/application/bank/service/BankUserService.java
  33. 4 0
      eladmin-system/src/main/java/me/zhengjie/application/bank/service/impl/BankLoginServiceImpl.java
  34. 15 4
      eladmin-system/src/main/java/me/zhengjie/application/bank/service/impl/BankOrderServiceImpl.java
  35. 49 0
      eladmin-system/src/main/java/me/zhengjie/application/bank/service/impl/BankUserServiceImpl.java
  36. 27 30
      eladmin-system/src/main/java/me/zhengjie/application/bank/service/impl/UserAXQInfoServiceImpl.java
  37. 40 58
      eladmin-system/src/main/java/me/zhengjie/base/util/CFCACertUtil.java
  38. 7 35
      eladmin-system/src/main/java/me/zhengjie/base/util/EQBServiceUtil.java
  39. 0 242
      eladmin-system/src/main/java/me/zhengjie/base/util/HttpConnector.java
  40. 54 81
      eladmin-system/src/main/java/me/zhengjie/base/util/HttpUtil.java
  41. 18 0
      eladmin-system/src/main/java/me/zhengjie/dao/mybatis/OrderFileRepository.java
  42. 9 0
      eladmin-system/src/main/java/me/zhengjie/dao/mybatis/UserAXQInfoRepository.java
  43. 4 0
      eladmin-system/src/main/java/me/zhengjie/dao/mybatis/entity/ContractOrderEntity.java
  44. 3 0
      eladmin-system/src/main/java/me/zhengjie/dao/mybatis/entity/UserAXQInfoEntity.java
  45. 153 31
      eladmin-system/src/main/java/me/zhengjie/domain/model/ModelSynthesizerDomain.java
  46. 0 16
      eladmin-system/src/main/resources/cfca.properties
  47. 23 1
      eladmin-system/src/main/resources/config/application-prod.yml
  48. 23 1
      eladmin-system/src/main/resources/config/application-test.yml
  49. 28 6
      eladmin-system/src/main/resources/config/application-nt-pre.yml
  50. 23 1
      eladmin-system/src/main/resources/config/application-nt-test.yml
  51. 23 1
      eladmin-system/src/main/resources/config/application-nt.yml
  52. 1 6
      eladmin-system/src/main/resources/config/application.yml
  53. 0 4
      eladmin-system/src/main/resources/proxy.properties
  54. 1 0
      pom.xml

+ 5 - 1
eladmin-security/src/main/java/me/zhengjie/security/security/TokenProvider.java

@@ -78,7 +78,7 @@ public class TokenProvider implements InitializingBean {
 	/**
 	/**
 	 * 创建Token 设置永不过期, Token 的时间有效性转到Redis 维护
 	 * 创建Token 设置永不过期, Token 的时间有效性转到Redis 维护
 	 *
 	 *
-	 * @param authentication /
+	 * @param userName /
 	 * @return /
 	 * @return /
 	 */
 	 */
 	public String appToken(String userName) {
 	public String appToken(String userName) {
@@ -98,6 +98,10 @@ public class TokenProvider implements InitializingBean {
 		return redisUtils.get(key);
 		return redisUtils.get(key);
 	}
 	}
 
 
+	public void delToken(String token) {
+		redisUtils.del(token);
+	}
+
 	/**
 	/**
 	 * 依据Token 获取鉴权信息
 	 * 依据Token 获取鉴权信息
 	 *
 	 *

+ 84 - 0
eladmin-sign/pom.xml

@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>eladmin</artifactId>
+        <groupId>me.zhengjie</groupId>
+        <version>2.6</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>eladmin-sign</artifactId>
+    <name>签名模块</name>
+
+    <properties>
+        <jackson.version>2.11.1</jackson.version>
+        <dateformat.version>2.6.7</dateformat.version>
+        <cfca.common.version>3.7.5.3</cfca.common.version>
+        <cfca.sadk.version>3.7.1.0</cfca.sadk.version>
+        <cfca.logback.version>4.2.1.0</cfca.logback.version>
+        <cfca.paperless.version>3.0.2.1</cfca.paperless.version>
+        <cfca.SealSADK7.version>5.8.2.1</cfca.SealSADK7.version>
+        <cfca.SealSADK.version>3.1.4.0</cfca.SealSADK.version>
+        <cfca.timestampAPI.version>4.2.2.0</cfca.timestampAPI.version>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-annotations</artifactId>
+            <version>${jackson.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-core</artifactId>
+            <version>${jackson.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-databind</artifactId>
+            <version>${jackson.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.dataformat</groupId>
+            <artifactId>jackson-dataformat-cbor</artifactId>
+            <version>${dateformat.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>cfca.trustsign</groupId>
+            <artifactId>common</artifactId>
+            <version>${cfca.common.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>cfca.sadk</groupId>
+            <artifactId>sadk</artifactId>
+            <version>${cfca.sadk.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>cfca.sadk</groupId>
+            <artifactId>logback</artifactId>
+            <version>${cfca.logback.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>cfca.sadk</groupId>
+            <artifactId>paperless</artifactId>
+            <version>${cfca.paperless.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>cfca.sadk</groupId>
+            <artifactId>SealSADK7</artifactId>
+            <version>${cfca.SealSADK7.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>cfca.sadk</groupId>
+            <artifactId>SealSADK</artifactId>
+            <version>${cfca.SealSADK.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>cfca.sadk</groupId>
+            <artifactId>timestampAPI</artifactId>
+            <version>${cfca.timestampAPI.version}</version>
+        </dependency>
+    </dependencies>
+</project>

+ 253 - 0
eladmin-sign/src/main/java/me/zhengjie/sign/connector/HttpClient.java

@@ -0,0 +1,253 @@
+package me.zhengjie.sign.connector;
+
+import me.zhengjie.sign.constant.Request;
+import me.zhengjie.sign.util.CommonUtil;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import javax.net.ssl.*;
+import java.io.*;
+import java.net.*;
+import java.security.GeneralSecurityException;
+import java.security.KeyStore;
+import java.security.SecureRandom;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Optional;
+
+@Component
+public class HttpClient {
+    @Value("${axq.proxy.port}")
+    private String proxyPort;
+    @Value("${axq.proxy.host}")
+    private String proxyHost;
+    @Value("${axq.proxy.user}")
+    private String authUser;
+    @Value("${axq.proxy.password}")
+    private String authPassword;
+    @Value("${axq.proxy.usable}")
+    private String isProxyUsed;
+
+    public static final String PREFIX = "--", LINEND = "\r\n", DEFAULT_CHARSET = "UTF-8";
+    public static final int DEFAULT_BUFFER_SIZE = 2048, DEFAULT_FILE_BUFFER_SIZE = 10 * 1024, DEFAULT_CONNECT_TIMEOUT = 3000, DEFAULT_READ_TIMEOUT = 15000;
+
+    public static final String DEFAULT_SSL_PROTOCOL = "TLSv1.2", DEFAULT_HTTP_USER_AGENT = "client", DEFAULT_HTTP_CONNECTION = "close",
+            DEFAULT_HTTP_CONTENT_TYPE = "text/plain", DEFAULT_HTTP_ACCEPT = "text/plain";
+
+    public static final String DEFAULT_KEY_ALGORITHM = KeyManagerFactory.getDefaultAlgorithm(), DEFAULT_KEY_STORE_TYPE = KeyStore.getDefaultType(),
+            DEFAULT_TRUST_ALGORITHM = TrustManagerFactory.getDefaultAlgorithm(), DEFAULT_TRUST_STORE_TYPE = KeyStore.getDefaultType();
+
+    private static HostnameVerifier ignoreHostnameVerifier = new HostnameVerifier() {
+        @Override
+        public boolean verify(String hostname, SSLSession session) {
+            return true;
+        }
+    };
+
+    public Config config = new Config();
+    public SSLConfig sslConfig = new SSLConfig();
+    public HttpConfig httpConfig = new HttpConfig();
+
+    private SSLSocketFactory sslSocketFactory;
+
+    public void initSSL(String keyStorePath, char[] keyStorePassword, String trustStorePath, char[] trustStorePassword)
+            throws GeneralSecurityException, IOException {
+        KeyManagerFactory keyManagerFactory = null;
+        KeyStore keyStore = null;
+        if (CommonUtil.isEmpty(sslConfig.keyProvider)) {
+            keyManagerFactory = KeyManagerFactory.getInstance(sslConfig.keyAlgorithm);
+            if (CommonUtil.isNotEmpty(sslConfig.keyStoreType)) {
+                keyStore = KeyStore.getInstance(sslConfig.keyStoreType);
+            }
+        } else {
+            keyManagerFactory = KeyManagerFactory.getInstance(sslConfig.keyAlgorithm, sslConfig.keyProvider);
+            if (CommonUtil.isNotEmpty(sslConfig.keyStoreType)) {
+                keyStore = KeyStore.getInstance(sslConfig.keyStoreType, sslConfig.keyProvider);
+            }
+        }
+        if (CommonUtil.isEmpty(keyStorePath)) {
+            keyManagerFactory.init(keyStore, keyStorePassword);
+        } else {
+            try (FileInputStream fileInputStream = new FileInputStream(keyStorePath)) {
+                keyStore.load(fileInputStream, keyStorePassword);
+                keyManagerFactory.init(keyStore, keyStorePassword);
+            }
+        }
+
+        TrustManagerFactory trustManagerFactory = null;
+        KeyStore trustStore = null;
+        if (CommonUtil.isEmpty(sslConfig.trustProvider)) {
+            trustManagerFactory = TrustManagerFactory.getInstance(sslConfig.trustAlgorithm);
+            if (CommonUtil.isNotEmpty(sslConfig.trustStoreType)) {
+                trustStore = KeyStore.getInstance(sslConfig.trustStoreType);
+            }
+        } else {
+            trustManagerFactory = TrustManagerFactory.getInstance(sslConfig.trustAlgorithm, sslConfig.trustProvider);
+            if (CommonUtil.isNotEmpty(sslConfig.trustStoreType)) {
+                trustStore = KeyStore.getInstance(sslConfig.trustStoreType, sslConfig.trustProvider);
+            }
+        }
+        if (CommonUtil.isEmpty(trustStorePath)) {
+            trustManagerFactory.init(trustStore);
+        } else {
+            try (FileInputStream fileInputStream = new FileInputStream(trustStorePath)) {
+                trustStore.load(fileInputStream, trustStorePassword);
+                trustManagerFactory.init(trustStore);
+            }
+        }
+
+        SSLContext sslContext = CommonUtil.isEmpty(sslConfig.sslProvider) ? SSLContext.getInstance(sslConfig.sslProtocol)
+                : SSLContext.getInstance(sslConfig.sslProtocol, sslConfig.sslProvider);
+        sslContext.init(keyManagerFactory.getKeyManagers(), trustManagerFactory.getTrustManagers(), new SecureRandom());
+        sslSocketFactory = sslContext.getSocketFactory();
+    }
+
+    public HttpURLConnection connect(String url, String method) throws IOException {
+        System.out.println("url:" + url);
+        HttpURLConnection connection = null;
+        if(Request.PROXY_IN_USED.equals(isProxyUsed)){
+            Authenticator.setDefault(new MyAuthenticator(authUser,authPassword));
+            SocketAddress sa = new InetSocketAddress(proxyHost,Integer.parseInt(proxyPort));
+            Proxy proxy = new Proxy(Proxy.Type.HTTP, sa);
+            connection = (HttpURLConnection) new URL(url).openConnection(proxy);
+        }else{
+            connection = (HttpURLConnection) new URL(url).openConnection();
+        }
+        if (sslSocketFactory != null) {
+            HttpsURLConnection httpsConn = (HttpsURLConnection) connection;
+            httpsConn.setSSLSocketFactory(sslSocketFactory);
+            if (sslConfig.ignoreHostname) {
+                httpsConn.setHostnameVerifier(ignoreHostnameVerifier);
+            }
+        }
+        connection.setConnectTimeout(config.connectTimeout);
+        connection.setReadTimeout(config.readTimeout);
+        connection.setDoInput(true);
+        connection.setDoOutput(true);
+        connection.setUseCaches(false);
+        connection.setRequestMethod(method);
+        connection.setRequestProperty("User-Agent", httpConfig.userAgent);
+        connection.setRequestProperty("Connection", httpConfig.connection);
+        connection.setRequestProperty("Content-Type", httpConfig.contentType + ";charset=" + config.charset);
+        connection.setRequestProperty("Accept", httpConfig.accept);
+        connection.setRequestProperty("Accept-Charset", config.charset);
+        return connection;
+    }
+
+    public int send(HttpURLConnection connection, byte[] requestData) throws IOException {
+        if (requestData != null) {
+            connection.setFixedLengthStreamingMode(requestData.length);
+            connection.connect();
+            OutputStream outputStream = connection.getOutputStream();
+            outputStream.write(requestData);
+            outputStream.flush();
+        } else {
+            connection.connect();
+        }
+        return connection.getResponseCode();
+    }
+
+    public int sendFile(HttpURLConnection connection, Map<String, String> paramMap, InputStream is, String fileName, String contentType) throws IOException {
+        if (CommonUtil.isNotEmpty(paramMap)) {
+            String BOUNDARY = java.util.UUID.randomUUID().toString();
+            connection.setRequestProperty("Connection", DEFAULT_HTTP_CONNECTION);
+            connection.setRequestProperty("Charsert", DEFAULT_CHARSET);
+            connection.setRequestProperty("Content-Type", "multipart/form-data;boundary=" + BOUNDARY);
+
+            DataOutputStream os = new DataOutputStream(connection.getOutputStream());
+            for (Entry<String, String> entry : paramMap.entrySet()) {
+                addTextBody(entry.getKey(), entry.getValue(), BOUNDARY, os);
+            }
+
+            if (is != null) {
+                addBinaryBody(Request.CONTRACT_FILE, fileName, contentType, BOUNDARY, is, os);
+            }
+
+            byte[] end_data = CommonUtil.getBytes(PREFIX + BOUNDARY + PREFIX + LINEND);
+            os.write(end_data);
+            os.flush();
+        } else {
+            connection.connect();
+        }
+        return connection.getResponseCode();
+    }
+
+    private void addTextBody(String name, String text, String BOUNDARY, DataOutputStream os) throws IOException {
+        StringBuilder sb = new StringBuilder(PREFIX).append(BOUNDARY).append(LINEND);
+        sb.append("Content-Disposition: form-data; name=\"").append(name).append("\"").append(LINEND);
+        sb.append(LINEND).append(text).append(LINEND);
+        os.write(CommonUtil.getBytes(sb.toString()));
+    }
+
+    private void addBinaryBody(String name, String fileName, String contentType, String BOUNDARY, InputStream is, DataOutputStream os) throws IOException {
+        StringBuilder sb = new StringBuilder(PREFIX).append(BOUNDARY).append(LINEND);
+        sb.append("Content-Disposition: form-data; name=\"").append(name).append("\"; filename=\"").append(fileName).append("\"").append(LINEND);
+        sb.append("Content-Type: ").append(contentType).append(LINEND).append(LINEND);
+        os.write(CommonUtil.getBytes(sb.toString()));
+
+        byte[] buffer = new byte[DEFAULT_FILE_BUFFER_SIZE];
+        int read = -1;
+        while ((read = is.read(buffer)) != -1) {
+            os.write(buffer, 0, read);
+        }
+        os.write(CommonUtil.getBytes(LINEND));
+    }
+
+    public byte[] receive(HttpURLConnection connection) throws IOException {
+        InputStream inputStream = connection.getErrorStream();
+        if (inputStream == null) {
+            inputStream = connection.getInputStream();
+        }
+        ByteArrayOutputStream os = new ByteArrayOutputStream(config.bufferSize);
+        byte[] buffer = new byte[config.bufferSize];
+        int read = -1, length = 0;
+        while ((read = inputStream.read(buffer)) != -1) {
+            os.write(buffer, 0, read);
+            length += read;
+        }
+        System.out.println("length:" + length);
+        return os.toByteArray();
+    }
+
+    public void disconnect(HttpURLConnection connection) {
+        Optional.ofNullable(connection).ifPresent(HttpURLConnection::disconnect);
+    }
+
+    public static class Config {
+        public String charset = DEFAULT_CHARSET;
+        public int bufferSize = DEFAULT_BUFFER_SIZE;
+        public int connectTimeout = DEFAULT_CONNECT_TIMEOUT;
+        public int readTimeout = DEFAULT_READ_TIMEOUT;
+    }
+
+    public static class SSLConfig {
+        public String sslProvider = null;
+        public String sslProtocol = DEFAULT_SSL_PROTOCOL;
+        public String keyProvider = null;
+        public String keyAlgorithm = DEFAULT_KEY_ALGORITHM;
+        public String keyStoreType = DEFAULT_KEY_STORE_TYPE;
+        public String trustProvider = null;
+        public String trustAlgorithm = DEFAULT_TRUST_ALGORITHM;
+        public String trustStoreType = DEFAULT_TRUST_STORE_TYPE;
+        public boolean ignoreHostname = true;
+    }
+
+    public static class HttpConfig {
+        public String userAgent = DEFAULT_HTTP_USER_AGENT;
+        public String connection = DEFAULT_HTTP_CONNECTION;
+        public String contentType = DEFAULT_HTTP_CONTENT_TYPE;
+        public String accept = DEFAULT_HTTP_ACCEPT;
+    }
+
+    private static class MyAuthenticator extends Authenticator {
+        private String user = "";
+        private String password = "";
+        public MyAuthenticator(String user, String password) {
+            this.user = user;
+            this.password = password;
+        }
+        protected PasswordAuthentication getPasswordAuthentication() {
+            return new PasswordAuthentication(user, password.toCharArray());
+        }
+    }
+}

+ 202 - 0
eladmin-sign/src/main/java/me/zhengjie/sign/connector/HttpConnector.java

@@ -0,0 +1,202 @@
+package me.zhengjie.sign.connector;
+
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+import me.zhengjie.sign.constant.MIMEType;
+import me.zhengjie.sign.constant.Request;
+import me.zhengjie.sign.constant.SystemConst;
+import me.zhengjie.sign.util.CommonUtil;
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.net.HttpURLConnection;
+import java.net.URLEncoder;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.StandardCopyOption;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+@Component
+@Getter
+@RequiredArgsConstructor
+public class HttpConnector implements InitializingBean {
+    private final HttpClient httpClient;
+    @Value("${axq.connect.connectTimeout}")
+    private int connectTimeout;
+    @Value("${axq.connect.readTimeout}")
+    private int readTimeout;
+    @Value("${axq.connect.isSSL}")
+    private boolean isSSL;
+    @Value("${axq.request.jksPWD}")
+    private String keyStorePassword;
+    @Value("${axq.request.jksPWD}")
+    private String trustStorePassword;
+    @Value("${axq.request.cfcaURL}")
+    private String url;
+    @Value("${axq.request.channel}")
+    private String channel;
+    @Value("${axq.connect.alias}")
+    private String alias;
+    @Value("${axq.request.platID}")
+    private String platID;
+    @Value("${axq.request.jksPath}")
+    private String keyStorePath;
+    @Value("${axq.request.jksPath}")
+    private String trustStorePath;
+
+    @Override
+    public void afterPropertiesSet() throws Exception {
+        Path temp = Paths.get(new File(HttpConnector.class.getClassLoader().getResource("").getPath().concat(keyStorePath)).getAbsolutePath());
+        Files.copy(HttpClient.class.getClassLoader().getResourceAsStream(keyStorePath), temp, StandardCopyOption.REPLACE_EXISTING);
+        keyStorePath = temp.toFile().getPath();
+        trustStorePath = keyStorePath;
+        httpClient.config.connectTimeout = connectTimeout;
+        httpClient.config.readTimeout = readTimeout;
+        httpClient.httpConfig.userAgent = "TrustSign FEP";
+        httpClient.httpConfig.contentType = MIMEType.FORM;
+        httpClient.httpConfig.accept = MIMEType.JSON;
+        if (isSSL) {
+            httpClient.initSSL(keyStorePath, keyStorePassword.toCharArray(), trustStorePath, trustStorePassword.toCharArray());
+        }
+        if (!url.endsWith("/")) {
+            url += "/";
+        }
+    }
+
+    public String post(String uri, String data, String signature) {
+        return deal(uri, "POST", prepare(data, signature, null));
+    }
+
+    public String post(String uri, String data, String signature, Map<String, String> map) {
+        return deal(uri, "POST", prepare(data, signature, map));
+    }
+
+    public String post(String uri, String data, String signature, File file) {
+        return dealFile(uri, "POST", data, file, signature);
+    }
+
+    public String post(String uri, String data, String signature, InputStream file, String fileName) {
+        return dealFile(uri, "POST", data, file, fileName, signature);
+    }
+
+    public byte[] getFile(String uri) {
+        HttpURLConnection connection = null;
+        try {
+            connection = httpClient.connect(url + uri, "GET");
+
+            int responseCode = httpClient.send(connection, null);
+            System.out.println("responseCode:" + responseCode);
+            if (responseCode != 200) {
+                System.out.println(CommonUtil.getString(httpClient.receive(connection)));
+                return null;
+            }
+            return httpClient.receive(connection);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        } finally {
+            httpClient.disconnect(connection);
+        }
+    }
+
+    private String prepare(String data, String signature, Map<String, String> map) {
+        try {
+            StringBuilder request = new StringBuilder();
+            request.append(Request.CHANNEL).append("=").append(URLEncoder.encode(channel, SystemConst.DEFAULT_CHARSET));
+            if (CommonUtil.isNotEmpty(data)) {
+                request.append("&").append(Request.DATA).append("=").append(URLEncoder.encode(data, SystemConst.DEFAULT_CHARSET));
+            }
+            if (CommonUtil.isNotEmpty(signature)) {
+                request.append("&").append(Request.SIGNATURE).append("=").append(URLEncoder.encode(signature, SystemConst.DEFAULT_CHARSET));
+            }
+            // 如果要返回英文错误信息需要加上这个参数
+            // request.append("&").append(Request.LOCALE).append("=").append(URLEncoder.encode(Locale.US.toString(), SystemConst.DEFAULT_CHARSET));
+            if (CommonUtil.isNotEmpty(map)) {
+                for (Entry<String, String> pair : map.entrySet()) {
+                    request.append("&").append(pair.getKey()).append("=")
+                            .append(pair.getValue() == null ? "" : URLEncoder.encode(pair.getValue(), SystemConst.DEFAULT_CHARSET));
+                }
+            }
+            return request.toString();
+        } catch (UnsupportedEncodingException e) {
+            return null;
+        }
+    }
+
+    private String deal(String uri, String method, String request) {
+        HttpURLConnection connection = null;
+        try {
+            connection = httpClient.connect(url + uri, method);
+            int responseCode = httpClient.send(connection, request == null ? null : CommonUtil.getBytes(request));
+            System.out.println("responseCode:" + responseCode);
+            return CommonUtil.getString(httpClient.receive(connection));
+        } catch (Exception e) {
+            e.printStackTrace();
+            return e.getMessage();
+        } finally {
+            httpClient.disconnect(connection);
+        }
+    }
+
+    private String dealFile(String uri, String method, String request, File file, String signature) {
+        HttpURLConnection connection = null;
+        try (FileInputStream is = new FileInputStream(file)) {
+            connection = httpClient.connect(url + uri, method);
+            Map<String, String> paramMap = new HashMap<>(4);
+            paramMap.put(Request.DATA, request);
+            paramMap.put(Request.SIGNATURE, signature);
+            int responseCode = httpClient.sendFile(connection, paramMap, is, file.getName(), MIMEType.PDF);
+            System.out.println("responseCode:" + responseCode);
+            return CommonUtil.getString(httpClient.receive(connection));
+        } catch (Exception e) {
+            e.printStackTrace();
+            return e.getMessage();
+        } finally {
+            httpClient.disconnect(connection);
+        }
+    }
+
+    /**
+     * 处理文件流
+     *
+     * @param uri
+     * @param method
+     * @param request
+     * @param fileName
+     * @param signature
+     * @return
+     */
+    private String dealFile(String uri, String method, String request, InputStream is, String fileName, String signature) {
+        HttpURLConnection connection = null;
+        String var8;
+        try {
+            try {
+                connection = this.httpClient.connect(this.url + uri, method);
+                Map<String, String> paramMap = new HashMap<>(4);
+                paramMap.put("data", request);
+                paramMap.put("signature", signature);
+                int responseCode = this.httpClient.sendFile(connection, paramMap, is, fileName, "application/pdf");
+                System.out.println("responseCode:" + responseCode);
+                String var11 = CommonUtil.getString(this.httpClient.receive(connection));
+                return var11;
+            } catch (Throwable var29) {
+                throw var29;
+            } finally {
+                is.close();
+            }
+        } catch (Exception var31) {
+            var8 = var31.getMessage();
+        } finally {
+            httpClient.disconnect(connection);
+        }
+        return var8;
+    }
+}

+ 13 - 0
eladmin-sign/src/main/java/me/zhengjie/sign/constant/MIMEType.java

@@ -0,0 +1,13 @@
+package me.zhengjie.sign.constant;
+
+public class MIMEType {
+    public static final String FORM = "application/x-www-form-urlencoded";
+    public static final String JSON = "application/json";
+    public static final String XML = "application/xml";
+    public static final String PDF = "application/pdf";
+    public static final String HTML = "text/html";
+    public static final String PLAIN = "text/plain";
+    public static final String IMAGE = "image/*";
+    public static final String DOC = "application/msword";
+    public static final String DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
+}

+ 9 - 0
eladmin-sign/src/main/java/me/zhengjie/sign/constant/Request.java

@@ -0,0 +1,9 @@
+package me.zhengjie.sign.constant;
+
+public class Request {
+    public static final String CHANNEL = "channel";
+    public static final String DATA = "data";
+    public static final String SIGNATURE = "signature";
+    public static final String CONTRACT_FILE = "contractFile";
+    public static final String PROXY_IN_USED = "1";
+}

+ 5 - 0
eladmin-sign/src/main/java/me/zhengjie/sign/constant/SystemConst.java

@@ -0,0 +1,5 @@
+package me.zhengjie.sign.constant;
+
+public class SystemConst {
+    public static final String DEFAULT_CHARSET = "UTF-8";
+}

+ 38 - 0
eladmin-sign/src/main/java/me/zhengjie/sign/converter/JsonObjectMapper.java

@@ -0,0 +1,38 @@
+package me.zhengjie.sign.converter;
+
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializationFeature;
+
+public class JsonObjectMapper extends ObjectMapper {
+    private static final long serialVersionUID = 1L;
+
+    public JsonObjectMapper() {
+        this.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);
+        this.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
+        this.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+        this.setSerializationInclusion(Include.NON_NULL);
+    }
+
+    @Override
+    public <T> T readValue(String content, Class<T> valueType) {
+        try {
+            return super.readValue(content, valueType);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+    @Override
+    public String writeValueAsString(Object object) {
+        try {
+            return super.writeValueAsString(object);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+}

+ 130 - 0
eladmin-sign/src/main/java/me/zhengjie/sign/util/CommonUtil.java

@@ -0,0 +1,130 @@
+package me.zhengjie.sign.util;
+
+import me.zhengjie.sign.constant.SystemConst;
+
+import java.io.UnsupportedEncodingException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+public class CommonUtil {
+    private static final String MASK = "[^ -()]";
+    private static final String MASK_CHAR = "*";
+    private static final String LIKE_CHAR = "%";
+
+    public static boolean isEmpty(String str) {
+        return (str == null || str.trim().length() == 0);
+    }
+
+    public static boolean isNotEmpty(String str) {
+        return (str != null && str.trim().length() != 0);
+    }
+
+    public static boolean isEmpty(String[] strs) {
+        return (strs == null || strs.length == 0);
+    }
+
+    public static boolean isNotEmpty(String[] strs) {
+        return (strs != null && strs.length != 0);
+    }
+
+    public static <T> boolean isEmpty(List<T> list) {
+        return (list == null || list.isEmpty());
+    }
+
+    public static <T> boolean isNotEmpty(List<T> list) {
+        return (list != null && !list.isEmpty());
+    }
+
+    public static <K, V> boolean isEmpty(Map<K, V> map) {
+        return (map == null || map.isEmpty());
+    }
+
+    public static <K, V> boolean isNotEmpty(Map<K, V> map) {
+        return (map != null && !map.isEmpty());
+    }
+
+    public static <K, V> List<V> mapToList(Map<K, V> map) {
+        List<V> list = new ArrayList<V>();
+        list.addAll(map.values());
+        return list;
+    }
+
+    public static int booleanToInt(Boolean bool) {
+        return bool == null ? 0 : (bool ? 1 : 0);
+    }
+
+    public static boolean intToBoolean(Integer i) {
+        return i == null ? false : (i != 0 ? true : false);
+    }
+
+    public static Number nvl(Number obj, Number value) {
+        if (obj == null) {
+            return value;
+        } else {
+            return obj;
+        }
+    }
+
+    public static String nvl(String str, String value) {
+        if (isEmpty(str)) {
+            return value;
+        } else {
+            return str;
+        }
+    }
+
+    public static byte[] getBytes(String str) {
+        try {
+            return str.getBytes(SystemConst.DEFAULT_CHARSET);
+        } catch (UnsupportedEncodingException e) {
+            return null;
+        }
+    }
+
+    public static String getString(byte[] bytes) {
+        try {
+            return new String(bytes, SystemConst.DEFAULT_CHARSET);
+        } catch (UnsupportedEncodingException e) {
+            return null;
+        }
+    }
+
+    public static String toString(String[] strings) {
+        if (strings == null)
+            return "";
+        int iMax = strings.length - 1;
+        if (iMax == -1)
+            return "";
+
+        StringBuilder b = new StringBuilder();
+        for (int i = 0;; i++) {
+            b.append(String.valueOf(strings[i]));
+            if (i == iMax)
+                return b.toString();
+            b.append(";");
+        }
+    }
+
+    public static String mask(String str, int begin, int end) {
+        return str.substring(0, begin) + str.substring(begin, end).replaceAll(MASK, MASK_CHAR) + str.substring(end, str.length());
+    }
+
+    public static String getLikeStr(String str) {
+        return LIKE_CHAR + str + LIKE_CHAR;
+    }
+
+    public static String formatSerialNo(String serialNo) {
+        int length = serialNo.length();
+        if (length >= 30 && length < 32) {
+            char[] temp = new char[32];
+            for (int i = 0; i < 32 - length; i++) {
+                temp[i] = '0';
+            }
+            serialNo.getChars(0, length, temp, 32 - length);
+            return new String(temp);
+        } else {
+            return serialNo;
+        }
+    }
+}

+ 97 - 0
eladmin-sign/src/main/java/me/zhengjie/sign/util/PdfUtil.java

@@ -0,0 +1,97 @@
+package me.zhengjie.sign.util;
+
+import cfca.sadk.algorithm.common.PKIException;
+import cfca.sadk.com.itextpdf.kernel.color.Color;
+import cfca.sadk.lib.crypto.JCrypto;
+import cfca.sadk.lib.crypto.Session;
+import cfca.sadk.seal.base.bean.appearance.AbstractAppearance.GSBlendMode;
+import cfca.sadk.seal.base.bean.appearance.BlankAppearance;
+import cfca.sadk.seal.base.bean.appearance.GraphicAppearance;
+import cfca.sadk.seal.base.bean.sign.SealResultInfo;
+import cfca.sadk.seal.base.bean.sign.SignInfoConfig;
+import cfca.sadk.seal.base.bean.sign.SignInfoConfig.SignatureVersion;
+import cfca.sadk.seal.base.exception.SealException;
+import cfca.sadk.seal.base.external.AbstractExternalP7Signer;
+import cfca.sadk.seal.base.util.AsynCFCASigner;
+import cfca.sadk.seal.util.AsyncSignatureUtil;
+import cfca.sadk.system.Mechanisms;
+import cfca.sadk.x509.certificate.X509Cert;
+
+import java.text.ParseException;
+
+public class PdfUtil {
+    private static final String REASON = "电子签名";
+    private static final String LOCATION = "北京";
+    private static final float TRANSPARENCY = 0.8f;
+
+    private static Session session = null;
+    static {
+        try {
+            String deviceName = JCrypto.JSOFT_LIB;
+            JCrypto.getInstance().initialize(deviceName, null);
+            session = JCrypto.getInstance().openSession(deviceName);
+
+            // FontUtil.getInstance("./ttf/simsun_new.ttf");
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    public static byte[] combineExternalSignature(byte[] pdfBytes, byte[] signedBytes, X509Cert x509Cert, String signLocationField) throws Exception {
+        try {
+            AbstractExternalP7Signer asynCFCASigner;
+            if (x509Cert.isSM2Cert()) {
+                asynCFCASigner = new AsynCFCASigner(signedBytes, Mechanisms.M_SM3_SM2);
+            } else {
+                asynCFCASigner = new AsynCFCASigner(signedBytes, Mechanisms.M_SHA256_RSA);
+            }
+
+            GraphicAppearance appearance = new GraphicAppearance();
+            appearance.setSignFieldName(signLocationField);
+            SealResultInfo result = AsyncSignatureUtil.combineExternalP7Signature(pdfBytes, appearance, asynCFCASigner);
+            return result.getSignedPDFData();
+        } catch (Exception e) {
+            throw e;
+        }
+    }
+
+    public static boolean isPdf(byte[] pdfBytes) {
+        if (pdfBytes.length > 5 && pdfBytes[0] == 0x25 && pdfBytes[1] == 0x50 && pdfBytes[2] == 0x44 && pdfBytes[3] == 0x46 && pdfBytes[4] == 0x2D) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    private static BlankAppearance getBlankAppearance(byte[] imageBytes, String signText, Color color, String signLocationField)
+            throws ParseException, SealException {
+        BlankAppearance appearance = new BlankAppearance();
+        appearance.setReason(REASON);
+        appearance.setLocation(LOCATION);
+        if (null != imageBytes) {
+            appearance.setStamperSr(imageBytes);
+            appearance.setGSBlendMode(GSBlendMode.MULTIPLY);
+        } else {
+            appearance.setSignText(signText);
+            appearance.setFontColor(color);
+            appearance.setBold(false);
+        }
+        appearance.setSignFieldName(signLocationField);
+        appearance.setTransparency(TRANSPARENCY);
+        return appearance;
+    }
+
+    private static SignInfoConfig getSignInfoConfigAsyn(X509Cert x509Cert) throws PKIException, SealException {
+        SignInfoConfig signInfoConfig = new SignInfoConfig();
+        signInfoConfig.setSession(session);
+        signInfoConfig.setChain(new X509Cert[] { x509Cert });
+        if (x509Cert.isSM2Cert()) {
+            signInfoConfig.setSignAlg(Mechanisms.M_SM3_SM2);
+            signInfoConfig.setSignatureVersion(SignatureVersion.VERSION_0);
+        } else {
+            signInfoConfig.setSignAlg(Mechanisms.M_SHA256_RSA);
+        }
+        signInfoConfig.setAsyn(true);
+        return signInfoConfig;
+    }
+}

+ 161 - 0
eladmin-sign/src/main/java/me/zhengjie/sign/util/SecurityUtil.java

@@ -0,0 +1,161 @@
+package me.zhengjie.sign.util;
+
+import cfca.sadk.algorithm.common.Mechanism;
+import cfca.sadk.algorithm.common.PKIException;
+import cfca.sadk.lib.crypto.JCrypto;
+import cfca.sadk.lib.crypto.Session;
+import cfca.sadk.util.*;
+import cfca.sadk.x509.certificate.X509Cert;
+import me.zhengjie.sign.constant.SystemConst;
+
+import java.security.PrivateKey;
+
+public class SecurityUtil {
+    private static Session session = null;
+
+    static {
+        String deviceName = JCrypto.JSOFT_LIB;
+        try {
+            JCrypto.getInstance().initialize(deviceName, null);
+            session = JCrypto.getInstance().openSession(deviceName);
+        } catch (PKIException e) {
+            e.printStackTrace();
+        }
+    }
+
+    public static String getSignCert(String pfxPath, String pfxPWD) throws PKIException {
+        try {
+            X509Cert x509Cert = CertUtil.getCertFromPFX(pfxPath, pfxPWD);
+
+            return Base64.toBase64String(x509Cert.getEncoded());
+        } catch (Exception e) {
+            throw new PKIException("get signature cert fail", e);
+        }
+    }
+
+    public static String getSM2SignCert(String sm2Path) throws PKIException {
+        try {
+            X509Cert x509Cert = CertUtil.getCertFromSM2(sm2Path);
+
+            return Base64.toBase64String(x509Cert.getEncoded());
+        } catch (Exception e) {
+            throw new PKIException("get signature cert fail", e);
+        }
+    }
+
+    public static String p1SignMessage(String pfxPath, String pfxPWD, byte[] sourceData) throws PKIException {
+        try {
+            PrivateKey privateKey = KeyUtil.getPrivateKeyFromPFX(pfxPath, pfxPWD);
+
+            Signature signature = new Signature();
+            byte[] signatureByte = signature.p1SignMessage(Mechanism.SHA256_RSA, sourceData, privateKey, session);
+            return new String(signatureByte, SystemConst.DEFAULT_CHARSET);
+        } catch (Exception e) {
+            throw new PKIException("P1 signature message fail", e);
+        }
+    }
+
+    public static String p1SM2SignMessage(String sm2Path, String pfxPWD, byte[] sourceData) throws PKIException {
+        try {
+            PrivateKey privateKey = KeyUtil.getPrivateKeyFromSM2(sm2Path, pfxPWD);
+
+            Signature signature = new Signature();
+            byte[] signatureByte = signature.p1SignMessage(Mechanism.SM3_SM2, sourceData, privateKey, session);
+            return new String(signatureByte, SystemConst.DEFAULT_CHARSET);
+        } catch (Exception e) {
+            throw new PKIException("P1 signature message fail", e);
+        }
+    }
+
+    public static String p7SignByHash(String pfxPath, String pfxPWD, byte[] sourceData) throws PKIException {
+        try {
+            PrivateKey privateKey = KeyUtil.getPrivateKeyFromPFX(pfxPath, pfxPWD);
+            X509Cert x509Cert = CertUtil.getCertFromPFX(pfxPath, pfxPWD);
+
+            Signature signature = new Signature();
+            byte[] signatureByte = signature.p7SignByHash(Mechanism.SHA256_RSA, sourceData, privateKey, x509Cert, session);
+            return new String(signatureByte, SystemConst.DEFAULT_CHARSET);
+        } catch (Exception e) {
+            throw new PKIException("P7 hash signature fail", e);
+        }
+    }
+
+    public static String p7SM2SignByHash(String sm2Path, String pfxPWD, byte[] sourceData) throws PKIException {
+        try {
+            PrivateKey privateKey = KeyUtil.getPrivateKeyFromSM2(sm2Path, pfxPWD);
+            X509Cert x509Cert = CertUtil.getCertFromSM2(sm2Path);
+
+            Signature signature = new Signature();
+            byte[] signatureByte = signature.p7SignByHash(Mechanism.SM3_SM2, sourceData, privateKey, x509Cert, session);
+            return new String(signatureByte, SystemConst.DEFAULT_CHARSET);
+        } catch (Exception e) {
+            throw new PKIException("SM2 P7 hash signature fail", e);
+        }
+    }
+
+    public static String p7SignMessageDetach(String pfxPath, String pfxPWD, byte[] sourceData) throws PKIException {
+        try {
+            PrivateKey privateKey = KeyUtil.getPrivateKeyFromPFX(pfxPath, pfxPWD);
+            X509Cert signCert = CertUtil.getCertFromPFX(pfxPath, pfxPWD);
+
+            Signature signature = new Signature();
+            byte[] signatureByte = signature.p7SignMessageDetach(Mechanism.SHA256_RSA, sourceData, privateKey, signCert, session);
+            return new String(signatureByte);
+        } catch (Exception e) {
+            throw new PKIException("P7 detach signature fail", e);
+        }
+    }
+
+    public static String p7SignMessageDetach(String jksPath, String jksPWD, String alias, String sourceData) throws PKIException {
+        try {
+            PrivateKey privateKey = KeyUtil.getPrivateKeyFromJKS(jksPath, jksPWD, alias);
+            X509Cert signCert = CertUtil.getCertFromJKS(jksPath, jksPWD, alias);
+
+            Signature signature = new Signature();
+            byte[] signatureByte = signature.p7SignMessageDetach(Mechanism.SHA256_RSA, CommonUtil.getBytes(sourceData), privateKey, signCert, session);
+            return new String(signatureByte);
+        } catch (Exception e) {
+            throw new PKIException("P7 detach signature fail", e);
+        }
+    }
+
+    public static Signature verifyP7Detach(byte[] original, byte[] signature) throws PKIException {
+        Signature sign = new Signature();
+        if (!sign.p7VerifyMessageDetach(original, signature, session)) {
+            throw new PKIException("verify P7 detach signature fail");
+        }
+        return sign;
+    }
+
+    public static Signature verifyP7ByHash(byte[] original, byte[] signature) throws PKIException {
+        Signature sign = new Signature();
+        if (!sign.p7VerifyByHash(original, signature, session)) {
+            throw new PKIException("verify P7 signature by hash fail");
+        }
+        return sign;
+    }
+
+    public static Signature verifyP7Detach(String original, String signature) throws PKIException {
+        return verifyP7Detach(CommonUtil.getBytes(original), CommonUtil.getBytes(signature));
+    }
+
+    public static X509Cert getX509CertFromSignature(String signature) throws PKIException {
+        return new Signature().getSignerX509CertFromP7SignData(CommonUtil.getBytes(signature));
+    }
+
+    public static String encryptBySM4(String plaintext, String password) throws PKIException {
+        return CommonUtil.getString(EncryptUtil.encryptMessageBySM4(CommonUtil.getBytes(plaintext), password));
+    }
+
+    public static String decryptBySM4(String ciphertext, String password) throws PKIException {
+        return CommonUtil.getString(EncryptUtil.decryptMessageBySM4(CommonUtil.getBytes(ciphertext), password));
+    }
+
+    public static P10Request getP10Request() {
+        return new P10Request(session);
+    }
+
+    public static String getP10(P10Request p10Request, int length) throws PKIException {
+        return CommonUtil.getString(p10Request.generatePKCS10Request(new Mechanism(Mechanism.SHA1_RSA), length, session));
+    }
+}

+ 38 - 0
eladmin-sign/src/main/java/me/zhengjie/sign/util/TimeUtil.java

@@ -0,0 +1,38 @@
+package me.zhengjie.sign.util;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+
+public class TimeUtil {
+    public static final String FORMAT_14 = "yyyyMMddHHmmss";
+    public static final String FORMAT_14_TEXT = "yyyy-MM-dd HH:mm:ss";
+    public static final String FORMAT_8 = "yyyyMMdd";
+    public static final String FORMAT_8_TEXT = "yyyy-MM-dd";
+    public static final String FORMAT_6 = "HHmmss";
+    public static final String FORMAT_6_TEXT = "HH:mm:ss";
+
+    public static String getTimeInFormat(Date date, String format) {
+        return new SimpleDateFormat(format).format(date);
+    }
+
+    public static Date getDateInFormat(String time, String format) throws ParseException {
+        return new SimpleDateFormat(format).parse(time);
+    }
+
+    public static String getCurrentTime(String format) {
+        return getTimeInFormat(new Date(), format);
+    }
+
+    public static Date getOffsetDate(Date date, int field, int amount) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        calendar.add(field, amount);
+        return calendar.getTime();
+    }
+
+    public static String getChangedFormat(String time, String fromFormat, String toFormat) throws ParseException {
+        return new SimpleDateFormat(toFormat).format(new SimpleDateFormat(fromFormat).parse(time));
+    }
+}

二進制
eladmin-sign/src/main/resources/anxinqian.jks


二進制
eladmin-sign/src/main/resources/anxinsign-test.jks


+ 6 - 48
eladmin-system/pom.xml

@@ -24,14 +24,6 @@
 		<tencentcloud.sdk.version>3.1.598</tencentcloud.sdk.version>
 		<tencentcloud.sdk.version>3.1.598</tencentcloud.sdk.version>
 		<hu.tu>5.4.5</hu.tu>
 		<hu.tu>5.4.5</hu.tu>
 		<xxl.job.version>2.3.0</xxl.job.version>
 		<xxl.job.version>2.3.0</xxl.job.version>
-		<cfca.common.version>3.7.5.3</cfca.common.version>
-		<cfca.sadk.version>3.7.1.0</cfca.sadk.version>
-		<cfca.logback.version>4.2.1.0</cfca.logback.version>
-		<cfca.paperless.version>3.0.2.1</cfca.paperless.version>
-		<cfca.SealSADK7.version>5.8.2.1</cfca.SealSADK7.version>
-		<cfca.SealSADK.version>3.1.4.0</cfca.SealSADK.version>
-		<cfca.timestampAPI.version>4.2.2.0</cfca.timestampAPI.version>
-		<anxinqian.version>1.0.5</anxinqian.version>
 		<zefer.fonts.version>1.0</zefer.fonts.version>
 		<zefer.fonts.version>1.0</zefer.fonts.version>
 		<zefer.pd4ml.version>370fx2pro</zefer.pd4ml.version>
 		<zefer.pd4ml.version>370fx2pro</zefer.pd4ml.version>
 		<zefer.ss_css.version>1.0</zefer.ss_css.version>
 		<zefer.ss_css.version>1.0</zefer.ss_css.version>
@@ -83,6 +75,12 @@
 			<version>2.6</version>
 			<version>2.6</version>
 		</dependency>
 		</dependency>
 
 
+		<dependency>
+			<groupId>me.zhengjie</groupId>
+			<artifactId>eladmin-sign</artifactId>
+			<version>2.6</version>
+		</dependency>
+
 		<!-- Spring boot websocket -->
 		<!-- Spring boot websocket -->
 		<dependency>
 		<dependency>
 			<groupId>org.springframework.boot</groupId>
 			<groupId>org.springframework.boot</groupId>
@@ -170,46 +168,6 @@
 			<version>2.0</version>
 			<version>2.0</version>
 		</dependency>
 		</dependency>
 		<dependency>
 		<dependency>
-			<groupId>cfca.trustsign</groupId>
-			<artifactId>common</artifactId>
-			<version>${cfca.common.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>cfca.sadk</groupId>
-			<artifactId>sadk</artifactId>
-			<version>${cfca.sadk.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>cfca.sadk</groupId>
-			<artifactId>logback</artifactId>
-			<version>${cfca.logback.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>cfca.sadk</groupId>
-			<artifactId>paperless</artifactId>
-			<version>${cfca.paperless.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>cfca.sadk</groupId>
-			<artifactId>SealSADK7</artifactId>
-			<version>${cfca.SealSADK7.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>cfca.sadk</groupId>
-			<artifactId>SealSADK</artifactId>
-			<version>${cfca.SealSADK.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>cfca.sadk</groupId>
-			<artifactId>timestampAPI</artifactId>
-			<version>${cfca.timestampAPI.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>com.sakuya</groupId>
-			<artifactId>anxinqian</artifactId>
-			<version>${anxinqian.version}</version>
-		</dependency>
-		<dependency>
 			<groupId>com.xuxueli</groupId>
 			<groupId>com.xuxueli</groupId>
 			<artifactId>xxl-job-core</artifactId>
 			<artifactId>xxl-job-core</artifactId>
 			<version>${xxl.job.version}</version>
 			<version>${xxl.job.version}</version>

+ 14 - 83
eladmin-system/src/main/java/me/zhengjie/application/admin/controller/DemoController.java

@@ -1,33 +1,21 @@
 package me.zhengjie.application.admin.controller;
 package me.zhengjie.application.admin.controller;
 
 
-import com.tencentcloudapi.common.exception.TencentCloudSDKException;
 import com.tencentyun.TLSSigAPIv2;
 import com.tencentyun.TLSSigAPIv2;
-
-import cfca.trustsign.common.vo.cs.UploadSignInfoVO;
-import cfca.trustsign.constant.Request;
-import cfca.trustsign.util.PdfUtil;
+import lombok.RequiredArgsConstructor;
 import me.zhengjie.annotation.AnonymousAccess;
 import me.zhengjie.annotation.AnonymousAccess;
-import me.zhengjie.annotation.rest.AnonymousPostMapping;
-import me.zhengjie.base.AppBaseResponse;
 import me.zhengjie.base.BaseResponse;
 import me.zhengjie.base.BaseResponse;
 import me.zhengjie.base.ResultData;
 import me.zhengjie.base.ResultData;
 import me.zhengjie.base.config.AppConfigInfo;
 import me.zhengjie.base.config.AppConfigInfo;
-import me.zhengjie.base.sms.CreateCloudRecording;
-import me.zhengjie.base.sms.TrtcVo;
-import me.zhengjie.base.util.CFCACertUtil;
-import me.zhengjie.base.util.HttpConnector;
 import me.zhengjie.websocket.MsgType;
 import me.zhengjie.websocket.MsgType;
 import me.zhengjie.websocket.SocketMsg;
 import me.zhengjie.websocket.SocketMsg;
 import me.zhengjie.websocket.WebSocketServer;
 import me.zhengjie.websocket.WebSocketServer;
-import org.apache.commons.io.FileUtils;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.*;
-import java.io.File;
-import java.io.FileInputStream;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
 import java.io.IOException;
 import java.io.IOException;
-import java.io.InputStream;
-import java.util.List;
 import java.util.Map;
 import java.util.Map;
 
 
 /**
 /**
@@ -38,11 +26,16 @@ import java.util.Map;
  */
  */
 @Controller
 @Controller
 @RequestMapping("/demo")
 @RequestMapping("/demo")
+@RequiredArgsConstructor
 public class DemoController {
 public class DemoController {
 
 
-	@Autowired
-	CreateCloudRecording createCloudRecording;
-
+	/**
+	 * 发送WebSocket信息
+	 *
+	 * @param cid
+	 * @param mesg
+	 * @return
+	 */
 	@ResponseBody
 	@ResponseBody
 	@AnonymousAccess
 	@AnonymousAccess
 	@RequestMapping("/socket/push/{cid}")
 	@RequestMapping("/socket/push/{cid}")
@@ -72,66 +65,4 @@ public class DemoController {
 		response.setData(new ResultData<String>(s));
 		response.setData(new ResultData<String>(s));
 		return response;
 		return response;
 	}
 	}
-
-	/**
-	 * 多人签发
-	 *
-	 * @return
-	 * @throws Exception
-	 */
-	@ResponseBody
-	@AnonymousPostMapping("/notarySign")
-	public BaseResponse<?> notarySign(@RequestBody List<UploadSignInfoVO> notaryUserInfos, String fileName)
-			throws Exception {
-
-		BaseResponse<?> response = new BaseResponse<>();
-//    	UploadSignInfoVO notaryUserInfo = new UploadSignInfoVO();
-		// List<UploadSignInfoVO> notaryUserInfos = new ArrayList<>();
-//		notaryUserInfo.setUserId("E06DAAB5F6894542E05312016B0AC8F1");
-//		notaryUserInfo.setSealId("E06DAB4AFAEF4DB7E05311016B0A5154");
-//		notaryUserInfo.setLocation("210.74.41.0");
-//		notaryUserInfo.setAuthorizationTime("20220214171200");
-//		notaryUserInfos.add(notaryUserInfo);
-//		notaryUserInfos.add(notaryUserInfo);
-//		UploadSignInfoVO notaryOfficeInfo = new UploadSignInfoVO();
-//		notaryOfficeInfo.setUserId(notaryOffice.getAxqUserId());
-//		notaryOfficeInfo.setSealId(notaryOffice.getAxqSealId());
-//		notaryOfficeInfo.setLocation("210.74.41.1");
-//		notaryOfficeInfo.setAuthorizationTime("20220214171200");
-		String path = "/home/oss/pdftest/" + fileName;
-		InputStream inputStream = new FileInputStream(path);
-		String contractNO = CFCACertUtil.uploadMultiSignContract(notaryUserInfos, null, null, inputStream, fileName);
-		System.out.println(contractNO);
-		response.setMsg(contractNO);
-		return response;
-	}
-
-	/**
-	 * 多人签发
-	 *
-	 * @return
-	 * @throws Exception
-	 */
-	@ResponseBody
-	@AnonymousPostMapping("/download")
-	public BaseResponse<?> download(@RequestBody Map<String, String> param) throws Exception {
-
-		BaseResponse<?> response = new BaseResponse<>();
-		HttpConnector httpConnector = new HttpConnector();
-		String contractNo = param.get("contractNo");
-		httpConnector.init();
-		String filePath = "platId/" + Request.AXQ_PLAT_ID + "/contractNo/" + contractNo + "/downloading";
-		byte[] fileBtye = httpConnector.getFile(filePath);
-
-		String suffix;
-		if (PdfUtil.isPdf(fileBtye)) {
-			suffix = ".pdf";
-		} else {
-			suffix = ".ofd";
-		}
-		String fullFilePath = "/home/oss/" + contractNo + suffix;
-		FileUtils.writeByteArrayToFile(new File(fullFilePath), fileBtye);
-		return response;
-	}
-
 }
 }

+ 1 - 0
eladmin-system/src/main/java/me/zhengjie/application/admin/controller/vo/OrderDetailDto.java

@@ -158,6 +158,7 @@ public class OrderDetailDto {
 	private String authNote;
 	private String authNote;
 	private String notaryUserName;
 	private String notaryUserName;
 	private Integer notaryFee;
 	private Integer notaryFee;
+	private String contractTerm;
 
 
 	// 品牌型号
 	// 品牌型号
 	private String brandModel;
 	private String brandModel;

+ 3 - 4
eladmin-system/src/main/java/me/zhengjie/application/admin/job/GenerateNotarizationJob.java

@@ -34,6 +34,7 @@ public class GenerateNotarizationJob {
     private final NotaryOfficeMapper notaryOfficeMapper;
     private final NotaryOfficeMapper notaryOfficeMapper;
     private final SysUserMapper userDao;
     private final SysUserMapper userDao;
     private final ContractOrderRepository contractOrderRepository;
     private final ContractOrderRepository contractOrderRepository;
+    private final CFCACertUtil cfcaCertUtil;
 
 
     /**
     /**
      * 生成签名公证书
      * 生成签名公证书
@@ -85,11 +86,10 @@ public class GenerateNotarizationJob {
         notaryOfficeInfo.setLocation("210.74.41.1");
         notaryOfficeInfo.setLocation("210.74.41.1");
         notaryOfficeInfo.setAuthorizationTime("20220214171200");
         notaryOfficeInfo.setAuthorizationTime("20220214171200");
 
 
-        CFCACertUtil.proxySwitchOn = "dev".equals(AppConfigInfo.APP_ENV_TYPE);
         String path = orderFile.getPdfUrl();
         String path = orderFile.getPdfUrl();
         InputStream inputStream = FileUploadUtil.getInputStream(path);
         InputStream inputStream = FileUploadUtil.getInputStream(path);
         String fileName=FileUploadUtil.getFileName(path);
         String fileName=FileUploadUtil.getFileName(path);
-        String contractNO = CFCACertUtil.uploadSignContract(notaryUserInfo, notaryOfficeInfo, inputStream,fileName);
+        String contractNO = cfcaCertUtil.uploadSignContract(notaryUserInfo, notaryOfficeInfo, inputStream,fileName);
         orderFile.setAxqContractNo(contractNO);
         orderFile.setAxqContractNo(contractNO);
         // 保存合同编号
         // 保存合同编号
         inputStream.close();
         inputStream.close();
@@ -101,10 +101,9 @@ public class GenerateNotarizationJob {
      * @param orderFile
      * @param orderFile
      */
      */
     private void downloadNotarization(OrderFileEntity orderFile) throws Exception {
     private void downloadNotarization(OrderFileEntity orderFile) throws Exception {
-        CFCACertUtil.proxySwitchOn = "dev".equals(AppConfigInfo.APP_ENV_TYPE);
         String uplaodPath = orderFile.getBusinessNo() + "/";
         String uplaodPath = orderFile.getBusinessNo() + "/";
         String path = uplaodPath + "notary-signed-" + orderFile.getBusinessNo() + "/";
         String path = uplaodPath + "notary-signed-" + orderFile.getBusinessNo() + "/";
-        String filePath = CFCACertUtil.download(path, orderFile.getAxqContractNo());
+        String filePath = cfcaCertUtil.download(path, orderFile.getAxqContractNo());
         saveAuthNorizationUrlById(filePath, orderFile.getId());
         saveAuthNorizationUrlById(filePath, orderFile.getId());
     }
     }
 
 

+ 0 - 20
eladmin-system/src/main/java/me/zhengjie/application/admin/service/impl/NotaryNoteServiceImpl.java

@@ -104,7 +104,6 @@ public class NotaryNoteServiceImpl implements NotaryNoteService {
 			orderFileMapper.updateById(orderFile);
 			orderFileMapper.updateById(orderFile);
 		}
 		}
 		saveNotaryUserId(notary.getBusinessNo());
 		saveNotaryUserId(notary.getBusinessNo());
-		recreateApplyDoc(notary.getBusinessNo());
 		return response;
 		return response;
 	}
 	}
 
 
@@ -123,25 +122,6 @@ public class NotaryNoteServiceImpl implements NotaryNoteService {
 		contractOrderRepository.updateWithId(saveOrder);
 		contractOrderRepository.updateWithId(saveOrder);
 	}
 	}
 
 
-	/**
-	 * 重新生成申请表
-	 *
-	 * @param businessNo
-	 */
-	private void recreateApplyDoc(String businessNo) {
-		ContractOrderEntity contractOrderEntity = contractOrderRepository.getContractOrderWithBizNo(businessNo);
-		ModelEntity model = modelRepository.getModelEntity(contractOrderEntity.getProdId(), contractOrderEntity.getContractType(), contractOrderEntity.getNotaryOfficeId(), ModelConstant.MODEL_TYPE_APPLY, ModelConstant.MODEL_STATUS_ENABLE);
-		OrderFileEntity fileEntity = orderFileRepository.getOrderFileWithCode(businessNo, ModelConstant.MODEL_TYPE_APPLY);
-		OrderFileEntity saveFile = new OrderFileEntity();
-		saveFile.setId(fileEntity.getId());
-		String html = modelSynthesizerDomain.composeCommonTemplateWithData(businessNo, model.getContent(), contextUtil.getCurrentUser().getNickName());
-		String htmlPath = FileUploadUtil.saveHtml(html, businessNo);
-		String pdfPath = FileUploadUtil.savePdf(html, businessNo);
-		fileEntity.setHtmlUrl(htmlPath);
-		fileEntity.setPdfUrl(pdfPath);
-		orderFileMapper.updateById(fileEntity);
-	}
-
 	@Override
 	@Override
 	public String generateTestPdf(String modelId, String businessNo) {
 	public String generateTestPdf(String modelId, String businessNo) {
 		ModelEntity model = modelMapper.selectById(modelId);
 		ModelEntity model = modelMapper.selectById(modelId);

+ 10 - 22
eladmin-system/src/main/java/me/zhengjie/application/admin/service/impl/NotaryOfficeServiceImpl.java

@@ -64,18 +64,14 @@ public class NotaryOfficeServiceImpl extends ServiceImpl<NotaryOfficeMapper, Not
 	private OfficeXbankMapper officeXbankMapper;
 	private OfficeXbankMapper officeXbankMapper;
 	@Autowired
 	@Autowired
 	private BankMapper bankMapper;
 	private BankMapper bankMapper;
-	@Value("${app.upload.path}")
-	private String uplaodPath;
-//	@Value("${app.image.url}")
-//	private String imageURL;
-	@Value("${spring.profiles.active}")
-	private String systemEnv;
 	@Autowired
 	@Autowired
 	private FileInfoMapper fileInfoMapper;
 	private FileInfoMapper fileInfoMapper;
 	@Autowired
 	@Autowired
 	private FileInfoService fileInfoService;
 	private FileInfoService fileInfoService;
 	@Autowired
 	@Autowired
 	private ApplicationContextUtil contextUtil;
 	private ApplicationContextUtil contextUtil;
+	@Autowired
+	private CFCACertUtil cfcaCertUtil;
 
 
 	/**
 	/**
 	 * 查询公证处信息
 	 * 查询公证处信息
@@ -189,8 +185,7 @@ public class NotaryOfficeServiceImpl extends ServiceImpl<NotaryOfficeMapper, Not
 	public AppBaseResponse verifyAuthMessage(NotaryOfficeCreateReq req) {
 	public AppBaseResponse verifyAuthMessage(NotaryOfficeCreateReq req) {
 		AppBaseResponse response = new AppBaseResponse();
 		AppBaseResponse response = new AppBaseResponse();
 		try {
 		try {
-			CFCACertUtil.proxySwitchOn = "dev".equals(systemEnv);
-			CFCACertUtil.confirmAuthMessage(req.getAxqUserId(), req.getCheckCode());
+			cfcaCertUtil.confirmAuthMessage(req.getAxqUserId(), req.getCheckCode());
 		} catch (Exception e) {
 		} catch (Exception e) {
 			e.printStackTrace();
 			e.printStackTrace();
 			response.fail(ResultCode.AXQ_AUTH_FAIL);
 			response.fail(ResultCode.AXQ_AUTH_FAIL);
@@ -214,10 +209,8 @@ public class NotaryOfficeServiceImpl extends ServiceImpl<NotaryOfficeMapper, Not
 	public AppBaseResponse sendAuthMessage(String userId) {
 	public AppBaseResponse sendAuthMessage(String userId) {
 		AppBaseResponse response = new AppBaseResponse();
 		AppBaseResponse response = new AppBaseResponse();
 		try {
 		try {
-			CFCACertUtil.proxySwitchOn = "dev".equals(systemEnv);
-			log.info(CFCACertUtil.proxySwitchOn + "");
 			// 发送授权验证码
 			// 发送授权验证码
-			CFCACertUtil.sendAuthMessage(userId);
+			cfcaCertUtil.sendAuthMessage(userId);
 		} catch (Exception e) {
 		} catch (Exception e) {
 			e.printStackTrace();
 			e.printStackTrace();
 			response.fail(ResultCode.AXQ_AUTH_MESSAGE_FAIL);
 			response.fail(ResultCode.AXQ_AUTH_MESSAGE_FAIL);
@@ -269,11 +262,10 @@ public class NotaryOfficeServiceImpl extends ServiceImpl<NotaryOfficeMapper, Not
 				userQw.isNull("axq_user_id");
 				userQw.isNull("axq_user_id");
 				List<SysUserEntity> userList = userMapper.selectList(userQw);
 				List<SysUserEntity> userList = userMapper.selectList(userQw);
 				for (SysUserEntity user : userList) {
 				for (SysUserEntity user : userList) {
-					CFCACertUtil.proxySwitchOn = "dev".equals(systemEnv);
 					// 安心签注册个人用户
 					// 安心签注册个人用户
 					PersonVO person = PersonVO.builder().personName(user.getNickName()).identNo(user.getIdCard())
 					PersonVO person = PersonVO.builder().personName(user.getNickName()).identNo(user.getIdCard())
 							.mobilePhone(user.getPhone()).build();
 							.mobilePhone(user.getPhone()).build();
-					String userId = CFCACertUtil.registerPerson(person);
+					String userId = cfcaCertUtil.registerPerson(person);
 					//
 					//
 					SysUserEntity updateUser = new SysUserEntity();
 					SysUserEntity updateUser = new SysUserEntity();
 					updateUser.setUserId(user.getUserId());
 					updateUser.setUserId(user.getUserId());
@@ -281,14 +273,13 @@ public class NotaryOfficeServiceImpl extends ServiceImpl<NotaryOfficeMapper, Not
 					userMapper.updateById(updateUser);
 					userMapper.updateById(updateUser);
 				}
 				}
 				if (StringUtils.isEmpty(currentOffice.getAxqUserId())) {
 				if (StringUtils.isEmpty(currentOffice.getAxqUserId())) {
-					CFCACertUtil.proxySwitchOn = "dev".equals(systemEnv);
 					// 注册安心签企业用户
 					// 注册安心签企业用户
 					EnterpriseVO enterpriseVO = EnterpriseVO.builder().enterpriseName(currentOffice.getName())
 					EnterpriseVO enterpriseVO = EnterpriseVO.builder().enterpriseName(currentOffice.getName())
 							.identNo(req.getIdentNo()).mobilePhone(req.getAgtMobile())
 							.identNo(req.getIdentNo()).mobilePhone(req.getAgtMobile())
 							.landlinePhone(currentOffice.getPhone()).build();
 							.landlinePhone(currentOffice.getPhone()).build();
 					EnterpriseTransactorVO enterpriseTransactorVO = EnterpriseTransactorVO.builder()
 					EnterpriseTransactorVO enterpriseTransactorVO = EnterpriseTransactorVO.builder()
 							.transactorName(req.getAgtName()).identNo(req.getAgtIdentNo()).build();
 							.transactorName(req.getAgtName()).identNo(req.getAgtIdentNo()).build();
-					String userId = CFCACertUtil.registerCompany(enterpriseVO, enterpriseTransactorVO);
+					String userId = cfcaCertUtil.registerCompany(enterpriseVO, enterpriseTransactorVO);
 					//
 					//
 					NotaryOfficeEntity saveOffice = new NotaryOfficeEntity();
 					NotaryOfficeEntity saveOffice = new NotaryOfficeEntity();
 					saveOffice.setId(req.getId());
 					saveOffice.setId(req.getId());
@@ -363,16 +354,15 @@ public class NotaryOfficeServiceImpl extends ServiceImpl<NotaryOfficeMapper, Not
 		if (NotaryOfficeConstant.NOTARY_AUTO_GENERATE.equals(entity.getAutoGenerate())) {
 		if (NotaryOfficeConstant.NOTARY_AUTO_GENERATE.equals(entity.getAutoGenerate())) {
 			try {
 			try {
 				NotaryOfficeEntity saveEntity = new NotaryOfficeEntity();
 				NotaryOfficeEntity saveEntity = new NotaryOfficeEntity();
-				CFCACertUtil.proxySwitchOn = "dev".equals(systemEnv);
 				if (me.zhengjie.utils.StringUtils.isEmpty(entity.getAxqSealId())) {
 				if (me.zhengjie.utils.StringUtils.isEmpty(entity.getAxqSealId())) {
 					// 上传公证处签章
 					// 上传公证处签章
 					byte[] b = FileUploadUtil.getByte(req.getImageId());
 					byte[] b = FileUploadUtil.getByte(req.getImageId());
-					String sealId = CFCACertUtil.addSeal(entity.getAxqUserId(), b);
+					String sealId = cfcaCertUtil.addSeal(entity.getAxqUserId(), b);
 					saveEntity.setAxqSealId(sealId);
 					saveEntity.setAxqSealId(sealId);
 				} else {
 				} else {
 					// 修改公证员签章
 					// 修改公证员签章
 					byte[] b = FileUploadUtil.getByte(req.getImageId());
 					byte[] b = FileUploadUtil.getByte(req.getImageId());
-					CFCACertUtil.updateSeal(entity.getAxqUserId(), entity.getAxqSealId(), b);
+					cfcaCertUtil.updateSeal(entity.getAxqUserId(), entity.getAxqSealId(), b);
 				}
 				}
 				saveEntity.setId(req.getId());
 				saveEntity.setId(req.getId());
 				saveEntity.setSealImg(req.getImageId());
 				saveEntity.setSealImg(req.getImageId());
@@ -396,10 +386,9 @@ public class NotaryOfficeServiceImpl extends ServiceImpl<NotaryOfficeMapper, Not
 		NotaryOfficeEntity entity = notaryOfficeMapper.selectById(req.getId());
 		NotaryOfficeEntity entity = notaryOfficeMapper.selectById(req.getId());
 		try {
 		try {
 			if (!me.zhengjie.utils.StringUtils.isEmpty(entity.getAxqUserId())) {
 			if (!me.zhengjie.utils.StringUtils.isEmpty(entity.getAxqUserId())) {
-				CFCACertUtil.proxySwitchOn = "dev".equals(systemEnv);
 				CertVO paramCertVO = new CertVO();
 				CertVO paramCertVO = new CertVO();
 				paramCertVO.setUserId(entity.getAxqUserId());
 				paramCertVO.setUserId(entity.getAxqUserId());
-				CertVO returnCertVO = CFCACertUtil.queryCertificate(paramCertVO);
+				CertVO returnCertVO = cfcaCertUtil.queryCertificate(paramCertVO);
 				//
 				//
 				SimpleDateFormat inDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
 				SimpleDateFormat inDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
 				Date beginDate = inDateFormat.parse(returnCertVO.getStartTime());
 				Date beginDate = inDateFormat.parse(returnCertVO.getStartTime());
@@ -431,10 +420,9 @@ public class NotaryOfficeServiceImpl extends ServiceImpl<NotaryOfficeMapper, Not
 		NotaryOfficeEntity notaryOffice = notaryOfficeMapper.selectById(req.getId());
 		NotaryOfficeEntity notaryOffice = notaryOfficeMapper.selectById(req.getId());
 		String authStatus = StringUtils.isEmpty(notaryOffice.getAxqIsAuth())  ? "0" : notaryOffice.getAxqIsAuth();
 		String authStatus = StringUtils.isEmpty(notaryOffice.getAxqIsAuth())  ? "0" : notaryOffice.getAxqIsAuth();
 		if ("0".equals(authStatus)) {
 		if ("0".equals(authStatus)) {
-			CFCACertUtil.proxySwitchOn = "dev".equals(systemEnv);
 			try {
 			try {
 				// 发送授权验证码
 				// 发送授权验证码
-				boolean isAuthed = CFCACertUtil.sendAuthMessage(notaryOffice.getAxqUserId());
+				boolean isAuthed = cfcaCertUtil.sendAuthMessage(notaryOffice.getAxqUserId());
 				if (isAuthed) {
 				if (isAuthed) {
 					authStatus = "1";
 					authStatus = "1";
 					NotaryOfficeEntity saveOffice = new NotaryOfficeEntity();
 					NotaryOfficeEntity saveOffice = new NotaryOfficeEntity();

+ 14 - 5
eladmin-system/src/main/java/me/zhengjie/application/admin/service/impl/OrderCochainServiceImpl.java

@@ -11,13 +11,11 @@ import java.util.Map;
 import javax.annotation.PostConstruct;
 import javax.annotation.PostConstruct;
 
 
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
-
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.StringUtils;
-
 import cn.hutool.core.util.ArrayUtil;
 import cn.hutool.core.util.ArrayUtil;
 import cn.hutool.core.util.ZipUtil;
 import cn.hutool.core.util.ZipUtil;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
@@ -64,7 +62,7 @@ public class OrderCochainServiceImpl extends AbstractServiceImpl<IOrderCochainDa
 
 
 	private static String UPLOAD_FILE_PATH;
 	private static String UPLOAD_FILE_PATH;
 
 
-//	@PostConstruct
+	@PostConstruct
 	public void init() {
 	public void init() {
 		new Thread(new Runnable() {
 		new Thread(new Runnable() {
 
 
@@ -84,6 +82,9 @@ public class OrderCochainServiceImpl extends AbstractServiceImpl<IOrderCochainDa
 	}
 	}
 
 
 	private void initCochainPath(String path) {
 	private void initCochainPath(String path) {
+		if (StringUtils.isNotBlank(UPLOAD_FILE_PATH)) {
+			return;
+		}
 		// 得到文件的临时目录
 		// 得到文件的临时目录
 		String applicationDir = FileUploadUtil.getApplicationTempDir();
 		String applicationDir = FileUploadUtil.getApplicationTempDir();
 		String downloadPath = applicationDir + "/" + path + "/";
 		String downloadPath = applicationDir + "/" + path + "/";
@@ -102,6 +103,15 @@ public class OrderCochainServiceImpl extends AbstractServiceImpl<IOrderCochainDa
 		for (OrderCochainEntity cochainEntity : cochainEntitys) {
 		for (OrderCochainEntity cochainEntity : cochainEntitys) {
 			// 业务编码
 			// 业务编码
 			String businessNo = cochainEntity.getBusinessNo();
 			String businessNo = cochainEntity.getBusinessNo();
+			// 这里必须先判断公证书已经生成然后,再上传区块连
+			QueryWrapper<OrderFileEntity> orderFileWrapper = new QueryWrapper<>();
+			orderFileWrapper.eq("business_no", businessNo);
+			orderFileWrapper.eq("code", 10);
+			// 这里处理,如果没有盖章的,就做任何处理
+			OrderFileEntity notarySigned = orderFileMapper.selectOne(orderFileWrapper);
+			if (notarySigned == null || StringUtils.isEmpty(notarySigned.getSignedPdfUrl())) {
+				continue;
+			}
 			initCochainPath(businessNo);
 			initCochainPath(businessNo);
 			List<File> zipList = new ArrayList<>();
 			List<File> zipList = new ArrayList<>();
 			QueryWrapper<ContractOrderEntity> orderqw = new QueryWrapper<>();
 			QueryWrapper<ContractOrderEntity> orderqw = new QueryWrapper<>();
@@ -169,7 +179,6 @@ public class OrderCochainServiceImpl extends AbstractServiceImpl<IOrderCochainDa
 					} else if (!repeat.equals(key)) {
 					} else if (!repeat.equals(key)) {
 						downloadByPath(orderFile.getSignedPdfUrl(), map, orderFile.getFileName(), zipList);
 						downloadByPath(orderFile.getSignedPdfUrl(), map, orderFile.getFileName(), zipList);
 					}
 					}
-
 				}
 				}
 				// 处理视频
 				// 处理视频
 				QueryWrapper<OrderRoomIdEntity> queryWrapper = new QueryWrapper<>();
 				QueryWrapper<OrderRoomIdEntity> queryWrapper = new QueryWrapper<>();

+ 25 - 4
eladmin-system/src/main/java/me/zhengjie/application/admin/service/impl/SmsTemplateServiceImpl.java

@@ -2,10 +2,12 @@ package me.zhengjie.application.admin.service.impl;
 
 
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
 import java.util.ArrayList;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.HashSet;
 import java.util.HashSet;
 import java.util.List;
 import java.util.List;
 import java.util.Set;
 import java.util.Set;
 
 
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.ParameterizedTypeReference;
 import org.springframework.core.ParameterizedTypeReference;
@@ -152,7 +154,8 @@ public class SmsTemplateServiceImpl extends AbstractServiceImpl<ISmsTemplateDao,
 
 
 	// 1--公证申请提交成功--- 2个公证员
 	// 1--公证申请提交成功--- 2个公证员
 	public void submitSuccess(String businessNo) {
 	public void submitSuccess(String businessNo) {
-		sendNotary(1, businessNo, "公证员");
+
+		sendNotary(1, businessNo, "公证员", sendSmsPhone());
 	}
 	}
 
 
 	// 2--审核通过---1个客户经理
 	// 2--审核通过---1个客户经理
@@ -181,7 +184,22 @@ public class SmsTemplateServiceImpl extends AbstractServiceImpl<ISmsTemplateDao,
 	// 4---开始公证(待公证) -- 2个公证员
 	// 4---开始公证(待公证) -- 2个公证员
 	@Override
 	@Override
 	public void startNotarize(String businessNo) {
 	public void startNotarize(String businessNo) {
-		sendNotary(4, businessNo, "公证员");
+
+		sendNotary(4, businessNo, "公证员", sendSmsPhone());
+	}
+
+	public Set<String> sendSmsPhone() {
+		String value = dictService.getLabelValue("sms_msg", "send_sms_phone");
+		Set<String> sendPhone = new HashSet<>();
+		if (StringUtils.isNoneBlank(value)) {
+			if (value.contains(",")) {
+				List<String> phone = Arrays.asList(value.split(","));
+				sendPhone.addAll(phone);
+			} else {
+				sendPhone.add(value);
+			}
+		}
+		return sendPhone;
 	}
 	}
 
 
 	// 5--提醒审批公证书 2个公证员
 	// 5--提醒审批公证书 2个公证员
@@ -194,7 +212,7 @@ public class SmsTemplateServiceImpl extends AbstractServiceImpl<ISmsTemplateDao,
 		log.eq("order_type", 5);
 		log.eq("order_type", 5);
 		long count = sendLogMapper.selectCount(log);
 		long count = sendLogMapper.selectCount(log);
 		if (count == 0) {
 		if (count == 0) {
-			sendNotary(5, businessNo, "公证书签发");
+			sendNotary(5, businessNo, "公证书签发", null);
 		}
 		}
 	}
 	}
 
 
@@ -256,7 +274,7 @@ public class SmsTemplateServiceImpl extends AbstractServiceImpl<ISmsTemplateDao,
 	 * @param businessNo 业务编号
 	 * @param businessNo 业务编号
 	 * @param notaryName 查询公证员
 	 * @param notaryName 查询公证员
 	 */
 	 */
-	private void sendNotary(Integer orderType, String businessNo, String notaryName) {
+	private void sendNotary(Integer orderType, String businessNo, String notaryName, Set<String> sendPhone) {
 		Long templateId = getTemplateId(orderType);
 		Long templateId = getTemplateId(orderType);
 		if (templateId == null) {
 		if (templateId == null) {
 			log.warn("短信模板不存在或者被停用订单类型  {}  ", orderType);
 			log.warn("短信模板不存在或者被停用订单类型  {}  ", orderType);
@@ -271,6 +289,9 @@ public class SmsTemplateServiceImpl extends AbstractServiceImpl<ISmsTemplateDao,
 		}
 		}
 		param.add(orderEntity.getConsultNo());
 		param.add(orderEntity.getConsultNo());
 		Set<String> phone = userDao.queryPhone(orderEntity.getBankId(), notaryName);
 		Set<String> phone = userDao.queryPhone(orderEntity.getBankId(), notaryName);
+		if (CollectionUtils.isNotEmpty(sendPhone)) {
+			phone.addAll(sendPhone);
+		}
 		SmsSendVo smsSend = new SmsSendVo();
 		SmsSendVo smsSend = new SmsSendVo();
 		smsSend.setSetPhoneNumberSet(phone);
 		smsSend.setSetPhoneNumberSet(phone);
 		smsSend.setTemplateId(String.valueOf(templateId));
 		smsSend.setTemplateId(String.valueOf(templateId));

+ 11 - 23
eladmin-system/src/main/java/me/zhengjie/application/admin/service/impl/UserServiceImpl.java

@@ -71,6 +71,7 @@ public class UserServiceImpl implements UserService {
     private final RedisUtils redisUtils;
     private final RedisUtils redisUtils;
     private final OnlineUserService onlineUserService;
     private final OnlineUserService onlineUserService;
     private final ApplicationContextUtil contextUtil;
     private final ApplicationContextUtil contextUtil;
+    private final CFCACertUtil cfcaCertUtil;
     @Autowired
     @Autowired
     private NotaryOfficeMapper notaryOfficeMapper;
     private NotaryOfficeMapper notaryOfficeMapper;
     @Autowired
     @Autowired
@@ -87,12 +88,6 @@ public class UserServiceImpl implements UserService {
     private ISysJobDao jobDao;
     private ISysJobDao jobDao;
     @Autowired
     @Autowired
     private ISysDeptDao deptDao;
     private ISysDeptDao deptDao;
-    @Value("${app.upload.path}")
-    private String uplaodPath;
-//    @Value("${app.image.url}")
-//    private String imageURL;
-    @Value("${spring.profiles.active}")
-    private String systemEnv;
     @Autowired
     @Autowired
     private UserDomain userDomain;
     private UserDomain userDomain;
 
 
@@ -276,11 +271,10 @@ public class UserServiceImpl implements UserService {
             NotaryOfficeEntity entity = notaryOfficeMapper.selectById(resources.getComId());
             NotaryOfficeEntity entity = notaryOfficeMapper.selectById(resources.getComId());
             if (NotaryOfficeConstant.NOTARY_AUTO_GENERATE.equals(entity.getAutoGenerate())) {
             if (NotaryOfficeConstant.NOTARY_AUTO_GENERATE.equals(entity.getAutoGenerate())) {
                 try {
                 try {
-                    CFCACertUtil.proxySwitchOn = "dev".equals(systemEnv);
                     // 安心签注册个人用户
                     // 安心签注册个人用户
                     PersonVO person = PersonVO.builder().personName(resources.getNickName())
                     PersonVO person = PersonVO.builder().personName(resources.getNickName())
                             .identNo(resources.getIdCard()).mobilePhone(resources.getPhone()).build();
                             .identNo(resources.getIdCard()).mobilePhone(resources.getPhone()).build();
-                    String userId = CFCACertUtil.registerPerson(person);
+                    String userId = cfcaCertUtil.registerPerson(person);
                     resources.setAxqUserId(userId);
                     resources.setAxqUserId(userId);
                 } catch (Exception e) {
                 } catch (Exception e) {
                     e.printStackTrace();
                     e.printStackTrace();
@@ -292,7 +286,7 @@ public class UserServiceImpl implements UserService {
                 // 安心签注册个人用户
                 // 安心签注册个人用户
                 PersonVO person = PersonVO.builder().personName(resources.getNickName())
                 PersonVO person = PersonVO.builder().personName(resources.getNickName())
                         .identNo(resources.getIdCard()).mobilePhone(resources.getPhone()).build();
                         .identNo(resources.getIdCard()).mobilePhone(resources.getPhone()).build();
-                String userId = CFCACertUtil.registerPerson(person);
+                String userId = cfcaCertUtil.registerPerson(person);
                 resources.setAxqUserId(userId);
                 resources.setAxqUserId(userId);
             } catch (Exception e) {
             } catch (Exception e) {
                 e.printStackTrace();
                 e.printStackTrace();
@@ -317,16 +311,15 @@ public class UserServiceImpl implements UserService {
             if (NotaryOfficeConstant.NOTARY_AUTO_GENERATE.equals(entity.getAutoGenerate())) {
             if (NotaryOfficeConstant.NOTARY_AUTO_GENERATE.equals(entity.getAutoGenerate())) {
                 try {
                 try {
                     SysUserEntity saveEntity = new SysUserEntity();
                     SysUserEntity saveEntity = new SysUserEntity();
-                    CFCACertUtil.proxySwitchOn = "dev".equals(systemEnv);
                     if(StringUtils.isEmpty(user.getAxqSealId())) {
                     if(StringUtils.isEmpty(user.getAxqSealId())) {
                         // 上传公证员签章,修改通过统一方式得到文件的流
                         // 上传公证员签章,修改通过统一方式得到文件的流
                         byte[] b = FileUploadUtil.getByte(resources.getSignImgId());
                         byte[] b = FileUploadUtil.getByte(resources.getSignImgId());
-                        String sealId = CFCACertUtil.addSeal(user.getAxqUserId(), b);
+                        String sealId = cfcaCertUtil.addSeal(user.getAxqUserId(), b);
                         saveEntity.setAxqSealId(sealId);
                         saveEntity.setAxqSealId(sealId);
                     } else {
                     } else {
                         // 修改公证员签章
                         // 修改公证员签章
                     	byte[] b = FileUploadUtil.getByte(resources.getSignImgId());  
                     	byte[] b = FileUploadUtil.getByte(resources.getSignImgId());  
-                        CFCACertUtil.updateSeal(user.getAxqUserId(), user.getAxqSealId(), b);
+                        cfcaCertUtil.updateSeal(user.getAxqUserId(), user.getAxqSealId(), b);
                     }
                     }
                     saveEntity.setUserId(user.getUserId());
                     saveEntity.setUserId(user.getUserId());
                     saveEntity.setSignImgId(resources.getSignImgId());
                     saveEntity.setSignImgId(resources.getSignImgId());
@@ -339,16 +332,15 @@ public class UserServiceImpl implements UserService {
         }else if(UserConstant.USER_TYPE_BANK.equals(user.getOrgId().split("_")[0])){
         }else if(UserConstant.USER_TYPE_BANK.equals(user.getOrgId().split("_")[0])){
         	try {
         	try {
                 SysUserEntity saveEntity = new SysUserEntity();
                 SysUserEntity saveEntity = new SysUserEntity();
-                CFCACertUtil.proxySwitchOn = "dev".equals(systemEnv);
                 if(StringUtils.isEmpty(user.getAxqSealId())) {
                 if(StringUtils.isEmpty(user.getAxqSealId())) {
                     // 上传公证员签章,修改通过统一方式得到文件的流
                     // 上传公证员签章,修改通过统一方式得到文件的流
                     byte[] b = FileUploadUtil.getByte(resources.getSignImgId());
                     byte[] b = FileUploadUtil.getByte(resources.getSignImgId());
-                    String sealId = CFCACertUtil.addSeal(user.getAxqUserId(), b);
+                    String sealId = cfcaCertUtil.addSeal(user.getAxqUserId(), b);
                     saveEntity.setAxqSealId(sealId);
                     saveEntity.setAxqSealId(sealId);
                 } else {
                 } else {
                     // 修改公证员签章
                     // 修改公证员签章
                 	byte[] b = FileUploadUtil.getByte(resources.getSignImgId());  
                 	byte[] b = FileUploadUtil.getByte(resources.getSignImgId());  
-                    CFCACertUtil.updateSeal(user.getAxqUserId(), user.getAxqSealId(), b);
+                    cfcaCertUtil.updateSeal(user.getAxqUserId(), user.getAxqSealId(), b);
                 }
                 }
                 saveEntity.setUserId(user.getUserId());
                 saveEntity.setUserId(user.getUserId());
                 saveEntity.setSignImgId(resources.getSignImgId());
                 saveEntity.setSignImgId(resources.getSignImgId());
@@ -388,11 +380,10 @@ public class UserServiceImpl implements UserService {
             if (NotaryOfficeConstant.NOTARY_AUTO_GENERATE.equals(entity.getAutoGenerate())) {
             if (NotaryOfficeConstant.NOTARY_AUTO_GENERATE.equals(entity.getAutoGenerate())) {
                 if (StringUtils.isEmpty(user.getAxqUserId())) {
                 if (StringUtils.isEmpty(user.getAxqUserId())) {
                     try {
                     try {
-                        CFCACertUtil.proxySwitchOn = "dev".equals(systemEnv);
                         // 安心签注册个人用户
                         // 安心签注册个人用户
                         PersonVO person = PersonVO.builder().personName(resources.getNickName())
                         PersonVO person = PersonVO.builder().personName(resources.getNickName())
                                 .identNo(resources.getIdCard()).mobilePhone(resources.getPhone()).build();
                                 .identNo(resources.getIdCard()).mobilePhone(resources.getPhone()).build();
-                        String userId = CFCACertUtil.registerPerson(person);
+                        String userId = cfcaCertUtil.registerPerson(person);
                         user.setAxqUserId(userId);
                         user.setAxqUserId(userId);
                     } catch (Exception e) {
                     } catch (Exception e) {
                         e.printStackTrace();
                         e.printStackTrace();
@@ -522,9 +513,8 @@ public class UserServiceImpl implements UserService {
     @Override
     @Override
     public void sendAuthMessage(String userId) {
     public void sendAuthMessage(String userId) {
         try {
         try {
-            CFCACertUtil.proxySwitchOn = "dev".equals(systemEnv);
             // 发送授权验证码
             // 发送授权验证码
-            CFCACertUtil.sendAuthMessage(userId);
+            cfcaCertUtil.sendAuthMessage(userId);
         }catch (Exception e){
         }catch (Exception e){
             e.printStackTrace();
             e.printStackTrace();
             throw new EntityNotFoundException(User.class, "安心签接口错误", "发送授权验证码出错");
             throw new EntityNotFoundException(User.class, "安心签接口错误", "发送授权验证码出错");
@@ -534,8 +524,7 @@ public class UserServiceImpl implements UserService {
     @Override
     @Override
     public void verifyAuthMessage(User user) {
     public void verifyAuthMessage(User user) {
         try {
         try {
-            CFCACertUtil.proxySwitchOn = "dev".equals(systemEnv);
-            CFCACertUtil.confirmAuthMessage(user.getAxqUserId(), user.getCheckCode());
+            cfcaCertUtil.confirmAuthMessage(user.getAxqUserId(), user.getCheckCode());
         }catch (Exception e){
         }catch (Exception e){
             e.printStackTrace();
             e.printStackTrace();
             throw new EntityNotFoundException(User.class, "安心签接口错误", "验证授权验证码出错");
             throw new EntityNotFoundException(User.class, "安心签接口错误", "验证授权验证码出错");
@@ -558,10 +547,9 @@ public class UserServiceImpl implements UserService {
         System.out.println(contextUtil.getCurrentUserId());
         System.out.println(contextUtil.getCurrentUserId());
         String authStatus = StringUtils.isEmpty(userEntity.getAxqIsAuth()) ? "0" : userEntity.getAxqIsAuth();
         String authStatus = StringUtils.isEmpty(userEntity.getAxqIsAuth()) ? "0" : userEntity.getAxqIsAuth();
         if ("0".equals(authStatus)) {
         if ("0".equals(authStatus)) {
-            CFCACertUtil.proxySwitchOn = "dev".equals(systemEnv);
             try {
             try {
                 // 发送授权验证码
                 // 发送授权验证码
-                boolean isAuthed = CFCACertUtil.sendAuthMessage(userEntity.getAxqUserId());
+                boolean isAuthed = cfcaCertUtil.sendAuthMessage(userEntity.getAxqUserId());
                 if (isAuthed) {
                 if (isAuthed) {
                     authStatus = "1";
                     authStatus = "1";
                     SysUserEntity saveUser = new SysUserEntity();
                     SysUserEntity saveUser = new SysUserEntity();

+ 13 - 1
eladmin-system/src/main/java/me/zhengjie/application/bank/controller/BankLoginController.java

@@ -21,6 +21,7 @@ import me.zhengjie.dao.mybatis.entity.UserAXQInfoEntity;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
@@ -40,7 +41,7 @@ import java.util.List;
 @RequestMapping("${fqgz.bank.app.url-prefix}")
 @RequestMapping("${fqgz.bank.app.url-prefix}")
 @Slf4j
 @Slf4j
 @RequiredArgsConstructor
 @RequiredArgsConstructor
-public class BankLoginController extends BaseController {
+public class BankAuthController extends BaseController {
     private final BankLoginService bankLoginService;
     private final BankLoginService bankLoginService;
     private final FileInfoService fileInfoService;
     private final FileInfoService fileInfoService;
     private final UserAXQInfoRepository userAXQInfoRepository;
     private final UserAXQInfoRepository userAXQInfoRepository;
@@ -57,6 +58,17 @@ public class BankLoginController extends BaseController {
     }
     }
 
 
     /**
     /**
+     * 退出登录
+     *
+     * @return
+     */
+    @GetMapping("/logout")
+    public ResponseDTO logout() {
+        bankLoginService.logout(getAuthorization());
+        return ResponseDTO.success();
+    }
+
+    /**
      * 文件和图片
      * 文件和图片
      *
      *
      * @return
      * @return

+ 2 - 1
eladmin-system/src/main/java/me/zhengjie/application/bank/controller/BankNotarizeController.java

@@ -12,6 +12,7 @@ import lombok.extern.slf4j.Slf4j;
 import me.zhengjie.annotation.rest.AnonymousGetMapping;
 import me.zhengjie.annotation.rest.AnonymousGetMapping;
 import me.zhengjie.annotation.rest.AnonymousPostMapping;
 import me.zhengjie.annotation.rest.AnonymousPostMapping;
 import me.zhengjie.application.admin.service.SmsTemplateService;
 import me.zhengjie.application.admin.service.SmsTemplateService;
+import me.zhengjie.application.bank.BaseController;
 import me.zhengjie.application.bank.service.BankNotarizeService;
 import me.zhengjie.application.bank.service.BankNotarizeService;
 import me.zhengjie.application.bank.service.UserAXQInfoService;
 import me.zhengjie.application.bank.service.UserAXQInfoService;
 import me.zhengjie.base.ResponseDTO;
 import me.zhengjie.base.ResponseDTO;
@@ -39,7 +40,7 @@ import static com.arcsoft.face.toolkit.ImageFactory.getRGBData;
 @RequestMapping("${fqgz.bank.app.url-prefix}")
 @RequestMapping("${fqgz.bank.app.url-prefix}")
 @Slf4j
 @Slf4j
 @RequiredArgsConstructor
 @RequiredArgsConstructor
-public class BankNotarizeController {
+public class BankNotarizeController extends BaseController {
 	private final OrderFileRepository orderFileRepository;
 	private final OrderFileRepository orderFileRepository;
 	private final UserAXQInfoService userAXQInfoService;
 	private final UserAXQInfoService userAXQInfoService;
 	private final BankNotarizeService bankNotarizeService;
 	private final BankNotarizeService bankNotarizeService;

+ 2 - 1
eladmin-system/src/main/java/me/zhengjie/application/bank/controller/BankNoteVideoController.java

@@ -3,6 +3,7 @@ package me.zhengjie.application.bank.controller;
 import lombok.RequiredArgsConstructor;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import me.zhengjie.annotation.rest.AnonymousPostMapping;
 import me.zhengjie.annotation.rest.AnonymousPostMapping;
+import me.zhengjie.application.bank.BaseController;
 import me.zhengjie.base.ResponseDTO;
 import me.zhengjie.base.ResponseDTO;
 import me.zhengjie.base.sms.CreateCloudRecording;
 import me.zhengjie.base.sms.CreateCloudRecording;
 import me.zhengjie.base.sms.TrtcVo;
 import me.zhengjie.base.sms.TrtcVo;
@@ -19,7 +20,7 @@ import java.util.Map;
 @RequestMapping("${fqgz.bank.app.url-prefix}/note-video")
 @RequestMapping("${fqgz.bank.app.url-prefix}/note-video")
 @Slf4j
 @Slf4j
 @RequiredArgsConstructor
 @RequiredArgsConstructor
-public class BankNoteVideoController {
+public class BankNoteVideoController extends BaseController {
 
 
     /**
     /**
      * 录制App端视频
      * 录制App端视频

+ 41 - 0
eladmin-system/src/main/java/me/zhengjie/application/bank/controller/BankUserController.java

@@ -0,0 +1,41 @@
+package me.zhengjie.application.bank.controller;
+
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import me.zhengjie.application.bank.BaseController;
+import me.zhengjie.application.bank.controller.vo.BankUserPwdVO;
+import me.zhengjie.application.bank.service.BankUserService;
+import me.zhengjie.base.ResponseDTO;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+@Validated
+@RestController
+@RequestMapping("${fqgz.bank.app.url-prefix}/user")
+@Slf4j
+@RequiredArgsConstructor
+public class BankUserController extends BaseController {
+    private final BankUserService bankUserService;
+
+    /**
+     * 修改秘密
+     *
+     * @param userPwdVO
+     * @return
+     */
+    @PostMapping("/update-pwd")
+    public ResponseDTO updatePwd(@RequestBody BankUserPwdVO userPwdVO) {
+        bankUserService.updatePwd(userPwdVO, getCurrentUser().getUsername());
+        return ResponseDTO.success();
+    }
+
+    /**
+     * 签章图片连接
+     *
+     * @return
+     */
+    @GetMapping("/seal-url")
+    public ResponseDTO<String> sealUrl() {
+        return ResponseDTO.success(bankUserService.getSealUrl(getCurrentUser().getSignImgId()));
+    }
+}

+ 2 - 2
eladmin-system/src/main/java/me/zhengjie/application/bank/controller/vo/BankOrderVO.java

@@ -31,10 +31,8 @@ public class BankOrderVO {
     @NotNull(message = "合同类型不能为空")
     @NotNull(message = "合同类型不能为空")
     private Integer contractType;
     private Integer contractType;
     // 合同起始日
     // 合同起始日
-    @NotBlank(message = "合同起始日不能为空")
     private String startDate;
     private String startDate;
     // 合同终止日
     // 合同终止日
-    @NotBlank(message = "合同终止日不能为空")
     private String endDate;
     private String endDate;
     // 合同金额
     // 合同金额
     @NotBlank(message = "合同金额不能为空")
     @NotBlank(message = "合同金额不能为空")
@@ -136,4 +134,6 @@ public class BankOrderVO {
     private String ownership;
     private String ownership;
     // 买价
     // 买价
     private String buyingPrice;
     private String buyingPrice;
+    // 合同期间(月数)
+    private String contractTerm;
 }
 }

+ 9 - 0
eladmin-system/src/main/java/me/zhengjie/application/bank/controller/vo/BankUserPwdVO.java

@@ -0,0 +1,9 @@
+package me.zhengjie.application.bank.controller.vo;
+
+import lombok.Data;
+
+@Data
+public class BankUserPwdVO {
+    private String oldPwd;
+    private String newPwd;
+}

+ 1 - 42
eladmin-system/src/main/java/me/zhengjie/application/bank/mq/RedisReceiver.java

@@ -2,14 +2,6 @@ package me.zhengjie.application.bank.mq;
 
 
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import lombok.RequiredArgsConstructor;
 import lombok.RequiredArgsConstructor;
-import me.zhengjie.base.util.FileUploadUtil;
-import me.zhengjie.dao.mybatis.ModelRepository;
-import me.zhengjie.dao.mybatis.OrderFileRepository;
-import me.zhengjie.dao.mybatis.ContractOrderRepository;
-import me.zhengjie.dao.mybatis.entity.ModelEntity;
-import me.zhengjie.dao.mybatis.entity.ContractOrderEntity;
-import me.zhengjie.dao.mybatis.entity.OrderFileEntity;
-import me.zhengjie.dao.mybatis.mapper.OrderFileMapper;
 import me.zhengjie.domain.model.ModelSynthesizerDomain;
 import me.zhengjie.domain.model.ModelSynthesizerDomain;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.data.redis.connection.Message;
 import org.springframework.data.redis.connection.Message;
@@ -17,16 +9,9 @@ import org.springframework.data.redis.connection.MessageListener;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
 
 
-import java.util.Date;
-import java.util.List;
-
 @Component
 @Component
 @RequiredArgsConstructor
 @RequiredArgsConstructor
 public class RedisReceiver implements MessageListener {
 public class RedisReceiver implements MessageListener {
-	private final OrderFileMapper orderFileMapper;
-	private final ContractOrderRepository contractOrderRepository;
-	private final ModelRepository modelRepository;
-	private final OrderFileRepository orderFileRepository;
 	private final ModelSynthesizerDomain modelSynthesizerDomain;
 	private final ModelSynthesizerDomain modelSynthesizerDomain;
 
 
 	@Override
 	@Override
@@ -37,34 +22,8 @@ public class RedisReceiver implements MessageListener {
 		System.out.println(text);
 		System.out.println(text);
 		if (StringUtils.isNotBlank(text)) {
 		if (StringUtils.isNotBlank(text)) {
 			JSONObject jsonObject = JSONObject.parseObject(text);
 			JSONObject jsonObject = JSONObject.parseObject(text);
-			generateCommonDoc(jsonObject);
+			modelSynthesizerDomain.generateCommonDoc(jsonObject.getString("userId"), jsonObject.getString("businessNo"));
 		}
 		}
 		System.out.println("Redis message receiver for generate common doc is end.");
 		System.out.println("Redis message receiver for generate common doc is end.");
 	}
 	}
-
-	public void generateCommonDoc(JSONObject jsonObject) {
-		String userId = jsonObject.getString("userId");
-		String businessNo = jsonObject.getString("businessNo");
-		//
-		ContractOrderEntity contractOrderEntity = contractOrderRepository.getContractOrderWithBizNo(businessNo);
-		List<ModelEntity> models = modelRepository.getCommonModel(contractOrderEntity.getProdId(),contractOrderEntity.getContractType(), contractOrderEntity.getNotaryOfficeId());
-		// 在保存之前先删除数据
-		orderFileRepository.delFileWithBizNO(businessNo);
-		for (ModelEntity m : models) {
-			OrderFileEntity fileEntity = new OrderFileEntity();
-			fileEntity.setBusinessNo(businessNo);
-			fileEntity.setCode(m.getCode());
-			fileEntity.setSortNum(m.getSort());
-			String html = modelSynthesizerDomain.composeCommonTemplateWithData(businessNo, m.getContent(),"");
-			String htmlPath = FileUploadUtil.saveHtml(html, businessNo);
-			String pdfPath = FileUploadUtil.savePdf(html, businessNo);
-			fileEntity.setHtmlUrl(htmlPath);
-			fileEntity.setPdfUrl(pdfPath);
-			fileEntity.setCreateTime(new Date());
-			fileEntity.setCreatorId(Long.parseLong(userId));
-			fileEntity.setFileName(m.getTitle());
-			//
-			orderFileMapper.insert(fileEntity);
-		}
-	}
 }
 }

+ 8 - 0
eladmin-system/src/main/java/me/zhengjie/application/bank/service/BankLoginService.java

@@ -14,8 +14,16 @@ public interface BankLoginService {
 
 
 	/**
 	/**
 	 * 登录
 	 * 登录
+	 *
 	 * @param sms
 	 * @param sms
 	 * @return
 	 * @return
 	 */
 	 */
 	ResponseDTO<BankLoginVO> login(BankLoginVO sms);
 	ResponseDTO<BankLoginVO> login(BankLoginVO sms);
+
+	/**
+	 * 退出
+	 *
+	 * @param authToken
+	 */
+	void logout(String authToken);
 }
 }

+ 10 - 0
eladmin-system/src/main/java/me/zhengjie/application/bank/service/BankUserService.java

@@ -0,0 +1,10 @@
+package me.zhengjie.application.bank.service;
+
+import me.zhengjie.application.bank.controller.vo.BankUserPwdVO;
+
+public interface BankUserService {
+
+    void updatePwd(BankUserPwdVO userPwdVO, String userName);
+
+    String getSealUrl(String signImgId);
+}

+ 4 - 0
eladmin-system/src/main/java/me/zhengjie/application/bank/service/impl/BankLoginServiceImpl.java

@@ -41,4 +41,8 @@ public class BankLoginServiceImpl implements BankLoginService {
 		}
 		}
 		return ResponseDTO.error(ResultCode.USER_LOGIN_ERROR);
 		return ResponseDTO.error(ResultCode.USER_LOGIN_ERROR);
 	}
 	}
+
+	public void logout(String authToken){
+		tokenProvider.delToken(authToken);
+	}
 }
 }

+ 15 - 4
eladmin-system/src/main/java/me/zhengjie/application/bank/service/impl/BankOrderServiceImpl.java

@@ -19,6 +19,7 @@ import me.zhengjie.dao.mybatis.mapper.BankMapper;
 import me.zhengjie.dao.mybatis.mapper.FileInfoMapper;
 import me.zhengjie.dao.mybatis.mapper.FileInfoMapper;
 import me.zhengjie.dao.mybatis.mapper.NotaryOfficeMapper;
 import me.zhengjie.dao.mybatis.mapper.NotaryOfficeMapper;
 import me.zhengjie.domain.model.ModelConstant;
 import me.zhengjie.domain.model.ModelConstant;
+import me.zhengjie.domain.model.ModelSynthesizerDomain;
 import me.zhengjie.domain.order.OrderBizCodeMessage;
 import me.zhengjie.domain.order.OrderBizCodeMessage;
 import me.zhengjie.domain.order.OrderConstant;
 import me.zhengjie.domain.order.OrderConstant;
 import me.zhengjie.domain.order.parser.OrderOCRParser;
 import me.zhengjie.domain.order.parser.OrderOCRParser;
@@ -57,6 +58,7 @@ public class BankOrderServiceImpl implements BankOrderService {
 
 
     private final OrderFileRepository orderFileRepository;
     private final OrderFileRepository orderFileRepository;
     private final SmsTemplateService smsTemplateService;
     private final SmsTemplateService smsTemplateService;
+    private final ModelSynthesizerDomain modelSynthesizerDomain;
     @Override
     @Override
     public void saveContractOrder(BankOrderVO vo, SysUserEntity userEntity) {
     public void saveContractOrder(BankOrderVO vo, SysUserEntity userEntity) {
         BankEntity bank = bankMapper.selectById(userEntity.getOrgId().split("_")[1]);
         BankEntity bank = bankMapper.selectById(userEntity.getOrgId().split("_")[1]);
@@ -64,6 +66,15 @@ public class BankOrderServiceImpl implements BankOrderService {
         NotaryOfficeEntity notaryOfficeEntity = notaryOfficeMapper.selectById(officeXbank.getNotaryOfficeId());
         NotaryOfficeEntity notaryOfficeEntity = notaryOfficeMapper.selectById(officeXbank.getNotaryOfficeId());
         // 保存或修改借款人信息
         // 保存或修改借款人信息
         ContractOrderEntity saveOrder = BeanCopyUtils.convertObj(vo, ContractOrderEntity.class);
         ContractOrderEntity saveOrder = BeanCopyUtils.convertObj(vo, ContractOrderEntity.class);
+        if (!OrderConstant.JOINT_FLAG_TRUE.equals(saveOrder.getJointFlag())) {
+            saveOrder.setJointIdCard("");
+            saveOrder.setJointIdcardBackPic("");
+            saveOrder.setJointIdcardFrontPic("");
+            saveOrder.setJointName("");
+            saveOrder.setJointPhone("");
+            saveOrder.setJointResidence("");
+            saveOrder.setJointSex("");
+        }
         saveOrder.setStartDate(DateFormatUtils.defaultFormat(vo.getStartDate()));
         saveOrder.setStartDate(DateFormatUtils.defaultFormat(vo.getStartDate()));
         saveOrder.setEndDate(DateFormatUtils.defaultFormat(vo.getEndDate()));
         saveOrder.setEndDate(DateFormatUtils.defaultFormat(vo.getEndDate()));
         saveOrder.setCustomerId(String.valueOf(userEntity.getUserId()));
         saveOrder.setCustomerId(String.valueOf(userEntity.getUserId()));
@@ -176,11 +187,11 @@ public class BankOrderServiceImpl implements BankOrderService {
         }
         }
         updateStatus(businessNo, OrderConstant.ORDER_STATUS_UNCHECKED, "");
         updateStatus(businessNo, OrderConstant.ORDER_STATUS_UNCHECKED, "");
         // 推送创建订单文档任务消息
         // 推送创建订单文档任务消息
-        JSONObject jsonObject = new JSONObject();
-        jsonObject.put("businessNo", businessNo);
-        jsonObject.put("userId", currentUser.getUserId());
-        redisReceiver.generateCommonDoc(jsonObject);
+//      JSONObject jsonObject = new JSONObject();
+//      jsonObject.put("businessNo", businessNo);
+//      jsonObject.put("userId", currentUser.getUserId());
 //		redisTemplate.convertAndSend(RedisCacheConfig.CHANNEL_HTML_PDF, jsonObject.toJSONString());
 //		redisTemplate.convertAndSend(RedisCacheConfig.CHANNEL_HTML_PDF, jsonObject.toJSONString());
+        modelSynthesizerDomain.generateCommonDoc(String.valueOf(currentUser.getUserId()), businessNo);
         //发送短信
         //发送短信
         smsTemplateService.submitSuccess(businessNo);
         smsTemplateService.submitSuccess(businessNo);
         
         

+ 49 - 0
eladmin-system/src/main/java/me/zhengjie/application/bank/service/impl/BankUserServiceImpl.java

@@ -0,0 +1,49 @@
+package me.zhengjie.application.bank.service.impl;
+
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import me.zhengjie.application.bank.controller.vo.BankUserPwdVO;
+import me.zhengjie.application.bank.service.BankUserService;
+import me.zhengjie.base.util.FileUploadUtil;
+import me.zhengjie.dao.mybatis.entity.FileInfoEntity;
+import me.zhengjie.dao.mybatis.entity.User;
+import me.zhengjie.dao.mybatis.mapper.FileInfoMapper;
+import me.zhengjie.dao.mybatis.mapper.UserRepository;
+import me.zhengjie.exception.BadRequestException;
+import org.springframework.security.crypto.password.PasswordEncoder;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Date;
+
+@Service
+@Slf4j
+@RequiredArgsConstructor
+public class BankUserServiceImpl implements BankUserService {
+    private final UserRepository userRepository;
+    private final PasswordEncoder passwordEncoder;
+    private final FileInfoMapper fileInfoMapper;
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void updatePwd(BankUserPwdVO userPwdVO, String userName) {
+        User userEntity = userRepository.findByUsername(userName);
+        if (!passwordEncoder.matches(userPwdVO.getOldPwd(), userEntity.getPassword())) {
+            throw new BadRequestException("修改失败,旧密码错误");
+        }
+        if (passwordEncoder.matches(userPwdVO.getNewPwd(), userEntity.getPassword())) {
+            throw new BadRequestException("新密码不能与旧密码相同");
+        }
+        userRepository.updatePass(userEntity.getUsername(), passwordEncoder.encode(userPwdVO.getNewPwd()), new Date());
+    }
+
+    @Override
+    public String getSealUrl(String signImgId) {
+        FileInfoEntity fileInfo = fileInfoMapper.selectById(signImgId);
+        String sealUrl = "";
+        if (fileInfo != null) {
+            sealUrl = FileUploadUtil.getFileUrl(fileInfo.getPath());
+        }
+        return sealUrl;
+    }
+}

+ 27 - 30
eladmin-system/src/main/java/me/zhengjie/application/bank/service/impl/UserAXQInfoServiceImpl.java

@@ -6,23 +6,22 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import lombok.RequiredArgsConstructor;
 import lombok.RequiredArgsConstructor;
-import me.zhengjie.base.util.ApplicationContextUtil;
-import me.zhengjie.dao.mybatis.ContractOrderRepository;
-import me.zhengjie.dao.mybatis.UserAXQInfoRepository;
-import me.zhengjie.dao.mybatis.entity.*;
-import me.zhengjie.dao.mybatis.mapper.FileInfoMapper;
-import me.zhengjie.dao.mybatis.mapper.SysUserMapper;
-import me.zhengjie.dao.mybatis.mapper.UserAXQInfoMapper;
 import me.zhengjie.application.bank.service.UserAXQInfoService;
 import me.zhengjie.application.bank.service.UserAXQInfoService;
-import me.zhengjie.base.util.FileUploadUtil;
 import me.zhengjie.base.ResponseDTO;
 import me.zhengjie.base.ResponseDTO;
 import me.zhengjie.base.ResultCode;
 import me.zhengjie.base.ResultCode;
 import me.zhengjie.base.pdf.PdfUtils;
 import me.zhengjie.base.pdf.PdfUtils;
+import me.zhengjie.base.util.CFCACertUtil;
+import me.zhengjie.base.util.FileUploadUtil;
+import me.zhengjie.dao.mybatis.ContractOrderRepository;
 import me.zhengjie.dao.mybatis.OrderFileRepository;
 import me.zhengjie.dao.mybatis.OrderFileRepository;
+import me.zhengjie.dao.mybatis.UserAXQInfoRepository;
+import me.zhengjie.dao.mybatis.entity.*;
+import me.zhengjie.dao.mybatis.mapper.FileInfoMapper;
 import me.zhengjie.dao.mybatis.mapper.OrderFileMapper;
 import me.zhengjie.dao.mybatis.mapper.OrderFileMapper;
-import me.zhengjie.base.util.CFCACertUtil;
+import me.zhengjie.dao.mybatis.mapper.SysUserMapper;
+import me.zhengjie.dao.mybatis.mapper.UserAXQInfoMapper;
+import me.zhengjie.domain.model.ModelSynthesizerDomain;
 import me.zhengjie.utils.StringUtils;
 import me.zhengjie.utils.StringUtils;
-import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayInputStream;
@@ -38,8 +37,6 @@ import java.util.List;
 @RequiredArgsConstructor
 @RequiredArgsConstructor
 public class UserAXQInfoServiceImpl implements UserAXQInfoService {
 public class UserAXQInfoServiceImpl implements UserAXQInfoService {
 
 
-	@Value("${spring.profiles.active}")
-	private String systemEnv;
 	private final UserAXQInfoRepository userAXQInfoRepository;
 	private final UserAXQInfoRepository userAXQInfoRepository;
 	private final UserAXQInfoMapper userAXQInfoMapper;
 	private final UserAXQInfoMapper userAXQInfoMapper;
 	private final OrderFileRepository orderFileRepository;
 	private final OrderFileRepository orderFileRepository;
@@ -47,16 +44,17 @@ public class UserAXQInfoServiceImpl implements UserAXQInfoService {
 	private final FileInfoMapper fileInfoMapper;
 	private final FileInfoMapper fileInfoMapper;
 	private final ContractOrderRepository contractOrderRepository;
 	private final ContractOrderRepository contractOrderRepository;
 	private final SysUserMapper sysUserMapper;
 	private final SysUserMapper sysUserMapper;
+	private final CFCACertUtil cfcaCertUtil;
+	private final ModelSynthesizerDomain modelSynthesizerDomain;
 
 
 	@Override
 	@Override
 	public ResponseDTO<?> registAXQUser(String idCard, String phone, String name) {
 	public ResponseDTO<?> registAXQUser(String idCard, String phone, String name) {
 		try {
 		try {
 			UserAXQInfoEntity entity = userAXQInfoRepository.getUserAXQInfoWithIdcard(idCard);
 			UserAXQInfoEntity entity = userAXQInfoRepository.getUserAXQInfoWithIdcard(idCard);
 			if (entity == null) {
 			if (entity == null) {
-				CFCACertUtil.proxySwitchOn = "dev".equals(systemEnv);
 				// 安心签注册个人用户
 				// 安心签注册个人用户
 				PersonVO person = PersonVO.builder().personName(name).identNo(idCard).mobilePhone(phone).build();
 				PersonVO person = PersonVO.builder().personName(name).identNo(idCard).mobilePhone(phone).build();
-				String userId = CFCACertUtil.registerPerson(person);
+				String userId = cfcaCertUtil.registerPerson(person);
 				UserAXQInfoEntity userAXQInfoEntity = new UserAXQInfoEntity();
 				UserAXQInfoEntity userAXQInfoEntity = new UserAXQInfoEntity();
 				userAXQInfoEntity.setIdCard(idCard);
 				userAXQInfoEntity.setIdCard(idCard);
 				userAXQInfoEntity.setUserName(name);
 				userAXQInfoEntity.setUserName(name);
@@ -82,20 +80,20 @@ public class UserAXQInfoServiceImpl implements UserAXQInfoService {
 				String idCard = jsonObject.getString("idCard");
 				String idCard = jsonObject.getString("idCard");
 				String imageId = jsonObject.getString("imageId");
 				String imageId = jsonObject.getString("imageId");
 				//
 				//
+				UserAXQInfoEntity entity = userAXQInfoRepository.getUserAXQInfoWithIdcard(idCard);
 				FileInfoEntity fileInfo = fileInfoMapper.selectById(imageId);
 				FileInfoEntity fileInfo = fileInfoMapper.selectById(imageId);
 				String content = inputStream2Base64(FileUploadUtil.getInputStream(fileInfo.getPath()));
 				String content = inputStream2Base64(FileUploadUtil.getInputStream(fileInfo.getPath()));
-				UserAXQInfoEntity entity = userAXQInfoRepository.getUserAXQInfoWithIdcard(idCard);
-				CFCACertUtil.proxySwitchOn = "dev".equals(systemEnv);
+				UserAXQInfoEntity saveEntity = new UserAXQInfoEntity();
 				if (!StringUtils.isEmpty(entity.getAxqSealId())) {
 				if (!StringUtils.isEmpty(entity.getAxqSealId())) {
-					CFCACertUtil.updateSealWithContent(entity.getAxqUserId(), entity.getAxqSealId(), content);
+					cfcaCertUtil.updateSealWithContent(entity.getAxqUserId(), entity.getAxqSealId(), content);
 				} else {
 				} else {
-					String sealId = CFCACertUtil.addSealWithContent(entity.getAxqUserId(), content);
+					String sealId = cfcaCertUtil.addSealWithContent(entity.getAxqUserId(), content);
 					entity.setAxqSealId(sealId);
 					entity.setAxqSealId(sealId);
-					UserAXQInfoEntity updateEntity = new UserAXQInfoEntity();
-					updateEntity.setId(entity.getId());
-					updateEntity.setAxqSealId(sealId);
-					userAXQInfoMapper.updateById(updateEntity);
+					saveEntity.setAxqSealId(sealId);
 				}
 				}
+				saveEntity.setId(entity.getId());
+				saveEntity.setImgSealId(Integer.parseInt(imageId));
+				userAXQInfoRepository.updateById(saveEntity);
 				// 签名用户信息
 				// 签名用户信息
 				UploadSignInfoVO notartyUser = new UploadSignInfoVO();
 				UploadSignInfoVO notartyUser = new UploadSignInfoVO();
 				notartyUser.setUserId(entity.getAxqUserId());
 				notartyUser.setUserId(entity.getAxqUserId());
@@ -105,6 +103,8 @@ public class UserAXQInfoServiceImpl implements UserAXQInfoService {
 				//
 				//
 				signInfoList.add(notartyUser);
 				signInfoList.add(notartyUser);
 			}
 			}
+			// 重新生成模板
+			modelSynthesizerDomain.recreateCommonDoc(businessNo);
 			// 客户经理签名信息
 			// 客户经理签名信息
 			ContractOrderEntity order = contractOrderRepository.getContractOrderWithBizNo(businessNo);
 			ContractOrderEntity order = contractOrderRepository.getContractOrderWithBizNo(businessNo);
 			SysUserEntity customer = sysUserMapper.selectById(order.getCustomerId());
 			SysUserEntity customer = sysUserMapper.selectById(order.getCustomerId());
@@ -130,9 +130,8 @@ public class UserAXQInfoServiceImpl implements UserAXQInfoService {
 			qw.eq("id_card", idCard);
 			qw.eq("id_card", idCard);
 			qw.eq("user_status", "1");
 			qw.eq("user_status", "1");
 			UserAXQInfoEntity entity = userAXQInfoMapper.selectOne(qw);
 			UserAXQInfoEntity entity = userAXQInfoMapper.selectOne(qw);
-			CFCACertUtil.proxySwitchOn = "dev".equals(systemEnv);
 			// 发送授权验证码
 			// 发送授权验证码
-			CFCACertUtil.sendAuthMessage(entity.getAxqUserId());
+			cfcaCertUtil.sendAuthMessage(entity.getAxqUserId());
 		} catch (Exception e) {
 		} catch (Exception e) {
 			e.printStackTrace();
 			e.printStackTrace();
 			return ResponseDTO.error(ResultCode.AXQ_AUTH_MESSAGE_FAIL);
 			return ResponseDTO.error(ResultCode.AXQ_AUTH_MESSAGE_FAIL);
@@ -147,8 +146,7 @@ public class UserAXQInfoServiceImpl implements UserAXQInfoService {
 			qw.eq("id_card", idCard);
 			qw.eq("id_card", idCard);
 			qw.eq("user_status", "1");
 			qw.eq("user_status", "1");
 			UserAXQInfoEntity entity = userAXQInfoMapper.selectOne(qw);
 			UserAXQInfoEntity entity = userAXQInfoMapper.selectOne(qw);
-			CFCACertUtil.proxySwitchOn = "dev".equals(systemEnv);
-			CFCACertUtil.confirmAuthMessage(entity.getAxqUserId(), checkCode);
+			cfcaCertUtil.confirmAuthMessage(entity.getAxqUserId(), checkCode);
 			//
 			//
 			UserAXQInfoEntity saveEntiy = new UserAXQInfoEntity();
 			UserAXQInfoEntity saveEntiy = new UserAXQInfoEntity();
 			saveEntiy.setId(entity.getId());
 			saveEntiy.setId(entity.getId());
@@ -184,9 +182,9 @@ public class UserAXQInfoServiceImpl implements UserAXQInfoService {
 		byte[] b = PdfUtils.mergePdf(list);
 		byte[] b = PdfUtils.mergePdf(list);
 		//将所有需要签名的pdf进行合并
 		//将所有需要签名的pdf进行合并
 		InputStream input = new ByteArrayInputStream(b);
 		InputStream input = new ByteArrayInputStream(b);
-		String axqContractNo = CFCACertUtil.uploadMultiSignContract(signInfoList, null, null, input, fileName);
+		String axqContractNo = cfcaCertUtil.uploadMultiSignContract(signInfoList, null, null, input, fileName);
 		String path = businessNo + "/signed-doc/";
 		String path = businessNo + "/signed-doc/";
-		String filePath = CFCACertUtil.download(path, axqContractNo);
+		String filePath = cfcaCertUtil.download(path, axqContractNo);
 		for (OrderFileEntity orderFile : orderFileList) {
 		for (OrderFileEntity orderFile : orderFileList) {
 			OrderFileEntity updateOrderFile = new OrderFileEntity();
 			OrderFileEntity updateOrderFile = new OrderFileEntity();
 			updateOrderFile.setId(orderFile.getId());
 			updateOrderFile.setId(orderFile.getId());
@@ -237,10 +235,9 @@ public class UserAXQInfoServiceImpl implements UserAXQInfoService {
 				: userAXQInfoEntity.getAxqIsAuth();
 				: userAXQInfoEntity.getAxqIsAuth();
 		System.out.println("身份证号:" + idCard + ";授权状态:" + authStatus);
 		System.out.println("身份证号:" + idCard + ";授权状态:" + authStatus);
 		if ("0".equals(authStatus)) {
 		if ("0".equals(authStatus)) {
-			CFCACertUtil.proxySwitchOn = "dev".equals(systemEnv);
 			try {
 			try {
 				// 发送授权验证码
 				// 发送授权验证码
-				boolean isAuthed = CFCACertUtil.sendAuthMessage(userAXQInfoEntity.getAxqUserId());
+				boolean isAuthed = cfcaCertUtil.sendAuthMessage(userAXQInfoEntity.getAxqUserId());
 				if (isAuthed) {
 				if (isAuthed) {
 					authStatus = "1";
 					authStatus = "1";
 					UserAXQInfoEntity saveEntiy = new UserAXQInfoEntity();
 					UserAXQInfoEntity saveEntiy = new UserAXQInfoEntity();

+ 40 - 58
eladmin-system/src/main/java/me/zhengjie/base/util/CFCACertUtil.java

@@ -6,28 +6,32 @@ import cfca.trustsign.common.vo.cs.*;
 import cfca.trustsign.common.vo.request.tx3.*;
 import cfca.trustsign.common.vo.request.tx3.*;
 import cfca.trustsign.common.vo.response.ErrorResVO;
 import cfca.trustsign.common.vo.response.ErrorResVO;
 import cfca.trustsign.common.vo.response.tx3.*;
 import cfca.trustsign.common.vo.response.tx3.*;
-
-import cfca.trustsign.constant.Request;
-import cfca.trustsign.converter.JsonObjectMapper;
-import cfca.trustsign.util.PdfUtil;
-import cfca.trustsign.util.SecurityUtil;
-import cfca.trustsign.util.TimeUtil;
+import com.alibaba.fastjson.JSONObject;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import me.zhengjie.application.admin.service.DictDetailService;
 import me.zhengjie.application.admin.service.DictDetailService;
+import me.zhengjie.sign.connector.HttpConnector;
+import me.zhengjie.sign.converter.JsonObjectMapper;
+import me.zhengjie.sign.util.PdfUtil;
+import me.zhengjie.sign.util.SecurityUtil;
+import me.zhengjie.sign.util.TimeUtil;
 import me.zhengjie.utils.SpringContextHolder;
 import me.zhengjie.utils.SpringContextHolder;
-import com.alibaba.fastjson.JSONObject;
-import com.fasterxml.jackson.databind.ObjectMapper;
+import org.springframework.stereotype.Component;
+
 import java.io.File;
 import java.io.File;
 import java.io.InputStream;
 import java.io.InputStream;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
 
 
+@Component
 @Slf4j
 @Slf4j
+@RequiredArgsConstructor
 public class CFCACertUtil {
 public class CFCACertUtil {
+	private final HttpConnector httpConnector;
 	private static final int PROXY_SIGN_ON = 1;
 	private static final int PROXY_SIGN_ON = 1;
 	private static final String PROJECT_CODE = "005";
 	private static final String PROJECT_CODE = "005";
 	private static final String AUTH_MODE = "公安部";
 	private static final String AUTH_MODE = "公安部";
-	public static boolean proxySwitchOn = false;
 
 
 	/**
 	/**
 	 * 注册安心签企业用户
 	 * 注册安心签企业用户
@@ -37,7 +41,7 @@ public class CFCACertUtil {
 	 * @return 安心签用户ID
 	 * @return 安心签用户ID
 	 * @throws Exception
 	 * @throws Exception
 	 */
 	 */
-	public static String registerCompany(EnterpriseVO enterprise, EnterpriseTransactorVO enterpriseTransactor)
+	public String registerCompany(EnterpriseVO enterprise, EnterpriseTransactorVO enterpriseTransactor)
 			throws Exception {
 			throws Exception {
 
 
 		enterprise.setAuthenticationTime(TimeUtil.getCurrentTime(TimeUtil.FORMAT_14));
 		enterprise.setAuthenticationTime(TimeUtil.getCurrentTime(TimeUtil.FORMAT_14));
@@ -65,7 +69,7 @@ public class CFCACertUtil {
 	 *
 	 *
 	 * @throws Exception
 	 * @throws Exception
 	 */
 	 */
-	public static String registerPerson(PersonVO person) throws Exception {
+	public String registerPerson(PersonVO person) throws Exception {
 		person.setAuthenticationTime(TimeUtil.getCurrentTime(TimeUtil.FORMAT_14));
 		person.setAuthenticationTime(TimeUtil.getCurrentTime(TimeUtil.FORMAT_14));
 		person.setAuthenticationMode(AUTH_MODE);
 		person.setAuthenticationMode(AUTH_MODE);
 
 
@@ -90,7 +94,7 @@ public class CFCACertUtil {
 	 * @return
 	 * @return
 	 * @throws Exception
 	 * @throws Exception
 	 */
 	 */
-	public static CertVO queryCertificate(CertVO cert) throws Exception {
+	public CertVO queryCertificate(CertVO cert) throws Exception {
 		Tx3311ReqVO tx3311ReqVO = new Tx3311ReqVO();
 		Tx3311ReqVO tx3311ReqVO = new Tx3311ReqVO();
 		tx3311ReqVO.setHead(HeadVO.builder().txTime(TimeUtil.getCurrentTime(TimeUtil.FORMAT_14)).build());
 		tx3311ReqVO.setHead(HeadVO.builder().txTime(TimeUtil.getCurrentTime(TimeUtil.FORMAT_14)).build());
 		tx3311ReqVO.setCert(cert);
 		tx3311ReqVO.setCert(cert);
@@ -105,7 +109,7 @@ public class CFCACertUtil {
 	}
 	}
 	//	9. 修改印章3012
 	//	9. 修改印章3012
 	//	此接口用于客户平台修改某用户的印章图片。客户平台可以调用此接口修改某用户指定印章ID的印章图片。
 	//	此接口用于客户平台修改某用户的印章图片。客户平台可以调用此接口修改某用户指定印章ID的印章图片。
-	public static void updateSealWithContent(String userId, String sealId, String content) throws Exception {
+	public void updateSealWithContent(String userId, String sealId, String content) throws Exception {
 
 
 		HeadVO head = new HeadVO();
 		HeadVO head = new HeadVO();
 		head.setTxTime(TimeUtil.getCurrentTime(TimeUtil.FORMAT_14));
 		head.setTxTime(TimeUtil.getCurrentTime(TimeUtil.FORMAT_14));
@@ -138,7 +142,7 @@ public class CFCACertUtil {
 	 * @param b
 	 * @param b
 	 * @throws Exception
 	 * @throws Exception
 	 */
 	 */
-	public static void updateSeal(String userId, String sealId, byte[] b) throws Exception {
+	public void updateSeal(String userId, String sealId, byte[] b) throws Exception {
 		// 这里将图片的路径下载文件
 		// 这里将图片的路径下载文件
 //    	byte[] b=DownloadUtils.downloadFile(filePath);
 //    	byte[] b=DownloadUtils.downloadFile(filePath);
 		String content = Base64.toBase64String(b);
 		String content = Base64.toBase64String(b);
@@ -153,7 +157,7 @@ public class CFCACertUtil {
 	 * @return 返回印章ID
 	 * @return 返回印章ID
 	 * @throws Exception
 	 * @throws Exception
 	 */
 	 */
-	public static String addSealWithContent(String userId, String content) throws Exception {
+	public String addSealWithContent(String userId, String content) throws Exception {
 
 
 		HeadVO head = new HeadVO();
 		HeadVO head = new HeadVO();
 		head.setTxTime(TimeUtil.getCurrentTime(TimeUtil.FORMAT_14));
 		head.setTxTime(TimeUtil.getCurrentTime(TimeUtil.FORMAT_14));
@@ -186,7 +190,7 @@ public class CFCACertUtil {
 	 * @return 返回印章ID
 	 * @return 返回印章ID
 	 * @throws Exception
 	 * @throws Exception
 	 */
 	 */
-	public static String addSeal(String userId, byte[] b) throws Exception {
+	public String addSeal(String userId, byte[] b) throws Exception {
 		String content = Base64.toBase64String(b);
 		String content = Base64.toBase64String(b);
 		return addSealWithContent(userId, content);
 		return addSealWithContent(userId, content);
 	}
 	}
@@ -197,7 +201,7 @@ public class CFCACertUtil {
 	 * @param userId
 	 * @param userId
 	 * @throws Exception
 	 * @throws Exception
 	 */
 	 */
-	public static boolean sendAuthMessage(String userId) throws Exception {
+	public boolean sendAuthMessage(String userId) throws Exception {
 
 
 		Tx3101ReqVO tx3101ReqVO = new Tx3101ReqVO();
 		Tx3101ReqVO tx3101ReqVO = new Tx3101ReqVO();
 		HeadVO head = new HeadVO();
 		HeadVO head = new HeadVO();
@@ -230,7 +234,7 @@ public class CFCACertUtil {
 	 * @param checkCode
 	 * @param checkCode
 	 * @throws Exception
 	 * @throws Exception
 	 */
 	 */
-	public static void confirmAuthMessage(String userId, String checkCode) throws Exception {
+	public void confirmAuthMessage(String userId, String checkCode) throws Exception {
 
 
 		Tx3102ReqVO tx3102ReqVO = new Tx3102ReqVO();
 		Tx3102ReqVO tx3102ReqVO = new Tx3102ReqVO();
 		HeadVO head = new HeadVO();
 		HeadVO head = new HeadVO();
@@ -261,7 +265,7 @@ public class CFCACertUtil {
 	 * @return 返回合同编号
 	 * @return 返回合同编号
 	 * @throws Exception
 	 * @throws Exception
 	 */
 	 */
-	public static String uploadSignContract(UploadSignInfoVO notaryUser, UploadSignInfoVO notaryOffice,
+	public String uploadSignContract(UploadSignInfoVO notaryUser, UploadSignInfoVO notaryOffice,
 			InputStream file, String fileName) throws Exception {
 			InputStream file, String fileName) throws Exception {
 
 
 		DictDetailService dictDetailService = SpringContextHolder.getBean(DictDetailService.class);
 		DictDetailService dictDetailService = SpringContextHolder.getBean(DictDetailService.class);
@@ -354,13 +358,9 @@ public class CFCACertUtil {
 	 * @param contractNo
 	 * @param contractNo
 	 * @throws Exception
 	 * @throws Exception
 	 */
 	 */
-	public static String download(String filePath, String contractNo) throws Exception {
-		HttpConnector httpConnector = new HttpConnector();
-		httpConnector.isProxyUsed = proxySwitchOn ? Request.PROXY_IN_USED : Request.PROXY_NO_USED;
-		httpConnector.init();
-
+	public String download(String filePath, String contractNo) throws Exception {
 		byte[] fileBtye = httpConnector
 		byte[] fileBtye = httpConnector
-				.getFile("platId/" + Request.AXQ_PLAT_ID + "/contractNo/" + contractNo + "/downloading");
+				.getFile("platId/" + httpConnector.getPlatID() + "/contractNo/" + contractNo + "/downloading");
 
 
 		String contentType;
 		String contentType;
 		String suffix;
 		String suffix;
@@ -387,7 +387,7 @@ public class CFCACertUtil {
 	 * @return
 	 * @return
 	 * @throws Exception
 	 * @throws Exception
 	 */
 	 */
-	private static String requestAPI(Object txReqVO, String txCode) throws Exception {
+	private String requestAPI(Object txReqVO, String txCode) throws Exception {
 		return requestAPI(txReqVO, txCode, null);
 		return requestAPI(txReqVO, txCode, null);
 	}
 	}
 
 
@@ -398,20 +398,17 @@ public class CFCACertUtil {
 	 * @param txCode
 	 * @param txCode
 	 * @throws PKIException
 	 * @throws PKIException
 	 */
 	 */
-	private static String requestAPI(Object txReqVO, String txCode, File file) throws Exception {
-		HttpConnector httpConnector = new HttpConnector();
-		httpConnector.isProxyUsed = proxySwitchOn ? Request.PROXY_IN_USED : Request.PROXY_NO_USED;
-		httpConnector.init();
+	private String requestAPI(Object txReqVO, String txCode, File file) throws Exception {
 		String req = new JsonObjectMapper().writeValueAsString(txReqVO);
 		String req = new JsonObjectMapper().writeValueAsString(txReqVO);
 		System.out.println("req:" + req);
 		System.out.println("req:" + req);
-		String signature = SecurityUtil.p7SignMessageDetach(Request.AXQ_JKS_PATH, Request.AXQ_JKS_PWD,
-				Request.AXQ_JKS_ALIAS, req);
+		String signature = SecurityUtil.p7SignMessageDetach(httpConnector.getKeyStorePath(), httpConnector.getKeyStorePassword(),
+				httpConnector.getAlias(), req);
 		String res = "";
 		String res = "";
 		if ("3203".equals(txCode)) {
 		if ("3203".equals(txCode)) {
-			res = httpConnector.post("platId/" + Request.AXQ_PLAT_ID + "/txCode/" + txCode + "/transaction", req,
+			res = httpConnector.post("platId/" + httpConnector.getPlatID() + "/txCode/" + txCode + "/transaction", req,
 					signature, file);
 					signature, file);
 		} else {
 		} else {
-			res = httpConnector.post("platId/" + Request.AXQ_PLAT_ID + "/txCode/" + txCode + "/transaction", req,
+			res = httpConnector.post("platId/" + httpConnector.getPlatID() + "/txCode/" + txCode + "/transaction", req,
 					signature);
 					signature);
 		}
 		}
 		System.out.println("res:" + res);
 		System.out.println("res:" + res);
@@ -425,21 +422,18 @@ public class CFCACertUtil {
 	 * @param txCode
 	 * @param txCode
 	 * @throws PKIException
 	 * @throws PKIException
 	 */
 	 */
-	private static String requestAPI(Object txReqVO, String txCode, InputStream file, String fileName)
+	private String requestAPI(Object txReqVO, String txCode, InputStream file, String fileName)
 			throws Exception {
 			throws Exception {
-		HttpConnector httpConnector = new HttpConnector();
-		httpConnector.isProxyUsed = proxySwitchOn ? Request.PROXY_IN_USED : Request.PROXY_NO_USED;
-		httpConnector.init();
 		String req = new JsonObjectMapper().writeValueAsString(txReqVO);
 		String req = new JsonObjectMapper().writeValueAsString(txReqVO);
 		System.out.println("req:" + req);
 		System.out.println("req:" + req);
-		String signature = SecurityUtil.p7SignMessageDetach(Request.AXQ_JKS_PATH, Request.AXQ_JKS_PWD,
-				Request.AXQ_JKS_ALIAS, req);
+		String signature = SecurityUtil.p7SignMessageDetach(httpConnector.getKeyStorePath(), httpConnector.getKeyStorePassword(),
+				httpConnector.getAlias(), req);
 		String res = "";
 		String res = "";
 		if ("3203".equals(txCode)) {
 		if ("3203".equals(txCode)) {
-			res = httpConnector.post("platId/" + Request.AXQ_PLAT_ID + "/txCode/" + txCode + "/transaction", req,
+			res = httpConnector.post("platId/" + httpConnector.getPlatID() + "/txCode/" + txCode + "/transaction", req,
 					signature, file, fileName);
 					signature, file, fileName);
 		} else {
 		} else {
-			res = httpConnector.post("platId/" + Request.AXQ_PLAT_ID + "/txCode/" + txCode + "/transaction", req,
+			res = httpConnector.post("platId/" + httpConnector.getPlatID() + "/txCode/" + txCode + "/transaction", req,
 					signature);
 					signature);
 		}
 		}
 		System.out.println("res:" + res);
 		System.out.println("res:" + res);
@@ -457,7 +451,7 @@ public class CFCACertUtil {
 	 * @return 返回合同编号
 	 * @return 返回合同编号
 	 * @throws Exception
 	 * @throws Exception
 	 */
 	 */
-	public static String uploadMultiSignContract(List<UploadSignInfoVO> notaryUserInfos, UploadSignInfoVO notaryUser,
+	public String uploadMultiSignContract(List<UploadSignInfoVO> notaryUserInfos, UploadSignInfoVO notaryUser,
 			UploadSignInfoVO seal, InputStream file, String fileName) throws Exception {
 			UploadSignInfoVO seal, InputStream file, String fileName) throws Exception {
 		DictDetailService dictDetailService = SpringContextHolder.getBean(DictDetailService.class);
 		DictDetailService dictDetailService = SpringContextHolder.getBean(DictDetailService.class);
 		Map<String, String> map = dictDetailService.getValueByName("signed_position");
 		Map<String, String> map = dictDetailService.getValueByName("signed_position");
@@ -532,7 +526,7 @@ public class CFCACertUtil {
 	 * @param signInfo
 	 * @param signInfo
 	 * @param keyword
 	 * @param keyword
 	 */
 	 */
-	public static void setSignInfoDefault(UploadSignInfoVO signInfo, SignKeywordVO keyword) {
+	public void setSignInfoDefault(UploadSignInfoVO signInfo, SignKeywordVO keyword) {
 		signInfo.setIsProxySign(PROXY_SIGN_ON);
 		signInfo.setIsProxySign(PROXY_SIGN_ON);
 		signInfo.setProjectCode(PROJECT_CODE);
 		signInfo.setProjectCode(PROJECT_CODE);
 		signInfo.setIsCheckProjectCode(0);
 		signInfo.setIsCheckProjectCode(0);
@@ -549,7 +543,7 @@ public class CFCACertUtil {
 	 * @param height
 	 * @param height
 	 * @return
 	 * @return
 	 */
 	 */
-	public static SignKeywordVO getSignKeywork(String keyword, String offsetX, String offsetY, String width,
+	public SignKeywordVO getSignKeywork(String keyword, String offsetX, String offsetY, String width,
 			String height) {
 			String height) {
 		SignKeywordVO signKeyword = new SignKeywordVO();
 		SignKeywordVO signKeyword = new SignKeywordVO();
 		signKeyword.setKeyword(keyword);
 		signKeyword.setKeyword(keyword);
@@ -566,22 +560,10 @@ public class CFCACertUtil {
 	 * @param response
 	 * @param response
 	 * @return
 	 * @return
 	 */
 	 */
-	private static boolean isSucess(String response) {
+	private boolean isSucess(String response) {
 		if (response.indexOf("\"head\"") < 0) {
 		if (response.indexOf("\"head\"") < 0) {
 			return false;
 			return false;
 		}
 		}
 		return true;
 		return true;
 	}
 	}
-
-	public static void main(String[] args) {
-		try {
-			PersonVO person = new PersonVO();
-			person.setPersonName("姜凤水");
-			person.setIdentNo("130821196602045575");
-			person.setMobilePhone("13776602160");
-			registerPerson(person);
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-	}
 }
 }

+ 7 - 35
eladmin-system/src/main/java/me/zhengjie/base/util/EQBServiceUtil.java

@@ -1,8 +1,7 @@
 package me.zhengjie.base.util;
 package me.zhengjie.base.util;
 
 
-import cfca.trustsign.connector.HttpClient;
+import com.alibaba.fastjson.JSONObject;
 import me.zhengjie.utils.FileUtil;
 import me.zhengjie.utils.FileUtil;
-import net.sf.json.JSONObject;
 import org.apache.commons.codec.binary.Base64;
 import org.apache.commons.codec.binary.Base64;
 
 
 import javax.crypto.Mac;
 import javax.crypto.Mac;
@@ -214,31 +213,16 @@ public class EQBServiceUtil {
      * @throws Exception
      * @throws Exception
      */
      */
     public static void downloadSignedContract(String flowId) throws Exception {
     public static void downloadSignedContract(String flowId) throws Exception {
-        HttpURLConnection connection = null;
-        HttpClient httpClient = new HttpClient();
         try {
         try {
             String accessUrl = "/v1/signflows/" + flowId + "/documents";
             String accessUrl = "/v1/signflows/" + flowId + "/documents";
             String signature = generateSignature(accessUrl, "", "", "GET");
             String signature = generateSignature(accessUrl, "", "", "GET");
             LinkedHashMap<String, String> header = getHeaderParam(signature, "");
             LinkedHashMap<String, String> header = getHeaderParam(signature, "");
             System.out.println(header.toString());
             System.out.println(header.toString());
             String fullUrl = SERVER_HOST + accessUrl;
             String fullUrl = SERVER_HOST + accessUrl;
-            connection = httpClient.connect(fullUrl, "GET");
-            if (null != header) {
-                for (String key : header.keySet()) {
-                    connection.setRequestProperty(key, header.get(key));
-                }
-            }
-            int responseCode = httpClient.send(connection, (byte[]) null);
-            System.out.println("responseCode:" + responseCode);
-            byte[] fileBytes = null;
-            if (responseCode == 200) {
-                fileBytes = httpClient.receive(connection);
-            }
-            System.out.println(new String(fileBytes));
+            JSONObject jsonObject = HttpUtil.doGetWithHeader(fullUrl, header);
+            System.out.println(jsonObject.toJSONString());
         } catch (Exception e) {
         } catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();
-        } finally {
-            httpClient.disconnect(connection);
         }
         }
     }
     }
 
 
@@ -250,24 +234,12 @@ public class EQBServiceUtil {
      */
      */
     public static void startFolw(String flowId) throws Exception {
     public static void startFolw(String flowId) throws Exception {
         HttpURLConnection connection = null;
         HttpURLConnection connection = null;
-        HttpClient httpClient = new HttpClient();
         String accessUrl = "/v1/signflows/" + flowId + "/start";
         String accessUrl = "/v1/signflows/" + flowId + "/start";
         String signature = generateSignature(accessUrl, "", "", "PUT");
         String signature = generateSignature(accessUrl, "", "", "PUT");
         LinkedHashMap<String, String> header = getHeaderParam(signature, "");
         LinkedHashMap<String, String> header = getHeaderParam(signature, "");
         String fullUrl = SERVER_HOST + accessUrl;
         String fullUrl = SERVER_HOST + accessUrl;
-        connection = httpClient.connect(fullUrl, "PUT");
-        if (null != header) {
-            for (String key : header.keySet()) {
-                connection.setRequestProperty(key, header.get(key));
-            }
-        }
-        int responseCode = httpClient.send(connection, (byte[]) null);
-        System.out.println("responseCode:" + responseCode);
-        byte[] fileBytes = null;
-        if (responseCode == 200) {
-            fileBytes = httpClient.receive(connection);
-        }
-        System.out.println(new String(fileBytes));
+        JSONObject jsonObject = HttpUtil.doGetWithHeader(fullUrl, header);
+        System.out.println(jsonObject.toJSONString());
     }
     }
 
 
     /**
     /**
@@ -322,7 +294,7 @@ public class EQBServiceUtil {
         header.put("contentType", "application/octet-stream");
         header.put("contentType", "application/octet-stream");
         header.put("contentMD5", getStringContentMD5(filePath));
         header.put("contentMD5", getStringContentMD5(filePath));
         String result = HttpUtil.postFile(url, header, filePath);
         String result = HttpUtil.postFile(url, header, filePath);
-        JSONObject resultObj = JSONObject.fromObject(result);
+        JSONObject resultObj = JSONObject.parseObject(result);
         System.out.println(resultObj);
         System.out.println(resultObj);
     }
     }
 
 
@@ -419,7 +391,7 @@ public class EQBServiceUtil {
         // 发送POST请求
         // 发送POST请求
         String data = reqBodyObj == null ? null : reqBodyObj.toString();
         String data = reqBodyObj == null ? null : reqBodyObj.toString();
         String result = HttpUtil.sendPOST(fullAccessUrl, data, getHeaderParam(signature, contentMD5), "UTF-8");
         String result = HttpUtil.sendPOST(fullAccessUrl, data, getHeaderParam(signature, contentMD5), "UTF-8");
-        JSONObject resultObj = JSONObject.fromObject(result);
+        JSONObject resultObj = JSONObject.parseObject(result);
         System.out.println("请求返回信息: " + resultObj.toString());
         System.out.println("请求返回信息: " + resultObj.toString());
         return resultObj;
         return resultObj;
     }
     }

+ 0 - 242
eladmin-system/src/main/java/me/zhengjie/base/util/HttpConnector.java

@@ -1,242 +0,0 @@
-package me.zhengjie.base.util;
-
-import cfca.trustsign.constant.Request;
-import cfca.trustsign.util.CommonUtil;
-import cn.hutool.core.io.IoUtil;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.net.HttpURLConnection;
-import java.net.URLEncoder;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Map.Entry;
-import cfca.trustsign.connector.HttpClient;
-
-public class HttpConnector {
-	private int connectTimeout;
-	private int readTimeout;
-	private boolean isSSL;
-	private String keyStorePath;
-	private String keyStorePassword;
-	private String trustStorePath;
-	private String trustStorePassword;
-	private String url;
-	private String channel;
-	private HttpClient httpClient;
-	public String isProxyUsed = "0";
-
-	public void init() {
-		this.connectTimeout = Request.AXQ_CONNECT_TIMEOUT;
-		this.readTimeout = Request.AXQ_READ_TIMEOUT;
-		this.isSSL = Request.AXQ_IS_SSL;
-		this.keyStorePath = Request.AXQ_JKS_PATH;
-		this.keyStorePassword = Request.AXQ_JKS_PWD;
-		this.trustStorePath = Request.AXQ_JKS_PATH;
-		this.trustStorePassword = Request.AXQ_JKS_PWD;
-		this.url = Request.AXQ_URL;
-		this.channel = Request.AXQ_CHANNEL;
-		this.httpClient = new HttpClient();
-		this.httpClient.config.connectTimeout = this.connectTimeout;
-		this.httpClient.config.readTimeout = this.readTimeout;
-		this.httpClient.httpConfig.userAgent = "TrustSign FEP";
-		this.httpClient.httpConfig.contentType = "application/x-www-form-urlencoded";
-		this.httpClient.httpConfig.accept = "application/json";
-		this.httpClient.isProxyUsed = this.isProxyUsed;
-
-		try {
-			if (this.isSSL) {
-				this.httpClient.initSSL(this.keyStorePath, this.keyStorePassword.toCharArray(), this.trustStorePath,
-						this.trustStorePassword.toCharArray());
-			}
-		} catch (Exception var2) {
-			var2.printStackTrace();
-		}
-
-		if (!this.url.endsWith("/")) {
-			this.url = this.url + "/";
-		}
-
-	}
-
-	public String post(String uri, String data, String signature) {
-		return this.deal(uri, "POST", this.prepare(data, signature, (Map) null));
-	}
-
-	public String post(String uri, String data, String signature, Map<String, String> map) {
-		return this.deal(uri, "POST", this.prepare(data, signature, map));
-	}
-
-	public String post(String uri, String data, String signature, File file) {
-		return this.dealFile(uri, "POST", data, file, signature);
-	}
-
-	public String post(String uri, String data, String signature, InputStream file,String fileName) {
-		return this.dealFile(uri, "POST", data, file,fileName, signature);
-	}
-
-	public byte[] getFile(String uri) {
-		HttpURLConnection connection = null;
-
-		Object var4;
-		try {
-			connection = this.httpClient.connect(this.url + uri, "GET");
-			int responseCode = this.httpClient.send(connection, (byte[]) null);
-			System.out.println("responseCode:" + responseCode);
-			if (responseCode == 200) {
-				byte[] var10 = this.httpClient.receive(connection);
-				return var10;
-			}
-
-			System.out.println(CommonUtil.getString(this.httpClient.receive(connection)));
-			var4 = null;
-		} catch (Exception var8) {
-			var8.printStackTrace();
-			var4 = null;
-			return (byte[]) var4;
-		} finally {
-			this.httpClient.disconnect(connection);
-		}
-
-		return (byte[]) var4;
-	}
-
-	private String prepare(String data, String signature, Map<String, String> map) {
-		try {
-			StringBuilder request = new StringBuilder();
-			request.append("channel").append("=").append(URLEncoder.encode(this.channel, "UTF-8"));
-			if (CommonUtil.isNotEmpty(data)) {
-				request.append("&").append("data").append("=").append(URLEncoder.encode(data, "UTF-8"));
-			}
-
-			if (CommonUtil.isNotEmpty(signature)) {
-				request.append("&").append("signature").append("=").append(URLEncoder.encode(signature, "UTF-8"));
-			}
-
-			if (CommonUtil.isNotEmpty(map)) {
-				Iterator var5 = map.entrySet().iterator();
-
-				while (var5.hasNext()) {
-					Entry<String, String> pair = (Entry) var5.next();
-					request.append("&").append((String) pair.getKey()).append("=").append(
-							pair.getValue() == null ? "" : URLEncoder.encode((String) pair.getValue(), "UTF-8"));
-				}
-			}
-
-			return request.toString();
-		} catch (UnsupportedEncodingException var7) {
-			return null;
-		}
-	}
-
-	private String deal(String uri, String method, String request) {
-		HttpURLConnection connection = null;
-
-		String var6;
-		try {
-			connection = this.httpClient.connect(this.url + uri, method);
-			int responseCode = this.httpClient.send(connection, request == null ? null : CommonUtil.getBytes(request));
-			System.out.println("responseCode:" + responseCode);
-			var6 = CommonUtil.getString(this.httpClient.receive(connection));
-			return var6;
-		} catch (Exception var10) {
-			var10.printStackTrace();
-			var6 = var10.getMessage();
-		} finally {
-			this.httpClient.disconnect(connection);
-		}
-
-		return var6;
-	}
-
-	private String dealFile(String uri, String method, String request, File file, String signature) {
-		HttpURLConnection connection = null;
-
-		String var8;
-		try {
-			FileInputStream is = new FileInputStream(file);
-			Throwable var33 = null;
-
-			try {
-				connection = this.httpClient.connect(this.url + uri, method);
-				Map<String, String> paramMap = new HashMap(4);
-				paramMap.put("data", request);
-				paramMap.put("signature", signature);
-				int responseCode = this.httpClient.sendFile(connection, paramMap, is, file.getName(),
-						"application/pdf");
-				System.out.println("responseCode:" + responseCode);
-				String var11 = CommonUtil.getString(this.httpClient.receive(connection));
-				return var11;
-			} catch (Throwable var29) {
-				var33 = var29;
-				throw var29;
-			} finally {
-				if (is != null) {
-					if (var33 != null) {
-						try {
-							is.close();
-						} catch (Throwable var28) {
-							var33.addSuppressed(var28);
-						}
-					} else {
-						is.close();
-					}
-				}
-
-			}
-		} catch (Exception var31) {
-			var31.printStackTrace();
-			var8 = var31.getMessage();
-		} finally {
-			this.httpClient.disconnect(connection);
-		}
-
-		return var8;
-	}
-
-	/**
-	 * 处理文件流
-	 * 
-	 * @param uri
-	 * @param method
-	 * @param request
-	 * @param file
-	 * @param signature
-	 * @return
-	 */
-	private String dealFile(String uri, String method, String request, InputStream is, String fileName,
-			String signature) {
-		HttpURLConnection connection = null;
-
-		String var8;
-		try {
-
-			try {
-				connection = this.httpClient.connect(this.url + uri, method);
-				Map<String, String> paramMap = new HashMap<>(4);
-				paramMap.put("data", request);
-				paramMap.put("signature", signature);
-				int responseCode = this.httpClient.sendFile(connection, paramMap, is, fileName, "application/pdf");
-				System.out.println("responseCode:" + responseCode);
-				String var11 = CommonUtil.getString(this.httpClient.receive(connection));
-				return var11;
-			} catch (Throwable var29) {
-
-				throw var29;
-			} finally {
-				IoUtil.close(is);
-
-			}
-		} catch (Exception var31) {
-
-			var8 = var31.getMessage();
-		} finally {
-			this.httpClient.disconnect(connection);
-		}
-
-		return var8;
-	}
-}

+ 54 - 81
eladmin-system/src/main/java/me/zhengjie/base/util/HttpUtil.java

@@ -1,16 +1,12 @@
 package me.zhengjie.base.util;
 package me.zhengjie.base.util;
 
 
-import java.io.*;
+import com.alibaba.fastjson.JSONObject;
 
 
+import java.io.*;
 import java.net.*;
 import java.net.*;
 import java.text.MessageFormat;
 import java.text.MessageFormat;
-import java.util.*;
-
-import cfca.trustsign.connector.HttpClient;
-import com.alibaba.fastjson.JSONObject;
-
-import cfca.trustsign.common.vo.cs.SignKeywordVO;
-import cfca.trustsign.common.vo.cs.UploadSignInfoVO;
+import java.util.LinkedHashMap;
+import java.util.Map;
 
 
 public class HttpUtil {
 public class HttpUtil {
 
 
@@ -314,59 +310,6 @@ public class HttpUtil {
 		return respContent;
 		return respContent;
 	}
 	}
 
 
-	public static void main(String[] args) throws Exception {
-
-		int i = 0;
-		String pdf = "gzs.pdf";
-
-		String localUrl = "https://flowbb.show.xjrkj.com/demo";
-		// String localUrl = "http://localhost:8000/demo";
-
-		List<UploadSignInfoVO> notaryUserInfos = new ArrayList<>();
-		// --------------------------------------------------------------------------------------
-		UploadSignInfoVO xj = new UploadSignInfoVO();
-		xj.setUserId("E06DAAB5F6894542E05312016B0AC8F1");
-		xj.setSealId("E06DAB4AFAEF4DB7E05311016B0A5154");
-		xj.setLocation("210.74.41.0");
-		xj.setAuthorizationTime("20220214171200");
-		notaryUserInfos.add(xj);
-//		UploadSignInfoVO ttt = new UploadSignInfoVO();
-//		ttt.setUserId("E658B207485F141AE05311016B0A5F19");
-//		ttt.setSealId("E658C5DBBAF1340DE05311016B0A3C4D");
-//		ttt.setLocation("210.74.41.0");
-//		ttt.setAuthorizationTime("20220214171200");
-//		notaryUserInfos.add(ttt);
-		UploadSignInfoVO wcc = new UploadSignInfoVO();
-		wcc.setUserId("E150B42F789F53D8E05311016B0A24B0");
-		wcc.setSealId("E150B90286FA6E31E05312016B0A03F2");
-		wcc.setLocation("210.74.41.0");
-		wcc.setAuthorizationTime("20220214171200");
-		notaryUserInfos.add(wcc);
-		for (UploadSignInfoVO user : notaryUserInfos) {
-			String x = String.valueOf(10 + i * 70);
-			i++;
-			SignKeywordVO keywordNotaryUser = CFCACertUtil.getSignKeywork("签章:", x, "0", "80", "40");
-			CFCACertUtil.setSignInfoDefault(user, keywordNotaryUser);
-		}
-		// --------------------------------------------------------------------------------------
-//		SignKeywordVO keywordNotaryOffice = CFCACertUtil.getSignKeywork("签章", "0", "0", "150", "150");
-//		if (notaryOffice != null) {
-//			setSignInfoDefault(notaryOffice, keywordNotaryOffice);
-//			signInfos.add(notaryOffice);
-//		}
-
-		String result = HttpUtil.sendPost(localUrl + "/notarySign?fileName=" + pdf,
-				JSONObject.toJSONString(notaryUserInfos));
-		JSONObject jsonObj = JSONObject.parseObject(result);
-		System.out.println(jsonObj.getString("msg") + ".pdf");
-		Map<String, String> param = new HashMap<String, String>();
-		param.put("contractNo", jsonObj.getString("msg"));
-		result = HttpUtil.sendPost(localUrl + "/download", JSONObject.toJSONString(param));
-		System.out.println(result);
-//		System.out.println("用户近6个月平均话费评分:" + result);
-
-	}
-
 	/**
 	/**
 	 * 发送带Header信息的Get请求
 	 * 发送带Header信息的Get请求
 	 *
 	 *
@@ -376,56 +319,86 @@ public class HttpUtil {
 	 */
 	 */
 	public static JSONObject doGetWithHeader(String url, Map<String, String> header) {
 	public static JSONObject doGetWithHeader(String url, Map<String, String> header) {
 		HttpURLConnection connection = null;
 		HttpURLConnection connection = null;
-		HttpClient httpClient = new HttpClient();
 		JSONObject returnMsg = null;
 		JSONObject returnMsg = null;
 		try {
 		try {
-			connection = httpClient.connect(url, "GET");
+			URL realUrl = new URL(url);
+			// 打开和URL之间的连接
+			connection = (HttpURLConnection) realUrl.openConnection();
 			if (null != header) {
 			if (null != header) {
 				for (String key : header.keySet()) {
 				for (String key : header.keySet()) {
 					connection.setRequestProperty(key, header.get(key));
 					connection.setRequestProperty(key, header.get(key));
 				}
 				}
 			}
 			}
-			int responseCode = httpClient.send(connection, (byte[]) null);
-			System.out.println("responseCode:" + responseCode);
-			byte[] fileBytes = null;
-			if (responseCode == 200) {
-				fileBytes = httpClient.receive(connection);
+			connection.setRequestMethod("GET");
+			connection.connect();
+			// 获取返回信息
+			int statusCode = connection.getResponseCode();
+			String respMessage = connection.getResponseMessage();
+			String respContent = "";
+			// 获得响应内容
+			if (HttpURLConnection.HTTP_OK == statusCode) {
+				// 返回响应结果
+				respContent = getResponseContent(connection);
+			} else {
+				// 返回非200状态时响应结果
+				respContent = getErrorResponseContent(connection);
+				String msg = MessageFormat.format("请求失败: Http状态码 = {0} , {1}", statusCode, respMessage);
+				System.out.println(msg);
 			}
 			}
-			String message = new String(fileBytes);
-			returnMsg = JSONObject.parseObject(message);
+			returnMsg = JSONObject.parseObject(respContent);
 			System.out.println(returnMsg);
 			System.out.println(returnMsg);
 		} catch (Exception e) {
 		} catch (Exception e) {
 			e.printStackTrace();
 			e.printStackTrace();
 		} finally {
 		} finally {
-			httpClient.disconnect(connection);
+			connection.disconnect();
 		}
 		}
 		return returnMsg;
 		return returnMsg;
 	}
 	}
 
 
 	public static JSONObject doPostWithHeaderAndBody(String url, Map<String, String> header, JSONObject body) {
 	public static JSONObject doPostWithHeaderAndBody(String url, Map<String, String> header, JSONObject body) {
 		HttpURLConnection connection = null;
 		HttpURLConnection connection = null;
-		HttpClient httpClient = new HttpClient();
 		JSONObject returnMsg = null;
 		JSONObject returnMsg = null;
+		OutputStream out = null;
 		try {
 		try {
-			connection = httpClient.connect(url, "POST");
+			URL realUrl = new URL(url);
+			// 打开和URL之间的连接
+			connection = (HttpURLConnection) realUrl.openConnection();
 			if (null != header) {
 			if (null != header) {
 				for (String key : header.keySet()) {
 				for (String key : header.keySet()) {
 					connection.setRequestProperty(key, header.get(key));
 					connection.setRequestProperty(key, header.get(key));
 				}
 				}
 			}
 			}
-			int responseCode = httpClient.send(connection, body.toString().getBytes());
-			System.out.println("responseCode:" + responseCode);
-			byte[] fileBytes = null;
-			if (responseCode == 200) {
-				fileBytes = httpClient.receive(connection);
+			// 发送POST请求必须设置如下两行
+			connection.setDoOutput(true);
+			connection.setDoInput(true);
+			connection.setRequestMethod("POST");
+			connection.connect();
+			// 发送请求内容
+			out = new DataOutputStream(connection.getOutputStream());
+			byte[] bufferOut = body.toString().getBytes();
+			out.write(bufferOut);
+			out.flush();
+			out.close();
+			// 获取返回信息
+			int statusCode = connection.getResponseCode();
+			String respMessage = connection.getResponseMessage();
+			String respContent="";
+			// 获得响应内容
+			if (HttpURLConnection.HTTP_OK == statusCode) {
+				// 返回响应结果
+				respContent = getResponseContent(connection);
+			} else {
+				// 返回非200状态时响应结果
+				respContent = getErrorResponseContent(connection);
+				String msg = MessageFormat.format("请求失败: Http状态码 = {0} , {1}", statusCode, respMessage);
+				System.out.println(msg);
 			}
 			}
-			String message = new String(fileBytes);
-			returnMsg = JSONObject.parseObject(message);
+			returnMsg = JSONObject.parseObject(respContent);
 			System.out.println(returnMsg);
 			System.out.println(returnMsg);
 		} catch (Exception e) {
 		} catch (Exception e) {
 			e.printStackTrace();
 			e.printStackTrace();
 		} finally {
 		} finally {
-			httpClient.disconnect(connection);
+			connection.disconnect();
 		}
 		}
 		return returnMsg;
 		return returnMsg;
 	}
 	}

+ 18 - 0
eladmin-system/src/main/java/me/zhengjie/dao/mybatis/OrderFileRepository.java

@@ -106,4 +106,22 @@ public class OrderFileRepository {
         qw.eq("business_no", businessNO);
         qw.eq("business_no", businessNO);
         orderFileMapper.delete(qw);
         orderFileMapper.delete(qw);
     }
     }
+
+    /**
+     * 插入订单文件
+     *
+     * @param orderFile
+     */
+    public void insert(OrderFileEntity orderFile) {
+        orderFileMapper.insert(orderFile);
+    }
+
+    /**
+     * 修改订单文件
+     *
+     * @param orderFile
+     */
+    public void updateById(OrderFileEntity orderFile) {
+        orderFileMapper.updateById(orderFile);
+    }
 }
 }

+ 9 - 0
eladmin-system/src/main/java/me/zhengjie/dao/mybatis/UserAXQInfoRepository.java

@@ -23,4 +23,13 @@ public class UserAXQInfoRepository {
         qw.eq("user_status", "1");
         qw.eq("user_status", "1");
         return userAXQInfoMapper.selectOne(qw);
         return userAXQInfoMapper.selectOne(qw);
     }
     }
+
+    /**
+     * 根据ID更新信息
+     *
+     * @param userAXQInfo
+     */
+    public void updateById(UserAXQInfoEntity userAXQInfo) {
+        userAXQInfoMapper.updateById(userAXQInfo);
+    }
 }
 }

+ 4 - 0
eladmin-system/src/main/java/me/zhengjie/dao/mybatis/entity/ContractOrderEntity.java

@@ -134,6 +134,7 @@ public class ContractOrderEntity implements Serializable {
     @TableField("bank_id")
     @TableField("bank_id")
     private String bankId;
     private String bankId;
 
 
+    @QueryWapper(QueryKeyword.LIKE)
     @TableField("bank_name")
     @TableField("bank_name")
     private String bankName;
     private String bankName;
 
 
@@ -178,4 +179,7 @@ public class ContractOrderEntity implements Serializable {
 
 
     @TableField("consult_no")
     @TableField("consult_no")
     private String consultNo;
     private String consultNo;
+
+    @TableField("contract_term")
+    private String contractTerm;
 }
 }

+ 3 - 0
eladmin-system/src/main/java/me/zhengjie/dao/mybatis/entity/UserAXQInfoEntity.java

@@ -42,4 +42,7 @@ public class UserAXQInfoEntity implements Serializable {
 
 
     @TableField("create_time")
     @TableField("create_time")
     private Date createTime;
     private Date createTime;
+
+    @TableField("img_seal_id")
+    private Integer imgSealId;
 }
 }

+ 153 - 31
eladmin-system/src/main/java/me/zhengjie/domain/model/ModelSynthesizerDomain.java

@@ -2,22 +2,23 @@ package me.zhengjie.domain.model;
 
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import lombok.RequiredArgsConstructor;
 import lombok.RequiredArgsConstructor;
-import me.zhengjie.application.admin.controller.OrderCochainController;
-import me.zhengjie.application.admin.service.dto.UserDto;
 import me.zhengjie.application.admin.controller.vo.NotaryNoteDto;
 import me.zhengjie.application.admin.controller.vo.NotaryNoteDto;
-import me.zhengjie.base.util.ApplicationContextUtil;
-import me.zhengjie.base.util.DateUtils;
-import me.zhengjie.base.util.StatusEnum;
-import me.zhengjie.base.util.TextTempletUtil;
+import me.zhengjie.application.admin.service.dto.UserDto;
+import me.zhengjie.base.util.*;
 import me.zhengjie.dao.mybatis.ContractOrderRepository;
 import me.zhengjie.dao.mybatis.ContractOrderRepository;
+import me.zhengjie.dao.mybatis.ModelRepository;
+import me.zhengjie.dao.mybatis.OrderFileRepository;
+import me.zhengjie.dao.mybatis.UserAXQInfoRepository;
 import me.zhengjie.dao.mybatis.entity.*;
 import me.zhengjie.dao.mybatis.entity.*;
 import me.zhengjie.dao.mybatis.mapper.*;
 import me.zhengjie.dao.mybatis.mapper.*;
 import me.zhengjie.domain.order.OrderConstant;
 import me.zhengjie.domain.order.OrderConstant;
 import me.zhengjie.utils.DateUtil;
 import me.zhengjie.utils.DateUtil;
+import me.zhengjie.utils.StringUtils;
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.io.IOUtils;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Component;
 
 
 import java.io.InputStream;
 import java.io.InputStream;
+import java.math.BigDecimal;
 import java.nio.charset.StandardCharsets;
 import java.nio.charset.StandardCharsets;
 import java.text.SimpleDateFormat;
 import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.*;
@@ -26,12 +27,69 @@ import java.util.*;
 @RequiredArgsConstructor
 @RequiredArgsConstructor
 public class ModelSynthesizerDomain {
 public class ModelSynthesizerDomain {
     private final ContractOrderRepository contractOrderRepository;
     private final ContractOrderRepository contractOrderRepository;
+    private final ModelRepository modelRepository;
+    private final OrderFileRepository orderFileRepository;
     private final BankMapper bankMapper;
     private final BankMapper bankMapper;
     private final SysUserMapper sysUserMapper;
     private final SysUserMapper sysUserMapper;
     private final NotaryOfficeMapper notaryOfficeMapper;
     private final NotaryOfficeMapper notaryOfficeMapper;
     private final CityMapper cityMapper;
     private final CityMapper cityMapper;
     private final ProvinceMapper provinceMapper;
     private final ProvinceMapper provinceMapper;
     private final ApplicationContextUtil contextUtil;
     private final ApplicationContextUtil contextUtil;
+    private final UserAXQInfoRepository userAXQInfoRepository;
+    private final FileInfoMapper fileInfoMapper;
+
+    /**
+     * 生成普通公证文书
+     *
+     * @param userId
+     * @param businessNo
+     */
+    public void generateCommonDoc(String userId, String businessNo) {
+        ContractOrderEntity contractOrderEntity = contractOrderRepository.getContractOrderWithBizNo(businessNo);
+        List<ModelEntity> models = modelRepository.getCommonModel(contractOrderEntity.getProdId(), contractOrderEntity.getContractType(), contractOrderEntity.getNotaryOfficeId());
+        // 在保存之前先删除数据
+        orderFileRepository.delFileWithBizNO(businessNo);
+        for (ModelEntity m : models) {
+            OrderFileEntity fileEntity = new OrderFileEntity();
+            fileEntity.setBusinessNo(businessNo);
+            fileEntity.setCode(m.getCode());
+            fileEntity.setSortNum(m.getSort());
+            String html = composeCommonTemplateWithData(businessNo, m.getContent(), "", false);
+            String htmlPath = FileUploadUtil.saveHtml(html, businessNo);
+            String pdfPath = FileUploadUtil.savePdf(html, businessNo);
+            fileEntity.setHtmlUrl(htmlPath);
+            fileEntity.setPdfUrl(pdfPath);
+            fileEntity.setCreateTime(new Date());
+            fileEntity.setCreatorId(Long.parseLong(userId));
+            fileEntity.setFileName(m.getTitle());
+            //
+            orderFileRepository.insert(fileEntity);
+        }
+    }
+
+    /**
+     * 重建普通公证文书
+     *
+     * @param businessNo
+     */
+    public void recreateCommonDoc(String businessNo) {
+        ContractOrderEntity contractOrderEntity = contractOrderRepository.getContractOrderWithBizNo(businessNo);
+        SysUserEntity notaryUser = sysUserMapper.selectById(contractOrderEntity.getNotaryUserId());
+        List<ModelEntity> models = modelRepository.getCommonModel(contractOrderEntity.getProdId(), contractOrderEntity.getContractType(), contractOrderEntity.getNotaryOfficeId());
+        for (ModelEntity m : models) {
+            OrderFileEntity fileEntity = orderFileRepository.getOrderFileWithCode(businessNo, m.getCode());
+            OrderFileEntity saveFile = new OrderFileEntity();
+            saveFile.setId(fileEntity.getId());
+            String html = composeCommonTemplateWithData(businessNo, m.getContent(), notaryUser.getNickName(), true);
+            String htmlPath = FileUploadUtil.saveHtml(html, businessNo);
+            String pdfPath = FileUploadUtil.savePdf(html, businessNo);
+            saveFile.setHtmlUrl(htmlPath);
+            saveFile.setPdfUrl(pdfPath);
+            saveFile.setUpdateTime(new Date());
+            //
+            orderFileRepository.updateById(saveFile);
+        }
+    }
 
 
     /**
     /**
      * 合成公证书预览模板
      * 合成公证书预览模板
@@ -68,7 +126,7 @@ public class ModelSynthesizerDomain {
      */
      */
     public Map<String, String> prepareNotarizationTemplateData(ContractOrderEntity contractOrderEntity) {
     public Map<String, String> prepareNotarizationTemplateData(ContractOrderEntity contractOrderEntity) {
         Map<String, String> map = new HashMap<String, String>();
         Map<String, String> map = new HashMap<String, String>();
-        map.put("$Amounts$", contractOrderEntity.getContractMoney());
+        map.put("$Amounts$", formatAmount(contractOrderEntity.getContractMoney()));
         if (contractOrderEntity.getContractType() == OrderConstant.CONTRACT_TYPE_BORROWER) {
         if (contractOrderEntity.getContractType() == OrderConstant.CONTRACT_TYPE_BORROWER) {
             map.put("$Type$", "借款合同");
             map.put("$Type$", "借款合同");
         } else if (contractOrderEntity.getContractType() == OrderConstant.CONTRACT_TYPE_MORTGAGE) {
         } else if (contractOrderEntity.getContractType() == OrderConstant.CONTRACT_TYPE_MORTGAGE) {
@@ -97,24 +155,20 @@ public class ModelSynthesizerDomain {
         map.put("$NotaryOffice$", notaryOffice.getName());
         map.put("$NotaryOffice$", notaryOffice.getName());
         // 当事人信息
         // 当事人信息
         try {
         try {
-            SimpleDateFormat monthformatter = new SimpleDateFormat("yyyy-MM");
-            Date beginDate = monthformatter.parse(contractOrderEntity.getStartDate());
-            Date endDate = monthformatter.parse(contractOrderEntity.getEndDate());
-            Integer months = DateUtils.getDiffNaturalMonth(endDate, beginDate);
             map.put("$Year$", DateUtil.formatYearToNum(new Date()));
             map.put("$Year$", DateUtil.formatYearToNum(new Date()));
             map.put("$Name$", contractOrderEntity.getName());
             map.put("$Name$", contractOrderEntity.getName());
             map.put("$Sex$", "1".equals(contractOrderEntity.getSex()) ? "男" : "女");
             map.put("$Sex$", "1".equals(contractOrderEntity.getSex()) ? "男" : "女");
             map.put("$Birthday$", DateUtil.formatDateWithChineseSeparatorAndNoZeroFilled(contractOrderEntity.getBirth(), "yyyy/M/d"));
             map.put("$Birthday$", DateUtil.formatDateWithChineseSeparatorAndNoZeroFilled(contractOrderEntity.getBirth(), "yyyy/M/d"));
-            map.put("$Phone$",contractOrderEntity.getPhone());
-            map.put("$Addr$",contractOrderEntity.getResidence());
+            map.put("$Phone$", contractOrderEntity.getPhone());
+            map.put("$Addr$", contractOrderEntity.getResidence());
             map.put("$IDNo$", contractOrderEntity.getIdCard());
             map.put("$IDNo$", contractOrderEntity.getIdCard());
             map.put("$LoanRate$", contractOrderEntity.getRate());
             map.put("$LoanRate$", contractOrderEntity.getRate());
             map.put("$Term$", DateUtil.formatDateWithChineseSeparatorAndNoZeroFilled(contractOrderEntity.getStartDate(), "yyyy-MM-dd").concat(" - ").concat(DateUtil.formatDateWithChineseSeparatorAndNoZeroFilled(contractOrderEntity.getEndDate(), "yyyy-MM-dd")));
             map.put("$Term$", DateUtil.formatDateWithChineseSeparatorAndNoZeroFilled(contractOrderEntity.getStartDate(), "yyyy-MM-dd").concat(" - ").concat(DateUtil.formatDateWithChineseSeparatorAndNoZeroFilled(contractOrderEntity.getEndDate(), "yyyy-MM-dd")));
-            map.put("$TotalMonth$", months.toString());
+            map.put("$TotalMonth$", getMonth(contractOrderEntity));
             if (contractOrderEntity.getJointFlag() == 1) {
             if (contractOrderEntity.getJointFlag() == 1) {
                 map.put("$MateName$", contractOrderEntity.getJointName());
                 map.put("$MateName$", contractOrderEntity.getJointName());
                 map.put("$MateSex$", StatusEnum.SexStatusEnum.getValue(contractOrderEntity.getJointSex()));
                 map.put("$MateSex$", StatusEnum.SexStatusEnum.getValue(contractOrderEntity.getJointSex()));
-                map.put("$MateBirthday$", DateUtil.formatDateWithChineseSeparatorAndNoZeroFilled(contractOrderEntity.getIdCard().substring(6, 14), "yyyyMMdd"));
+                map.put("$MateBirthday$", DateUtil.formatDateWithChineseSeparatorAndNoZeroFilled(contractOrderEntity.getJointIdCard().substring(6, 14), "yyyyMMdd"));
                 map.put("$MateAddr$", contractOrderEntity.getJointResidence());
                 map.put("$MateAddr$", contractOrderEntity.getJointResidence());
                 map.put("$MatePhone$", contractOrderEntity.getJointPhone());
                 map.put("$MatePhone$", contractOrderEntity.getJointPhone());
                 map.put("$MateIDNo$", contractOrderEntity.getJointIdCard());
                 map.put("$MateIDNo$", contractOrderEntity.getJointIdCard());
@@ -305,14 +359,14 @@ public class ModelSynthesizerDomain {
             noteValue.put("$Phone$", contractOrderEntity.getPhone());
             noteValue.put("$Phone$", contractOrderEntity.getPhone());
             noteValue.put("$Sex$", "1".equals(contractOrderEntity.getSex()) ? "男" : "女");
             noteValue.put("$Sex$", "1".equals(contractOrderEntity.getSex()) ? "男" : "女");
             noteValue.put("$Addr$", contractOrderEntity.getResidence());
             noteValue.put("$Addr$", contractOrderEntity.getResidence());
-            noteValue.put("$Amounts$", contractOrderEntity.getContractMoney());
+            noteValue.put("$Amounts$", formatAmount(contractOrderEntity.getContractMoney()));
             noteValue.put("$Term$", DateUtil.formatDateWithChineseSeparatorAndNoZeroFilled(contractOrderEntity.getStartDate(), "yyyy-MM-dd") + "~" + DateUtil.formatDateWithChineseSeparatorAndNoZeroFilled(contractOrderEntity.getEndDate(), "yyyy-MM-dd"));
             noteValue.put("$Term$", DateUtil.formatDateWithChineseSeparatorAndNoZeroFilled(contractOrderEntity.getStartDate(), "yyyy-MM-dd") + "~" + DateUtil.formatDateWithChineseSeparatorAndNoZeroFilled(contractOrderEntity.getEndDate(), "yyyy-MM-dd"));
             noteValue.put("$LoanRate$", contractOrderEntity.getRate());
             noteValue.put("$LoanRate$", contractOrderEntity.getRate());
             noteValue.put("$McontractNO$", contractOrderEntity.getMainContractNo());
             noteValue.put("$McontractNO$", contractOrderEntity.getMainContractNo());
             if (contractOrderEntity.getJointFlag() == 1) {
             if (contractOrderEntity.getJointFlag() == 1) {
                 noteValue.put("$MateName$", contractOrderEntity.getJointName());
                 noteValue.put("$MateName$", contractOrderEntity.getJointName());
                 noteValue.put("$MateSex$", StatusEnum.SexStatusEnum.getValue(contractOrderEntity.getJointSex()));
                 noteValue.put("$MateSex$", StatusEnum.SexStatusEnum.getValue(contractOrderEntity.getJointSex()));
-                noteValue.put("$MateBirthday$", DateUtil.formatDateWithChineseSeparatorAndNoZeroFilled(contractOrderEntity.getIdCard().substring(6, 14), "yyyyMMdd"));
+                noteValue.put("$MateBirthday$", DateUtil.formatDateWithChineseSeparatorAndNoZeroFilled(contractOrderEntity.getJointIdCard().substring(6, 14), "yyyyMMdd"));
                 noteValue.put("$MateAddr$", contractOrderEntity.getJointResidence());
                 noteValue.put("$MateAddr$", contractOrderEntity.getJointResidence());
                 noteValue.put("$MatePhone$", contractOrderEntity.getJointPhone());
                 noteValue.put("$MatePhone$", contractOrderEntity.getJointPhone());
                 noteValue.put("$MateIDNo$", contractOrderEntity.getJointIdCard());
                 noteValue.put("$MateIDNo$", contractOrderEntity.getJointIdCard());
@@ -336,15 +390,7 @@ public class ModelSynthesizerDomain {
                 noteValue.put("$obligor$", obligor);
                 noteValue.put("$obligor$", obligor);
             }
             }
         }
         }
-        try {
-            SimpleDateFormat monthformatter = new SimpleDateFormat("yyyy-MM");
-            Date beginDate = monthformatter.parse(contractOrderEntity.getStartDate());
-            Date endDate = monthformatter.parse(contractOrderEntity.getEndDate());
-            Integer months = DateUtils.getDiffNaturalMonth(endDate, beginDate);
-            noteValue.put("$TotalMonth$", months.toString());
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
+        noteValue.put("$TotalMonth$", getMonth(contractOrderEntity));
         // 准备银行信息
         // 准备银行信息
         BankEntity bank = bankMapper.selectById(contractOrderEntity.getBankId());
         BankEntity bank = bankMapper.selectById(contractOrderEntity.getBankId());
         noteValue.put("$Bank$", bank.getBankName());
         noteValue.put("$Bank$", bank.getBankName());
@@ -382,8 +428,8 @@ public class ModelSynthesizerDomain {
      * @param content
      * @param content
      * @return
      * @return
      */
      */
-    public String composeCommonTemplateWithData(String businessNo, String content, String userName) {
-        String replaceContent = TextTempletUtil.replaceContent(content, prepareCommonTemplateData(businessNo, content, userName));
+    private String composeCommonTemplateWithData(String businessNo, String content, String userName, boolean hasSignImg) {
+        String replaceContent = TextTempletUtil.replaceContent(content, prepareCommonTemplateData(businessNo, userName, hasSignImg));
         String result = "";
         String result = "";
         try {
         try {
             InputStream inputStream = ModelSynthesizerDomain.class.getClassLoader().getResourceAsStream("template/note/notary-model.html");
             InputStream inputStream = ModelSynthesizerDomain.class.getClassLoader().getResourceAsStream("template/note/notary-model.html");
@@ -398,16 +444,17 @@ public class ModelSynthesizerDomain {
      * 准备通用模板替换数据
      * 准备通用模板替换数据
      *
      *
      * @param businessNo
      * @param businessNo
-     * @param contractNo
      * @param userName
      * @param userName
+     * @param hasSignImg
      * @return
      * @return
      */
      */
-    private Map<String, String> prepareCommonTemplateData(String businessNo, String contractNo,String userName) {
+    private Map<String, String> prepareCommonTemplateData(String businessNo, String userName, boolean hasSignImg) {
         ContractOrderEntity contractOrderEntity = contractOrderRepository.getContractOrderWithBizNo(businessNo);
         ContractOrderEntity contractOrderEntity = contractOrderRepository.getContractOrderWithBizNo(businessNo);
         //
         //
         Map<String, String> map = new HashMap<>();
         Map<String, String> map = new HashMap<>();
         map.put("$Greffier$", userName);
         map.put("$Greffier$", userName);
         map.put("$Date$", DateUtil.formatDateWithChineseSeparatorAndNoZeroFilled(new Date()));
         map.put("$Date$", DateUtil.formatDateWithChineseSeparatorAndNoZeroFilled(new Date()));
+        map.put("$TotalMonth$", getMonth(contractOrderEntity));
         // 准备订单信息
         // 准备订单信息
         try {
         try {
             map.put("$AcceptedNO$", contractOrderEntity.getConsultNo());
             map.put("$AcceptedNO$", contractOrderEntity.getConsultNo());
@@ -421,7 +468,7 @@ public class ModelSynthesizerDomain {
             if (contractOrderEntity.getJointFlag() == 1) {
             if (contractOrderEntity.getJointFlag() == 1) {
                 map.put("$MateName$", contractOrderEntity.getJointName());
                 map.put("$MateName$", contractOrderEntity.getJointName());
                 map.put("$MateSex$", StatusEnum.SexStatusEnum.getValue(contractOrderEntity.getJointSex()));
                 map.put("$MateSex$", StatusEnum.SexStatusEnum.getValue(contractOrderEntity.getJointSex()));
-                map.put("$MateBirthday$", DateUtil.formatDateWithChineseSeparatorAndNoZeroFilled(contractOrderEntity.getIdCard().substring(6, 14), "yyyyMMdd"));
+                map.put("$MateBirthday$", DateUtil.formatDateWithChineseSeparatorAndNoZeroFilled(contractOrderEntity.getJointIdCard().substring(6, 14), "yyyyMMdd"));
                 map.put("$MateAddr$", contractOrderEntity.getJointResidence());
                 map.put("$MateAddr$", contractOrderEntity.getJointResidence());
                 map.put("$MatePhone$", contractOrderEntity.getJointPhone());
                 map.put("$MatePhone$", contractOrderEntity.getJointPhone());
                 map.put("$MateIDNo$", contractOrderEntity.getJointIdCard());
                 map.put("$MateIDNo$", contractOrderEntity.getJointIdCard());
@@ -447,6 +494,25 @@ public class ModelSynthesizerDomain {
         map.put("$PBName$", user.getNickName());
         map.put("$PBName$", user.getNickName());
         map.put("$PBSex$", user.getGender());
         map.put("$PBSex$", user.getGender());
         map.put("$PBPhone$", user.getPhone());
         map.put("$PBPhone$", user.getPhone());
+        //
+        if (hasSignImg) {
+            List<String> imgIdList = new ArrayList<>();
+            Map<String,String> imgTypeMap = new HashMap<>();
+            imgIdList.add(user.getSignImgId());
+            imgTypeMap.put(user.getSignImgId(),"customer");
+            //
+            String userSignImgId = String.valueOf(userAXQInfoRepository.getUserAXQInfoWithIdcard(contractOrderEntity.getIdCard()).getImgSealId());
+            imgIdList.add(userSignImgId);
+            imgTypeMap.put(userSignImgId, "user");
+            //
+            if (contractOrderEntity.getJointFlag() == OrderConstant.JOINT_FLAG_TRUE) {
+                userSignImgId = String.valueOf(userAXQInfoRepository.getUserAXQInfoWithIdcard(contractOrderEntity.getJointIdCard()).getImgSealId());
+                imgIdList.add(userSignImgId);
+                imgTypeMap.put(userSignImgId, "user");
+            }
+            List<FileInfoEntity> fileList = fileInfoMapper.selectBatchIds(imgIdList);
+            map.put("photograph", generateSignImgHtml(fileList, imgTypeMap));
+        }
         // 准备公证处信息
         // 准备公证处信息
         NotaryOfficeEntity office = notaryOfficeMapper.selectById(contractOrderEntity.getNotaryOfficeId());
         NotaryOfficeEntity office = notaryOfficeMapper.selectById(contractOrderEntity.getNotaryOfficeId());
         String[] areas = office.getAreaCodesStr().split(",");
         String[] areas = office.getAreaCodesStr().split(",");
@@ -468,4 +534,60 @@ public class ModelSynthesizerDomain {
         //
         //
         return map;
         return map;
     }
     }
+
+    /**
+     * 生成签名图片html文本
+     *
+     * @param fileInfoList
+     * @return
+     */
+    private String generateSignImgHtml(List<FileInfoEntity> fileInfoList, Map<String, String> imgTypeMap) {
+        String signImgHtml = "";
+        for (FileInfoEntity fileInfo : fileInfoList) {
+            if ("customer".equals(imgTypeMap.get(String.valueOf(fileInfo.getId())))) {
+                signImgHtml += "<img style=\"width: 160px;height: 60px;margin-right: 8px;\" title=\"客户经理签名\" src=\"" + FileUploadUtil.getPreviewUrl(fileInfo.getPath()) + "\"/>";
+            } else {
+                signImgHtml += "<img style=\"width: 80px;height: 40px;margin-right: 8px;\" title=\"当事人签名\" src=\"" + FileUploadUtil.getPreviewUrl(fileInfo.getPath()) + "\"/>";
+            }
+        }
+        return signImgHtml;
+    }
+
+    /**
+     * 获取合同月份
+     *
+     * @param contractOrderEntity
+     * @return
+     */
+    private String getMonth(ContractOrderEntity contractOrderEntity) {
+        String month = "";
+        try {
+            if (StringUtils.isNotBlank(contractOrderEntity.getContractTerm())) {
+                month = contractOrderEntity.getContractTerm();
+            } else if (StringUtils.isNotBlank(contractOrderEntity.getStartDate()) && StringUtils.isNotBlank(contractOrderEntity.getEndDate())) {
+                SimpleDateFormat monthformatter = new SimpleDateFormat("yyyy-MM");
+                Date beginDate = monthformatter.parse(contractOrderEntity.getStartDate());
+                Date endDate = monthformatter.parse(contractOrderEntity.getEndDate());
+                month = String.valueOf(DateUtils.getDiffNaturalMonth(endDate, beginDate));
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return month + "个月";
+    }
+
+    /**
+     * 格式化金额字段
+     *
+     * @param amount
+     * @return
+     */
+    private String formatAmount(String amount) {
+        String formatAmount = "0";
+        if (StringUtils.isNotBlank(amount)) {
+            float iAmount = Float.parseFloat(amount) / 10000;
+            formatAmount = String.valueOf(new BigDecimal(iAmount).setScale(0, BigDecimal.ROUND_DOWN));
+        }
+        return formatAmount;
+    }
 }
 }

+ 0 - 16
eladmin-system/src/main/resources/cfca.properties

@@ -1,16 +0,0 @@
-connectTimeout = 30000
-readTimeout = 30000
-isSSL = true
-alias = anxinsign
-# product configuration
-#platID = E96620D49426837BE053345B210A8F01
-#cfcaURL = https://cs.anxinsign.com/FEP/
-#channel = prod
-#jksPath = anxinqian.jks
-#jksPWD = anxinqian1234
-# test configuration
-platID = D998E5EBBF4C2D95E05312016B0A7677
-cfcaURL = https://210.74.42.33:9443/FEP/
-channel = test
-jksPath = anxinsign-test.jks
-jksPWD = 123456

+ 23 - 1
eladmin-system/src/main/resources/config/application-prod.yml

@@ -170,6 +170,9 @@ app:
     bucketName: mytest    
     bucketName: mytest    
     preview: https://fqgz.flowbb.cn
     preview: https://fqgz.flowbb.cn
 tencent:
 tencent:
+  account:
+    secretId: AKIDO7duvhh3xb0C9G5i38xcGftrbBWvZCxY
+    secretKey: ZN7sVvAAzaw4Viz9AwSiiQtAD4g2B5tR
   client:
   client:
     webankAppId: TIDAdW8e
     webankAppId: TIDAdW8e
     secret: 34mhXRkury4DCFZpXCQ9E1fr7KUAPTiXTVac6H6e4pvxYMo5jl1m7sehQUqsmwsQ
     secret: 34mhXRkury4DCFZpXCQ9E1fr7KUAPTiXTVac6H6e4pvxYMo5jl1m7sehQUqsmwsQ
@@ -197,4 +200,23 @@ xxl:
 
 
 logging:
 logging:
   config: classpath:logback-spring.xml
   config: classpath:logback-spring.xml
-  logdir: ./logs/java-app
+  logdir: ./logs/java-app
+
+axq:
+  proxy:
+    usable: 0
+    host: 114.55.230.80
+    port: 3128
+    user: sakuya
+    password: qwe123!@#90[
+  connect:
+    alias: anxinsign
+    connectTimeout: 30000
+    readTimeout: 30000
+    isSSL: true
+  request:
+    platID: D998E5EBBF4C2D95E05312016B0A7677
+    cfcaURL: https://210.74.42.33:9443/FEP/
+    channel: test
+    jksPath: anxinsign-test.jks
+    jksPWD: 123456

+ 23 - 1
eladmin-system/src/main/resources/config/application-test.yml

@@ -172,6 +172,9 @@ app:
     preview: https://flowbb.show.xjrkj.com
     preview: https://flowbb.show.xjrkj.com
     
     
 tencent:
 tencent:
+  account:
+    secretId: AKIDCD2b091cvxiDRP6VeX9VaOvBAsKVQ4SZ
+    secretKey: qPhjUyA5j6C1ZqqZ2D7k8bniLhma7NQH
   client:
   client:
     webankAppId: TIDAeQGR
     webankAppId: TIDAeQGR
     secret: Wqwpw09j9Yg4s2e1GbuiUoeRQjlKFA1oXTuVC8w1Cy1gOtnlq0xz9QrKvqCSOqJS
     secret: Wqwpw09j9Yg4s2e1GbuiUoeRQjlKFA1oXTuVC8w1Cy1gOtnlq0xz9QrKvqCSOqJS
@@ -199,4 +202,23 @@ xxl:
 
 
 logging:
 logging:
   config: classpath:./logback-spring.xml
   config: classpath:./logback-spring.xml
-  logdir: ./logs/java-app
+  logdir: ./logs/java-app
+
+axq:
+  proxy:
+    usable: 0
+    host: 114.55.230.80
+    port: 3128
+    user: sakuya
+    password: qwe123!@#90[
+  connect:
+    alias: anxinsign
+    connectTimeout: 30000
+    readTimeout: 30000
+    isSSL: true
+  request:
+    platID: D998E5EBBF4C2D95E05312016B0A7677
+    cfcaURL: https://210.74.42.33:9443/FEP/
+    channel: test
+    jksPath: anxinsign-test.jks
+    jksPWD: 123456

+ 28 - 6
eladmin-system/src/main/resources/config/application-nt-pre.yml

@@ -170,17 +170,20 @@ app:
     bucketName: mytest    
     bucketName: mytest    
     preview: https://fqgz.flowbb.cn
     preview: https://fqgz.flowbb.cn
 tencent:
 tencent:
+  account:
+    secretId: AKIDjNyBC1cy75rPjrlSzUlrfIkxwthIi096
+    secretKey: qdGgstjOq6A0b0FFNJ3tX8appfLq7JRR
   client:
   client:
     webankAppId: TIDAdW8e
     webankAppId: TIDAdW8e
     secret: 34mhXRkury4DCFZpXCQ9E1fr7KUAPTiXTVac6H6e4pvxYMo5jl1m7sehQUqsmwsQ
     secret: 34mhXRkury4DCFZpXCQ9E1fr7KUAPTiXTVac6H6e4pvxYMo5jl1m7sehQUqsmwsQ
     keyLicence: ZNjSJAs5nqb0OJR7SXGj8b8Jr8GZuhkIiLceBA1rp/UZ/X8nHbYzfNGkyhXLuTG82QzHIiNxixrzc7zWFcRyxiIIhglIxi0zZDD9nSQsXrHlMJMC3EUXarN9tp5QX0X2dS38gsi+F1TIigfHqxj39iX43wAO4KOfZekBIPNPA2Vb/AjlWnsTbOZCVwANXXwcKsCYiZJrbQlxGlxF9bfXEuhJgILJGQ2iT74wJ/Qn4qRraiyaYzi0Un44C24Y44pbYX4kEokvVQaPnClnAnMH98l8w0VIxPc2lH5io0ATpoPMoZGWKtICVPzrvpaMwjaPlyBzZ/qWwc5jeS+ySxwJyA==
     keyLicence: ZNjSJAs5nqb0OJR7SXGj8b8Jr8GZuhkIiLceBA1rp/UZ/X8nHbYzfNGkyhXLuTG82QzHIiNxixrzc7zWFcRyxiIIhglIxi0zZDD9nSQsXrHlMJMC3EUXarN9tp5QX0X2dS38gsi+F1TIigfHqxj39iX43wAO4KOfZekBIPNPA2Vb/AjlWnsTbOZCVwANXXwcKsCYiZJrbQlxGlxF9bfXEuhJgILJGQ2iT74wJ/Qn4qRraiyaYzi0Un44C24Y44pbYX4kEokvVQaPnClnAnMH98l8w0VIxPc2lH5io0ATpoPMoZGWKtICVPzrvpaMwjaPlyBzZ/qWwc5jeS+ySxwJyA==
   bank:
   bank:
-    webankAppId: IDAQVtYe
-    secret: pzFuoHgzUWHKw01XT0H7FIMDMf0a58JsTP31gE1hpP5T5uY1RfyAGftROvAiMery
-    keyLicence: gDsQvwRTlBm4/gdPKXaG6iKnjbpF9irGFpAGVP5yIw3MKZKybnnOGoHs+5cOV2W2z4dyUmiu1yXuUGKuvtwaWRDPoaPvCMFShdy7oEY61Zc0N/0uCvU2qXP+l/ULp2fnnOXJxLRb+Ldsnj2V9LuBgOnyvFyVQ/HPh90ood2X1F0bunPOAIzXmffDLgeO6ZlCF6nLN0cEBkm7m80p6hp25NqdfxfN9n2E+j6rBJe2NLKMazbd+HRaFvWs5PPpR2FowvQPYXiYI8xDMCxhE94waN4E3/BuCY1blf1vxH60DlAB21Z8dP38kwTUXejm0ybvUHu4iyFMCjkPy+XuvslJGw==
+    webankAppId: IDAVZfDX
+    secret: i5Rw30IrvEU5Zm9QWYb0hBNtAzGFFCUlohJu6FI0w254eXd039gVADubvzJRp3qy
+    keyLicence: IHdC/s+4yYQ3Ydkc4S3xKrJmboZSipzQcTeK/SvxwnKiXFzi2Mr9QUX1qa+4mR5OWPHq8M28TCgC4+udPb5QuN41b1ql2W0swQLunEYZqZ/Iet8krdQnE2Kxh9TTU1ZbSL4f6gclIq8oIxjYcpG4K5e3CTqgbE9+DNGINy5DvztjLhz1/IGRy2nbKfhvtzDdq2etcGXVolhbGPmstJ5Krllrm52Rmo1yiEp6IYl9IlaXUzEgKYi/a8PdpoXJtdEF0JXPJSUIwvA5BuFJidJabCKGg2HwS+8Pgq1zB+1KEiQWhu8nNJt5eo8qxBjFkt10MwKY7yIMsvxOpiehLWoFhw==
   ttlsig:
   ttlsig:
-    sdkappid: 1400743315
-    key: 3b8f5b1a04511a8e9f40a90b61bc8312452226416c5e533e81cbbf52e9b0e351
+    sdkappid: 1400756087
+    key: aa566f428e4bc4c1f12e602cca1af3cd8fd0d9fb5315072cec556798127bed51
 
 
 xxl:
 xxl:
   job:
   job:
@@ -197,4 +200,23 @@ xxl:
 
 
 logging:
 logging:
   config: classpath:logback-spring.xml
   config: classpath:logback-spring.xml
-  logdir: ./logs/java-app
+  logdir: ./logs/java-app
+
+axq:
+  proxy:
+    usable: 0
+    host: 114.55.230.80
+    port: 3128
+    user: sakuya
+    password: qwe123!@#90[
+  connect:
+    alias: anxinsign
+    connectTimeout: 30000
+    readTimeout: 30000
+    isSSL: true
+  request:
+    platID: D998E5EBBF4C2D95E05312016B0A7677
+    cfcaURL: https://210.74.42.33:9443/FEP/
+    channel: test
+    jksPath: anxinsign-test.jks
+    jksPWD: 123456

+ 23 - 1
eladmin-system/src/main/resources/config/application-nt-test.yml

@@ -171,6 +171,9 @@ app:
     bucketName: mytest    
     bucketName: mytest    
     preview: https://fqgz.flowbb.cn:9001
     preview: https://fqgz.flowbb.cn:9001
 tencent:
 tencent:
+  account:
+    secretId: AKIDjNyBC1cy75rPjrlSzUlrfIkxwthIi096
+    secretKey: qdGgstjOq6A0b0FFNJ3tX8appfLq7JRR
   client:
   client:
     webankAppId: TIDAdW8e
     webankAppId: TIDAdW8e
     secret: 34mhXRkury4DCFZpXCQ9E1fr7KUAPTiXTVac6H6e4pvxYMo5jl1m7sehQUqsmwsQ
     secret: 34mhXRkury4DCFZpXCQ9E1fr7KUAPTiXTVac6H6e4pvxYMo5jl1m7sehQUqsmwsQ
@@ -198,4 +201,23 @@ xxl:
 
 
 logging:
 logging:
   config: classpath:logback-spring.xml
   config: classpath:logback-spring.xml
-  logdir: ./logs/java-app
+  logdir: ./logs/java-app
+
+axq:
+  proxy:
+    usable: 0
+    host: 114.55.230.80
+    port: 3128
+    user: sakuya
+    password: qwe123!@#90[
+  connect:
+    alias: anxinsign
+    connectTimeout: 30000
+    readTimeout: 30000
+    isSSL: true
+  request:
+    platID: D998E5EBBF4C2D95E05312016B0A7677
+    cfcaURL: https://210.74.42.33:9443/FEP/
+    channel: test
+    jksPath: anxinsign-test.jks
+    jksPWD: 123456

+ 23 - 1
eladmin-system/src/main/resources/config/application-nt.yml

@@ -170,6 +170,9 @@ app:
     bucketName: fqgz
     bucketName: fqgz
     preview: https://fqgz.ntgzc.com
     preview: https://fqgz.ntgzc.com
 tencent:
 tencent:
+  account:
+    secretId: AKIDO7duvhh3xb0C9G5i38xcGftrbBWvZCxY
+    secretKey: ZN7sVvAAzaw4Viz9AwSiiQtAD4g2B5tR
   client:
   client:
     webankAppId: TIDAdW8e
     webankAppId: TIDAdW8e
     secret: 34mhXRkury4DCFZpXCQ9E1fr7KUAPTiXTVac6H6e4pvxYMo5jl1m7sehQUqsmwsQ
     secret: 34mhXRkury4DCFZpXCQ9E1fr7KUAPTiXTVac6H6e4pvxYMo5jl1m7sehQUqsmwsQ
@@ -197,4 +200,23 @@ xxl:
 
 
 logback:
 logback:
   config: classpath:logback-spring.xml
   config: classpath:logback-spring.xml
-  logdir: ./logs/java-app
+  logdir: ./logs/java-app
+
+axq:
+  proxy:
+    usable: 0
+    host: 114.55.230.80
+    port: 3128
+    user: sakuya
+    password: qwe123!@#90[
+  connect:
+    alias: anxinsign
+    connectTimeout: 30000
+    readTimeout: 30000
+    isSSL: true
+  request:
+    platID: E96620D49426837BE053345B210A8F01
+    cfcaURL: https://cs.anxinsign.com/FEP/
+    channel: prod
+    jksPath: anxinqian.jks
+    jksPWD: anxinqian1234

+ 1 - 6
eladmin-system/src/main/resources/config/application.yml

@@ -66,9 +66,4 @@ fqgz:
       url-prefix: /api/user-mini
       url-prefix: /api/user-mini
   admin:
   admin:
     web:
     web:
-      url-prefix: /api/admin-web
-
-tencent:
-  account:
-    secretId: AKIDjNyBC1cy75rPjrlSzUlrfIkxwthIi096
-    secretKey: qdGgstjOq6A0b0FFNJ3tX8appfLq7JRR
+      url-prefix: /api/admin-web

+ 0 - 4
eladmin-system/src/main/resources/proxy.properties

@@ -1,4 +0,0 @@
-proxyPort = 3128
-proxyHost = 114.55.230.80
-authUser  = sakuya
-authPassword = qwe123!@#90[

+ 1 - 0
pom.xml

@@ -18,6 +18,7 @@
         <module>eladmin-mnt</module>
         <module>eladmin-mnt</module>
         <module>eladmin-quartz</module>
         <module>eladmin-quartz</module>
         <module>eladmin-security</module>
         <module>eladmin-security</module>
+        <module>eladmin-sign</module>
     </modules>
     </modules>
 
 
     <name>fqgz</name>
     <name>fqgz</name>