Преглед на файлове

【诚泰对接】所有接口功能提交

dongxin преди 1 година
родител
ревизия
2880fd96a9
променени са 55 файла, в които са добавени 4624 реда и са изтрити 14 реда
  1. 22 0
      src/main/java/com/ydtech/config/properties/ChengTaiApiConfigurationProperties.java
  2. 82 0
      src/main/java/com/ydtech/config/resttemplate/IgnoreSSLRequestFactory.java
  3. 32 7
      src/main/java/com/ydtech/config/resttemplate/RestTemplateConfig.java
  4. 3 0
      src/main/java/com/ydtech/constants/RedisConstant.java
  5. 17 0
      src/main/java/com/ydtech/constants/enums/InsuranceRisk.java
  6. 8 3
      src/main/java/com/ydtech/modules/ins/model/vo/QuoteRespVo.java
  7. 403 0
      src/main/java/com/ydtech/modules/order/components/chengtai/ChengTaiRequestApiComponents.java
  8. 17 0
      src/main/java/com/ydtech/modules/order/constants/OrderCacheConstant.java
  9. 118 0
      src/main/java/com/ydtech/modules/order/controller/ChengTaiOrderApiController.java
  10. 15 0
      src/main/java/com/ydtech/modules/order/controller/QuoteController.java
  11. 179 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/HexUtil.java
  12. 421 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/RSAUtil.java
  13. 18 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/constants/CarKindCodeEnum.java
  14. 48 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/constants/CtKindCodeEnum.java
  15. 53 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/constants/FileTypeEnum.java
  16. 55 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/constants/ImageTypeEnum.java
  17. 32 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/constants/OrderStatusEnum.java
  18. 21 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/constants/PlateType.java
  19. 30 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/constants/RequestType.java
  20. 23 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/constants/ResponseCode.java
  21. 28 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/constants/RiskCodeEnum.java
  22. 28 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/constants/TaxConditionCodeEnum.java
  23. 23 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/constants/UseNatureCodeEnum.java
  24. 33 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/request/CarInfoRequest.java
  25. 25 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/request/ChengTaiBaseRequest.java
  26. 22 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/request/DownLoadDocumentUrlRequest.java
  27. 629 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/request/InsurePremiumRequest.java
  28. 22 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/request/OrderNoRequest.java
  29. 37 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/request/PayUrlRequest.java
  30. 89 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/request/QueryCarActualValueRequest.java
  31. 184 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/request/SubmitVerifyRequest.java
  32. 22 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/request/SubmitVerifyResultRequest.java
  33. 24 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/request/TokenRequest.java
  34. 22 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/request/UnderwritingRequest.java
  35. 22 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/request/UnderwritingResultRequest.java
  36. 85 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/request/UploadFileRequest.java
  37. 109 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/response/CarInfoResponse.java
  38. 47 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/response/ChengTaiBaseResponse.java
  39. 25 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/response/DownLoadDocumentUrlResponse.java
  40. 512 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/response/InsurePremiumResponse.java
  41. 13 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/response/OrderNoResponse.java
  42. 15 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/response/PayUrlResponse.java
  43. 17 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/response/QueryCarActualValueResponse.java
  44. 33 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/response/SubmitVerifyResponse.java
  45. 30 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/response/SubmitVerifyResultResponse.java
  46. 15 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/response/TokenResponse.java
  47. 26 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/response/UnderwritingResponse.java
  48. 25 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/response/UnderwritingResultResponse.java
  49. 20 0
      src/main/java/com/ydtech/modules/order/entity/api/chengtai/response/UploadFileResponse.java
  50. 22 0
      src/main/java/com/ydtech/modules/order/entity/config/ChengTaiConfigureParameters.java
  51. 16 0
      src/main/java/com/ydtech/modules/order/entity/vo/ct/CtQuoteAccidentVo.java
  52. 92 0
      src/main/java/com/ydtech/modules/order/service/ChengTaiOrderApiService.java
  53. 688 0
      src/main/java/com/ydtech/modules/order/service/impl/ChengTaiOrderApiServiceImpl.java
  54. 12 4
      src/main/java/com/ydtech/modules/order/service/impl/InsOrderPdfUrlServiceImpl.java
  55. 15 0
      src/main/java/com/ydtech/modules/order/service/impl/InsuranceCompanyPolymerizationServiceImpl.java

+ 22 - 0
src/main/java/com/ydtech/config/properties/ChengTaiApiConfigurationProperties.java

@@ -0,0 +1,22 @@
+package com.ydtech.config.properties;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+@Data
+@Component
+@ConfigurationProperties(prefix = "chengtai.api")
+public class ChengTaiApiConfigurationProperties {
+
+    //诚泰接入方code
+    private String partnerCode;
+    //诚泰请求API地址
+    private String baseUrl;
+    //诚泰RSA公钥
+    private String ctPublicKey;
+    //我司RSA公钥
+    private String publicKey;
+    //我司RSA私钥
+    private String privateKey;
+}

+ 82 - 0
src/main/java/com/ydtech/config/resttemplate/IgnoreSSLRequestFactory.java

@@ -0,0 +1,82 @@
+package com.ydtech.config.resttemplate;
+import org.apache.http.client.HttpClient;
+import org.springframework.http.client.SimpleClientHttpRequestFactory;
+
+import javax.net.ssl.HostnameVerifier;
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSession;
+import javax.net.ssl.SSLSocketFactory;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.X509TrustManager;
+import java.io.IOException;
+import java.net.HttpURLConnection;
+import java.security.SecureRandom;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+
+/**
+ * 绕过证书
+ */
+public class IgnoreSSLRequestFactory extends SimpleClientHttpRequestFactory {
+
+    public IgnoreSSLRequestFactory(HttpClient httpClient) {
+        super();
+    }
+
+    @Override
+    protected void prepareConnection(HttpURLConnection connection, String httpMethod)
+            throws IOException {
+        if (connection instanceof HttpsURLConnection) {
+            prepareHttpsConnection((HttpsURLConnection) connection);
+        }
+        connection.setConnectTimeout(3000);
+        connection.setReadTimeout(3000);
+        super.prepareConnection(connection, httpMethod);
+    }
+
+    private void prepareHttpsConnection(HttpsURLConnection connection) {
+        connection.setHostnameVerifier(new SkipHostnameVerifier());
+        try {
+            connection.setSSLSocketFactory(createSslSocketFactory());
+        } catch (Exception ex) {
+            // Ignore
+        }
+    }
+
+    private SSLSocketFactory createSslSocketFactory() throws Exception {
+        SSLContext context = SSLContext.getInstance("TLS");
+        context.init(null, new TrustManager[]{new SkipX509TrustManager()},
+                new SecureRandom());
+        return context.getSocketFactory();
+    }
+
+    private class SkipHostnameVerifier implements HostnameVerifier {
+
+        @Override
+        public boolean verify(String s, SSLSession sslSession) {
+            return true;
+        }
+
+    }
+
+    private static class SkipX509TrustManager implements X509TrustManager {
+
+
+        @Override
+        public void checkClientTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException {
+
+        }
+
+        @Override
+        public void checkServerTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException {
+
+        }
+
+        @Override
+        public X509Certificate[] getAcceptedIssuers() {
+            return new X509Certificate[0];
+        }
+    }
+}
+

+ 32 - 7
src/main/java/com/ydtech/config/resttemplate/RestTemplateConfig.java

@@ -1,6 +1,10 @@
 package com.ydtech.config.resttemplate;
 
+import java.security.KeyManagementException;
+import java.security.NoSuchAlgorithmException;
 import java.util.concurrent.TimeUnit;
+
+import cn.hutool.core.net.SSLContextBuilder;
 import org.apache.http.client.HttpClient;
 import org.apache.http.client.config.RequestConfig;
 import org.apache.http.config.Registry;
@@ -8,12 +12,14 @@ import org.apache.http.config.RegistryBuilder;
 import org.apache.http.conn.HttpClientConnectionManager;
 import org.apache.http.conn.socket.ConnectionSocketFactory;
 import org.apache.http.conn.socket.PlainConnectionSocketFactory;
+import org.apache.http.conn.ssl.NoopHostnameVerifier;
 import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
 import org.apache.http.impl.client.DefaultHttpRequestRetryHandler;
 import org.apache.http.impl.client.HttpClientBuilder;
 import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Primary;
 import org.springframework.http.client.ClientHttpRequestFactory;
 import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
 import org.springframework.web.client.RestTemplate;
@@ -43,8 +49,9 @@ public class RestTemplateConfig {
     // 从连接池中获取连接的超时时间
     private static final int CONNECTION_REQUEST_TIMEOUT = 1000;
 
-    @Bean
-    public RestTemplate restTemplate() {
+    @Bean("restTemplate")
+    @Primary
+    public RestTemplate restTemplate() throws NoSuchAlgorithmException, KeyManagementException {
         RestTemplate restTemplate = new RestTemplate(httpRequestFactory());
         restTemplate.setErrorHandler(new CustomResponseErrorHandler());
         restTemplate.setInterceptors(Collections.singletonList(new RestTemplateRequestInterceptor()));
@@ -52,12 +59,12 @@ public class RestTemplateConfig {
     }
 
     @Bean
-    public ClientHttpRequestFactory httpRequestFactory() {
+    public ClientHttpRequestFactory httpRequestFactory() throws NoSuchAlgorithmException, KeyManagementException {
         return new HttpComponentsClientHttpRequestFactory(httpClient());
     }
 
     @Bean
-    public HttpClient httpClient() {
+    public HttpClient httpClient() throws NoSuchAlgorithmException, KeyManagementException {
         RequestConfig requestConfig = RequestConfig.custom()
                 .setSocketTimeout(SOCKET_TIMEOUT)  //返回数据的超时时间
                 .setConnectTimeout(CONNECT_TIMEOUT) //连接上服务器的超时时间
@@ -73,10 +80,28 @@ public class RestTemplateConfig {
                 .build();
     }
 
+    /**
+     * 绕过ssl对证书进行验证,无需将证书导出到jdk管理仓库
+     */
+    @Bean("restTemplateIgnoreSSL")
+    public RestTemplate restTemplateIgnoreSSL() throws NoSuchAlgorithmException, KeyManagementException {
+        IgnoreSSLRequestFactory requestFactory = new IgnoreSSLRequestFactory(httpClient());
+        requestFactory.setConnectTimeout(60000); //连接上服务器(握手成功)的时间
+        requestFactory.setReadTimeout(60000); //返回数据时间
+        RestTemplate restTemplate = new RestTemplate(requestFactory);
+        return restTemplate;
+    }
+
+
 
-    private HttpClientConnectionManager poolingConnectionManager() {
-        Registry<ConnectionSocketFactory> registry = RegistryBuilder.<ConnectionSocketFactory>create().register("http",
-                PlainConnectionSocketFactory.getSocketFactory()).register("https", SSLConnectionSocketFactory.getSocketFactory()).build();
+    private HttpClientConnectionManager poolingConnectionManager() throws NoSuchAlgorithmException, KeyManagementException {
+        SSLContextBuilder contextBuilder = new SSLContextBuilder();
+        SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory(contextBuilder.build(), NoopHostnameVerifier.INSTANCE);
+        Registry<ConnectionSocketFactory> registry = RegistryBuilder.<ConnectionSocketFactory>create()
+                .register("http", new PlainConnectionSocketFactory())
+                .register("https", socketFactory).build();
+//        Registry<ConnectionSocketFactory> registry = RegistryBuilder.<ConnectionSocketFactory>create().register("http",
+//                PlainConnectionSocketFactory.getSocketFactory()).register("https", SSLConnectionSocketFactory.getSocketFactory()).build();
         PoolingHttpClientConnectionManager poolingConnectionManager = new PoolingHttpClientConnectionManager(registry);
         poolingConnectionManager.setMaxTotal(MAX_TOTAL);
         poolingConnectionManager.setDefaultMaxPerRoute(DEFAULT_MAX_PER_ROUTE);

+ 3 - 0
src/main/java/com/ydtech/constants/RedisConstant.java

@@ -8,6 +8,9 @@ public class RedisConstant {
 
     public static final String PHONE_VERIFICATION_CODE_KEY = "sys:login:phone:";
 
+    // 诚泰 token key
+    public static final String CHENGTAI_TOKEN_CODE_KEY = "chengtai:login:token:";
+
     public static final long PHONE_VERIFICATION_CODE_KEY_TIME = 5L;
 
 

+ 17 - 0
src/main/java/com/ydtech/constants/enums/InsuranceRisk.java

@@ -135,4 +135,21 @@ public enum InsuranceRisk {
         }
         return trafficFlag;
     }
+
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/5/28 10:14
+     *  @Description: 判断是否投保商业
+     */
+    public static Boolean getFlagByBUSINESS(List<RiskInfoVo> risks) {
+        boolean businessFlag = false;//是否含交强
+        for (RiskInfoVo risk : risks) {
+            // 交强
+            if (InsuranceRisk.BUSINESS.getCode().equals(risk.getRiskCode())) {
+                businessFlag = true;
+            }
+        }
+        return businessFlag;
+    }
 }

+ 8 - 3
src/main/java/com/ydtech/modules/ins/model/vo/QuoteRespVo.java

@@ -39,9 +39,6 @@ public class QuoteRespVo {
     @ApiModelProperty("提示信息")
     private String tips;
 
-    @TableField(value = "orderstatus")
-    private String orderstatus = "0";
-
     @ApiModelProperty("商业险险种")
     private List<QuoteKindRespVo> kindList;
 
@@ -204,6 +201,14 @@ public class QuoteRespVo {
     @ApiModelProperty("验车链接")
     private String vehicleInspectionUrl;
 
+    // 诚泰增加特约
+    @ApiModelProperty("交强特别约定")
+    private String jqappoint;
+
+    @ApiModelProperty("商业特别约定")
+    @TableField(value = "syappoint")
+    private String syappoint;
+
     public void setJqClaims(String jqClaims) {
         this.jqClaims = StringUtils.isEmpty(jqClaims) ? null : jqClaims;
     }

+ 403 - 0
src/main/java/com/ydtech/modules/order/components/chengtai/ChengTaiRequestApiComponents.java

@@ -0,0 +1,403 @@
+package com.ydtech.modules.order.components.chengtai;
+
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.ydtech.config.properties.ChengTaiApiConfigurationProperties;
+import com.ydtech.constants.InsuranceEnum;
+import com.ydtech.constants.RedisConstant;
+import com.ydtech.exception.SystemException;
+import com.ydtech.modules.order.constants.OrderCacheConstant;
+import com.ydtech.modules.order.entity.api.chengtai.RSAUtil;
+import com.ydtech.modules.order.entity.api.chengtai.constants.RequestType;
+import com.ydtech.modules.order.entity.api.chengtai.constants.ResponseCode;
+import com.ydtech.modules.order.entity.api.chengtai.request.*;
+import com.ydtech.modules.order.entity.api.chengtai.response.*;
+import com.ydtech.modules.order.entity.config.ChengTaiConfigureParameters;
+import com.ydtech.modules.order.utils.InsuranceLog;
+import com.ydtech.utils.StringUtils;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.redisson.api.RLock;
+import org.redisson.api.RedissonClient;
+import org.springframework.data.redis.core.StringRedisTemplate;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Component;
+import org.springframework.web.client.RestTemplate;
+
+import javax.annotation.Resource;
+import java.nio.charset.Charset;
+import java.security.PrivateKey;
+import java.security.PublicKey;
+import java.time.Duration;
+import java.util.Base64;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * 诚泰财险
+ */
+@Slf4j
+@Component
+@RequiredArgsConstructor
+public class ChengTaiRequestApiComponents {
+
+    // 递归层级
+    public static final int RECURSIVE_HIERARCHY = 3;
+
+    private static final String AUTHTOKEN = "X-ACCESS-TOKEN";
+
+    @Resource(name = "restTemplateIgnoreSSL")
+    private RestTemplate restTemplateIgnoreSSL;
+
+    private final ChengTaiApiConfigurationProperties properties;
+
+    private final RedissonClient redissonClient;
+
+    private final StringRedisTemplate redisTemplate;
+
+
+    /**
+     * 加密请求
+     *
+     * @param q      请求参数
+     * @param url    请求url
+     * @param tClass 响应类型
+     * @param <Q>    Request 请求体
+     * @param <S>    Response 响应体
+     * @return <S>
+     */
+    private <Q extends ChengTaiBaseRequest, S extends ChengTaiBaseResponse> S post(Q q, String url, Class<S> tClass,
+                                                                                   RequestType requestType, HttpHeaders httpHeaders) throws Exception {
+
+        String busReqString = JSON.toJSONString(q, SerializerFeature.WriteMapNullValue, SerializerFeature.WriteNullStringAsEmpty);
+//        Gson gson = new GsonBuilder().serializeNulls().create();
+//        busReqString = gson.toJson(busReqString);
+        InsuranceLog.infoLog(InsuranceEnum.CHAC.getPinyin(), "\n\t---------> {} \n\t---------> URl: {} \n\t---------> 请求参数:{}",
+                requestType.getDesc(), url + requestType.getCode(), busReqString);
+        String pri = properties.getPrivateKey();
+        String ctPub = properties.getCtPublicKey();
+        PrivateKey privateKey = RSAUtil.getPrivateKeyFromPKCS8("RSA", pri);
+        PublicKey ctPublicKey = RSAUtil.getPublicKeyFromX509("RSA", ctPub);
+        //base64加密
+        String baseStr = Base64.getEncoder().encodeToString(busReqString.getBytes(Charset.forName("UTF-8")));
+        //rsa加密
+        String encryptStr = RSAUtil.encryptString(ctPublicKey, baseStr); //加密
+        String signatureStr = RSAUtil.signature(baseStr, privateKey);  //加签
+        //rsa加密
+        Map requetBean = new HashMap();
+        requetBean.put("encryptionMessage",encryptStr);
+        requetBean.put("signature",signatureStr);
+        requetBean.put("embarkPartnerCode",q.getEmbarkPartnerCode());
+        String content = JSON.toJSONString(requetBean);
+        InsuranceLog.infoLog(InsuranceEnum.CHAC.getPinyin(), "\n\t---------> {} \n\t---------> 加密后的参数:{} \n\t---------> " +
+                "请求头内容signature:{}", requestType.getDesc(), content, busReqString);
+        // 请求
+        HttpEntity<String> httpEntity = new HttpEntity<>(content, httpHeaders);
+        ResponseEntity<String> response = restTemplateIgnoreSSL.postForEntity(url + requestType.getCode(), httpEntity, String.class);
+        String body = response.getBody();
+        InsuranceLog.infoLog(InsuranceEnum.CHAC.getPinyin(), "\n\t---------> {} \n\t---------> 解密前的参数:{}", requestType.getDesc(), body);
+        S res = JSON.parseObject(body).toJavaObject(tClass);
+        if(!res.getFlag()){return res;}
+        // 解密响应
+        String newSource = RSAUtil.decryptString(privateKey, res.encryptionMessage);
+        String info = new String(Base64.getDecoder().decode(newSource), Charset.forName("UTF-8"));
+        boolean flag = RSAUtil.signatureVerfiy(newSource, res.signature, ctPublicKey);
+        InsuranceLog.infoLog(InsuranceEnum.CHAC.getPinyin(), "\n\t---------> {} \n\t---------> 解密后的参数:{}", requestType.getDesc(), info);
+        S data = JSON.parseObject(info).toJavaObject(tClass);
+        data.setCode(res.getCode());
+        data.setFlag(flag);
+        if(!ResponseCode.R_000.equals(res.getCode())) {
+            data.setMessage(res.message);
+        }
+        return data;
+    }
+
+
+    /**
+     * token非加密请求
+     *
+     * @param q      请求参数
+     * @param url    请求url
+     * @param tClass 响应类型
+     * @param <Q>    Request 请求体
+     * @param <S>    Response 响应体
+     * @return <S>
+     */
+    private <Q extends ChengTaiBaseRequest, S extends ChengTaiBaseResponse> S postToken(Q q, String url, Class<S> tClass,
+                                                                                   RequestType requestType,HttpHeaders httpHeaders) throws Exception {
+        String busReqString = JSON.toJSONString(q, SerializerFeature.WriteMapNullValue, SerializerFeature.WriteNullStringAsEmpty);
+        InsuranceLog.infoLog(InsuranceEnum.CHAC.getPinyin(), "\n\t---------> {} \n\t---------> URl: {} \n\t---------> 请求参数:{}",
+                requestType.getDesc(), url + requestType.getCode(), busReqString);
+        String pri = properties.getPrivateKey();
+        String ctPub = properties.getCtPublicKey();
+        PrivateKey privateKey = RSAUtil.getPrivateKeyFromPKCS8("RSA", pri);
+        PublicKey ctPublicKey = RSAUtil.getPublicKeyFromX509("RSA", ctPub);
+        // 请求
+        HttpEntity<String> httpEntity = new HttpEntity<>(busReqString, httpHeaders);
+        ResponseEntity<String> response = restTemplateIgnoreSSL.postForEntity(url + requestType.getCode(), httpEntity, String.class);
+        String body = response.getBody();
+        InsuranceLog.infoLog(InsuranceEnum.CHAC.getPinyin(), "\n\t---------> {} \n\t---------> 解密前的参数:{}", requestType.getDesc(), body);
+        S res = JSON.parseObject(body).toJavaObject(tClass);
+        if (!ResponseCode.R_000.getCode().equals(res.getCode())){return res;}
+        // 解密响应
+        String newSource = RSAUtil.decryptString(privateKey, res.encryptionMessage);
+        String info = new String(Base64.getDecoder().decode(newSource), Charset.forName("UTF-8"));
+        boolean flag = RSAUtil.signatureVerfiy(newSource, res.signature, ctPublicKey);
+        InsuranceLog.infoLog(InsuranceEnum.CHAC.getPinyin(), "\n\t---------> {} \n\t---------> 解密后的参数:{}", requestType.getDesc(), info);
+        S data = JSON.parseObject(info).toJavaObject(tClass);
+        data.setCode(res.getCode());
+        data.setFlag(flag);
+        data.setMessage(res.message);
+        return data;
+    }
+
+    /**
+     * token非加密请求
+     *
+     * @param q      请求参数
+     * @param url    请求url
+     * @param tClass 响应类型
+     * @param <Q>    Request 请求体
+     * @param <S>    Response 响应体
+     * @return <S>
+     */
+    private <Q extends ChengTaiBaseRequest, S extends ChengTaiBaseResponse> S postNo(Q q, String url, Class<S> tClass,
+                                                                                        RequestType requestType,HttpHeaders httpHeaders) throws Exception {
+        String busReqString = JSON.toJSONString(q, SerializerFeature.WriteMapNullValue, SerializerFeature.WriteNullStringAsEmpty);
+        InsuranceLog.infoLog(InsuranceEnum.CHAC.getPinyin(), "\n\t---------> {} \n\t---------> URl: {} \n\t---------> 请求参数:{}",
+                requestType.getDesc(), url + requestType.getCode(), busReqString);
+        // 请求
+        HttpEntity<String> httpEntity = new HttpEntity<>(busReqString, httpHeaders);
+        ResponseEntity<String> response = restTemplateIgnoreSSL.postForEntity(url + requestType.getCode(), httpEntity, String.class);
+        String body = response.getBody();
+        InsuranceLog.infoLog(InsuranceEnum.CHAC.getPinyin(), "\n\t---------> {} \n\t---------> 解密前的参数:{}", requestType.getDesc(), body);
+        S res = JSON.parseObject(body).toJavaObject(tClass);
+        return res;
+    }
+
+    public <Q extends ChengTaiBaseRequest, S extends ChengTaiBaseResponse> S verificationResponse(Q q, String url, Class<S> tClass,
+                                                                                            RequestType requestType,HttpHeaders httpHeaders) throws Exception {
+        S response = post(q, url, tClass, requestType, httpHeaders);
+        verificationResponseCode(response.getCode(), response.getFlag(),response.getMessage());
+        return response;
+    }
+
+    public <Q extends ChengTaiBaseRequest, S extends ChengTaiBaseResponse> S verificationTokenResponse(Q q, String url, Class<S> tClass,
+                                                                                                  RequestType requestType,HttpHeaders httpHeaders) throws Exception {
+        S response = postToken(q, url, tClass, requestType,httpHeaders);
+        verificationResponseCode(response.getCode(), response.getFlag(),response.getMessage());
+        return response;
+    }
+
+    public <Q extends ChengTaiBaseRequest, S extends ChengTaiBaseResponse> S verificationNoResponse(Q q, String url, Class<S> tClass,
+                                                                                                       RequestType requestType,HttpHeaders httpHeaders) throws Exception {
+        S response = postNo(q, url, tClass, requestType,httpHeaders);
+        verificationResponseCode(response.getCode(), true,response.getMessage());
+        return response;
+    }
+
+    /**
+     * 验证响应
+     *
+     * @param responseCode 响应code
+     * @param responseMsg  响应内容
+     */
+    private void verificationResponseCode(String responseCode, boolean flag, String responseMsg) {
+        if (!flag){
+            throw new SystemException(responseMsg);
+        }
+        if (!ResponseCode.R_000.getCode().equals(responseCode)) {
+            throw new SystemException(responseMsg);
+        }
+    }
+
+    /**
+     * 获取token信息
+     *
+     * @param parameters
+     * @return 返回token响应
+     */
+    public HttpHeaders getToken(ChengTaiConfigureParameters parameters,HttpHeaders httpHeaders) throws Exception {
+        TokenRequest request = new TokenRequest(parameters.getPartnerCode());
+        httpHeaders.setContentType(MediaType.APPLICATION_JSON);
+        TokenResponse response = verificationTokenResponse(request, properties.getBaseUrl(), TokenResponse.class, RequestType.Z00001,httpHeaders);
+        String token = response.getAccessToken();
+        if(StringUtils.isNotBlank(token)){
+            httpHeaders.set(AUTHTOKEN, token);
+            httpHeaders.setContentType(MediaType.APPLICATION_JSON);
+            redisTemplate.opsForValue().set(parameters.getAccessToken(), token);
+            redisTemplate.expire(parameters.getAccessToken(), Duration.ofMinutes(OrderCacheConstant.CT_ACCESS_TOKEN_TIME));
+        }
+        return httpHeaders;
+    }
+
+
+    public HttpHeaders getHttpHeaders(ChengTaiConfigureParameters parameters, int number) {
+        if (number <= 0) {
+            throw new SystemException("接口请求异常,请重试!");
+        }
+        number--;
+
+        HttpHeaders httpHeaders = new HttpHeaders();
+
+        String token = redisTemplate.opsForValue().get(RedisConstant.CHENGTAI_TOKEN_CODE_KEY);
+        // 缓存中不存在就去请求token
+        if (StringUtils.isNotBlank(token)) {
+            httpHeaders.set(AUTHTOKEN, token);
+            httpHeaders.setContentType(MediaType.APPLICATION_JSON);
+            return httpHeaders;
+        }
+
+        // 使用分布式锁 只有一个人可以访问登录
+        RLock lock = redissonClient.getLock(parameters.getAccessLock());
+        try {
+            boolean isLock = lock.tryLock(1, 10000, TimeUnit.MILLISECONDS);
+            if (isLock) {
+                try {
+                    return this.getToken(parameters,httpHeaders);
+                } catch (Exception e) {
+                    throw new RuntimeException(e);
+                } finally {
+                    lock.unlock();
+                }
+            }
+
+        } catch (InterruptedException e) {
+            log.debug(e.getMessage());
+            lock.unlock();
+            Thread.currentThread().interrupt();
+            throw new SystemException(e.getMessage());
+        }
+
+        // 睡眠一段时间 自调用 重新获取缓存中的 header
+        try {
+            Thread.sleep(280);
+        } catch (InterruptedException e) {
+            log.debug(e.getMessage());
+            Thread.currentThread().interrupt();
+            throw new SystemException("接口请求异常,请重试!");
+        }
+
+        return getHttpHeaders(parameters, number);
+
+    }
+
+    /**
+     * 车辆查询
+     * @param request
+     * @param httpHeaders
+     * @return
+     * @throws Exception
+     */
+    public CarInfoResponse carinfoQuery(CarInfoRequest request,HttpHeaders httpHeaders) throws Exception {
+        return verificationResponse(request,properties.getBaseUrl(),CarInfoResponse.class,RequestType.Z00002,httpHeaders);
+    }
+
+    /**
+     * 车辆价值计算
+     * @param request
+     * @param httpHeaders
+     * @return
+     */
+    public QueryCarActualValueResponse queryActualValue(QueryCarActualValueRequest request, HttpHeaders httpHeaders) throws Exception {
+        return verificationResponse(request,properties.getBaseUrl(),QueryCarActualValueResponse.class,RequestType.Z00003,httpHeaders);
+    }
+
+    /**
+     * 报价
+     * @param request
+     * @param httpHeaders
+     * @return
+     */
+    public InsurePremiumResponse quoteApi(InsurePremiumRequest request, HttpHeaders httpHeaders) throws Exception {
+        return verificationResponse(request,properties.getBaseUrl(),InsurePremiumResponse.class,RequestType.Z00004,httpHeaders);
+    }
+
+    /**
+     * 影像上传
+     * @param request
+     * @param httpHeaders
+     * @return
+     * @throws Exception
+     */
+    public UploadFileResponse submitImage(UploadFileRequest request, HttpHeaders httpHeaders) throws Exception {
+        return verificationNoResponse(request,properties.getBaseUrl(),UploadFileResponse.class,RequestType.Z00005,httpHeaders);
+    }
+
+    /**
+     * 投保保存
+     * @param request
+     * @param httpHeaders
+     * @return
+     */
+    public SubmitVerifyResponse auditSave(SubmitVerifyRequest request, HttpHeaders httpHeaders) throws Exception {
+        return verificationResponse(request,properties.getBaseUrl(),SubmitVerifyResponse.class,RequestType.Z00006,httpHeaders);
+    }
+
+    /**
+     * 核保
+     * @param request
+     * @param httpHeaders
+     * @return
+     */
+    public UnderwritingResponse audit(UnderwritingRequest request, HttpHeaders httpHeaders) throws Exception {
+        return verificationResponse(request,properties.getBaseUrl(),UnderwritingResponse.class,RequestType.Z00007,httpHeaders);
+    }
+
+    /**
+     * 核保结果查询
+     * @param request
+     * @param httpHeaders
+     * @return
+     */
+    public UnderwritingResultResponse auditResult(UnderwritingResultRequest request, HttpHeaders httpHeaders) throws Exception {
+        return verificationResponse(request,properties.getBaseUrl(),UnderwritingResultResponse.class,RequestType.Z00008,httpHeaders);
+    }
+
+    /**
+     * 投保结果查询
+     * @param request
+     * @param httpHeaders
+     * @return
+     */
+    public SubmitVerifyResultResponse auditSaveResult(SubmitVerifyResultRequest request, HttpHeaders httpHeaders) throws Exception {
+        return verificationResponse(request,properties.getBaseUrl(),SubmitVerifyResultResponse.class,RequestType.Z00009,httpHeaders);
+    }
+
+    /**
+     * 获取支付链接
+     * @param request
+     * @param httpHeaders
+     * @return
+     */
+    public PayUrlResponse getPayUrl(PayUrlRequest request, HttpHeaders httpHeaders) throws Exception {
+        return verificationResponse(request,properties.getBaseUrl(),PayUrlResponse.class,RequestType.Z00010,httpHeaders);
+    }
+
+    /**
+     * 保单下载
+     * @param request
+     * @param httpHeaders
+     * @return
+     */
+    public DownLoadDocumentUrlResponse downLoadDocumentUrl(DownLoadDocumentUrlRequest request, HttpHeaders httpHeaders) throws Exception {
+        return verificationResponse(request,properties.getBaseUrl(),DownLoadDocumentUrlResponse.class,RequestType.Z00011,httpHeaders);
+    }
+
+    /**
+     * 未缴费保单撤单
+     * @param request
+     * @param httpHeaders
+     * @return
+     */
+    public OrderNoResponse cancel(OrderNoRequest request, HttpHeaders httpHeaders) throws Exception {
+        return verificationResponse(request,properties.getBaseUrl(),OrderNoResponse.class,RequestType.Z00012,httpHeaders);
+    }
+}

+ 17 - 0
src/main/java/com/ydtech/modules/order/constants/OrderCacheConstant.java

@@ -83,14 +83,31 @@ public class OrderCacheConstant {
      */
     public static final String ZJ_ACCESS_TOKEN = "zj:accessToken:";
 
+    /**
+     * 诚泰财险 为接入方提供获取token
+     */
+    public static final String CT_ACCESS_TOKEN = "ct:accessToken:";
+
     /**
      * token 锁
      */
     public static final String ZJ_ACCESS_LOCK = "zj:accessLock:";
 
+    /**
+     * token 锁
+     */
+    public static final String CT_ACCESS_LOCK = "ct:accessLock:";
+
+
+
     /**
      * 紫金财险 为接入方提供获取token时间
      */
     public static final long ZJ_ACCESS_TOKEN_TIME = 6 * 24L + 23L;
 
+    /**
+     * 诚泰财险 为接入方提供获取token时间
+     */
+    public static final long CT_ACCESS_TOKEN_TIME = 238;
+
 }

+ 118 - 0
src/main/java/com/ydtech/modules/order/controller/ChengTaiOrderApiController.java

@@ -0,0 +1,118 @@
+package com.ydtech.modules.order.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.PropertyNamingStrategy;
+import com.fasterxml.jackson.databind.SerializationFeature;
+import com.ydtech.aop.request.RequestSingleParam;
+import com.ydtech.core.page.HttpResult;
+import com.ydtech.modules.ins.model.vo.QuoteRespVo;
+import com.ydtech.modules.ins.model.ya.CarModelDTO;
+import com.ydtech.modules.order.aop.AuditVerification;
+import com.ydtech.modules.order.aop.QuoteVerification;
+import com.ydtech.modules.order.components.InsOrdersComponents;
+import com.ydtech.modules.order.entity.api.chengtai.request.SubmitVerifyRequest;
+import com.ydtech.modules.order.entity.api.chengtai.response.CarInfoResponse;
+import com.ydtech.modules.order.entity.api.yangguang.request.YangGuangQueryVehicleModelRequest;
+import com.ydtech.modules.order.entity.vo.*;
+import com.ydtech.modules.order.entity.vo.ct.CtQuoteAccidentVo;
+import com.ydtech.modules.order.entity.vo.zj.ZjQuoteAccidentVo;
+import com.ydtech.modules.order.service.ChengTaiOrderApiService;
+import com.ydtech.modules.order.service.InsOrdersService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.client.RestTemplate;
+
+import javax.annotation.Resource;
+import java.io.InputStream;
+import java.io.OutputStreamWriter;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Scanner;
+import java.util.stream.Collectors;
+
+@Api(tags = "诚泰财险 API")
+@RestController
+@RequestMapping("/api/chengTai")
+@RequiredArgsConstructor
+public class ChengTaiOrderApiController {
+
+    private final ChengTaiOrderApiService chengTaiOrderApiService;
+
+    private final InsOrdersComponents insOrdersComponents;
+
+    @Resource(name = "restTemplateIgnoreSSL")
+    private RestTemplate restTemplateIgnoreSSL;
+
+    @QuoteVerification("报价授权")
+    @PostMapping("/quote")
+    @ApiOperation("报价")
+    public HttpResult<QuoteRespVo> quote(@RequestBody BaseQuoteVo<List<QuoteAccidentalDrivingVo>> quoteVo) throws Exception {
+        BaseQuoteInfoVo quoteInfo = this.insOrdersComponents.getQuoteInfo(quoteVo.getOrderNo(), quoteVo.getAgreementId(),quoteVo.getKinds());
+        return this.chengTaiOrderApiService.quoteApi(quoteInfo, null);
+    }
+
+    @PostMapping(value = "/modelsQuery")
+    @ApiOperation(value = "车型查询接口")
+    public HttpResult<List<CarInfoResponse.CarModelListDTO>> modelsQuery(@RequestSingleParam(value = "modelName") String modelName) throws Exception {
+        CarInfoResponse response = this.chengTaiOrderApiService.modelsQuery(modelName);
+        List<CarInfoResponse.CarModelListDTO> carModelDTOS =
+                response.getCarModelList().stream().sorted(Comparator.comparing(CarInfoResponse.CarModelListDTO::getModelName)).collect(Collectors.toList());
+        return HttpResult.ok(carModelDTOS);
+    }
+
+    @PostMapping(value = "/submitImage")
+    @ApiOperation(value = "提交影像信息")
+    public HttpResult<Object> submitImage(@RequestSingleParam(value = "companyId") String companyId) throws Exception {
+        return this.chengTaiOrderApiService.submitImages(companyId);
+    }
+
+    @AuditVerification("核保")
+    @PostMapping(value = "/audit")
+    @ApiOperation(value = "提交核保")
+    public HttpResult<Object> audit(@RequestSingleParam(value = "companyId") String companyId) throws Exception {
+        return this.chengTaiOrderApiService.audit(companyId);
+    }
+
+    @PostMapping("/getOrderDetail")
+    @ApiOperation(value = "订单状态查询")
+    public HttpResult<Object> getOrderDetail(@RequestSingleParam(value = "companyId") String companyId) throws Exception {
+        return this.chengTaiOrderApiService.getOrderDetail(companyId);
+    }
+
+    @PostMapping("/auditStatusQuery")
+    @ApiOperation(value = "核保状态查询")
+    public HttpResult<Object> auditStatusQuery(@RequestSingleParam(value = "companyId") String companyId) throws Exception {
+        return this.chengTaiOrderApiService.auditStatusQuery(companyId);
+    }
+
+    @PostMapping("/getPolicyPrint")
+    @ApiOperation(value = "电子保单")
+    public HttpResult<String> getPolicyPrint(@RequestBody PolicyPrintVo policyPrintVo) throws Exception {
+        return this.chengTaiOrderApiService.getPolicyPrint(policyPrintVo);
+    }
+
+    @PostMapping("/getPayUrl")
+    @ApiOperation(value = "支付链接")
+    public HttpResult<String> getPayUrl(@RequestSingleParam(value = "companyId") String companyId) throws Exception {
+        return this.chengTaiOrderApiService.getPayUrl(companyId);
+    }
+
+    @PostMapping(value = "/cancel")
+    @ApiOperation(value = "未缴费保单撤单")
+    public HttpResult<Object> cancel(@RequestSingleParam(value = "companyId") String companyId) throws Exception {
+        return this.chengTaiOrderApiService.cancel(companyId);
+    }
+}

+ 15 - 0
src/main/java/com/ydtech/modules/order/controller/QuoteController.java

@@ -22,6 +22,7 @@ import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
 import com.ydtech.modules.order.entity.vo.BaseQuoteVo;
 import com.ydtech.modules.order.entity.vo.QuoteAccidentalDrivingVo;
 import com.ydtech.modules.order.entity.vo.bohai.BoHaiQuoteAccidentVo;
+import com.ydtech.modules.order.entity.vo.ct.CtQuoteAccidentVo;
 import com.ydtech.modules.order.entity.vo.guoren.GuoRenQuoteVo;
 import com.ydtech.modules.order.entity.vo.guoren.GuorenAccidentalDrivingVo;
 import com.ydtech.modules.order.entity.vo.zj.ZjQuoteAccidentVo;
@@ -107,6 +108,8 @@ public class QuoteController extends BaseController {
     @Autowired
     InsAreaCompanyService insAreaCompanyService;
 
+    @Autowired
+    ChengTaiOrderApiService chengTaiOrderApiService;
 
     @Autowired
     YongAnOrderService yongAnOrderService;
@@ -228,6 +231,14 @@ public class QuoteController extends BaseController {
             }
             respVo = boHaiOrderApiService.quote(quoteInfo, quoteVo1);
         }
+        if("CHAC1000000".equals(ptlAgreementAttribution.getInsCompanyId()) && Objects.isNull(respVo)){
+            BaseQuoteVo<List<CtQuoteAccidentVo>> quoteVo1 = new BaseQuoteVo<>();
+//            JSONArray jsonObject = JSONArray.parseArray(JSONArray.toJSONString(quoteVo.getAccidentalDrivingVo()));
+//            List<CtQuoteAccidentVo> javaObject = jsonObject.toJavaList(CtQuoteAccidentVo.class);
+            BeanUtils.copyProperties(quoteVo, quoteVo1);
+//            quoteVo1.setAccidentalDrivingVo(javaObject);
+            respVo = chengTaiOrderApiService.quoteApi(quoteInfo, quoteVo1);
+        }
         if("PAIC1000000".equals(ptlAgreementAttribution.getInsCompanyId()) && Objects.isNull(respVo)){
 //            BaseQuoteVo<AccidentalDrivingVo> quoteVo1 = new BaseQuoteVo<>();
 //            JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(quoteVo.getAccidentalDrivingVo()));
@@ -287,6 +298,10 @@ public class QuoteController extends BaseController {
             if(insAreaCompany.getCompanyId().equals("ZKIC1000000")){
                 httpResult = zijinOrderApiService.submitImage(companyId);
             }
+            //诚泰
+            if(insAreaCompany.getCompanyId().equals("CHAC1000000")){
+                httpResult = chengTaiOrderApiService.submitImages(companyId);
+            }
         }
 
         return httpResult;

+ 179 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/HexUtil.java

@@ -0,0 +1,179 @@
+package com.ydtech.modules.order.entity.api.chengtai;
+
+public class HexUtil {
+	private static final char[] DIGITS_LOWER = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd',
+			'e', 'f' };
+	private static final char[] DIGITS_UPPER = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D',
+			'E', 'F' };
+
+	/**
+	 * 16进制转byte数组
+	 * 
+	 * @param data
+	 *            16进制字符串
+	 * @return byte数组
+	 * @throws Exception
+	 *             转化失败的异常
+	 */
+	public static byte[] hex2Bytes(final String data) throws Exception {
+		final int len = data.length();
+
+		if ((len & 0x01) != 0) {
+			throw new Exception("Odd number of characters.");
+		}
+
+		final byte[] out = new byte[len >> 1];
+
+		// two characters form the hex value.
+		for (int i = 0, j = 0; j < len; i++) {
+			int f = toDigit(data.charAt(j), j) << 4;
+			j++;
+			f = f | toDigit(data.charAt(j), j);
+			j++;
+			out[i] = (byte) (f & 0xFF);
+		}
+		return out;
+	}
+
+	/**
+	 * bytes数组转16进制String
+	 * 
+	 * @param data
+	 *            bytes数组
+	 * @return 转化结果
+	 */
+	public static String bytes2Hex(final byte[] data) {
+		return bytes2Hex(data, true);
+	}
+
+	/**
+	 * bytes数组转16进制String
+	 * 
+	 * @param data
+	 *            bytes数组
+	 * @param toLowerCase
+	 *            是否小写
+	 * @return 转化结果
+	 */
+	public static String bytes2Hex(final byte[] data, final boolean toLowerCase) {
+		return bytes2Hex(data, toLowerCase ? DIGITS_LOWER : DIGITS_UPPER);
+	}
+
+	/**
+	 * bytes数组转16进制String
+	 * 
+	 * @param data
+	 *            bytes数组
+	 * @param toDigits
+	 *            DIGITS_LOWER或DIGITS_UPPER
+	 * @return 转化结果
+	 */
+	private static String bytes2Hex(final byte[] data, final char[] toDigits) {
+		final int l = data.length;
+		final char[] out = new char[l << 1];
+		// two characters form the hex value.
+		for (int i = 0, j = 0; i < l; i++) {
+			out[j++] = toDigits[(0xF0 & data[i]) >>> 4];
+			out[j++] = toDigits[0x0F & data[i]];
+		}
+		return new String(out);
+	}
+
+	/**
+	 * 16转化为数字
+	 * 
+	 * @param ch
+	 *            16进制
+	 * @param index
+	 *            索引
+	 * @return 转化结果
+	 * @throws Exception
+	 *             转化失败异常
+	 */
+	private static int toDigit(final char ch, final int index) throws Exception {
+		final int digit = Character.digit(ch, 16);
+		if (digit == -1) {
+			throw new Exception("Illegal hexadecimal character " + ch + " at index " + index);
+		}
+		return digit;
+	}
+
+	/*
+	 * 16进制字符串转字符串
+	 */
+	public static String hex2String(String hex) throws Exception {
+		String r = bytes2String(hexString2Bytes(hex));
+		return r;
+	}
+
+	/*
+	 * 字节数组转字符串
+	 */
+	public static String bytes2String(byte[] b) throws Exception {
+		String r = new String(b, "UTF-8");
+		return r;
+	}
+
+	/*
+	 * 16进制字符串转字节数组
+	 */
+	public static byte[] hexString2Bytes(String hex) {
+
+		if ((hex == null) || (hex.equals(""))) {
+			return null;
+		} else if (hex.length() % 2 != 0) {
+			return null;
+		} else {
+			hex = hex.toUpperCase();
+			int len = hex.length() / 2;
+			byte[] b = new byte[len];
+			char[] hc = hex.toCharArray();
+			for (int i = 0; i < len; i++) {
+				int p = 2 * i;
+				b[i] = (byte) (charToByte(hc[p]) << 4 | charToByte(hc[p + 1]));
+			}
+			return b;
+		}
+	}
+
+	/*
+	 * 字符转换为字节
+	 */
+	private static byte charToByte(char c) {
+		return (byte) "0123456789ABCDEF".indexOf(c);
+	}
+
+	/*
+	 * 字符串转16进制字符串
+	 */
+	public static String string2HexString(String s) throws Exception {
+		String r = bytes2HexString(string2Bytes(s));
+		return r;
+	}
+
+	/*
+	 * 字节数组转16进制字符串
+	 */
+	public static String bytes2HexString(byte[] b) {
+		String r = "";
+
+		for (int i = 0; i < b.length; i++) {
+			String hex = Integer.toHexString(b[i] & 0xFF);
+			if (hex.length() == 1) {
+				hex = '0' + hex;
+			}
+			r += hex.toUpperCase();
+		}
+
+		return r;
+	}
+
+	/*
+	 * 字符串转字节数组
+	 */
+	public static byte[] string2Bytes(String s) {
+		byte[] r = s.getBytes();
+		return r;
+	}
+
+}

+ 421 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/RSAUtil.java

@@ -0,0 +1,421 @@
+package com.ydtech.modules.order.entity.api.chengtai;
+
+import javax.crypto.Cipher;
+import java.io.ByteArrayOutputStream;
+import java.math.BigInteger;
+import java.nio.charset.Charset;
+import java.security.*;
+import java.security.interfaces.RSAPrivateKey;
+import java.security.interfaces.RSAPublicKey;
+import java.security.spec.*;
+import java.util.Base64;
+
+/**
+ * RSA非对称加密辅助类
+ */
+public class RSAUtil {
+
+	/** 指定加密算法为DESede */
+	private static String ALGORITHM = "RSA/ECB/PKCS1Padding";// MD5withRSA///RSA/ECB/PKCS1Padding
+	/** 指定key的大小(64的整数倍,最小512位) */
+	private static int KEYSIZE = 1024;
+	/* RSA最大加密明文大小 */
+	private static final int MAX_ENCRYPT_BLOCK = 117;
+	/* RSA最大解密密文大小 */
+	private static final int MAX_DECRYPT_BLOCK = 128;
+	/* 公钥模量 */
+	public static String publicModulus = null;
+	/* 公钥指数 */
+	public static String publicExponent = null;
+	/* 私钥模量 */
+	public static String privateModulus = null;
+	/* 私钥指数 */
+	public static String privateExponent = null;
+	private static KeyFactory keyFactory = null;
+
+	static {
+		try {
+			keyFactory = KeyFactory.getInstance("RSA");
+		} catch (NoSuchAlgorithmException ex) {
+			System.out.println(ex.getMessage());
+		}
+	}
+
+	/**
+	 * 私钥签名
+	 * @param res 元数据
+	 * @param key 私钥
+	 * @return
+	 * @throws Exception
+	 */
+	public static String signature(String res, PrivateKey key) throws Exception {
+	
+		Signature signature = Signature.getInstance("MD5withRSA");	
+		
+		signature.initSign(key);
+		signature.update(res.getBytes("UTF-8"));
+	
+		return Base64.getEncoder().encodeToString(signature.sign());
+		
+	}
+	/**
+	 * 签名验证
+	 * 
+	 * @param res 数据
+	 * @param sign 签名
+	 * @param key 公钥
+	 * @return
+	 * @throws Exception
+	 */
+	public static boolean signatureVerfiy(String res, String sign, PublicKey key) throws Exception {
+
+		Signature signature = Signature.getInstance("MD5withRSA");
+
+		signature.initVerify(key);
+
+		signature.update(res.getBytes("UTF-8"));
+
+		boolean isPassed = signature.verify(Base64.getDecoder().decode(sign));
+
+		return isPassed;
+
+	}
+
+	public RSAUtil() {
+		try {
+			generateKeyPairString(KEYSIZE);
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+
+	public RSAUtil(int keySize) {
+		try {
+			generateKeyPairString(keySize);
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+
+	/**
+	 * 生成密钥对字符串
+	 */
+	private void generateKeyPairString(int keySize) throws Exception {
+		/** RSA算法要求有一个可信任的随机数源 */
+		SecureRandom sr = new SecureRandom();
+		/** 为RSA算法创建一个KeyPairGenerator对象 */
+		KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA");
+		/** 利用上面的随机数据源初始化这个KeyPairGenerator对象 */
+		kpg.initialize(keySize, sr);
+		/** 生成密匙对 */
+		KeyPair kp = kpg.generateKeyPair();
+		/** 得到公钥 */
+		Key publicKey = kp.getPublic();
+		/** 得到私钥 */
+		Key privateKey = kp.getPrivate();
+		/** 用字符串将生成的密钥写入文件 */
+
+		String algorithm = publicKey.getAlgorithm(); // 获取算法
+		KeyFactory keyFact = KeyFactory.getInstance(algorithm);
+		BigInteger prime = null;
+		BigInteger exponent = null;
+
+		RSAPublicKeySpec keySpec = (RSAPublicKeySpec) keyFact.getKeySpec(publicKey, RSAPublicKeySpec.class);
+		prime = keySpec.getModulus();
+		exponent = keySpec.getPublicExponent();
+		RSAUtil.publicModulus = HexUtil.bytes2Hex(prime.toByteArray());
+		RSAUtil.publicExponent = HexUtil.bytes2Hex(exponent.toByteArray());
+
+		RSAPrivateCrtKeySpec privateKeySpec = (RSAPrivateCrtKeySpec) keyFact.getKeySpec(privateKey,
+				RSAPrivateCrtKeySpec.class);
+		BigInteger privateModulus = privateKeySpec.getModulus();
+		BigInteger privateExponent = privateKeySpec.getPrivateExponent();
+		RSAUtil.privateModulus = HexUtil.bytes2Hex(privateModulus.toByteArray());
+		RSAUtil.privateExponent = HexUtil.bytes2Hex(privateExponent.toByteArray());
+	}
+
+	/**
+	 * 根据给定的16进制系数和专用指数字符串构造一个RSA专用的公钥对象。
+	 * 
+	 * @param hexModulus
+	 *            系数。
+	 * @param hexPublicExponent
+	 *            专用指数。
+	 * @return RSA专用公钥对象。
+	 */
+	public static RSAPublicKey getRSAPublicKey(String hexModulus, String hexPublicExponent) {
+		if (isBlank(hexModulus) || isBlank(hexPublicExponent)) {
+			System.out.println("hexModulus and hexPublicExponent cannot be empty. return null(RSAPublicKey).");
+			return null;
+		}
+		byte[] modulus = null;
+		byte[] publicExponent = null;
+		try {
+			modulus = HexUtil.hex2Bytes(hexModulus);
+			publicExponent = HexUtil.hex2Bytes(hexPublicExponent);
+		} catch (Exception ex) {
+			System.out.println("hexModulus or hexPublicExponent value is invalid. return null(RSAPublicKey).");
+			ex.printStackTrace();
+		}
+		if (modulus != null && publicExponent != null) {
+			return generateRSAPublicKey(modulus, publicExponent);
+		}
+		return null;
+	}
+
+	/**
+	 * 根据给定的系数和专用指数构造一个RSA专用的公钥对象。
+	 * 
+	 * @param modulus
+	 *            系数。
+	 * @param publicExponent
+	 *            专用指数。
+	 * @return RSA专用公钥对象。
+	 */
+	public static RSAPublicKey generateRSAPublicKey(byte[] modulus, byte[] publicExponent) {
+		RSAPublicKeySpec publicKeySpec = new RSAPublicKeySpec(new BigInteger(modulus), new BigInteger(publicExponent));
+		try {
+			return (RSAPublicKey) keyFactory.generatePublic(publicKeySpec);
+		} catch (InvalidKeySpecException ex) {
+			System.out.println("RSAPublicKeySpec is unavailable.");
+			ex.printStackTrace();
+		} catch (NullPointerException ex) {
+			System.out.println("RSAUtils#KEY_FACTORY is null, can not generate KeyFactory instance.");
+			ex.printStackTrace();
+		}
+		return null;
+	}
+
+	/**
+	 * 根据给定的16进制系数和专用指数字符串构造一个RSA专用的私钥对象。
+	 * 
+	 * @param hexModulus
+	 *            系数。
+	 * @param hexPrivateExponent
+	 *            专用指数。
+	 * @return RSA专用私钥对象。
+	 */
+	public static RSAPrivateKey getRSAPrivateKey(String hexModulus, String hexPrivateExponent) {
+		if (isBlank(hexModulus) || isBlank(hexPrivateExponent)) {
+			System.out.println(
+					"hexModulus and hexPrivateExponent cannot be empty. RSAPrivateKey value is null to return.");
+			return null;
+		}
+		byte[] modulus = null;
+		byte[] privateExponent = null;
+		try {
+			modulus = HexUtil.hex2Bytes(hexModulus);
+			privateExponent = HexUtil.hex2Bytes(hexPrivateExponent);
+		} catch (Exception ex) {
+			System.out.println("hexModulus or hexPrivateExponent value is invalid. return null(RSAPrivateKey).");
+			ex.printStackTrace();
+		}
+		if (modulus != null && privateExponent != null) {
+			return generateRSAPrivateKey(modulus, privateExponent);
+		}
+		return null;
+	}
+
+	/**
+	 * 根据给定的系数和专用指数构造一个RSA专用的私钥对象。
+	 * 
+	 * @param modulus
+	 *            系数。
+	 * @param privateExponent
+	 *            专用指数。
+	 * @return RSA专用私钥对象。
+	 */
+	public static RSAPrivateKey generateRSAPrivateKey(byte[] modulus, byte[] privateExponent) {
+		RSAPrivateKeySpec privateKeySpec = new RSAPrivateKeySpec(new BigInteger(modulus),
+				new BigInteger(privateExponent));
+		try {
+			return (RSAPrivateKey) keyFactory.generatePrivate(privateKeySpec);
+		} catch (InvalidKeySpecException ex) {
+			System.out.println("RSAPrivateKeySpec is unavailable.");
+			ex.printStackTrace();
+		} catch (NullPointerException ex) {
+			System.out.println("RSAUtils#KEY_FACTORY is null, can not generate KeyFactory instance.");
+			ex.printStackTrace();
+		}
+		return null;
+	}
+
+	/**
+	 * 使用给定的公钥加密给定的字符串。
+	 * 
+	 * @param publicKey
+	 *            给定的公钥。
+	 * @param plaintext
+	 *            字符串。
+	 * @return 给定字符串的密文。
+	 */
+	public static String encryptString(Key key, String plaintext) {
+		if (key == null || plaintext == null) {
+			return null;
+		}
+		byte[] data = plaintext.getBytes(Charset.forName("UTF-8"));
+		try {
+			byte[] en_data = encrypt(key, data);
+			return new String(Base64.getEncoder().encodeToString(en_data));
+			// return new String(HexUtil.bytes2Hex(en_data));
+		} catch (Exception ex) {
+			ex.printStackTrace();
+		}
+		return null;
+	}
+
+	/**
+	 * 使用指定的公钥加密数据。
+	 * 
+	 * @param publicKey
+	 *            给定的公钥。
+	 * @param data
+	 *            要加密的数据。
+	 * @return 加密后的数据。
+	 */
+
+	public static byte[] encrypt(Key key, byte[] data) throws Exception {
+		Cipher ci = Cipher.getInstance(ALGORITHM);
+		ci.init(Cipher.ENCRYPT_MODE, key);
+		int inputLen = data.length;
+		ByteArrayOutputStream out = new ByteArrayOutputStream();
+		int offSet = 0;
+		byte[] cache;
+		int i = 0;
+		// 对数据分段加密
+		while (inputLen - offSet > 0) {
+			if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {
+				cache = ci.doFinal(data, offSet, MAX_ENCRYPT_BLOCK);
+			} else {
+				cache = ci.doFinal(data, offSet, inputLen - offSet);
+			}
+			out.write(cache, 0, cache.length);
+			i++;
+			offSet = i * MAX_ENCRYPT_BLOCK;
+		}
+		byte[] encryptedData = out.toByteArray();
+		out.close();
+		return encryptedData;
+	}
+
+	/**
+	 * 使用给定的公钥解密给定的字符串。
+	 * 
+	 * @param publicKey
+	 *            给定的公钥
+	 * @param encrypttext
+	 *            密文
+	 * @return 原文字符串。
+	 */
+	public static String decryptString(Key key, String encrypttext) {
+		if (key == null || isBlank(encrypttext)) {
+			return null;
+		}
+		try {
+			byte[] en_data = Base64.getDecoder().decode(encrypttext);
+			byte[] data = decrypt(key, en_data);
+			return new String(data,"UTF-8");
+		} catch (Exception ex) {
+			ex.printStackTrace();
+			System.out.println(
+					String.format("\"%s\" Decryption failed. Cause: %s", encrypttext, ex.getCause().getMessage()));
+		}
+		return null;
+	}
+
+	/**
+	 * 使用指定的公钥解密数据。
+	 * 
+	 * @param publicKey
+	 *            指定的公钥
+	 * @param data
+	 *            要解密的数据
+	 * @return 原数据
+	 * @throws Exception
+	 */
+	public static byte[] decrypt(Key key, byte[] data) throws Exception {
+		Cipher ci = Cipher.getInstance(ALGORITHM);
+		ci.init(Cipher.DECRYPT_MODE, key);
+		int inputLen = data.length;
+		ByteArrayOutputStream out = new ByteArrayOutputStream();
+		int offSet = 0;
+		byte[] cache;
+		int i = 0;
+		// 对数据分段解密
+		while (inputLen - offSet > 0) {
+			if (inputLen - offSet > MAX_DECRYPT_BLOCK) {
+				cache = ci.doFinal(data, offSet, MAX_DECRYPT_BLOCK);
+			} else {
+				cache = ci.doFinal(data, offSet, inputLen - offSet);
+			}
+			out.write(cache, 0, cache.length);
+			i++;
+			offSet = i * MAX_DECRYPT_BLOCK;
+		}
+		byte[] decryptedData = out.toByteArray();
+		out.close();
+		return decryptedData;
+	}
+
+	/**
+	 * 判断非空字符串
+	 * 
+	 * @param cs
+	 *            待判断的CharSequence序列
+	 * @return 是否非空
+	 */
+	private static boolean isBlank(final CharSequence cs) {
+		int strLen;
+		if (cs == null || (strLen = cs.length()) == 0) {
+			return true;
+		}
+		for (int i = 0; i < strLen; i++) {
+			if (Character.isWhitespace(cs.charAt(i)) == false) {
+				return false;
+			}
+		}
+		return true;
+	}
+
+	/**
+	 * 获得公钥
+	 * 
+	 * @param algorithm
+	 * @param ins
+	 * @return
+	 * @throws Exception
+	 */
+	public static PublicKey getPublicKeyFromX509(String algorithm, String pubkeyString) throws Exception {
+
+		KeyFactory keyFactory = KeyFactory.getInstance(algorithm);
+
+		byte[] encodedKey = pubkeyString.getBytes("UTF-8");
+
+		encodedKey = Base64.getDecoder().decode((encodedKey));
+
+		return keyFactory.generatePublic(new X509EncodedKeySpec(encodedKey));
+	}
+
+	/**
+	 * 获得私钥
+	 * 
+	 * @param algorithm
+	 *            RAS
+	 * @param ins
+	 *            私钥字符串
+	 * @return
+	 * @throws Exception
+	 */
+	public static PrivateKey getPrivateKeyFromPKCS8(String algorithm, String privateKeyString) throws Exception {
+		if ((privateKeyString == null) || (algorithm == null) || "".equals(algorithm.trim())) {
+			return null;
+		}
+		KeyFactory keyFactory = KeyFactory.getInstance(algorithm);
+
+		byte[] encodedKey = privateKeyString.getBytes(Charset.forName("UTF-8"));
+
+		encodedKey = Base64.getDecoder().decode(encodedKey);
+
+		return keyFactory.generatePrivate(new PKCS8EncodedKeySpec(encodedKey));
+	}
+}

+ 18 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/constants/CarKindCodeEnum.java

@@ -0,0 +1,18 @@
+package com.ydtech.modules.order.entity.api.chengtai.constants;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 车辆种类
+ */
+@Getter
+@AllArgsConstructor
+public enum CarKindCodeEnum {
+
+    A0("A0", "客车"),
+    A1("H0", "货车");
+    private final String code;
+
+    private final String desc;
+}

+ 48 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/constants/CtKindCodeEnum.java

@@ -0,0 +1,48 @@
+package com.ydtech.modules.order.entity.api.chengtai.constants;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 险别代码枚举
+ */
+@Getter
+@AllArgsConstructor
+public enum CtKindCodeEnum {
+
+    BZ("BZ", "机动车交通事故责任强制保险"),
+    B("B", "第三者责任保险"),
+    A("A", "车辆损失保险"),
+    D3("D11", "车上人员责任保险(驾驶员)"),
+    D4("D12", "车上人员责任保险(乘客)"),
+
+    MJ1("FA", "绝对免赔率特约条款(机动车损失保险)"),
+    MJ2("FB", "绝对免赔率特约条款(第三者责任保险)"),
+    MJ3("FD11", "绝对免赔率特约条款(车上人员责任保险(司机))"),
+    MJ4("FD12", "绝对免赔率特约条款(车上人员责任保险(乘客))"),
+    BD("BD", "三者假日翻倍险"),
+    L("L", "车身划痕损失险"),
+
+    SY_FJ_YBW1("YB", "医保外用药责任险(第三者责任保险)"),
+    SY_FJ_YBW3("YD11", "医保外用药责任险(车上人员责任保险(司机))"),
+    SY_FJ_YBW2("YD12", "医保外用药责任险(车上人员责任保险(乘客))"),
+
+    TY1("S1", "道路救援服务特约条款"),
+    TY2("S2", "车辆安全检测特约条款"),
+    TY3("S3", "代为驾驶服务特约条款"),
+    TY4("S4", "代为送检服务特约条款"),
+
+    B_N("B", "新能源第三者责任保险"),
+    A_N("A", "新能源汽车车辆损失保险"),
+    D3_N("D11", "车上人员责任保险(驾驶员)"),
+    D4_N("D12", "新能源汽车车上人员责任保险(乘客)"),
+
+    TY1_N("S1", "道路救援服务特约条款(新能源车)"),
+    TY2_N("S2", "车辆安全检测特约条款(新能源车)"),
+    TY3_N("S3", "代为驾驶服务特约条款(新能源车)"),
+    TY4_N("S4", "代为送检服务特约条款(新能源车)"),
+            ;
+    private final String code;
+
+    private final String desc;
+}

+ 53 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/constants/FileTypeEnum.java

@@ -0,0 +1,53 @@
+package com.ydtech.modules.order.entity.api.chengtai.constants;
+
+import com.ydtech.constants.InsuranceImageEnum;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 诚泰上传图片类型枚举
+ */
+@Getter
+@AllArgsConstructor
+public enum FileTypeEnum {
+
+    FT_1("21", "验车照片", new String[]{"C05"}),
+    FT_2("2", "其他车辆证件", new String[]{}),
+    FT_3("3", "其他客户证件", new String[]{}),
+    FT_4("4", "车辆购置证明", new String[]{
+            InsuranceImageEnum.GC00.getCode()
+    }),
+    FT_5("5", "过户证明", new String[]{}),
+    FT_6("6", "退保证明", new String[]{}),
+    FT_7("7", "单证", new String[]{}),
+    FT_8("8", "申请书", new String[]{}),
+    FT_9("9", "其他", new String[]{}),
+    FT_19("19", "实名缴费证明", new String[]{
+            InsuranceImageEnum.GX00.getCode(),
+    }),
+    FT_51("51", "银行卡", new String[]{}),
+    FT_52("52", "驾驶证", new String[]{}),
+    FT_53("53", "身份证", new String[]{
+            InsuranceImageEnum.C02.getCode(),
+            InsuranceImageEnum.D02.getCode(),
+            InsuranceImageEnum.C03.getCode(),
+            InsuranceImageEnum.D03.getCode(),
+            InsuranceImageEnum.C04.getCode(),
+            InsuranceImageEnum.D04.getCode(),
+    }),
+    FT_54("54", "增值税发票", new String[]{}),
+    FT_55("55", "车辆合格证", new String[]{InsuranceImageEnum.XC00.getCode()}),
+    FT_56("56", "行驶证", new String[]{
+            InsuranceImageEnum.C01.getCode(),
+            InsuranceImageEnum.D01.getCode(),
+    }),
+    FT_41("41", "充电桩影像资料", new String[]{}),
+    FT_42("42", "是否为新能源证明材料", new String[]{});
+
+    private final String code;
+
+    private final String name;
+
+    private final String[] imagesType;
+
+}

+ 55 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/constants/ImageTypeEnum.java

@@ -0,0 +1,55 @@
+package com.ydtech.modules.order.entity.api.chengtai.constants;
+
+import com.ydtech.constants.InsuranceImageEnum;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 诚泰图片类型枚举
+ */
+@Getter
+@AllArgsConstructor
+public enum ImageTypeEnum {
+
+    IT_1("1", "行驶证正面",new String[]{
+            InsuranceImageEnum.C01.getCode(),
+    }),
+    IT_11("11", "行驶证反面",new String[]{
+            InsuranceImageEnum.D01.getCode(),
+    }),
+
+    IT_2("2", "车主身份证正面",new String[]{
+            InsuranceImageEnum.C02.getCode(),
+    }),
+    IT_3("3", "车主身份证反面",new String[]{
+            InsuranceImageEnum.D02.getCode(),
+    }),
+
+    IT_4("4", "投保人身份证正面",new String[]{
+            InsuranceImageEnum.C03.getCode(),
+    }),
+    IT_5("5", "投保人身份证反面",new String[]{
+            InsuranceImageEnum.D03.getCode(),
+    }),
+
+    IT_6("6", "被保人身份证正面",new String[]{
+            InsuranceImageEnum.C04.getCode(),
+    }),
+    IT_7("7", "被保人身份证反面",new String[]{
+            InsuranceImageEnum.D04.getCode(),
+    }),
+
+    IT_20("20", "购车发票", new String[]{
+            InsuranceImageEnum.GC00.getCode()
+    }),
+
+    IT_21("21", "验车照", new String[]{"C05"}),
+    IT_22("22", "其他影像资料",new String[]{}),
+    IT_30("30", "验车视频",new String[]{});
+    private final String code;
+
+    private final String desc;
+
+    private final String[] imagesType;
+
+}

+ 32 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/constants/OrderStatusEnum.java

@@ -0,0 +1,32 @@
+package com.ydtech.modules.order.entity.api.chengtai.constants;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 诚泰保单状态枚举
+ */
+@Getter
+@AllArgsConstructor
+public enum OrderStatusEnum {
+
+    A1000("A1000", "未核保"),
+    A2003("A2003", "核保中"),
+    A2000("A2000", "核保成功"),
+    A2004("A2004", "投保“车+意”核保失败(非车核保失败)"),
+    A2002("A2002", "转人工核保"),
+    A2006("A2006", "人核已领取待审核"),
+    A2001("A2001", "核保拒保"),
+    A2999("A2999", "核保失败"),
+    A2998("A2998", "核保撤销失败"),
+    A2008("A2008", "涉恐或反欺诈"),
+    A2009("A2009", "涉恐冻结"),
+    A2007("A2007", "转出单"),
+    A7004("A7004", "支付成功承保中"),
+    A7005("A7005", "支付成功承保成功"),
+    A7999("A7999", "承保失败");
+
+    private final String code;
+
+    private final String desc;
+}

+ 21 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/constants/PlateType.java

@@ -0,0 +1,21 @@
+package com.ydtech.modules.order.entity.api.chengtai.constants;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 号牌种类
+ */
+@Getter
+@AllArgsConstructor
+public enum PlateType {
+    P01("01", "大型汽车号牌"),
+    P02("02", "小型汽车号牌"),
+    P03("03", "使馆汽车号牌"),
+    P51("51", "大型新能源汽车"),
+    P52("52", "小型新能源汽车");
+
+    private final String code;
+
+    private final String desc;
+}

+ 30 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/constants/RequestType.java

@@ -0,0 +1,30 @@
+package com.ydtech.modules.order.entity.api.chengtai.constants;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @description: 诚泰财险 请求类型代码
+ * @author: wenks
+ * @date: 2024/10/16 11:52
+ **/
+@Getter
+@AllArgsConstructor
+public enum RequestType {
+
+    Z00001("SHUB-ChacInsureLoginShub", "获取Token信息"),
+    Z00002("SHUB-ChacCarInfoQueryShub", "车辆查询"),
+    Z00003("SHUB-ChaCarCalculActualValueCalCulShub", "车辆实际价值计算"),
+    Z00004("SHUB-ChacInsurePremiumCalculationShub", "保费试算"),
+    Z00005("SHUB-ChacInsureImageUploadShub", "影像上传"),
+    Z00006("SHUB-ChacInsureProposalInsureSaveEventShub", "投保保存"),
+    Z00007("SHUB-ChacInsureProposalUnderWriteEventShub", "核保"),
+    Z00008("SHUB-ChacInsureProposalUnderWriteRetShub", "核保结果查询"),
+    Z00009("SHUB-ChacInsureApplicateRetShub", "投保结果查询"),
+    Z00010("SHUB-ChacInsureSMSReissueShub", "获取支付链接"),
+    Z00011("SHUB-ChacInsureSearchDownPolicyAddressShub", "保单下载"),
+    Z00012("SHUB-ChacCancelOrderShub", "撤销订单");
+    private final String code;
+
+    private final String desc;
+}

+ 23 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/constants/ResponseCode.java

@@ -0,0 +1,23 @@
+package com.ydtech.modules.order.entity.api.chengtai.constants;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 诚泰异常信息枚举
+ */
+@AllArgsConstructor
+@Getter
+public enum ResponseCode {
+
+    R_000("000", "访问成功"),
+    R_999("999", "访问失败"),
+    R_998("998", "查询接入方信息失败"),
+    R_997("000", "验签失败"),
+    R_996("000", "参数解密失败"),
+    R_995("000", "系统繁忙");
+
+    private final String code;
+
+    private final String desc;
+}

+ 28 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/constants/RiskCodeEnum.java

@@ -0,0 +1,28 @@
+package com.ydtech.modules.order.entity.api.chengtai.constants;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 险种枚举
+ */
+@Getter
+@AllArgsConstructor
+public enum RiskCodeEnum {
+
+    R1002("1002", "交强险(08版)"),
+    R1003("1003", "摩托车拖拉机交强险(08版)"),
+    R1231("1231", "机动车综合商业保险"),
+    R1232("1232", "特种车综合商业保险"),
+    R1233("1233", "摩托车、拖拉机综合商业保险"),
+    R1234("1234", "机动车单程提车保险"),
+    R0825("0825", "新能源车综合商业保险"),
+    R0821("0821", "机动车商业保险(2020版)"),
+    R0822("0822", "特种车商业保险(2020版)"),
+    R0823("0823", "摩托车、拖拉机商业保险(2020版)"),
+    R0824("0824", "机动车单程提车保险(2020版)");
+
+    private final String code;
+
+    private final String desc;
+}

+ 28 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/constants/TaxConditionCodeEnum.java

@@ -0,0 +1,28 @@
+package com.ydtech.modules.order.entity.api.chengtai.constants;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 纳税类型代码
+ */
+@Getter
+@AllArgsConstructor
+public enum TaxConditionCodeEnum {
+
+    T_1("1N", "纳税"),
+    T_2("3M", "免税"),
+    T_3("5J", "减税"),
+    T_4("2W", "完税"),
+    T_5("4H", "缓税"),
+
+    T_6("6Q", "欠税"),
+    T_7("7B", "不征税"),
+    T_8("8R", "拒缴"),
+    T_9("9D", "有争议"),
+    T_0("0N", "不代收");
+
+    private final String code;
+
+    private final String desc;
+}

+ 23 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/constants/UseNatureCodeEnum.java

@@ -0,0 +1,23 @@
+package com.ydtech.modules.order.entity.api.chengtai.constants;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@AllArgsConstructor
+@Getter
+public enum UseNatureCodeEnum {
+
+    U_05("8A", "家庭自用"),
+    U_07("8B", "非营业企业"),
+    U_06("8C", "非营业党政机关,事业团体"),
+    U_01("9A", "营业出租租赁"),
+    U_02("9B", "营业城市公交"),
+    U_03("9C", "营业公路客运"),
+    U_04("9D", "营业货运"),
+    U_08("8D", "非营业货运");
+
+    private final String code;
+
+    private final String desc;
+
+}

+ 33 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/request/CarInfoRequest.java

@@ -0,0 +1,33 @@
+package com.ydtech.modules.order.entity.api.chengtai.request;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.ydtech.modules.ins.model.vo.CarInfoVo;
+import com.ydtech.modules.order.entity.config.ChengTaiConfigureParameters;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+/**
+ * 【车型查询】请求实体
+ */
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+@Data
+public class CarInfoRequest extends ChengTaiBaseRequest{
+
+    @JsonProperty("modelCName")
+    private String modelCName;
+
+    @JsonProperty("begin")
+    private Integer begin;
+
+    @JsonProperty("count")
+    private Integer count;
+
+    public CarInfoRequest(CarInfoVo carInfo, ChengTaiConfigureParameters parameters ) {
+        super(parameters.getPartnerCode());
+        this.modelCName = carInfo.getModelcname();
+        this.begin = 0;
+        this.count = 50;
+    }
+}

+ 25 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/request/ChengTaiBaseRequest.java

@@ -0,0 +1,25 @@
+package com.ydtech.modules.order.entity.api.chengtai.request;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.ydtech.modules.order.entity.api.bohai.request.BoHaiBaseRequest;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * 【诚泰】请求实体父类
+ */
+@NoArgsConstructor
+@Data
+public class ChengTaiBaseRequest implements Serializable {
+
+    private static final long serialVersionUID = 0xf935831e396ad089L;
+    private String encryptionMessage;
+    private String signature;
+    private String embarkPartnerCode;
+
+    public ChengTaiBaseRequest(String embarkPartnerCode) {
+        this.embarkPartnerCode = embarkPartnerCode;
+    }
+}

+ 22 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/request/DownLoadDocumentUrlRequest.java

@@ -0,0 +1,22 @@
+package com.ydtech.modules.order.entity.api.chengtai.request;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.ydtech.modules.order.entity.config.ChengTaiConfigureParameters;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 【保单下载】请求实体
+ */
+@NoArgsConstructor
+@Data
+public class DownLoadDocumentUrlRequest  extends ChengTaiBaseRequest{
+
+    @JsonProperty("policyNo")
+    private String policyNo;
+
+    public DownLoadDocumentUrlRequest(ChengTaiConfigureParameters parameters, String policyNo) {
+        super(parameters.getPartnerCode());
+        this.policyNo = policyNo;
+    }
+}

+ 629 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/request/InsurePremiumRequest.java

@@ -0,0 +1,629 @@
+package com.ydtech.modules.order.entity.api.chengtai.request;
+
+import cn.hutool.core.util.ArrayUtil;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.ydtech.constants.enums.InsuranceRisk;
+import com.ydtech.modules.admin.model.vo.PersonAreaVo;
+import com.ydtech.modules.ins.model.vo.CarInfoVo;
+import com.ydtech.modules.ins.model.vo.CustomerInfoVo;
+import com.ydtech.modules.ins.model.vo.KindInfoVo;
+import com.ydtech.modules.ins.model.vo.RiskInfoVo;
+import com.ydtech.modules.order.constants.InsuranceTypeCorrespondence;
+import com.ydtech.modules.order.entity.api.chengtai.constants.*;
+import com.ydtech.modules.order.entity.api.chengtai.response.CarInfoResponse;
+import com.ydtech.modules.order.entity.api.chengtai.response.QueryCarActualValueResponse;
+import com.ydtech.modules.order.entity.config.ChengTaiConfigureParameters;
+import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
+import com.ydtech.modules.order.entity.vo.BaseQuoteVo;
+import com.ydtech.modules.order.entity.vo.VehicleAndVesselTax;
+import com.ydtech.modules.order.entity.vo.ct.CtQuoteAccidentVo;
+import com.ydtech.modules.protocol.utils.AssertionUtils;
+import com.ydtech.utils.IDCardUtils;
+import com.ydtech.utils.StringUtils;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.math.BigDecimal;
+import java.util.*;
+
+/**
+ * 【保费试算】请求实体
+ */
+@NoArgsConstructor
+@Data
+public class InsurePremiumRequest extends ChengTaiBaseRequest{
+
+    @JsonProperty("accContract")
+    private AccContractDTO accContract;
+    @JsonProperty("biContract")
+    private BiContractDTO biContract;
+    @JsonProperty("insuredObject")
+    private InsuredObjectDTO insuredObject;
+    @JsonProperty("owner")
+    private OwnerDTO owner;
+    @JsonProperty("ciContract")
+    private CiContractDTO ciContract;
+    @JsonProperty("orderId")
+    private String orderId;
+    @JsonProperty("handlerCode")
+    private String handlerCode;
+
+    public InsurePremiumRequest(BaseQuoteInfoVo quoteInfoVo,
+                                CarInfoResponse.CarModelListDTO carModelListDTO,
+                                QueryCarActualValueResponse carActualValueResponse,
+                                PersonAreaVo personAreaVo,
+                                ChengTaiConfigureParameters parameters,
+                                BaseQuoteVo<List<CtQuoteAccidentVo>> quoteVo){
+        super(parameters.getPartnerCode());
+        // 标的信息
+        InsuredObjectDTO insuredObject = new InsuredObjectDTO(quoteInfoVo, carModelListDTO,carActualValueResponse);
+        this.insuredObject = insuredObject;
+        // 客户信息
+        OwnerDTO owner = new OwnerDTO(quoteInfoVo.getOwnerInfo(), personAreaVo);
+        this.owner = owner;
+        // 交强险
+        Boolean isJq = InsuranceRisk.getFlagByTRAFFIC(quoteInfoVo.getRiskList());
+        if (isJq){
+            CiContractDTO ciContract = new CiContractDTO(quoteInfoVo);
+            this.ciContract = ciContract;
+        }
+        // 商业险
+        Boolean isSy = InsuranceRisk.getFlagByBUSINESS(quoteInfoVo.getRiskList());
+        if (isSy){
+            BiContractDTO biContract = new BiContractDTO(quoteInfoVo,carActualValueResponse.getActualValue());
+            this.biContract = biContract;
+        }
+//        // 意外险
+//        List<CtQuoteAccidentVo> ctQuoteAccidentVos = quoteVo.getAccidentalDrivingVo();
+//        if(CollUtil.isNotEmpty(ctQuoteAccidentVos)){
+//            AccContractDTO accContract = new AccContractDTO(ctQuoteAccidentVos);
+//        }
+        this.handlerCode = parameters.getUserId();
+
+    }
+
+    @NoArgsConstructor
+    @Data
+    public static class AccContractDTO {
+        @JsonProperty("contractMain")
+        private ContractMainDTO contractMain;
+        @JsonProperty("coverage")
+        private List<CoverageDTO> coverage;
+
+        public AccContractDTO(List<CtQuoteAccidentVo> ctQuoteAccidentVos){
+            ContractMainDTO contractMain = new ContractMainDTO();
+        }
+        @NoArgsConstructor
+        @Data
+        public static class ContractMainDTO {
+            @JsonProperty("riskCode")
+            private String riskCode;
+            @JsonProperty("validAtOnce")
+            private String validAtOnce;
+            @JsonProperty("validDate")
+            private String validDate;
+            @JsonProperty("expiryDate")
+            private String expiryDate;
+            @JsonProperty("renewalFlag")
+            private String renewalFlag;
+            @JsonProperty("insPlan")
+            private String insPlan;
+        }
+
+        @NoArgsConstructor
+        @Data
+        public static class CoverageDTO {
+            @JsonProperty("kindCode")
+            private String kindCode;
+            @JsonProperty("ifMainKind")
+            private String ifMainKind;
+            @JsonProperty("quantity")
+            private Integer quantity;
+            @JsonProperty("calculateFlag")
+            private String calculateFlag;
+            @JsonProperty("shortRateType")
+            private String shortRateType;
+            @JsonProperty("shortRate")
+            private String shortRate;
+        }
+    }
+
+    @NoArgsConstructor
+    @Data
+    public static class BiContractDTO {
+        @JsonProperty("contractMain")
+        private ContractMainDTO contractMain;
+        @JsonProperty("coverage")
+        private List<CoverageDTO> coverage;
+
+        public BiContractDTO(BaseQuoteInfoVo quoteInfoVo,BigDecimal actualValue){
+            boolean isNewEnergy = quoteInfoVo.getCarInfo().isNewEnergy();
+            // 险种信息
+            ContractMainDTO contractMain = new ContractMainDTO(quoteInfoVo,isNewEnergy);
+            this.contractMain = contractMain;
+            // 投保险别列表
+            this.coverage = CoverageDTO.toCoverageList(isNewEnergy,quoteInfoVo,actualValue);
+        }
+
+        @NoArgsConstructor
+        @Data
+        public static class ContractMainDTO {
+            @JsonProperty("hopeCoefficient")
+            private Integer hopeCoefficient;
+            @JsonProperty("hopeDiscount")
+            private Integer hopeDiscount;
+            @JsonProperty("lastYearPolicyNo")
+            private String lastYearPolicyNo;
+            @JsonProperty("othBusinessNo")
+            private String othBusinessNo;
+            @JsonProperty("renewalFlag")
+            private String renewalFlag;
+            @JsonProperty("riskCode")
+            private String riskCode;
+            @JsonProperty("riskName")
+            private String riskName;
+            @JsonProperty("validAtOnce")
+            private String validAtOnce;
+            @JsonProperty("validDate")
+            private String validDate;
+
+            public ContractMainDTO(BaseQuoteInfoVo quoteInfoVo,boolean isNewEnergy){
+                if(isNewEnergy){
+                    this.riskCode = RiskCodeEnum.R0825.getCode();
+                    this.riskName = RiskCodeEnum.R0825.getDesc();
+                }else{
+                    this.riskCode = RiskCodeEnum.R0821.getCode();
+                    this.riskName = RiskCodeEnum.R0821.getDesc();
+                }
+                List<RiskInfoVo> riskList = quoteInfoVo.getRiskList();
+                for (RiskInfoVo riskInfoVo : riskList) {
+                    if(InsuranceRisk.BUSINESS.getCode().equals(riskInfoVo.getRiskCode())){
+                        this.validAtOnce = StringUtils.isBlank(riskInfoVo.getInstantFlag())
+                                || "0".equals(riskInfoVo.getInstantFlag()) ? "0" : "1"; // 及时起保
+                        this.validDate =riskInfoVo.getStartDate();
+                        System.out.println(validDate);
+                        this.renewalFlag = "0";
+                    }
+                }
+            }
+        }
+
+        @NoArgsConstructor
+        @Data
+        public static class CoverageDTO {
+            @JsonProperty("amount")
+            private BigDecimal amount;
+            @JsonProperty("unitAmount")
+            private Double unitAmount;
+            @JsonProperty("quantity")
+            private Integer quantity;
+            @JsonProperty("calculateFlag")
+            private String calculateFlag;
+            @JsonProperty("kindCode")
+            private String kindCode;
+            @JsonProperty("shortRate")
+            private String shortRate;
+            @JsonProperty("shortRateType")
+            private String shortRateType;
+            @JsonProperty("deductible")
+            private BigDecimal deductible;
+            @JsonProperty("deductibleRate")
+            private BigDecimal deductibleRate;
+
+            public static List<CoverageDTO> toCoverageList(boolean isNewEnergy,
+                                                           BaseQuoteInfoVo quoteInfoVo,
+                                                           BigDecimal actualValue) {
+                List<CoverageDTO> list = new ArrayList<>();
+                List<KindInfoVo> kindList = quoteInfoVo.getKindList();
+
+                for (KindInfoVo kindInfoVo : kindList) {
+                    String code = kindInfoVo.getKindCode();
+                    CoverageDTO coverageDTO = new CoverageDTO();
+
+                    CtKindCodeEnum ctKindCodeEnum = Enum.valueOf(CtKindCodeEnum.class, code);
+                    coverageDTO.kindCode = ctKindCodeEnum.getCode();
+                    // 司机
+                    if (ArrayUtil.indexOf(InsuranceTypeCorrespondence.getDriver(), code) >= 0) {
+                        coverageDTO.quantity = 1;
+                        coverageDTO.unitAmount = kindInfoVo.getAmount();
+                        coverageDTO.amount = new BigDecimal(kindInfoVo.getAmount());
+                    }
+                    // 乘客
+                    else if (ArrayUtil.indexOf(InsuranceTypeCorrespondence.getPassenger(), code) >= 0) {
+                        coverageDTO.quantity = Integer.parseInt(quoteInfoVo.getCarInfo().getSeatCount()) -1;
+                        coverageDTO.unitAmount = kindInfoVo.getUnitAmount();
+                        coverageDTO.amount =
+                                BigDecimal.valueOf(kindInfoVo.getUnitAmount()).multiply(BigDecimal.valueOf(coverageDTO.quantity));
+                    }
+                    // 绝对免赔
+                    else if (ArrayUtil.indexOf(InsuranceTypeCorrespondence.getAbsoluteDeductible(), code) >= 0) {
+                        coverageDTO.deductibleRate = new BigDecimal(kindInfoVo.getDeductibleRate());
+                    } else if (ArrayUtil.indexOf(InsuranceTypeCorrespondence.getSpecialContractClause(), code) >= 0) {
+                        coverageDTO.quantity = kindInfoVo.getServiceTimes();
+                    } else if (CtKindCodeEnum.A.getCode().equals(code)) {
+                        coverageDTO.amount = actualValue;
+                    } else {
+                        coverageDTO.amount = new BigDecimal(kindInfoVo.getAmount());
+                    }
+                    coverageDTO.calculateFlag = "1";
+                    coverageDTO.shortRateType = "2";
+                    coverageDTO.shortRate = "100";
+                    list.add(coverageDTO);
+                }
+                return list;
+            }
+        }
+    }
+
+    @NoArgsConstructor
+    @Data
+    public static class InsuredObjectDTO {
+        @JsonProperty("policyCar")
+        private PolicyCarDTO policyCar;
+        @JsonProperty("repairFactory")
+        private RepairFactoryDTO repairFactory;
+        @JsonProperty("deviceList")
+        private List<?> deviceList;
+
+        public InsuredObjectDTO(BaseQuoteInfoVo quoteInfoVo,
+                                CarInfoResponse.CarModelListDTO carModelListDTO,
+                                QueryCarActualValueResponse carActualValueResponse){
+            PolicyCarDTO policyCarDTO = new PolicyCarDTO(quoteInfoVo, carModelListDTO,carActualValueResponse);
+            this.policyCar = policyCarDTO;
+
+            // 修理厂信息
+            RepairFactoryDTO repairFactory = new RepairFactoryDTO();
+            this.repairFactory = repairFactory;
+        }
+
+        @NoArgsConstructor
+        @Data
+        public static class PolicyCarDTO {
+            @JsonProperty("actualValue")
+            private BigDecimal actualValue;
+            @JsonProperty("attachNature")
+            private String attachNature;
+            @JsonProperty("carCheckReason")
+            private String carCheckReason;
+            @JsonProperty("carCheckReasonName")
+            private String carCheckReasonName;
+            @JsonProperty("carCheckStatus")
+            private String carCheckStatus;
+            @JsonProperty("carKindCode")
+            private String carKindCode;
+            @JsonProperty("consultValue")
+            private BigDecimal consultValue;
+            @JsonProperty("displacement")
+            private BigDecimal displacement;
+            @JsonProperty("ecdemicVehicleFlag")
+            private String ecdemicVehicleFlag;
+            @JsonProperty("energyTypes")
+            private String energyTypes;
+            @JsonProperty("engine")
+            private String engine;
+            @JsonProperty("exhaustScaleUnit")
+            private String exhaustScaleUnit;
+            @JsonProperty("issueDate")
+            private String issueDate;
+            @JsonProperty("approvedPassengersCapacity")
+            private BigDecimal approvedPassengersCapacity;
+            @JsonProperty("grossMass")
+            private Integer grossMass;
+            @JsonProperty("vehicleKindCode")
+            private String vehicleKindCode;
+            @JsonProperty("transferMark")
+            private String transferMark;
+            @JsonProperty("transferDate")
+            private String transferDate;
+            @JsonProperty("loanVehicleFlag")
+            private String loanVehicleFlag;
+            @JsonProperty("approvedLoad")
+            private BigDecimal approvedLoad;
+            @JsonProperty("modelCode")
+            private String modelCode;
+            @JsonProperty("monthDepRate")
+            private BigDecimal monthDepRate;
+            @JsonProperty("newCarSign")
+            private String newCarSign;
+            @JsonProperty("plateNo")
+            private String plateNo;
+            @JsonProperty("plateType")
+            private String plateType;
+            @JsonProperty("runArea")
+            private String runArea;
+            @JsonProperty("purchasePrice")
+            private BigDecimal purchasePrice;
+            @JsonProperty("registerDate")
+            private String registerDate;
+            @JsonProperty("unladenMass")
+            private BigDecimal unladenMass;
+            @JsonProperty("vehicleType")
+            private String vehicleType;
+            @JsonProperty("enrollDate")
+            private String enrollDate;
+            @JsonProperty("verifyCode")
+            private String verifyCode;
+            @JsonProperty("vin")
+            private String vin;
+            @JsonProperty("useNatureCode")
+            private String useNatureCode;
+            @JsonProperty("carTypeCode")
+            private String carTypeCode;
+
+            public PolicyCarDTO(BaseQuoteInfoVo quoteInfoVo,
+                                CarInfoResponse.CarModelListDTO carModelListDTO,
+                                QueryCarActualValueResponse carActualValueResponse){
+                CarInfoVo carInfo = quoteInfoVo.getCarInfo();
+                this.vin = carInfo.getFrameNo();
+                this.engine = carInfo.getEngineNo();
+                this.plateNo = carInfo.getLicenseNo();
+                if("1".equals(carInfo.getEnergyType()) || "3".equals(carInfo.getEnergyType())) {
+                    this.plateType = PlateType.P52.getCode();
+                }else{
+                    this.plateType = PlateType.P02.getCode();
+                }
+                this.runArea = "02";
+                this.modelCode = carModelListDTO.getModelCode();
+                this.registerDate = carInfo.getRegisterDate();
+                this.enrollDate = carInfo.getRegisterDate();  // 后期需要改
+                UseNatureCodeEnum useNatureCodeEnum = UseNatureCodeEnum.valueOf("U_"+carInfo.getVehicleUse());
+                AssertionUtils.isEmpty(useNatureCodeEnum, "使用性质输入错误");
+                this.useNatureCode = useNatureCodeEnum.getCode();
+                CarKindCodeEnum carKindCodeEnum = CarKindCodeEnum.valueOf(carInfo.getCimodelclass());
+                AssertionUtils.isEmpty(carKindCodeEnum, "车辆种类输入错误");
+                this.carKindCode = carKindCodeEnum.getCode();
+                this.vehicleType = carInfo.getCartype();
+                this.ecdemicVehicleFlag = "0"; // 外地车标志
+
+                this.carTypeCode = "01"; // 01 常见车型 02 新车型 03 老旧车型 04 特殊车型
+                this.purchasePrice = new BigDecimal(carModelListDTO.getPurchasePrice());
+                switch (carInfo.getProperty()) {
+                    case "1":
+                        this.attachNature = "01";
+                        break;
+                    case "2":
+                        this.attachNature = "03";
+                        break;
+                    case "3":
+                        this.attachNature = "02";
+                        break;
+                }
+                this.carCheckStatus = "3";
+                this.carCheckReason = "1";
+                this.carCheckReasonName = "按期续保未增保损失险类";
+                this.displacement = StringUtils.isBlank(carInfo.getExhaustScale())?new BigDecimal(1) : new BigDecimal(carInfo.getExhaustScale()).multiply(new BigDecimal("1000"));
+                this.exhaustScaleUnit = "ml";
+                this.approvedLoad = StringUtils.isBlank(carInfo.getLimitLoad()) ? new BigDecimal(0) : new BigDecimal(carInfo.getLimitLoad());
+                this.approvedPassengersCapacity = carModelListDTO.getApprovedPassengersCapacity();
+                if("1".equals(carInfo.getEnergyType()) || "3".equals(carInfo.getEnergyType())) {
+                    this.vehicleKindCode = "X";
+                }else{
+                    this.vehicleKindCode = "V";
+                }
+                this.issueDate = carInfo.getRegisterDate();  // 后期确认
+                this.transferMark = carInfo.isTransferFlag() ? "1" : "0";
+                if(carInfo.isTransferFlag()){
+                    this.transferDate = carInfo.getTransferDate();
+                }
+                this.loanVehicleFlag = carInfo.isLoanStatus()? "1" : "0";
+                this.energyTypes = carInfo.getEnergyType();
+                this.monthDepRate = carActualValueResponse.getMonthDepRate();
+                this.actualValue = carActualValueResponse.getActualValue();
+                this.consultValue = carActualValueResponse.getActualValue(); // TODO 下星期问保险公司
+                this.unladenMass = new BigDecimal(carInfo.getCompleteKerbMass());
+            }
+        }
+
+//        @NoArgsConstructor
+        @Data
+        public static class RepairFactoryDTO {
+            @JsonProperty("factoryCode")
+            private String factoryCode;
+            @JsonProperty("factoryId")
+            private String factoryId;
+            @JsonProperty("factoryName")
+            private String factoryName;
+
+            public RepairFactoryDTO(){
+                super();
+                this.factoryId = "1";
+                this.factoryCode = "99";
+                this.factoryName = "其他";
+            }
+        }
+    }
+
+    @NoArgsConstructor
+    @Data
+    public static class OwnerDTO {
+        @JsonProperty("type")
+        private String type;
+        @JsonProperty("isTerror")
+        private String isTerror;
+        @JsonProperty("name")
+        private String name;
+        @JsonProperty("identifyTypeCode")
+        private String identifyTypeCode;
+        @JsonProperty("identifyNumber")
+        private String identifyNumber;
+        @JsonProperty("identifyValidDate")
+        private String identifyValidDate;
+        @JsonProperty("identifyValidEndDate")
+        private String identifyValidEndDate;
+        @JsonProperty("identifyTypeName")
+        private String identifyTypeName;
+        @JsonProperty("sex")
+        private String sex;
+        @JsonProperty("age")
+        private Integer age;
+        @JsonProperty("birthday")
+        private String birthday;
+        @JsonProperty("longTerm")
+        private String longTerm;
+        @JsonProperty("province")
+        private String province;
+        @JsonProperty("city")
+        private String city;
+        @JsonProperty("district")
+        private String district;
+        @JsonProperty("addr")
+        private String addr;
+        @JsonProperty("mobile")
+        private String mobile;
+        @JsonProperty("relationWithInsured")
+        private String relationWithInsured;
+        @JsonProperty("relationWithCar")
+        private String relationWithCar;
+
+        public OwnerDTO(CustomerInfoVo ownerInfo, PersonAreaVo personAreaVo){
+            this.type = "1";
+            this.isTerror = "0";
+            this.name = ownerInfo.getName();
+            this.identifyTypeCode = "01";
+            this.identifyTypeName = "居民身份证";
+            this.identifyNumber = ownerInfo.getIdentifyNumber();
+            this.province = personAreaVo.getProvinceCode();
+            this.city = personAreaVo.getCityCode();
+            this.district = personAreaVo.getCountyCode();
+            this.addr = ownerInfo.getAddr();
+            this.mobile = ownerInfo.getMobile();
+            this.identifyValidDate = ownerInfo.getIdentifyValidDate();
+            this.identifyValidEndDate = ownerInfo.getIdentifyValidEndDate();
+            this.longTerm = "0";
+            this.sex = "男".equals(ownerInfo.getGender()) ? "1" : "2";
+            this.birthday = IDCardUtils.GetBirthday(ownerInfo.getIdentifyNumber());
+            this.relationWithInsured = "0";
+            this.relationWithCar = "1";
+
+        }
+    }
+
+    @NoArgsConstructor
+    @Data
+    public static class CiContractDTO {
+        @JsonProperty("contractMain")
+        private ContractMainDTO contractMain;
+        @JsonProperty("coverage")
+        private List<CoverageDTO> coverage;
+        @JsonProperty("tax")
+        private TaxDTO tax;
+
+        public CiContractDTO(BaseQuoteInfoVo quoteInfoVo){
+            // 险种信息
+            this.contractMain = new ContractMainDTO(quoteInfoVo);
+            // 投保险别列表
+            this.coverage = Arrays.asList(CoverageDTO.getCoverage());
+            // 车船税信息
+            this.tax = new TaxDTO(quoteInfoVo);
+        }
+
+        @NoArgsConstructor
+        @Data
+        public static class ContractMainDTO {
+            @JsonProperty("riskCode")
+            private String riskCode;
+            @JsonProperty("riskName")
+            private String riskName;
+            @JsonProperty("validAtOnce")
+            private String validAtOnce;
+            @JsonProperty("currency")
+            private String currency;
+            @JsonProperty("validDate")
+            private String validDate;
+            @JsonProperty("expiryDate")
+            private String expiryDate;
+            @JsonProperty("renewalFlag")
+            private String renewalFlag;
+            @JsonProperty("lastYearPolicyNo")
+            private String lastYearPolicyNo;
+
+            public ContractMainDTO(BaseQuoteInfoVo quoteInfoVo){
+                this.riskCode = RiskCodeEnum.R1002.getCode();
+                this.riskName = RiskCodeEnum.R1002.getDesc();
+                this.currency = "CNY";
+                List<RiskInfoVo> riskList = quoteInfoVo.getRiskList();
+                for (RiskInfoVo riskInfoVo : riskList) {
+                    if(InsuranceRisk.TRAFFIC_CODE.equals(riskInfoVo.getRiskCode())){
+                        this.validAtOnce = StringUtils.isBlank(riskInfoVo.getInstantFlag())?"0" : "1"; // 及时起保
+                        this.validDate =riskInfoVo.getStartDate();
+                        this.expiryDate =riskInfoVo.getEndDate();
+                        this.renewalFlag = "0";
+                    }
+                }
+            }
+        }
+
+        @NoArgsConstructor
+        @Data
+        public static class TaxDTO {
+            @JsonProperty("taxConditionCode")
+            private String taxConditionCode;
+            @JsonProperty("taxStartDate")
+            private String taxStartDate;
+            @JsonProperty("taxEndDate")
+            private String taxEndDate;
+            @JsonProperty("calculateMode")
+            private String calculateMode;
+            @JsonProperty("taxPayerIdentityNo")
+            private String taxPayerIdentityNo;
+            @JsonProperty("taxPayerIdentificationCode")
+            private String taxPayerIdentificationCode;
+            @JsonProperty("taxPayerName")
+            private String taxPayerName;
+            @JsonProperty("lastPaidYear")
+            private String lastPaidYear;
+
+            public TaxDTO(BaseQuoteInfoVo quoteInfoVo){
+
+                VehicleAndVesselTax vehicleAndVesselTax = quoteInfoVo.getVehicleAndVesselTax();
+                TaxConditionCodeEnum taxConditionCodeEnum = Enum.valueOf(TaxConditionCodeEnum.class, "T_" + vehicleAndVesselTax.getTaxRelifFlag());
+                this.taxConditionCode = taxConditionCodeEnum.getCode();
+                List<RiskInfoVo> riskList = quoteInfoVo.getRiskList();
+                for (RiskInfoVo riskInfoVo : riskList) {
+                    if (InsuranceRisk.TRAFFIC_CODE.equals(riskInfoVo.getRiskCode())) {
+                        this.taxStartDate = riskInfoVo.getStartDate();
+                        this.taxEndDate = riskInfoVo.getEndDate();
+                    }
+                }
+                this.calculateMode = "1";
+                this.taxPayerIdentityNo = vehicleAndVesselTax.getIdentifyNumber();
+                this.taxPayerIdentificationCode = vehicleAndVesselTax.getIdentifyNumber();
+                this.taxPayerName = vehicleAndVesselTax.getTaxpayerName();
+                Calendar calendar = Calendar.getInstance();
+                int year = calendar.get(Calendar.YEAR);
+                this.lastPaidYear = (year - 1) + "";
+            }
+        }
+
+        @NoArgsConstructor
+        @Data
+        public static class CoverageDTO {
+            @JsonProperty("kindCode")
+            private String kindCode;
+            @JsonProperty("ifMainKind")
+            private String ifMainKind;
+            @JsonProperty("amount")
+            private BigDecimal amount;
+            @JsonProperty("calculateFlag")
+            private String calculateFlag;
+            @JsonProperty("shortRateType")
+            private String shortRateType;
+            @JsonProperty("shortRate")
+            private String shortRate;
+
+            public static CoverageDTO getCoverage() {
+                CoverageDTO coverage = new CoverageDTO();
+                coverage.setKindCode(CtKindCodeEnum.BZ.getCode());
+                coverage.setIfMainKind("1");
+                coverage.setAmount(new BigDecimal(200000));
+                coverage.setShortRateType("2");
+                coverage.setShortRate("100");
+                coverage.setCalculateFlag("1");
+                coverage.setShortRateType("2");
+                coverage.setShortRate("100");
+                return coverage;
+            }
+        }
+    }
+
+}

+ 22 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/request/OrderNoRequest.java

@@ -0,0 +1,22 @@
+package com.ydtech.modules.order.entity.api.chengtai.request;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.ydtech.modules.order.entity.config.ChengTaiConfigureParameters;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 【撤销订单】请求实体
+ */
+@NoArgsConstructor
+@Data
+public class OrderNoRequest  extends ChengTaiBaseRequest{
+
+    @JsonProperty("orderId")
+    private String orderId;
+
+    public OrderNoRequest(ChengTaiConfigureParameters parameters, String orderId) {
+        super(parameters.getPartnerCode());
+        this.orderId = orderId;
+    }
+}

+ 37 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/request/PayUrlRequest.java

@@ -0,0 +1,37 @@
+package com.ydtech.modules.order.entity.api.chengtai.request;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.ydtech.modules.order.entity.config.ChengTaiConfigureParameters;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 【获取支付链接】请求实体
+ */
+@NoArgsConstructor
+@Data
+public class PayUrlRequest  extends ChengTaiBaseRequest{
+
+
+    @JsonProperty("orderId")
+    private String orderId;
+    @JsonProperty("type")
+    private String type;
+    @JsonProperty("isSendMsg")
+    private boolean isSendMsg;
+
+    public PayUrlRequest(ChengTaiConfigureParameters parameters, String orderId) {
+        super(parameters.getPartnerCode());
+        this.orderId = orderId;
+        this.type = "1";
+        this.isSendMsg = false;
+    }
+
+    public boolean getIsSendMsg() {
+        return isSendMsg;
+    }
+
+    public void setSendMsg(boolean sendMsg) {
+        isSendMsg = sendMsg;
+    }
+}

+ 89 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/request/QueryCarActualValueRequest.java

@@ -0,0 +1,89 @@
+package com.ydtech.modules.order.entity.api.chengtai.request;
+
+import cn.hutool.core.collection.CollUtil;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.ydtech.constants.enums.InsuranceRisk;
+import com.ydtech.modules.ins.model.vo.CarInfoVo;
+import com.ydtech.modules.ins.model.vo.RiskInfoVo;
+import com.ydtech.modules.order.entity.api.chengtai.constants.CarKindCodeEnum;
+import com.ydtech.modules.order.entity.api.chengtai.constants.PlateType;
+import com.ydtech.modules.order.entity.api.chengtai.constants.UseNatureCodeEnum;
+import com.ydtech.modules.order.entity.api.chengtai.response.CarInfoResponse;
+import com.ydtech.modules.order.entity.config.ChengTaiConfigureParameters;
+import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
+import com.ydtech.modules.protocol.utils.AssertionUtils;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+ * 【车辆价值计算】请求实体
+ */
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+@Data
+public class QueryCarActualValueRequest extends ChengTaiBaseRequest{
+
+    @JsonProperty("ciValidDate")
+    private String ciValidDate;
+    @JsonProperty("biValidDate")
+    private String biValidDate;
+    @JsonProperty("purchasePrice")
+    private BigDecimal purchasePrice;
+    @JsonProperty("registerDate")
+    private String registerDate;
+    @JsonProperty("issueDate")
+    private String issueDate;
+    @JsonProperty("carKindCode")
+    private String carKindCode;
+    @JsonProperty("plateType")
+    private String plateType;
+    @JsonProperty("approvedPassengersCapacity")
+    private BigDecimal approvedPassengersCapacity;
+    @JsonProperty("useNatureCode")
+    private String useNatureCode;
+    @JsonProperty("energyTypes")
+    private String energyTypes;
+
+    public QueryCarActualValueRequest(BaseQuoteInfoVo quoteInfoVo, CarInfoResponse.CarModelListDTO carModelListDTO, ChengTaiConfigureParameters parameters){
+        super(parameters.getPartnerCode());
+        String purchasePrice = carModelListDTO.getPurchasePrice(); // 新车购置价格
+        BigDecimal seatCount = carModelListDTO.getApprovedPassengersCapacity(); // 核定载客人数
+        CarInfoVo carInfo = quoteInfoVo.getCarInfo();
+        String jqStartDate = ""; // 交强起保日期
+        String syStartDate = ""; // 商业起保日期
+        // 3.1 计算起保日期
+        List<RiskInfoVo> riskList = quoteInfoVo.getRiskList(); // 交强险
+        if (CollUtil.isNotEmpty(riskList)) {
+            for (RiskInfoVo riskInfoVo : riskList) {
+                if (InsuranceRisk.TRAFFIC.getCode().equals(riskInfoVo.getRiskCode())) {
+                    jqStartDate = riskInfoVo.getStartDate();
+                } else if(InsuranceRisk.BUSINESS.getCode().equals(riskInfoVo.getRiskCode())) {
+                    syStartDate = riskInfoVo.getStartDate();
+                }
+            }
+        }
+        this.ciValidDate = jqStartDate;
+        this.biValidDate = syStartDate;
+        this.purchasePrice = new BigDecimal(purchasePrice);
+        this.registerDate = carInfo.getRegisterDate();
+        this.issueDate = carInfo.getIssueDate();
+        CarKindCodeEnum carKindCodeEnum = CarKindCodeEnum.valueOf(carInfo.getCimodelclass());
+        AssertionUtils.isEmpty(carKindCodeEnum, "车辆种类输入错误");
+        this.carKindCode = carKindCodeEnum.getCode();
+        if("1".equals(carInfo.getEnergyType()) || "3".equals(carInfo.getEnergyType())) {
+            this.plateType = PlateType.P52.getCode();
+        }else{
+            this.plateType = PlateType.P02.getCode();
+        }
+        this.approvedPassengersCapacity = seatCount;
+        UseNatureCodeEnum useNatureCodeEnum = UseNatureCodeEnum.valueOf("U_"+carInfo.getVehicleUse());
+        AssertionUtils.isEmpty(useNatureCodeEnum, "使用性质输入错误");
+        this.useNatureCode = useNatureCodeEnum.getCode();
+
+        this.energyTypes = carInfo.getEnergyType();
+    }
+}

+ 184 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/request/SubmitVerifyRequest.java

@@ -0,0 +1,184 @@
+package com.ydtech.modules.order.entity.api.chengtai.request;
+
+import com.alibaba.fastjson.JSONObject;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.ydtech.modules.admin.model.vo.PersonAreaVo;
+import com.ydtech.modules.order.entity.InsAreaCompany;
+import com.ydtech.modules.order.entity.InsOrders;
+import com.ydtech.modules.order.entity.config.ChengTaiConfigureParameters;
+import com.ydtech.utils.IDCardUtils;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 【投保保存】请求实体
+ */
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+@Data
+public class SubmitVerifyRequest extends ChengTaiBaseRequest{
+
+    @JsonProperty("applicant")
+    private ApplicantDTO applicant;
+    @JsonProperty("insured")
+    private InsuredDTO insured;
+    @JsonProperty("engageList")
+    private List<EngageListDTO> engageList;
+    @JsonProperty("orderId")
+    private String orderId;
+
+    public SubmitVerifyRequest(ChengTaiConfigureParameters parameters,
+                               InsAreaCompany insAreaCompany,
+                               InsOrders insOrders,
+                               List<EngageListDTO> engageList,
+                               PersonAreaVo applyPersonAreaVo,
+                               PersonAreaVo insurePersonAreaVo){
+        super(parameters.getPartnerCode());
+        this.orderId = insAreaCompany.getInsOrderNo();
+        // 投保人
+        ApplicantDTO applicant = new ApplicantDTO(insOrders,applyPersonAreaVo);
+        this.applicant = applicant;
+        // 被保人
+        InsuredDTO insured = new InsuredDTO(insOrders,insurePersonAreaVo);
+        this.insured = insured;
+        // 特约获取组装
+        this.engageList = engageList;
+    }
+
+    @Data
+    public static class ApplicantDTO {
+        @JsonProperty("type")
+        private String type;
+        @JsonProperty("name")
+        private String name;
+        @JsonProperty("identifyTypeCode")
+        private String identifyTypeCode;
+        @JsonProperty("identifyNumber")
+        private String identifyNumber;
+        @JsonProperty("identifyValidDate")
+        private String identifyValidDate;
+        @JsonProperty("identifyValidEndDate")
+        private String identifyValidEndDate;
+        @JsonProperty("identifyTypeName")
+        private String identifyTypeName;
+        @JsonProperty("sex")
+        private String sex;
+        @JsonProperty("age")
+        private Integer age;
+        @JsonProperty("birthday")
+        private String birthday;
+        @JsonProperty("longTerm")
+        private String longTerm;
+        @JsonProperty("province")
+        private String province;
+        @JsonProperty("city")
+        private String city;
+        @JsonProperty("district")
+        private String district;
+        @JsonProperty("addr")
+        private String addr;
+        @JsonProperty("mobile")
+        private String mobile;
+
+        public ApplicantDTO(InsOrders insOrders, PersonAreaVo applyPersonAreaVo){
+            // 获取投保人信息
+            JSONObject applyInfo = insOrders.getApplyinfo();
+            this.type = "1";
+            this.name = applyInfo.getString("name");
+            this.identifyTypeCode = "01";
+            this.identifyTypeName = "居民身份证";
+            this.identifyNumber = applyInfo.getString("identifyNumber");
+            this.province = applyPersonAreaVo.getProvinceCode();
+            this.city = applyPersonAreaVo.getCityCode();
+            this.district = applyPersonAreaVo.getCountyCode();
+            this.addr = applyInfo.getString("addr");
+            this.mobile = applyInfo.getString("mobile");
+            this.sex = IDCardUtils.GetSex(identifyNumber).equalsIgnoreCase("FEMALE") ? "2" : "1";
+            this.identifyValidDate = applyInfo.getString("identifyValidDate");
+            this.identifyValidEndDate = applyInfo.getString("identifyValidEndDate");
+            this.longTerm = "0";
+            this.birthday = IDCardUtils.GetBirthday(applyInfo.getString("identifyNumber"));
+        }
+    }
+
+    @Data
+    public static class InsuredDTO {
+        @JsonProperty("type")
+        private String type;
+        @JsonProperty("name")
+        private String name;
+        @JsonProperty("identifyTypeCode")
+        private String identifyTypeCode;
+        @JsonProperty("identifyNumber")
+        private String identifyNumber;
+        @JsonProperty("identifyValidDate")
+        private String identifyValidDate;
+        @JsonProperty("identifyValidEndDate")
+        private String identifyValidEndDate;
+        @JsonProperty("identifyTypeName")
+        private String identifyTypeName;
+        @JsonProperty("sex")
+        private String sex;
+        @JsonProperty("age")
+        private Integer age;
+        @JsonProperty("birthday")
+        private String birthday;
+        @JsonProperty("longTerm")
+        private String longTerm;
+        @JsonProperty("province")
+        private String province;
+        @JsonProperty("city")
+        private String city;
+        @JsonProperty("district")
+        private String district;
+        @JsonProperty("addr")
+        private String addr;
+        @JsonProperty("mobile")
+        private String mobile;
+        @JsonProperty("relationWithInsured")
+        private String relationWithInsured;
+        @JsonProperty("relationWithCar")
+        private String relationWithCar;
+
+        public InsuredDTO(InsOrders insOrders, PersonAreaVo personAreaVo){
+            // 获取被保人信息
+            JSONObject insureinfo = insOrders.getInsureinfo();
+            this.type = "1";
+            this.name = insureinfo.getString("name");
+            this.identifyTypeCode = "01";
+            this.identifyTypeName = "居民身份证";
+            this.identifyNumber = insureinfo.getString("identifyNumber");
+            this.province = personAreaVo.getProvinceCode();
+            this.city = personAreaVo.getCityCode();
+            this.district = personAreaVo.getCountyCode();
+            this.addr = insureinfo.getString("addr");
+            this.mobile = insureinfo.getString("mobile");
+            this.sex = IDCardUtils.GetSex(identifyNumber).equalsIgnoreCase("FEMALE") ? "2" : "1";
+            this.identifyValidDate = insureinfo.getString("identifyValidDate");
+            this.identifyValidEndDate = insureinfo.getString("identifyValidEndDate");
+            this.longTerm = "0";
+            this.birthday = IDCardUtils.GetBirthday(insureinfo.getString("identifyNumber"));
+        }
+    }
+
+    @NoArgsConstructor
+    @Data
+    public static class EngageListDTO implements Serializable {
+        @JsonProperty("riskCode")
+        private String riskCode;
+        @JsonProperty("engageDetail")
+        private String engageDetail;
+        @JsonProperty("modifyind")
+        private String modifyind;
+        @JsonProperty("engageCode")
+        private String engageCode;
+        @JsonProperty("engageTitle")
+        private String engageTitle;
+        @JsonProperty("chooseType")
+        private String chooseType;
+    }
+}

+ 22 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/request/SubmitVerifyResultRequest.java

@@ -0,0 +1,22 @@
+package com.ydtech.modules.order.entity.api.chengtai.request;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.ydtech.modules.order.entity.config.ChengTaiConfigureParameters;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 【投保结果查询】请求实体
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class SubmitVerifyResultRequest  extends ChengTaiBaseRequest{
+
+    @JsonProperty("orderId")
+    private String orderId;
+
+    public SubmitVerifyResultRequest(ChengTaiConfigureParameters parameters, String orderId) {
+        super(parameters.getPartnerCode());
+        this.orderId = orderId;
+    }
+}

+ 24 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/request/TokenRequest.java

@@ -0,0 +1,24 @@
+package com.ydtech.modules.order.entity.api.chengtai.request;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+/**
+ * 【获取token】请求实体
+ */
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+@Data
+public class TokenRequest extends ChengTaiBaseRequest{
+
+    private static final long serialVersionUID = -489340818664271735L;
+
+    @JsonProperty("embarkPartnerCode")
+    private String embarkPartnerCode;
+
+    public TokenRequest(String embarkPartnerCode){
+        this.embarkPartnerCode = embarkPartnerCode;
+    }
+}

+ 22 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/request/UnderwritingRequest.java

@@ -0,0 +1,22 @@
+package com.ydtech.modules.order.entity.api.chengtai.request;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.ydtech.modules.order.entity.config.ChengTaiConfigureParameters;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 【核保】请求实体
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class UnderwritingRequest  extends ChengTaiBaseRequest{
+
+    @JsonProperty("orderId")
+    private String orderId;
+
+    public UnderwritingRequest(ChengTaiConfigureParameters parameters, String orderId) {
+        super(parameters.getPartnerCode());
+        this.orderId = orderId;
+    }
+}

+ 22 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/request/UnderwritingResultRequest.java

@@ -0,0 +1,22 @@
+package com.ydtech.modules.order.entity.api.chengtai.request;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.ydtech.modules.order.entity.config.ChengTaiConfigureParameters;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 【核保结果查询】请求实体
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class UnderwritingResultRequest  extends ChengTaiBaseRequest{
+
+    @JsonProperty("orderId")
+    private String orderId;
+
+    public UnderwritingResultRequest(ChengTaiConfigureParameters parameters, String orderId) {
+        super(parameters.getPartnerCode());
+        this.orderId = orderId;
+    }
+}

+ 85 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/request/UploadFileRequest.java

@@ -0,0 +1,85 @@
+package com.ydtech.modules.order.entity.api.chengtai.request;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.ydtech.constants.InsuranceImageEnum;
+import com.ydtech.modules.order.entity.api.chengtai.constants.ImageTypeEnum;
+import com.ydtech.modules.order.entity.api.zijin.constants.enums.FileTypeEnum;
+import com.ydtech.modules.order.entity.config.ChengTaiConfigureParameters;
+import com.ydtech.modules.order.entity.po.InsTaskImagesBase64;
+import com.ydtech.modules.protocol.utils.AssertionUtils;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 【影像上传】请求实体
+ */
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+@Data
+public class UploadFileRequest extends ChengTaiBaseRequest{
+
+
+    @JsonProperty("orderId")
+    private String orderId;
+    @JsonProperty("imageType")
+    private String imageType;
+    @JsonProperty("imageObjType")
+    private String imageObjType;
+    @JsonProperty("interfaceType")
+    private String interfaceType;
+    @JsonProperty("fileList")
+    private List<FileListDTO> fileList;
+
+    public UploadFileRequest(InsTaskImagesBase64 insTaskImagesBase64, String orderNo, ChengTaiConfigureParameters parameters){
+        super(parameters.getPartnerCode());
+        this.orderId = orderNo;
+        String imageType = insTaskImagesBase64.getImageType();
+
+        InsuranceImageEnum insuranceImageEnum = Enum.valueOf(InsuranceImageEnum.class, imageType);
+
+        for (ImageTypeEnum imageTypeEnum : ImageTypeEnum.values()) {
+            boolean contains = Arrays.asList(imageTypeEnum.getImagesType()).contains(insuranceImageEnum.getCode());
+            if(contains){
+                this.imageType = imageTypeEnum.getCode();
+                this.fileList = Arrays.asList(new FileListDTO(insTaskImagesBase64, imageTypeEnum));
+                if(InsuranceImageEnum.C01.getCode().equals(this.imageType)
+                        || InsuranceImageEnum.D01.getCode().equals(this.imageType)
+                        || InsuranceImageEnum.C02.getCode().equals(this.imageType)
+                        || InsuranceImageEnum.D02.getCode().equals(this.imageType)
+                ){
+                    this.imageObjType = "1";
+                }else if(InsuranceImageEnum.C03.getCode().equals(this.imageType)
+                        || InsuranceImageEnum.D03.getCode().equals(this.imageType)
+                ){
+                    this.imageObjType = "2";
+                } else if(InsuranceImageEnum.C04.getCode().equals(this.imageType)
+                        || InsuranceImageEnum.D04.getCode().equals(this.imageType)
+                ){
+                    this.imageObjType = "3";
+                }
+                break;
+            }
+        }
+    }
+
+    @NoArgsConstructor
+    @Data
+    public static class FileListDTO {
+        @JsonProperty("fileName")
+        private String fileName;
+        @JsonProperty("fileContent")
+        private String fileContent;
+        @JsonProperty("fileId")
+        private String fileId;
+
+        public FileListDTO(InsTaskImagesBase64 insTaskImagesBase64, ImageTypeEnum imageTypeEnum){
+            String suffix = insTaskImagesBase64.getFileName().substring(insTaskImagesBase64.getFileName().lastIndexOf("."));
+            this.fileName = imageTypeEnum.getDesc() + suffix;
+            this.fileContent = insTaskImagesBase64.getBase64String();
+        }
+    }
+}

+ 109 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/response/CarInfoResponse.java

@@ -0,0 +1,109 @@
+package com.ydtech.modules.order.entity.api.chengtai.response;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.ydtech.modules.order.entity.filter.CarModelsFilter;
+import com.ydtech.modules.order.entity.vo.CoreModelsVo;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Objects;
+
+@NoArgsConstructor
+@Data
+public class CarInfoResponse extends ChengTaiBaseResponse {
+
+    private static final long serialVersionUID = 0x84989501b87b4329L;
+
+    @JsonProperty("carModelList")
+    private List<CarModelListDTO> carModelList;
+
+    @JsonProperty("total")
+    private Integer total;
+
+
+    @NoArgsConstructor
+    @Data
+    public static class CarModelListDTO implements Serializable, CarModelsFilter {
+        private static final long serialVersionUID = -8892193629620452567L;
+
+        @JsonProperty("deptName")
+        private String deptName;
+        @JsonProperty("hfStartTime")
+        private String hfStartTime;
+        @JsonProperty("vehicleName")
+        private String vehicleName;
+        @JsonProperty("seriesCode")
+        private String seriesCode;
+        @JsonProperty("purchasePriceTax")
+        private BigDecimal purchasePriceTax;
+        @JsonProperty("qualityMax")
+        private BigDecimal qualityMax;
+        @JsonProperty("purchasePrice")
+        private String purchasePrice;
+        @JsonProperty("carYear")
+        private String carYear;
+        @JsonProperty("hfName")
+        private String hfName;
+        @JsonProperty("unladenMass")
+        private BigDecimal unladenMass;
+        @JsonProperty("modelCode")
+        private String modelCode;
+        @JsonProperty("seriesType")
+        private String seriesType;
+        @JsonProperty("shortHandCode")
+        private String shortHandCode;
+        @JsonProperty("displacement")
+        private BigDecimal displacement;
+        @JsonProperty("hfEndTime")
+        private String hfEndTime;
+        @JsonProperty("transmissionType")
+        private String transmissionType;
+        @JsonProperty("power")
+        private BigDecimal power;
+        @JsonProperty("brand")
+        private String brand;
+        @JsonProperty("brandCode")
+        private String brandCode;
+        @JsonProperty("factory")
+        private String factory;
+        @JsonProperty("insCarClassName")
+        private String insCarClassName;
+        @JsonProperty("insCarClass")
+        private String insCarClass;
+        @JsonProperty("seriesName")
+        private String seriesName;
+        @JsonProperty("carKind")
+        private String carKind;
+        @JsonProperty("modelName")
+        private String modelName;
+        @JsonProperty("series")
+        private String series;
+        @JsonProperty("approvedPassengersCapacity")
+        private BigDecimal approvedPassengersCapacity;
+        @JsonProperty("vehiclemodel")
+        private String vehiclemodel;
+        @JsonProperty("deptCode")
+        private String deptCode;
+        @JsonProperty("hfCode")
+        private String hfCode;
+        @JsonProperty("qualityMin")
+        private BigDecimal qualityMin;
+
+
+        public CoreModelsVo toCoreModelsVo() {
+            CoreModelsVo coreModelsVo = new CoreModelsVo();
+            coreModelsVo.setModelCode(this.modelCode);
+            coreModelsVo.setModelName(this.modelName);
+            coreModelsVo.setCarYear(this.carYear);
+            coreModelsVo.setPower(this.power.toString());
+            coreModelsVo.setEnginedesc(Objects.nonNull(this.displacement)? this.displacement.toString() : "");
+            coreModelsVo.setPurchasePrice(this.purchasePrice);
+            coreModelsVo.setSeatCount(this.approvedPassengersCapacity.toString());
+            return coreModelsVo;
+        }
+    }
+}

+ 47 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/response/ChengTaiBaseResponse.java

@@ -0,0 +1,47 @@
+package com.ydtech.modules.order.entity.api.chengtai.response;
+
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.ydtech.modules.order.entity.api.bohai.response.ElectronicPolicyResponse;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+@NoArgsConstructor
+@Data
+public class ChengTaiBaseResponse implements Serializable {
+
+    private static final long serialVersionUID = -6579348094955612464L;
+
+    /**
+     * 加密报文
+     */
+    @JsonProperty("encryptionMessage")
+    public String encryptionMessage;
+
+    /**
+     * 签名
+     */
+    @JsonProperty("signature")
+    public String signature;
+
+    @JsonProperty("code")
+    public String code;
+
+    @JsonProperty("responseCode")
+    public String responseCode;
+
+    @JsonProperty("errorMessage")
+    public String errorMessage;
+
+    @JsonProperty("message")
+    public String message;
+
+    @JsonProperty("systemCode")
+    public String systemCode;
+
+    @JsonProperty("flag")
+    public Boolean flag;
+}

+ 25 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/response/DownLoadDocumentUrlResponse.java

@@ -0,0 +1,25 @@
+package com.ydtech.modules.order.entity.api.chengtai.response;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@NoArgsConstructor
+@Data
+public class DownLoadDocumentUrlResponse extends ChengTaiBaseResponse{
+
+    @JsonProperty("ciDownLoad")
+    private String ciDownLoad;
+    @JsonProperty("ciDownloadResponseCode")
+    private String ciDownloadResponseCode;
+    @JsonProperty("biDownloadResponseCode")
+    private String biDownloadResponseCode;
+    @JsonProperty("biDownLoad")
+    private String biDownLoad;
+    @JsonProperty("businessType")
+    private String businessType;
+    @JsonProperty("contractNoBi")
+    private String contractNoBi;
+    @JsonProperty("contractNoCi")
+    private String contractNoCi;
+}

+ 512 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/response/InsurePremiumResponse.java

@@ -0,0 +1,512 @@
+package com.ydtech.modules.order.entity.api.chengtai.response;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+@NoArgsConstructor
+@Data
+public class InsurePremiumResponse extends ChengTaiBaseResponse{
+
+    @JsonProperty("orderId")
+    private String orderId;
+    @JsonProperty("biContract")
+    private BiContractDTO biContract;
+    @JsonProperty("insuredObject")
+    private InsuredObjectDTO insuredObject;
+    @JsonProperty("ciContract")
+    private CiContractDTO ciContract;
+
+    @NoArgsConstructor
+    @Data
+    public static class BiContractDTO {
+        @JsonProperty("coverage")
+        private List<CoverageDTO> coverage;
+        @JsonProperty("discountInfo")
+        private DiscountInfoDTO discountInfo;
+        @JsonProperty("platFormMessage")
+        private PlatFormMessageDTO platFormMessage;
+        @JsonProperty("adjust")
+        private List<AdjustDTO> adjust;
+        @JsonProperty("engage")
+        private List<EngageDTO> engage;
+        @JsonProperty("chargingPileList")
+        private List<?> chargingPileList;
+        @JsonProperty("coveragePremium")
+        private List<CoveragePremiumDTO> coveragePremium;
+        @JsonProperty("reInsureItem")
+        private ReInsureItemDTO reInsureItem;
+        @JsonProperty("contractMain")
+        private ContractMainDTO contractMain;
+
+        @NoArgsConstructor
+        @Data
+        public static class DiscountInfoDTO {
+            @JsonProperty("entireInitialDiscount")
+            private String entireInitialDiscount;
+        }
+
+        @NoArgsConstructor
+        @Data
+        public static class PlatFormMessageDTO {
+            @JsonProperty("scoreCode")
+            private String scoreCode;
+            @JsonProperty("lastPolicyQueryDate")
+            private String lastPolicyQueryDate;
+            @JsonProperty("insureYears")
+            private String insureYears;
+            @JsonProperty("ciCarKind")
+            private String ciCarKind;
+            @JsonProperty("peccancyAdjustCI")
+            private String peccancyAdjustCI;
+            @JsonProperty("lastPolicyExpireDate")
+            private String lastPolicyExpireDate;
+            @JsonProperty("noClaimAdjustReasonCodeBI")
+            private String noClaimAdjustReasonCodeBI;
+            @JsonProperty("modelEnergyType")
+            private String modelEnergyType;
+            @JsonProperty("noClaimAdjustReason")
+            private String noClaimAdjustReason;
+            @JsonProperty("score")
+            private String score;
+            @JsonProperty("queryDate")
+            private String queryDate;
+            @JsonProperty("claimAdjustReasonCodeBI")
+            private String claimAdjustReasonCodeBI;
+            @JsonProperty("ciModelCode")
+            private String ciModelCode;
+            @JsonProperty("lastPolicyEffectiveDate")
+            private String lastPolicyEffectiveDate;
+            @JsonProperty("unMatchLicenseNoMessage")
+            private String unMatchLicenseNoMessage;
+            @JsonProperty("lastReplacementValue")
+            private String lastReplacementValue;
+            @JsonProperty("expireDate")
+            private String expireDate;
+            @JsonProperty("repeatedMsg")
+            private String repeatedMsg;
+            @JsonProperty("question")
+            private String question;
+            @JsonProperty("noClaimAdjustReasonBI")
+            private String noClaimAdjustReasonBI;
+            @JsonProperty("nonClaimAdjust")
+            private String nonClaimAdjust;
+            @JsonProperty("querySequenceNo")
+            private String querySequenceNo;
+            @JsonProperty("noClaimAdjustReasonCodeCI")
+            private String noClaimAdjustReasonCodeCI;
+            @JsonProperty("lastModelCode")
+            private String lastModelCode;
+            @JsonProperty("claimAdjustReasonCodeCI")
+            private String claimAdjustReasonCodeCI;
+            @JsonProperty("lastModel")
+            private String lastModel;
+            @JsonProperty("answer")
+            private String answer;
+            @JsonProperty("claimCoeff")
+            private String claimCoeff;
+            @JsonProperty("claimAdjustLevel")
+            private String claimAdjustLevel;
+            @JsonProperty("peccancyAdjustReasonCI")
+            private String peccancyAdjustReasonCI;
+            @JsonProperty("reinsuranceFlag")
+            private String reinsuranceFlag;
+            @JsonProperty("claimTimes")
+            private String claimTimes;
+            @JsonProperty("rateFloatFlag")
+            private String rateFloatFlag;
+        }
+
+        @NoArgsConstructor
+        @Data
+        public static class ReInsureItemDTO {
+            @JsonProperty("engineNo")
+            private String engineNo;
+            @JsonProperty("coverageItem")
+            private String coverageItem;
+            @JsonProperty("licensePlateColorCode")
+            private String licensePlateColorCode;
+            @JsonProperty("policyNo")
+            private String policyNo;
+            @JsonProperty("vin")
+            private String vin;
+            @JsonProperty("expireDate")
+            private String expireDate;
+            @JsonProperty("billDate")
+            private String billDate;
+            @JsonProperty("insurerCode")
+            private String insurerCode;
+            @JsonProperty("licensePlateNo")
+            private String licensePlateNo;
+            @JsonProperty("licensePlateType")
+            private String licensePlateType;
+            @JsonProperty("effectiveDate")
+            private String effectiveDate;
+        }
+
+        @NoArgsConstructor
+        @Data
+        public static class ContractMainDTO {
+            @JsonProperty("riskName")
+            private String riskName;
+            @JsonProperty("hopeDiscount")
+            private String hopeDiscount;
+            @JsonProperty("validDate")
+            private String validDate;
+            @JsonProperty("riskCode")
+            private String riskCode;
+            @JsonProperty("totalPremium")
+            private BigDecimal totalPremium;
+            @JsonProperty("policyNo")
+            private String policyNo;
+            @JsonProperty("validAtOnce")
+            private String validAtOnce;
+            @JsonProperty("renewalFlag")
+            private String renewalFlag;
+            @JsonProperty("lastYearPolicyNo")
+            private String lastYearPolicyNo;
+            @JsonProperty("sumAmount")
+            private String sumAmount;
+            @JsonProperty("proposalNo")
+            private String proposalNo;
+            @JsonProperty("expiryDate")
+            private String expiryDate;
+            @JsonProperty("hopeCoefficient")
+            private String hopeCoefficient;
+            @JsonProperty("currency")
+            private String currency;
+        }
+
+        @NoArgsConstructor
+        @Data
+        public static class CoverageDTO {
+            @JsonProperty("glassClassName")
+            private String glassClassName;
+            @JsonProperty("amount")
+            private Double amount;
+            @JsonProperty("kindCode")
+            private String kindCode;
+            @JsonProperty("quantity")
+            private String quantity;
+            @JsonProperty("validDate")
+            private String validDate;
+            @JsonProperty("coveragePremium")
+            private BigDecimal coveragePremium;
+            @JsonProperty("glassClassCode")
+            private String glassClassCode;
+            @JsonProperty("calculateFlag")
+            private String calculateFlag;
+            @JsonProperty("expiryDate")
+            private String expiryDate;
+            @JsonProperty("ifMainKind")
+            private String ifMainKind;
+            @JsonProperty("deductible")
+            private String deductible;
+            @JsonProperty("kindName")
+            private String kindName;
+            @JsonProperty("unitAmount")
+            private BigDecimal unitAmount;
+            @JsonProperty("currency")
+            private String currency;
+        }
+
+        @NoArgsConstructor
+        @Data
+        public static class AdjustDTO {
+            @JsonProperty("adjustName")
+            private String adjustName;
+            @JsonProperty("adjustRate")
+            private String adjustRate;
+            @JsonProperty("adjustCode")
+            private String adjustCode;
+            @JsonProperty("minRate")
+            private String minRate;
+            @JsonProperty("maxRate")
+            private String maxRate;
+        }
+
+        @NoArgsConstructor
+        @Data
+        public static class EngageDTO {
+            @JsonProperty("engageDetail")
+            private String engageDetail;
+            @JsonProperty("modifyind")
+            private String modifyind;
+            @JsonProperty("engageCode")
+            private String engageCode;
+            @JsonProperty("engageTitle")
+            private String engageTitle;
+            @JsonProperty("chooseType")
+            private String chooseType;
+        }
+
+        @NoArgsConstructor
+        @Data
+        public static class CoveragePremiumDTO {
+            @JsonProperty("vehiclaCode")
+            private String vehiclaCode;
+            @JsonProperty("pureriskPremium")
+            private String pureriskPremium;
+            @JsonProperty("used")
+            private String used;
+        }
+    }
+
+    @NoArgsConstructor
+    @Data
+    public static class InsuredObjectDTO {
+        @JsonProperty("deviceList")
+        private List<?> deviceList;
+    }
+
+    @NoArgsConstructor
+    @Data
+    public static class CiContractDTO {
+        @JsonProperty("coverage")
+        private List<CoverageDTO> coverage;
+        @JsonProperty("discountInfo")
+        private DiscountInfoDTO discountInfo;
+        @JsonProperty("platFormMessage")
+        private PlatFormMessageDTO platFormMessage;
+        @JsonProperty("engage")
+        private List<EngageDTO> engage;
+        @JsonProperty("adjust")
+        private List<AdjustDTO> adjust;
+        @JsonProperty("tax")
+        private TaxDTO tax;
+        @JsonProperty("contractMain")
+        private ContractMainDTO contractMain;
+
+        @NoArgsConstructor
+        @Data
+        public static class DiscountInfoDTO {
+            @JsonProperty("entireInitialDiscount")
+            private String entireInitialDiscount;
+        }
+
+        @NoArgsConstructor
+        @Data
+        public static class PlatFormMessageDTO {
+            @JsonProperty("lastPolicyQueryDate")
+            private String lastPolicyQueryDate;
+            @JsonProperty("insureYears")
+            private String insureYears;
+            @JsonProperty("ciCarKind")
+            private String ciCarKind;
+            @JsonProperty("peccancyAdjustCI")
+            private String peccancyAdjustCI;
+            @JsonProperty("lastPolicyExpireDate")
+            private String lastPolicyExpireDate;
+            @JsonProperty("noClaimAdjustReasonCodeBI")
+            private String noClaimAdjustReasonCodeBI;
+            @JsonProperty("modelEnergyType")
+            private String modelEnergyType;
+            @JsonProperty("noClaimAdjustReason")
+            private String noClaimAdjustReason;
+            @JsonProperty("queryDate")
+            private String queryDate;
+            @JsonProperty("claimAdjustReasonCodeBI")
+            private String claimAdjustReasonCodeBI;
+            @JsonProperty("ciModelCode")
+            private String ciModelCode;
+            @JsonProperty("lastPolicyEffectiveDate")
+            private String lastPolicyEffectiveDate;
+            @JsonProperty("unMatchLicenseNoMessage")
+            private String unMatchLicenseNoMessage;
+            @JsonProperty("lastReplacementValue")
+            private String lastReplacementValue;
+            @JsonProperty("expireDate")
+            private String expireDate;
+            @JsonProperty("repeatedMsg")
+            private String repeatedMsg;
+            @JsonProperty("question")
+            private String question;
+            @JsonProperty("noClaimAdjustReasonBI")
+            private String noClaimAdjustReasonBI;
+            @JsonProperty("nonClaimAdjust")
+            private String nonClaimAdjust;
+            @JsonProperty("querySequenceNo")
+            private String querySequenceNo;
+            @JsonProperty("noClaimAdjustReasonCodeCI")
+            private String noClaimAdjustReasonCodeCI;
+            @JsonProperty("lastModelCode")
+            private String lastModelCode;
+            @JsonProperty("claimAdjustReasonCodeCI")
+            private String claimAdjustReasonCodeCI;
+            @JsonProperty("lastModel")
+            private String lastModel;
+            @JsonProperty("answer")
+            private String answer;
+            @JsonProperty("claimCoeff")
+            private String claimCoeff;
+            @JsonProperty("claimAdjustLevel")
+            private String claimAdjustLevel;
+            @JsonProperty("peccancyAdjustReasonCI")
+            private String peccancyAdjustReasonCI;
+            @JsonProperty("reinsuranceFlag")
+            private String reinsuranceFlag;
+            @JsonProperty("claimTimes")
+            private String claimTimes;
+            @JsonProperty("rateFloatFlag")
+            private String rateFloatFlag;
+        }
+
+        @NoArgsConstructor
+        @Data
+        public static class TaxDTO {
+            @JsonProperty("sumTax")
+            private BigDecimal sumTax;
+            @JsonProperty("sumOverdue")
+            private BigDecimal sumOverdue;
+            @JsonProperty("taxPayerIdentityNo")
+            private String taxPayerIdentityNo;
+            @JsonProperty("documentNumber")
+            private String documentNumber;
+            @JsonProperty("taxPayerName")
+            private String taxPayerName;
+            @JsonProperty("annualTaxDue")
+            private BigDecimal annualTaxDue;
+            @JsonProperty("noTaxReasonCode")
+            private String noTaxReasonCode;
+            @JsonProperty("sumTaxDefault")
+            private String sumTaxDefault;
+            @JsonProperty("lastPaidYear")
+            private String lastPaidYear;
+            @JsonProperty("unladenMass")
+            private Integer unladenMass;
+            @JsonProperty("taxStartDate")
+            private String taxStartDate;
+            @JsonProperty("taxEndDate")
+            private String taxEndDate;
+            @JsonProperty("taxDepartmentCity")
+            private String taxDepartmentCity;
+            @JsonProperty("deductionDueType")
+            private String deductionDueType;
+            @JsonProperty("taxDepartment")
+            private String taxDepartment;
+            @JsonProperty("taxDocumentDate")
+            private String taxDocumentDate;
+            @JsonProperty("taxConditionCode")
+            private String taxConditionCode;
+            @JsonProperty("taxDepartmentProvince")
+            private String taxDepartmentProvince;
+            @JsonProperty("annualTaxAmount")
+            private String annualTaxAmount;
+            @JsonProperty("taxPayerIdentityType")
+            private String taxPayerIdentityType;
+            @JsonProperty("calculateMode")
+            private String calculateMode;
+            @JsonProperty("deductionDueProportion")
+            private String deductionDueProportion;
+            @JsonProperty("unit")
+            private String unit;
+            @JsonProperty("taxDepartmentDetail")
+            private String taxDepartmentDetail;
+            @JsonProperty("deductionDueCode")
+            private String deductionDueCode;
+            @JsonProperty("deduction")
+            private String deduction;
+            @JsonProperty("taxPayerIdentificationCode")
+            private String taxPayerIdentificationCode;
+        }
+
+        @NoArgsConstructor
+        @Data
+        public static class ContractMainDTO {
+            @JsonProperty("riskName")
+            private String riskName;
+            @JsonProperty("hopeDiscount")
+            private String hopeDiscount;
+            @JsonProperty("validDate")
+            private String validDate;
+            @JsonProperty("riskCode")
+            private String riskCode;
+            @JsonProperty("totalPremium")
+            private BigDecimal totalPremium;
+            @JsonProperty("policyNo")
+            private String policyNo;
+            @JsonProperty("validAtOnce")
+            private String validAtOnce;
+            @JsonProperty("renewalFlag")
+            private String renewalFlag;
+            @JsonProperty("lastYearPolicyNo")
+            private String lastYearPolicyNo;
+            @JsonProperty("sumAmount")
+            private String sumAmount;
+            @JsonProperty("proposalNo")
+            private String proposalNo;
+            @JsonProperty("expiryDate")
+            private String expiryDate;
+            @JsonProperty("hopeCoefficient")
+            private String hopeCoefficient;
+            @JsonProperty("currency")
+            private String currency;
+        }
+
+        @NoArgsConstructor
+        @Data
+        public static class CoverageDTO {
+            @JsonProperty("glassClassName")
+            private String glassClassName;
+            @JsonProperty("amount")
+            private Integer amount;
+            @JsonProperty("kindCode")
+            private String kindCode;
+            @JsonProperty("quantity")
+            private String quantity;
+            @JsonProperty("validDate")
+            private String validDate;
+            @JsonProperty("coveragePremium")
+            private String coveragePremium;
+            @JsonProperty("glassClassCode")
+            private String glassClassCode;
+            @JsonProperty("calculateFlag")
+            private String calculateFlag;
+            @JsonProperty("expiryDate")
+            private String expiryDate;
+            @JsonProperty("ifMainKind")
+            private String ifMainKind;
+            @JsonProperty("deductible")
+            private String deductible;
+            @JsonProperty("kindName")
+            private String kindName;
+            @JsonProperty("unitAmount")
+            private String unitAmount;
+            @JsonProperty("currency")
+            private String currency;
+        }
+
+        @NoArgsConstructor
+        @Data
+        public static class EngageDTO {
+            @JsonProperty("engageDetail")
+            private String engageDetail;
+            @JsonProperty("modifyind")
+            private String modifyind;
+            @JsonProperty("engageCode")
+            private String engageCode;
+            @JsonProperty("engageTitle")
+            private String engageTitle;
+            @JsonProperty("chooseType")
+            private String chooseType;
+        }
+
+        @NoArgsConstructor
+        @Data
+        public static class AdjustDTO {
+            @JsonProperty("adjustName")
+            private String adjustName;
+            @JsonProperty("adjustRate")
+            private String adjustRate;
+            @JsonProperty("adjustCode")
+            private String adjustCode;
+            @JsonProperty("minRate")
+            private String minRate;
+            @JsonProperty("maxRate")
+            private String maxRate;
+        }
+    }
+}

+ 13 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/response/OrderNoResponse.java

@@ -0,0 +1,13 @@
+package com.ydtech.modules.order.entity.api.chengtai.response;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@NoArgsConstructor
+@Data
+public class OrderNoResponse extends ChengTaiBaseResponse{
+
+    @JsonProperty("invalidFlag")
+    private String invalidFlag;
+}

+ 15 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/response/PayUrlResponse.java

@@ -0,0 +1,15 @@
+package com.ydtech.modules.order.entity.api.chengtai.response;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@NoArgsConstructor
+@Data
+public class PayUrlResponse extends ChengTaiBaseResponse{
+
+    @JsonProperty("message")
+    private String message;
+    @JsonProperty("smsUrl")
+    private String smsUrl;
+}

+ 17 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/response/QueryCarActualValueResponse.java

@@ -0,0 +1,17 @@
+package com.ydtech.modules.order.entity.api.chengtai.response;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.math.BigDecimal;
+
+@NoArgsConstructor
+@Data
+public class QueryCarActualValueResponse extends ChengTaiBaseResponse{
+
+    @JsonProperty("monthDepRate")
+    private BigDecimal monthDepRate;
+    @JsonProperty("actualValue")
+    private BigDecimal actualValue;
+}

+ 33 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/response/SubmitVerifyResponse.java

@@ -0,0 +1,33 @@
+package com.ydtech.modules.order.entity.api.chengtai.response;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@NoArgsConstructor
+@Data
+public class SubmitVerifyResponse extends ChengTaiBaseResponse{
+
+    @JsonProperty("isPolitics")
+    private String isPolitics;
+    @JsonProperty("underWriteInd")
+    private String underWriteInd;
+    @JsonProperty("SMSCheckFlag")
+    private String sMSCheckFlag;
+    @JsonProperty("terrorType")
+    private String terrorType;
+    @JsonProperty("orderId")
+    private String orderId;
+    @JsonProperty("signStatus")
+    private String signStatus;
+    @JsonProperty("resCode")
+    private String resCode;
+    @JsonProperty("isTerror")
+    private String isTerror;
+    @JsonProperty("contractNoBI")
+    private String contractNoBI;
+    @JsonProperty("uuid")
+    private String uuid;
+    @JsonProperty("contractNoCI")
+    private String contractNoCI;
+}

+ 30 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/response/SubmitVerifyResultResponse.java

@@ -0,0 +1,30 @@
+package com.ydtech.modules.order.entity.api.chengtai.response;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+
+@NoArgsConstructor
+@Data
+public class SubmitVerifyResultResponse extends ChengTaiBaseResponse{
+
+    @JsonProperty("data")
+    private List<DataDTO> data;
+    @JsonProperty("policyProsts")
+    private String policyProsts;
+
+    @NoArgsConstructor
+    @Data
+    public static class DataDTO {
+        @JsonProperty("insCode")
+        private String insCode;
+        @JsonProperty("orderId")
+        private String orderId;
+        @JsonProperty("policyCode")
+        private String policyCode;
+        @JsonProperty("riskCode")
+        private String riskCode;
+    }
+}

+ 15 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/response/TokenResponse.java

@@ -0,0 +1,15 @@
+package com.ydtech.modules.order.entity.api.chengtai.response;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@NoArgsConstructor
+@Data
+public class TokenResponse extends ChengTaiBaseResponse {
+
+    private static final long serialVersionUID = -489340818664271735L;
+
+    @JsonProperty("accessToken")
+    private String accessToken;
+}

+ 26 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/response/UnderwritingResponse.java

@@ -0,0 +1,26 @@
+package com.ydtech.modules.order.entity.api.chengtai.response;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+
+@NoArgsConstructor
+@Data
+public class UnderwritingResponse extends ChengTaiBaseResponse{
+
+    @JsonProperty("finalRuleResult")
+    private String finalRuleResult;
+    @JsonProperty("data")
+    private List<DataDTO> data;
+
+    @NoArgsConstructor
+    @Data
+    public static class DataDTO {
+        @JsonProperty("reasondescription")
+        private String reasondescription;
+        @JsonProperty("riskCode")
+        private String riskCode;
+    }
+}

+ 25 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/response/UnderwritingResultResponse.java

@@ -0,0 +1,25 @@
+package com.ydtech.modules.order.entity.api.chengtai.response;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@NoArgsConstructor
+@Data
+public class UnderwritingResultResponse extends ChengTaiBaseResponse{
+
+    @JsonProperty("finalRuleResult")
+    private String finalRuleResult;
+    @JsonProperty("contractNoACCI")
+    private String contractNoACCI;
+    @JsonProperty("orderId")
+    private String orderId;
+    @JsonProperty("finalRuleResultMsg")
+    private String finalRuleResultMsg;
+    @JsonProperty("contractNoBI")
+    private String contractNoBI;
+    @JsonProperty("contractNoCI")
+    private String contractNoCI;
+    @JsonProperty("finalRuleResultEndDate")
+    private String finalRuleResultEndDate;
+}

+ 20 - 0
src/main/java/com/ydtech/modules/order/entity/api/chengtai/response/UploadFileResponse.java

@@ -0,0 +1,20 @@
+package com.ydtech.modules.order.entity.api.chengtai.response;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+
+@NoArgsConstructor
+@Data
+public class UploadFileResponse extends ChengTaiBaseResponse {
+    @JsonProperty("data")
+    private DataDTO data;
+    @NoArgsConstructor
+    @Data
+    public static class DataDTO {
+        @JsonProperty("fileIds")
+        private List<String> fileIds;
+    }
+}

+ 22 - 0
src/main/java/com/ydtech/modules/order/entity/config/ChengTaiConfigureParameters.java

@@ -0,0 +1,22 @@
+package com.ydtech.modules.order.entity.config;
+
+import com.ydtech.modules.order.constants.OrderCacheConstant;
+import lombok.Data;
+
+@Data
+public class ChengTaiConfigureParameters implements ConfigureParameters {
+
+    // 合作方代码
+    private String partnerCode;
+
+    // 合作方代码
+    private String userId; // 20230801
+
+    public String getAccessLock() {
+        return OrderCacheConstant.CT_ACCESS_LOCK + ":" + this.getPartnerCode();
+    }
+
+    public String getAccessToken() {
+        return OrderCacheConstant.CT_ACCESS_TOKEN + ":" + this.getPartnerCode();
+    }
+}

+ 16 - 0
src/main/java/com/ydtech/modules/order/entity/vo/ct/CtQuoteAccidentVo.java

@@ -0,0 +1,16 @@
+package com.ydtech.modules.order.entity.vo.ct;
+
+import com.ydtech.modules.order.entity.api.zijin.response.QueryVehicProductsResponse;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+@Data
+public class CtQuoteAccidentVo extends QueryVehicProductsResponse.ProductDtoListDTO{
+    private static final long serialVersionUID = 0x9fd5cb8e1ce77a89L;
+
+
+
+}

+ 92 - 0
src/main/java/com/ydtech/modules/order/service/ChengTaiOrderApiService.java

@@ -0,0 +1,92 @@
+package com.ydtech.modules.order.service;
+
+import com.ydtech.core.page.HttpResult;
+import com.ydtech.modules.ins.model.vo.QuoteRespVo;
+import com.ydtech.modules.order.entity.InsAreaCompany;
+import com.ydtech.modules.order.entity.InsOrders;
+import com.ydtech.modules.order.entity.api.chengtai.response.CarInfoResponse;
+import com.ydtech.modules.order.entity.dto.ReadPdfUrlListDto;
+import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
+import com.ydtech.modules.order.entity.vo.BaseQuoteVo;
+import com.ydtech.modules.order.entity.vo.PolicyPrintVo;
+import com.ydtech.modules.order.entity.vo.ct.CtQuoteAccidentVo;
+
+import java.util.List;
+
+public interface ChengTaiOrderApiService{
+
+
+    /**
+     * 报价
+     * @param quoteInfoVo 报价实体
+     * @param quoteVo
+     * @return
+     */
+    HttpResult<QuoteRespVo> quoteApi(BaseQuoteInfoVo quoteInfoVo, BaseQuoteVo<List<CtQuoteAccidentVo>> quoteVo) throws Exception;
+
+    /**
+     * 提交影像信息
+     *
+     * @param subOrderNo 子订单好
+     * @return HttpResult
+     */
+    HttpResult<Object> submitImages(String subOrderNo) throws Exception;
+
+    /**
+     * 车型查询
+     * @param modelName
+     * @return
+     */
+    CarInfoResponse modelsQuery(String modelName) throws Exception;
+
+    /**
+     * 提交核保
+     * @param companyId
+     * @return
+     */
+    HttpResult<Object> audit(String companyId) throws Exception;
+
+    /**
+     * 订单状态查询
+     * @param companyId
+     * @return
+     */
+    HttpResult<Object> getOrderDetail(String companyId) throws Exception;
+
+    /**
+     * 核保状态查询
+     * @param companyId
+     * @return
+     */
+    HttpResult<Object> auditStatusQuery(String companyId) throws Exception;
+
+    /**
+     * 电子保单
+     * @param policyPrintVo
+     * @return
+     */
+    HttpResult<String> getPolicyPrint(PolicyPrintVo policyPrintVo) throws Exception;
+
+    /**
+     * 未缴费保单撤单
+     * @param companyId
+     * @return
+     */
+    HttpResult<Object> cancel(String companyId) throws Exception;
+
+    /**
+     * 获取支付链接
+     * @param companyId
+     * @return
+     */
+    HttpResult<String> getPayUrl(String companyId) throws Exception;
+
+    /**
+     * 获取保单信息
+     * @param subOrder
+     * @param insOrders
+     * @param flag
+     * @return
+     */
+    ReadPdfUrlListDto getPolicyByCompanyIdPdfList(InsAreaCompany subOrder, InsOrders insOrders, boolean flag);
+}

+ 688 - 0
src/main/java/com/ydtech/modules/order/service/impl/ChengTaiOrderApiServiceImpl.java

@@ -0,0 +1,688 @@
+package com.ydtech.modules.order.service.impl;
+
+import cn.hutool.core.collection.CollUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.ydtech.constants.enums.InsuranceOrderPdf;
+import com.ydtech.constants.enums.InsuranceRisk;
+import com.ydtech.constants.enums.dict.InsOrderStatusEnum;
+import com.ydtech.core.page.HttpResult;
+import com.ydtech.exception.SystemException;
+import com.ydtech.modules.admin.model.vo.PersonAreaVo;
+import com.ydtech.modules.admin.service.SysAreaService;
+import com.ydtech.modules.ins.model.guoren.PremiumResp;
+import com.ydtech.modules.ins.model.vo.*;
+import com.ydtech.modules.order.components.ConfigureParametersComponents;
+import com.ydtech.modules.order.components.InsImagesUploadCacheComponents;
+import com.ydtech.modules.order.components.chengtai.ChengTaiRequestApiComponents;
+import com.ydtech.modules.order.constants.UnderwritingStatus;
+import com.ydtech.modules.order.entity.InsAreaCompany;
+import com.ydtech.modules.order.entity.InsAreaCompanyExternalPolicy;
+import com.ydtech.modules.order.entity.InsOrders;
+import com.ydtech.modules.order.entity.TaxArrears;
+import com.ydtech.modules.order.entity.api.chengtai.constants.CtKindCodeEnum;
+import com.ydtech.modules.order.entity.api.chengtai.constants.OrderStatusEnum;
+import com.ydtech.modules.order.entity.api.chengtai.constants.ResponseCode;
+import com.ydtech.modules.order.entity.api.chengtai.constants.RiskCodeEnum;
+import com.ydtech.modules.order.entity.api.chengtai.request.*;
+import com.ydtech.modules.order.entity.api.chengtai.response.*;
+import com.ydtech.modules.order.entity.api.guoren.constants.GuoRenRiskCode;
+import com.ydtech.modules.order.entity.api.zijin.constants.enums.BusType;
+import com.ydtech.modules.order.entity.api.zijin.request.UploadImageInfoListRequest;
+import com.ydtech.modules.order.entity.config.ChengTaiConfigureParameters;
+import com.ydtech.modules.order.entity.dto.ReadPdfUrlListDto;
+import com.ydtech.modules.order.entity.filter.CarModelsFilterUtils;
+import com.ydtech.modules.order.entity.po.InsTaskImagesBase64;
+import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
+import com.ydtech.modules.order.entity.vo.BaseQuoteVo;
+import com.ydtech.modules.order.entity.vo.PolicyPrintVo;
+import com.ydtech.modules.order.entity.vo.ct.CtQuoteAccidentVo;
+import com.ydtech.modules.order.service.*;
+import com.ydtech.modules.protocol.entity.po.PtlAgreementAttribution;
+import com.ydtech.modules.protocol.service.PtlAgreementAttributionService;
+import com.ydtech.utils.CalculateUtils;
+import com.ydtech.utils.StringUtils;
+import com.ydtech.utils.baidu.FileUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.HttpHeaders;
+import org.springframework.stereotype.Service;
+
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Service
+public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
+
+
+    @Autowired
+    private PtlAgreementAttributionService ptlAgreementAttributionService;
+
+    @Autowired
+    private ConfigureParametersComponents configureParametersComponents;
+
+    @Autowired
+    private ChengTaiRequestApiComponents chengTaiRequestApiComponents;
+
+    @Autowired
+    private InsOrdersService insOrdersService;
+
+    @Autowired
+    private InsAreaCompanyService insAreaCompanyService;
+
+    @Autowired
+    private InsTaskImagesService insTaskImagesService;
+
+    @Autowired
+    private SysAreaService sysAreaService;
+
+    @Autowired
+    private InsImagesUploadCacheComponents insImagesUploadCacheComponents;
+
+    @Autowired
+    private InsSubOrderUpdateDetailService insSubOrderUpdateDetailService;
+
+    @Value("${upload.file.path}")
+    private String uploadFilePath;
+
+    @Value("${upload.file.url}")
+    private String showFileUrl;
+
+    @Value("${api.url}")
+    private String apiUrl;
+
+    @Override
+    public HttpResult<QuoteRespVo> quoteApi(BaseQuoteInfoVo quoteInfoVo, BaseQuoteVo<List<CtQuoteAccidentVo>> quoteVo) throws Exception {
+        /** 1. 协议id获取配置实体 */
+        String agreementId = quoteVo.getAgreementId();
+        // 1.1 账号信息
+        PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(agreementId);
+        // 1.2 通过 协议id获取配置实体
+        ChengTaiConfigureParameters parameters = configureParametersComponents.toEntity(ChengTaiConfigureParameters.class,
+                ptlAgreementAttribution);
+        HttpHeaders httpHeaders = chengTaiRequestApiComponents.getHttpHeaders(parameters,ChengTaiRequestApiComponents.RECURSIVE_HIERARCHY);
+
+        /** 2. 查询车型 */
+        CarInfoRequest carInfoRequest = new CarInfoRequest(quoteInfoVo.getCarInfo(), parameters);
+        CarInfoResponse carInfoResponse = chengTaiRequestApiComponents.carinfoQuery(carInfoRequest, httpHeaders);
+        // 2.1 过滤车型
+        CarInfoResponse.CarModelListDTO carModelListDTO =
+                new CarModelsFilterUtils<CarInfoResponse.CarModelListDTO>().to(carInfoResponse.getCarModelList(),
+                        quoteInfoVo.getCarInfo());
+        /** 3. 计算车辆实际价值 */
+        QueryCarActualValueRequest carActualValueRequest = new QueryCarActualValueRequest(quoteInfoVo,carModelListDTO, parameters);
+        QueryCarActualValueResponse carActualValueResponse = chengTaiRequestApiComponents.queryActualValue(carActualValueRequest,httpHeaders);
+
+        /** 4. 报价 */
+        PersonAreaVo personAreaVo = new PersonAreaVo();
+        buildRegion(quoteInfoVo,personAreaVo);
+        InsurePremiumRequest insurePremiumRequest = new InsurePremiumRequest(quoteInfoVo,carModelListDTO, carActualValueResponse,personAreaVo,parameters,quoteVo);
+        InsurePremiumResponse insurePremiumResponse = chengTaiRequestApiComponents.quoteApi(insurePremiumRequest,httpHeaders);
+
+        String message = "";
+        if(!ResponseCode.R_000.getCode().equals(insurePremiumResponse.getCode())){
+            QuoteRespVo resp  = new QuoteRespVo();
+            InsOrders order = insOrdersService.getById(quoteVo.getOrderNo());
+            InsOrderStatusEnum insOrderStatusEnum = InsOrderStatusEnum.QUOTE_FAILED;
+            if(insurePremiumResponse.getMessage().contains("重复投保"))
+            {
+                insOrderStatusEnum = InsOrderStatusEnum.REPEAT_INSURE;
+            }
+            insOrdersService.responseFailedOrder(quoteVo,ptlAgreementAttribution, order,insurePremiumResponse.getMessage(),insOrderStatusEnum);
+            throw new SystemException(insurePremiumResponse.getMessage());
+        }
+
+        // 警告信息
+        CarInfoVo carInfo = quoteInfoVo.getCarInfo();
+        boolean isEnergy = carInfo.isNewEnergy();
+        QuoteRespVo quoteRespVo = getQuoteRespVo(insurePremiumResponse, quoteInfoVo, isEnergy);
+        if (!StringUtils.isEmpty(message)) {
+            ArrayList<String> objects = new ArrayList<>();
+            objects.add(message);
+            quoteRespVo.setWarnMessageList(objects);
+        }
+
+        // 设置核心报价车型
+        quoteRespVo.setCoreModels(carModelListDTO.toCoreModelsVo());
+        return responseOrder(insurePremiumResponse, quoteRespVo, ptlAgreementAttribution, insurePremiumResponse.getOrderId());
+    }
+
+    private HttpResult<QuoteRespVo> responseOrder(InsurePremiumResponse insurePremiumResponse, QuoteRespVo quoteRespVo, PtlAgreementAttribution ptlAgreementAttribution, String orderId) {
+        // 保存订单信息
+        InsAreaCompany insAreaCompany = new InsAreaCompany(quoteRespVo, ptlAgreementAttribution);
+        // 协议id
+        insAreaCompany.setReptxt(JSON.parseObject(JSON.toJSONString(insurePremiumResponse)));
+        insAreaCompany.setOrderstatus(InsOrderStatusEnum.QUOTE_ING.getCode());
+        insAreaCompany.setInsOrderNo(orderId);
+
+        // 车船税
+        if(Objects.nonNull(insurePremiumResponse.getCiContract())){
+            if(Objects.nonNull(insurePremiumResponse.getCiContract().getTax())){
+                InsurePremiumResponse.CiContractDTO.TaxDTO taxDTO = insurePremiumResponse.getCiContract().getTax();
+                TaxArrears taxArrears = new TaxArrears("往年欠税", taxDTO.getAnnualTaxDue().doubleValue(),
+                        taxDTO.getSumOverdue().doubleValue());
+                List<TaxArrears> taxArrearsList = Collections.singletonList(taxArrears);
+                insAreaCompany.setTaxArrears(JSON.parseArray(JSON.toJSONString(taxArrearsList)));
+
+            }
+        }
+        // 特约
+        insAreaCompany.setJqappoint(quoteRespVo.getJqappoint());
+        insAreaCompany.setSyappoint(quoteRespVo.getSyappoint());
+        insAreaCompanyService.insertCompanyAndOrders(insAreaCompany, new ArrayList<>());
+        quoteRespVo.setCompanyId(insAreaCompany.getId());
+        return HttpResult.ok("报价成功", quoteRespVo);
+
+    }
+
+    private QuoteRespVo getQuoteRespVo(InsurePremiumResponse insurePremiumResponse,
+                                       BaseQuoteInfoVo quoteInfoVo,
+                                       boolean isEnergy) {
+        Double jqPremium = 0D;
+        Double syPremium = 0D;
+        Double sumPayTax = 0D;
+        Double jyPremium = 0D;
+        QuoteRespVo quoteRespVo = new QuoteRespVo();
+        // 交强
+        if(Objects.nonNull(insurePremiumResponse.getCiContract())){
+            InsurePremiumResponse.CiContractDTO.ContractMainDTO ciContractMain = insurePremiumResponse.getCiContract().getContractMain();
+            jqPremium = ciContractMain.getTotalPremium().doubleValue();
+            quoteRespVo.setStartDateJq(ciContractMain.getValidDate());
+            quoteRespVo.setEndDateJq(ciContractMain.getExpiryDate());
+            //车船税
+            InsurePremiumResponse.CiContractDTO.TaxDTO taxDTO = insurePremiumResponse.getCiContract().getTax();
+            sumPayTax = taxDTO.getSumTax().doubleValue();
+        }
+        //商业
+        if(Objects.nonNull(insurePremiumResponse.getBiContract())){
+            InsurePremiumResponse.BiContractDTO.ContractMainDTO biContractMain = insurePremiumResponse.getBiContract().getContractMain();
+            syPremium = biContractMain.getTotalPremium().doubleValue();
+            quoteRespVo.setStartDateSy(biContractMain.getValidDate());
+            quoteRespVo.setEndDateSy(biContractMain.getExpiryDate());
+        }
+        // 意外险
+
+
+        List<QuoteKindRespVo> kindList1 = new ArrayList<>();
+        List<RiskInfoVo> riskList = quoteInfoVo.getRiskList();
+        //  报价险种放入保费
+        List<QuoteRiskRespVo> riskList1 = QuoteRiskRespVo.toQuoteRiskRespVoList(riskList, jqPremium, syPremium);
+
+        QuoteKindRespVo kind;
+        List<InsurePremiumResponse.BiContractDTO.CoverageDTO> coverage = new ArrayList<>();
+        if(Objects.nonNull(insurePremiumResponse.getBiContract())){
+            coverage = insurePremiumResponse.getBiContract().getCoverage();
+        }
+
+
+        // 商业险险种
+        List<KindInfoVo> kindList = quoteInfoVo.getKindList();
+        if (CollUtil.isNotEmpty(coverage)){
+            for (KindInfoVo kindInfoVo : kindList) {
+                kind = new QuoteKindRespVo();
+                kind.setKindCode(kindInfoVo.getKindCode());
+                kind.setKindName(kindInfoVo.getKindName());
+                CtKindCodeEnum ctKindCodeEnum = Enum.valueOf(CtKindCodeEnum.class, kindInfoVo.getKindCode());
+                InsurePremiumResponse.BiContractDTO.CoverageDTO coverageDTO = coverage.stream().filter(a -> a.getKindCode().equals(ctKindCodeEnum.getCode())).collect(Collectors.toList()).get(0);
+                kind.setAmount(coverageDTO.getAmount().doubleValue());
+                kind.setCoveragePremium(coverageDTO.getCoveragePremium().doubleValue());
+                kind.setUnitAmount(coverageDTO.getUnitAmount() != null ? coverageDTO.getUnitAmount().doubleValue() : 0);
+                kind.setServiceTimes(coverageDTO.getQuantity());
+                if (!ObjectUtils.isEmpty(kindInfoVo.getDeductibleRate())) {
+                    kind.setDeductibleRate(Double.parseDouble(kindInfoVo.getDeductibleRate()));
+                }
+                kindList1.add(kind);
+            }
+        }
+        quoteRespVo.setRiskList(riskList1);
+        quoteRespVo.setKindList(kindList1);
+        quoteRespVo.setJqPremium(jqPremium);
+        quoteRespVo.setSyPremium(syPremium);
+        quoteRespVo.setTaxAmount(sumPayTax);
+        quoteRespVo.setJyPremium(jyPremium);
+        quoteRespVo.setCiSumPermium(CalculateUtils.add(jqPremium, sumPayTax));//交强险和车船税合计
+        quoteRespVo.setSumPermium(CalculateUtils.add(jqPremium, syPremium, sumPayTax, jyPremium));//保费合计
+        quoteRespVo.setTotalAdjustRate(0);
+        quoteRespVo.setOrderno(quoteInfoVo.getOrderNo()); //订单号
+        // 交强特约
+        if(Objects.nonNull(insurePremiumResponse.getCiContract())){
+            List<InsurePremiumResponse.CiContractDTO.EngageDTO> ciEngageDTOS = insurePremiumResponse.getCiContract().getEngage();
+            if(CollUtil.isNotEmpty(ciEngageDTOS)){
+//                for (InsurePremiumResponse.CiContractDTO.EngageDTO ciEngageDTO : ciEngageDTOS) {
+//                    ciEngageDTO.set
+//                }
+                quoteRespVo.setJqappoint(JSON.toJSONString(ciEngageDTOS));
+            }
+        }
+
+        // 商业特约
+        if(Objects.nonNull(insurePremiumResponse.getBiContract())){
+            List<InsurePremiumResponse.BiContractDTO.EngageDTO> biEngageDTOS = insurePremiumResponse.getBiContract().getEngage();
+            if(CollUtil.isNotEmpty(biEngageDTOS)){
+                quoteRespVo.setSyappoint(JSON.toJSONString(biEngageDTOS));
+            }
+        }
+        return quoteRespVo;
+    }
+
+    /**
+     * 获取地区编码
+     * @param quoteInfoVo
+     * @param personAreaVo
+     */
+    private void buildRegion(BaseQuoteInfoVo quoteInfoVo, PersonAreaVo personAreaVo) {
+
+        //车主
+        CustomerInfoVo owner = quoteInfoVo.getOwnerInfo();
+        //被保人
+        CustomerInfoVo insured = quoteInfoVo.getInsuredPersonInfo();
+        //投保人
+        CustomerInfoVo applicant = quoteInfoVo.getPolicyHolderInfo();
+
+        //车主地区信息
+        PersonAreaVo ownerPersonAreaVo = sysAreaService.queryByAddressYc(owner.getAddr(), owner.getIdentifyNumber());
+        PersonAreaVo insuredPersonAreaVo;
+        PersonAreaVo applicantPersonAreaVo;
+
+        //车主是否与投保人相同
+        if (owner.getIdentifyNumber().equals(insured.getIdentifyNumber())) {
+            insuredPersonAreaVo = ownerPersonAreaVo;
+        } else {
+            //投保人地区信息
+            insuredPersonAreaVo = sysAreaService.queryByAddressYc(insured.getAddr(), insured.getIdentifyNumber());
+        }
+
+        //车主是否与被保人相同
+        if (owner.getIdentifyNumber().equals(applicant.getIdentifyNumber())) {
+            applicantPersonAreaVo = ownerPersonAreaVo;
+        } else { //投保人是否与被保人相同
+            if (insured.getIdentifyNumber().equals(applicant.getIdentifyNumber())) {
+                applicantPersonAreaVo = insuredPersonAreaVo;
+            } else {
+                applicantPersonAreaVo = sysAreaService.queryByAddressYc(applicant.getAddr(), applicant.getIdentifyNumber());
+            }
+        }
+
+        if (!Objects.isNull(ownerPersonAreaVo)) {
+            personAreaVo.setProvinceCode(ownerPersonAreaVo.getProvinceCode());
+            personAreaVo.setCityCode(ownerPersonAreaVo.getCityCode());
+            personAreaVo.setCountyCode(ownerPersonAreaVo.getCountyCode());
+        }
+
+        if (!Objects.isNull(insuredPersonAreaVo)) {
+            personAreaVo.setProvinceCode(insuredPersonAreaVo.getProvinceCode());
+            personAreaVo.setCityCode(insuredPersonAreaVo.getCityCode());
+            personAreaVo.setCountyCode(insuredPersonAreaVo.getCountyCode());
+        }
+
+        if (!Objects.isNull(applicantPersonAreaVo)) {
+            personAreaVo.setProvinceCode(applicantPersonAreaVo.getProvinceCode());
+            personAreaVo.setCityCode(applicantPersonAreaVo.getCityCode());
+            personAreaVo.setCountyCode(applicantPersonAreaVo.getCountyCode());
+        }
+    }
+
+    @Override
+    public HttpResult<Object> submitImages(String companyId) throws Exception {
+        InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(companyId);
+        /** 1. 协议id获取配置实体 */
+        String agreementId = insAreaCompany.getAgreementId();
+        // 1.1 账号信息
+        PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(agreementId);
+        // 1.2 通过 协议id获取配置实体
+        ChengTaiConfigureParameters parameters = configureParametersComponents.toEntity(ChengTaiConfigureParameters.class,
+                ptlAgreementAttribution);
+        HttpHeaders httpHeaders = chengTaiRequestApiComponents.getHttpHeaders(parameters,ChengTaiRequestApiComponents.RECURSIVE_HIERARCHY);
+        InsOrders insOrders = insOrdersService.getById(insAreaCompany.getOrderno());
+
+        List<InsTaskImagesBase64> insTaskImagesBase64s = insTaskImagesService.findByOrderNo(insOrders.getOrderno(),
+                insAreaCompany.getId(), true);
+        if (insTaskImagesBase64s.isEmpty()) {
+            return HttpResult.ok();
+        }
+        // 封装文件订单
+//        List<UploadImageInfoListRequest.ItemFileDataListDTO> itemFileDataListDTOS = new ArrayList<>();
+        for (InsTaskImagesBase64 insTaskImagesBase64 : insTaskImagesBase64s) {
+            UploadFileRequest uploadFileRequest = new UploadFileRequest(insTaskImagesBase64, insAreaCompany.getInsOrderNo(), parameters);
+            UploadFileResponse uploadFileResponse = chengTaiRequestApiComponents.submitImage(uploadFileRequest,httpHeaders);
+            insTaskImagesBase64.setImageId(uploadFileResponse.getData().getFileIds().get(0));
+        }
+        // 将上传的数据存入缓存
+        insImagesUploadCacheComponents.setUploadImageCache(companyId, insTaskImagesBase64s);
+        return HttpResult.ok();
+    }
+
+    @Override
+    public CarInfoResponse modelsQuery(String modelName) throws Exception {
+        CarInfoVo carInfo = new CarInfoVo();
+        carInfo.setCiCarName(modelName);
+        ChengTaiConfigureParameters parameters = new ChengTaiConfigureParameters();
+        parameters.setPartnerCode("JZG_TYTQ_SX");
+        HttpHeaders httpHeaders = chengTaiRequestApiComponents.getHttpHeaders(parameters,ChengTaiRequestApiComponents.RECURSIVE_HIERARCHY);
+        CarInfoRequest request = new CarInfoRequest(carInfo, parameters);
+        CarInfoResponse response = chengTaiRequestApiComponents.carinfoQuery(request, httpHeaders);
+        return response;
+    }
+
+    @Override
+    public HttpResult<Object> audit(String companyId) throws Exception {
+        InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(companyId);
+        InsOrders insOrders = insOrdersService.getById(insAreaCompany.getOrderno());
+        // 1 通过 协议id获取配置实体
+        PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(insAreaCompany.getAgreementId());
+        ChengTaiConfigureParameters parameters = configureParametersComponents.toEntity(ChengTaiConfigureParameters.class,
+                ptlAgreementAttribution);
+        HttpHeaders httpHeaders = chengTaiRequestApiComponents.getHttpHeaders(parameters,ChengTaiRequestApiComponents.RECURSIVE_HIERARCHY);
+        // 2 提交核保
+        JSONObject applyInfo = insOrders.getApplyinfo();
+        JSONObject insureinfo = insOrders.getInsureinfo();
+        PersonAreaVo applyPersonAreaVo = sysAreaService.queryByAddressYc(applyInfo.getString("addr"), applyInfo.getString("identifyNumber"));
+        PersonAreaVo insurePersonAreaVo = sysAreaService.queryByAddressYc(insureinfo.getString("addr"), insureinfo.getString("identifyNumber"));
+
+        List<SubmitVerifyRequest.EngageListDTO> engageDTO = new ArrayList<>();
+        // 获取特约
+        List<SubmitVerifyRequest.EngageListDTO> ciEngageDTO = JSON.parseArray(insAreaCompany.getJqappoint(),
+                SubmitVerifyRequest.EngageListDTO.class);
+        if(CollUtil.isNotEmpty(ciEngageDTO)){
+            for (SubmitVerifyRequest.EngageListDTO engageListDTO : ciEngageDTO) {
+                engageListDTO.setRiskCode(RiskCodeEnum.R1002.getCode());
+            }
+        }
+        List<SubmitVerifyRequest.EngageListDTO> biEngageDTO = JSON.parseArray(insAreaCompany.getSyappoint(),
+                SubmitVerifyRequest.EngageListDTO.class);
+        if(CollUtil.isNotEmpty(biEngageDTO)){
+            for (SubmitVerifyRequest.EngageListDTO engageListDTO : biEngageDTO) {
+                engageListDTO.setRiskCode(RiskCodeEnum.R0821.getCode());
+            }
+        }
+        if(CollUtil.isNotEmpty(ciEngageDTO)){
+            engageDTO.addAll(ciEngageDTO);
+        }
+        if(CollUtil.isNotEmpty(biEngageDTO)){
+            engageDTO.addAll(biEngageDTO);
+        }
+        // 投保保存
+        SubmitVerifyRequest submitVerifyRequest = new SubmitVerifyRequest(parameters,insAreaCompany,
+                insOrders,engageDTO,applyPersonAreaVo,insurePersonAreaVo);
+        try{
+            SubmitVerifyResponse submitVerifyResponse = chengTaiRequestApiComponents.auditSave(submitVerifyRequest,httpHeaders);
+            // 核保
+            UnderwritingRequest underwritingRequest = new UnderwritingRequest(parameters,submitVerifyResponse.getOrderId());
+            UnderwritingResponse underwritingResponse = chengTaiRequestApiComponents.audit(underwritingRequest,httpHeaders);
+
+            // 查询投保结果
+            SubmitVerifyResultRequest submitVerifyResultRequest = new SubmitVerifyResultRequest(parameters,submitVerifyResponse.getOrderId());
+            SubmitVerifyResultResponse submitVerifyResultResponse = chengTaiRequestApiComponents.auditSaveResult(submitVerifyResultRequest,httpHeaders);
+            List<SubmitVerifyResultResponse.DataDTO> data = submitVerifyResultResponse.getData();
+            if(CollUtil.isNotEmpty(data)){
+                for (SubmitVerifyResultResponse.DataDTO dataDTO : data) {
+                    if(RiskCodeEnum.R1002.getCode().equals(dataDTO.getRiskCode())){
+                        insAreaCompany.setJqpolicyno(dataDTO.getPolicyCode());
+                        insAreaCompany.setJqapplyno(dataDTO.getInsCode());
+                    }
+                    if (RiskCodeEnum.R0821.getCode().equals(dataDTO.getRiskCode())) {
+                        insAreaCompany.setSypolicyno(dataDTO.getPolicyCode());
+                        insAreaCompany.setSyapplyno(dataDTO.getInsCode());
+                    }
+                }
+            }
+            insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
+            // 获取支付链接
+            PayUrlRequest payUrlRequest = new PayUrlRequest(parameters,submitVerifyResponse.getOrderId());
+            PayUrlResponse payUrlResponse = chengTaiRequestApiComponents.getPayUrl(payUrlRequest, httpHeaders);
+            insAreaCompany.setPaymentLink(payUrlResponse.getSmsUrl());
+            insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
+            return HttpResult.ok("核保成功");
+        }catch (SystemException systemException){
+            // 查询核保结果
+            UnderwritingResultRequest resultRequest = new UnderwritingResultRequest(parameters,insAreaCompany.getInsOrderNo());
+            UnderwritingResultResponse underwritingResultResponse = chengTaiRequestApiComponents.auditResult(resultRequest,httpHeaders);
+            String uwMsg = systemException.getMessage();
+            if (OrderStatusEnum.A2001.getCode().equals(underwritingResultResponse.getFinalRuleResult())) {
+                //  add  by  hxl  添加手动更新状态
+                insSubOrderUpdateDetailService.insertData(insAreaCompany, insAreaCompany.getOrderstatus(), InsOrderStatusEnum.TO_BACK.getCode(), "1");
+                insAreaCompany.setOrderstatus(InsOrderStatusEnum.TO_BACK.getCode());
+                insAreaCompanyService.updateCompanyAndOrdersMessage(insAreaCompany, uwMsg);
+                return HttpResult.error(OrderStatusEnum.A2001.getDesc() + ":" + uwMsg);
+                // 人工核保
+            } else if (OrderStatusEnum.A2002.getCode().equals(underwritingResultResponse.getFinalRuleResult())) {
+                insAreaCompany.setUnderwritingStatus(UnderwritingStatus.US_2.getCode());
+                //  add  by  hxl  添加手动更新状态
+                insSubOrderUpdateDetailService.insertData(insAreaCompany, insAreaCompany.getOrderstatus(), InsOrderStatusEnum.WAIT_AUDIT.getCode(), "1");
+                insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_AUDIT.getCode());
+                insAreaCompanyService.updateCompanyAndOrdersMessage(insAreaCompany, uwMsg);
+                return HttpResult.error("人工核保" + ":" + uwMsg);
+            }
+
+            throw new SystemException(systemException.getMessage());
+        }
+
+    }
+
+    @Override
+    public HttpResult<Object> getOrderDetail(String companyId) throws Exception {
+        InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(companyId);
+
+        // 1 通过 协议id获取配置实体
+        PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(insAreaCompany.getAgreementId());
+        ChengTaiConfigureParameters parameters = configureParametersComponents.toEntity(ChengTaiConfigureParameters.class,
+                ptlAgreementAttribution);
+        HttpHeaders httpHeaders = chengTaiRequestApiComponents.getHttpHeaders(parameters,ChengTaiRequestApiComponents.RECURSIVE_HIERARCHY);
+
+        SubmitVerifyResultRequest submitVerifyResultRequest = new SubmitVerifyResultRequest(parameters,insAreaCompany.getInsOrderNo());
+        SubmitVerifyResultResponse submitVerifyResultResponse = chengTaiRequestApiComponents.auditSaveResult(submitVerifyResultRequest,httpHeaders);
+        // 查询核保结果
+        UnderwritingResultRequest resultRequest = new UnderwritingResultRequest(parameters,insAreaCompany.getInsOrderNo());
+        UnderwritingResultResponse underwritingResultResponse = chengTaiRequestApiComponents.auditResult(resultRequest,httpHeaders);
+        // 3. 订单生效以后修改状态
+        if (OrderStatusEnum.A7005.getCode().equals(submitVerifyResultResponse.getPolicyProsts()) || OrderStatusEnum.A7004.getCode().equals(submitVerifyResultResponse.getPolicyProsts())) {
+            // 3.1 非车险订单存入数据
+            String payTime = underwritingResultResponse.getFinalRuleResultEndDate();
+            if (StringUtils.isNotEmpty(payTime)) {
+                insAreaCompany.setPayDate(LocalDateTime.parse(payTime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
+            }
+            List<SubmitVerifyResultResponse.DataDTO> data = submitVerifyResultResponse.getData();
+            if(CollUtil.isNotEmpty(data)){
+                for (SubmitVerifyResultResponse.DataDTO dataDTO : data) {
+                    if(RiskCodeEnum.R1002.getCode().equals(dataDTO.getRiskCode())){
+                        insAreaCompany.setJqpolicyno(dataDTO.getPolicyCode());
+                        insAreaCompany.setJqapplyno(dataDTO.getInsCode());
+                    }
+                    if (RiskCodeEnum.R0821.getCode().equals(dataDTO.getRiskCode())) {
+                        insAreaCompany.setSypolicyno(dataDTO.getPolicyCode());
+                        insAreaCompany.setSyapplyno(dataDTO.getInsCode());
+                    }
+                }
+            }
+
+            //  add  by  hxl  添加手动更新状态
+            insSubOrderUpdateDetailService.insertData(insAreaCompany, insAreaCompany.getOrderstatus(), InsOrderStatusEnum.ACCEPT_INSURANCE.getCode(), "1");
+            insAreaCompany.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
+            insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
+            return HttpResult.ok("订单已支付,订单状态修改完成");
+        }
+        return HttpResult.ok("订单还未支付哦.");
+    }
+
+    @Override
+    public HttpResult<Object> auditStatusQuery(String companyId) throws Exception {
+        InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(companyId);
+
+        // 1 通过 协议id获取配置实体
+        PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(insAreaCompany.getAgreementId());
+        ChengTaiConfigureParameters parameters = configureParametersComponents.toEntity(ChengTaiConfigureParameters.class,
+                ptlAgreementAttribution);
+        HttpHeaders httpHeaders = chengTaiRequestApiComponents.getHttpHeaders(parameters,ChengTaiRequestApiComponents.RECURSIVE_HIERARCHY);
+
+        // 查询投保结果
+        SubmitVerifyResultRequest submitVerifyResultRequest = new SubmitVerifyResultRequest(parameters,insAreaCompany.getInsOrderNo());
+        SubmitVerifyResultResponse submitVerifyResultResponse = chengTaiRequestApiComponents.auditSaveResult(submitVerifyResultRequest,httpHeaders);
+        List<SubmitVerifyResultResponse.DataDTO> data = submitVerifyResultResponse.getData();
+
+        if (OrderStatusEnum.A2000.getCode().equals(submitVerifyResultResponse.getPolicyProsts())) {
+            insSubOrderUpdateDetailService.insertData(insAreaCompany, insAreaCompany.getOrderstatus(), InsOrderStatusEnum.WAIT_PAY.getCode(), "1");
+            if(CollUtil.isNotEmpty(data)){
+                for (SubmitVerifyResultResponse.DataDTO dataDTO : data) {
+                    if(RiskCodeEnum.R1002.getCode().equals(dataDTO.getRiskCode())){
+                        insAreaCompany.setJqpolicyno(dataDTO.getPolicyCode());
+                        insAreaCompany.setJqapplyno(dataDTO.getInsCode());
+                    }
+                    if (RiskCodeEnum.R0821.getCode().equals(dataDTO.getRiskCode())) {
+                        insAreaCompany.setSypolicyno(dataDTO.getPolicyCode());
+                        insAreaCompany.setSyapplyno(dataDTO.getInsCode());
+                    }
+                }
+            }
+            insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
+            // 获取支付链接
+            PayUrlRequest payUrlRequest = new PayUrlRequest(parameters,insAreaCompany.getInsOrderNo());
+            PayUrlResponse payUrlResponse = chengTaiRequestApiComponents.getPayUrl(payUrlRequest, httpHeaders);
+            insAreaCompany.setPaymentLink(payUrlResponse.getSmsUrl());
+            insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
+            //  add  by  hxl  添加手动更新状态
+            return HttpResult.ok("核保成功");
+        } else if (OrderStatusEnum.A2001.getCode().equals(submitVerifyResultResponse.getPolicyProsts())) {
+            //  add  by  hxl  添加手动更新状态
+            insSubOrderUpdateDetailService.insertData(insAreaCompany, insAreaCompany.getOrderstatus(), InsOrderStatusEnum.TO_BACK.getCode(), "1");
+            insAreaCompany.setOrderstatus(InsOrderStatusEnum.TO_BACK.getCode());
+            String uwMsg = InsOrderStatusEnum.TO_BACK.getDesc();
+            insAreaCompanyService.updateCompanyAndOrdersMessage(insAreaCompany, uwMsg);
+            return HttpResult.error(uwMsg);
+        }
+        return HttpResult.ok("核保状态未修改");
+    }
+
+    @Override
+    public HttpResult<String> getPolicyPrint(PolicyPrintVo policyPrintVo) throws Exception {
+        InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(policyPrintVo.getCompanyId());
+        if (!InsOrderStatusEnum.ACCEPT_INSURANCE.getCode().equals(insAreaCompany.getOrderstatus())) {
+            throw new SystemException("此订单还未承保");
+        }
+        // 1 通过 协议id获取配置实体
+        PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(insAreaCompany.getAgreementId());
+        ChengTaiConfigureParameters parameters = configureParametersComponents.toEntity(ChengTaiConfigureParameters.class,
+                ptlAgreementAttribution);
+        HttpHeaders httpHeaders = chengTaiRequestApiComponents.getHttpHeaders(parameters,ChengTaiRequestApiComponents.RECURSIVE_HIERARCHY);
+
+        InsOrders insOrders = insOrdersService.getById(insAreaCompany.getOrderno());
+        DownLoadDocumentUrlRequest request = new DownLoadDocumentUrlRequest(parameters,policyPrintVo.getPolicyNumber());
+        DownLoadDocumentUrlResponse response = chengTaiRequestApiComponents.downLoadDocumentUrl(request, httpHeaders);
+
+        // 车牌号
+        String licensePlate = insOrders.getLicenseno();
+        // 被保人信息
+        String templateName;
+        String url = null;
+        switch (policyPrintVo.getRiskCode()) {
+            case InsuranceRisk.TRAFFIC_CODE:
+                templateName = "-交强险保单.pdf";
+                url = response.getCiDownLoad();
+                break;
+            case InsuranceRisk.BUSINESS_CODE:
+                templateName = "-商业险保单.pdf";
+                url = response.getBiDownLoad();
+                break;
+            default:
+                throw new SystemException("保险编号异常");
+        }
+        String transferUrl = gainCarInsPolicy(url, licensePlate + templateName, insAreaCompany.getId());
+        return HttpResult.ok("生成成功", transferUrl);
+    }
+
+    @Override
+    public HttpResult<Object> cancel(String companyId) throws Exception {
+        InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(companyId);
+
+        // 1 通过 协议id获取配置实体
+        PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(insAreaCompany.getAgreementId());
+        ChengTaiConfigureParameters parameters = configureParametersComponents.toEntity(ChengTaiConfigureParameters.class,
+                ptlAgreementAttribution);
+        HttpHeaders httpHeaders = chengTaiRequestApiComponents.getHttpHeaders(parameters,ChengTaiRequestApiComponents.RECURSIVE_HIERARCHY);
+
+        // 2 请求查看订单状态
+        OrderNoRequest orderNoRequest = new OrderNoRequest(parameters,insAreaCompany.getInsOrderNo());
+        OrderNoResponse response = chengTaiRequestApiComponents.cancel(orderNoRequest, httpHeaders);
+
+        // 3 撤销成功后修改状态为报价中
+        insAreaCompany.setOrderstatus(InsOrderStatusEnum.QUOTE_ING.getCode());
+        insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
+
+        return HttpResult.ok("撤单成功");
+    }
+
+    @Override
+    public HttpResult<String> getPayUrl(String companyId) throws Exception {
+        InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(companyId);
+        // 1 通过 协议id获取配置实体
+        PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(insAreaCompany.getAgreementId());
+        ChengTaiConfigureParameters parameters = configureParametersComponents.toEntity(ChengTaiConfigureParameters.class,
+                ptlAgreementAttribution);
+        HttpHeaders httpHeaders = chengTaiRequestApiComponents.getHttpHeaders(parameters,ChengTaiRequestApiComponents.RECURSIVE_HIERARCHY);
+        // 获取支付链接
+        PayUrlRequest payUrlRequest = new PayUrlRequest(parameters,insAreaCompany.getInsOrderNo());
+        PayUrlResponse payUrlResponse = chengTaiRequestApiComponents.getPayUrl(payUrlRequest, httpHeaders);
+        insAreaCompany.setPaymentLink(payUrlResponse.getSmsUrl());
+        insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
+        return HttpResult.ok("获取成功");
+    }
+
+    @Override
+    public ReadPdfUrlListDto getPolicyByCompanyIdPdfList(InsAreaCompany insAreaCompany, InsOrders insOrders, boolean flag) {
+        String jqPath =  getPdfUrl(insAreaCompany, insOrders,InsuranceRisk.TRAFFIC_CODE,PolicyPrintVo.PolicyPrintType.PPT_2.getCode(),insAreaCompany.getJqpolicyno(),flag);
+        String syPath = getPdfUrl(insAreaCompany,insOrders,InsuranceRisk.BUSINESS_CODE,PolicyPrintVo.PolicyPrintType.PPT_2.getCode(), insAreaCompany.getSypolicyno(),flag);
+        InsAreaCompanyExternalPolicy insAreaCompanyExternalPolicy =new InsAreaCompanyExternalPolicy(insAreaCompany.getId(),jqPath,syPath,null,null);
+        return new ReadPdfUrlListDto(insAreaCompanyExternalPolicy,insAreaCompany,null);
+    }
+
+    public String getPdfUrl(InsAreaCompany insAreaCompany, InsOrders insOrders,String jqFlag,String jqSignFlag,String policyNo,boolean flag) {
+        if (!InsOrderStatusEnum.ACCEPT_INSURANCE.getCode().equals(insAreaCompany.getOrderstatus())) {
+            throw new SystemException("此订单还未承保");
+        }
+        // 被保人信息
+        String  pathPrefix = insAreaCompany.getInscompany()+"-"+insOrders.getLicenseno()+"-"+insAreaCompany.getId() +"-"+policyNo+"-";
+        if(org.apache.commons.lang3.StringUtils.isBlank(policyNo)){
+            return null;
+        }
+        // 1 通过 协议id获取配置实体
+        PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(insAreaCompany.getAgreementId());
+        ChengTaiConfigureParameters parameters = configureParametersComponents.toEntity(ChengTaiConfigureParameters.class,
+                ptlAgreementAttribution);
+        HttpHeaders httpHeaders = chengTaiRequestApiComponents.getHttpHeaders(parameters,ChengTaiRequestApiComponents.RECURSIVE_HIERARCHY);
+        // 车牌号
+        String licensePlate = insOrders.getLicenseno();
+        // 被保人信息
+        String templateName = null;
+        String url = null;
+        try{
+            DownLoadDocumentUrlRequest request = new DownLoadDocumentUrlRequest(parameters,policyNo);
+            DownLoadDocumentUrlResponse response = chengTaiRequestApiComponents.downLoadDocumentUrl(request, httpHeaders);
+            switch (jqFlag) {
+                case InsuranceRisk.TRAFFIC_CODE:
+                    templateName = pathPrefix + InsuranceOrderPdf.JQBD.getDesc();
+                    url = response.getCiDownLoad();
+                    break;
+                case InsuranceRisk.BUSINESS_CODE:
+                    templateName = pathPrefix + InsuranceOrderPdf.SYBD.getDesc();
+                    url = response.getBiDownLoad();
+                    break;
+            }
+        } catch (Exception e){
+            throw new SystemException(e.toString());
+        }
+        String transferUrl = gainCarInsPolicyNew(url, templateName, insAreaCompany.getId(),flag);
+        return transferUrl;
+    }
+
+    private String gainCarInsPolicyNew(String url, String fileName, String subOrderId,boolean flag) {
+        String dir = "carInsPolicyNew/" + subOrderId + "/";
+        return FileUtil.netUrlToFileNew(url, dir, fileName, uploadFilePath, apiUrl + showFileUrl,flag);
+    }
+    private String gainCarInsPolicy(String url, String fileName, String licensePlate) {
+        String dir = "carInsPolicy/" + licensePlate + "/";
+        return FileUtil.netUrlToFile(url, dir, fileName, uploadFilePath, apiUrl + showFileUrl);
+    }
+
+}

+ 12 - 4
src/main/java/com/ydtech/modules/order/service/impl/InsOrderPdfUrlServiceImpl.java

@@ -64,6 +64,9 @@ public class InsOrderPdfUrlServiceImpl extends ServiceImpl<InsOrderPdfUrlMapper,
     @Autowired
     private ZijinOrderApiService zijinOrderApiService;
 
+    @Autowired
+    private ChengTaiOrderApiService chengTaiOrderApiService;
+
     @Autowired
     private BoHaiOrderApiService boHaiOrderApiService;
 
@@ -218,6 +221,15 @@ public class InsOrderPdfUrlServiceImpl extends ServiceImpl<InsOrderPdfUrlMapper,
         else if(subOrder.getCompanyId().contains(InsuranceEnum.ZKIC.getCode())){
             return zijinOrderApiService.getPolicyByCompanyIdPdfList(subOrder,insOrders,flag);
         }
+        //诚泰财险 ZKIC  测试通过
+        else if(subOrder.getCompanyId().contains(InsuranceEnum.CHAC.getCode())){
+            if(subOrder.getApiType()!=null && subOrder.getApiType()==1){
+                return chengTaiOrderApiService.getPolicyByCompanyIdPdfList(subOrder,insOrders,flag);
+                //爬虫 测试通过
+            }else if(subOrder.getApiType()!=null && subOrder.getApiType()==2){
+                return insCrawlerOrderService.getPolicyByCompanyIdPdfList(subOrder,insOrders,flag);
+            }
+        }
         //渤海财险  BPIC  测试通过库中暂无驾意险保单无法测试驾意险
         else if(subOrder.getCompanyId().contains(InsuranceEnum.BPIC.getCode())){
             return boHaiOrderApiService.getPolicyByCompanyIdPdfList(subOrder,insOrders,flag);
@@ -226,10 +238,6 @@ public class InsOrderPdfUrlServiceImpl extends ServiceImpl<InsOrderPdfUrlMapper,
         else if(subOrder.getCompanyId().contains(InsuranceEnum.HBIC.getCode())){
             return insCrawlerOrderService.getPolicyByCompanyIdPdfList(subOrder,insOrders,flag);
         }
-        //诚泰财险  TPBX 爬虫 调不通
-        else if(subOrder.getCompanyId().contains(InsuranceEnum.CHAC.getCode())){
-            return insCrawlerOrderService.getPolicyByCompanyIdPdfList(subOrder,insOrders,flag);
-        }
         //安盛天平  TPBX 爬虫  测试通过
         else if(subOrder.getCompanyId().contains(InsuranceEnum.TPBX.getCode())){
             return insCrawlerOrderService.getPolicyByCompanyIdPdfList(subOrder,insOrders,flag);

+ 15 - 0
src/main/java/com/ydtech/modules/order/service/impl/InsuranceCompanyPolymerizationServiceImpl.java

@@ -32,6 +32,8 @@ public class InsuranceCompanyPolymerizationServiceImpl implements InsuranceCompa
 
     private final ZhongMeiOrderApiService zhongMeiOrderApiService;
 
+    private final ChengTaiOrderApiService chengTaiOrderApiService;
+
     @Override
     public boolean cancelOrder(InsAreaCompany insAreaCompany) {
         Integer apiType = insAreaCompany.getApiType();
@@ -102,6 +104,12 @@ public class InsuranceCompanyPolymerizationServiceImpl implements InsuranceCompa
                 // 中煤财险
             } else if (InsuranceEnum.ZMBX.getCode().equals(code)) {
                 zhongMeiOrderApiService.auditStatusQuery(insAreaCompany.getId());
+            } else if (InsuranceEnum.CHAC.getCode().equals(code)) {
+                try {
+                    chengTaiOrderApiService.auditStatusQuery(insAreaCompany.getId());
+                } catch (Exception e) {
+                    throw new RuntimeException(e);
+                }
             }
         });
     }
@@ -142,6 +150,13 @@ public class InsuranceCompanyPolymerizationServiceImpl implements InsuranceCompa
                 // 中煤财险
             } else if (InsuranceEnum.ZMBX.getCode().equals(code)) {
                 zhongMeiOrderApiService.paymentEnquiry(insAreaCompany.getId());
+            // 诚泰财险
+            } else if (InsuranceEnum.CHAC.getCode().equals(code)) {
+                try {
+                    chengTaiOrderApiService.getOrderDetail(insAreaCompany.getId());
+                } catch (Exception e) {
+                    throw new RuntimeException(e);
+                }
             }
         });
     }