Просмотр исходного кода

1.修改永城代码逻辑
2.修改国任代码逻辑

wks 2 лет назад
Родитель
Сommit
09909f9f4e
29 измененных файлов с 504 добавлено и 1304 удалено
  1. 0 74
      src/main/java/com/ydtech/components/InsAlltrustRequestApiComponents.java
  2. 19 0
      src/main/java/com/ydtech/config/properties/GuorenApiConfigurationProperties.java
  3. 18 0
      src/main/java/com/ydtech/config/properties/YongchengApiConfigurationProperties.java
  4. 1 1
      src/main/java/com/ydtech/config/properties/ZhongmeiApiConfigurationProperties.java
  5. 1 1
      src/main/java/com/ydtech/config/properties/ZijinApiConfigurationProperties.java
  6. 0 3
      src/main/java/com/ydtech/modules/ins/model/guoRen/ChannelInfoDto.java
  7. 0 20
      src/main/java/com/ydtech/modules/ins/model/guoRen/RequestDto.java
  8. 5 7
      src/main/java/com/ydtech/modules/ins/model/yc/YcBuildData.java
  9. 2 4
      src/main/java/com/ydtech/modules/ins/model/yc/ruote/Ruote.java
  10. 1 2
      src/main/java/com/ydtech/modules/ins/scheduler/InsOrderScheduler.java
  11. 3 3
      src/main/java/com/ydtech/modules/order/components/ZhongmeiRequestApiComponents.java
  12. 21 0
      src/main/java/com/ydtech/modules/order/components/gouren/GuorenRequestApiComponent.java
  13. 197 0
      src/main/java/com/ydtech/modules/order/components/yongcheng/YongchengRequestApiComponents.java
  14. 25 25
      src/main/java/com/ydtech/modules/order/components/zhongmei/ZhongmeiRepeatInsuranceComponents.java
  15. 11 11
      src/main/java/com/ydtech/modules/order/components/zijin/ZijinRequestApiComponents.java
  16. 20 26
      src/main/java/com/ydtech/modules/order/controller/GuoRenOrderApiController.java
  17. 26 43
      src/main/java/com/ydtech/modules/order/controller/YongChengOrderApiController.java
  18. 3 3
      src/main/java/com/ydtech/modules/order/controller/ZhongMeiOrderApiController.java
  19. 25 0
      src/main/java/com/ydtech/modules/order/entity/api/yongcheng/constants/RequestUrl.java
  20. 7 2
      src/main/java/com/ydtech/modules/order/entity/api/zhongmei/constants/enums/ImageTypeEnum.java
  21. 1 1
      src/main/java/com/ydtech/modules/order/entity/crawler/response/CrawlerVerifyPaymentResponse.java
  22. 3 56
      src/main/java/com/ydtech/modules/order/service/GuorenOrderApiService.java
  23. 9 41
      src/main/java/com/ydtech/modules/order/service/YongchengOrderApiService.java
  24. 12 569
      src/main/java/com/ydtech/modules/order/service/impl/GuorenOrderApiServiceImpl.java
  25. 65 334
      src/main/java/com/ydtech/modules/order/service/impl/YongchengOrderApiServiceImpl.java
  26. 12 31
      src/main/java/com/ydtech/utils/HttpXmlUtil.java
  27. 1 20
      src/main/java/com/ydtech/utils/InsUtils.java
  28. 14 20
      src/main/resources/application-prod.yml
  29. 2 7
      src/main/resources/application-test.yml

+ 0 - 74
src/main/java/com/ydtech/components/InsAlltrustRequestApiComponents.java

@@ -1,74 +0,0 @@
-package com.ydtech.components;
-
-import com.ydtech.modules.ins.model.yc.ruote.Agent;
-import lombok.Data;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Component;
-
-/**
- * 永诚API方式
- *
- * @author: lig
- * @date: 2023年02月28日 0028
- */
-@Component
-@Data
-public class InsAlltrustRequestApiComponents {
-
-    @Value("${yc.api.url}")
-    String url = "";
-
-
-    @Value("${yc.api.pay.callBack}")
-    private String payCallBack;
-
-//    @Value("${yc.api.userName}")
-//    private String userName;
-//    @Value("${yc.api.password}")
-//    private String password;
-//    @Value("${yc.api.agent.dptCde}")
-//    private String dptCde;
-//    @Value("${yc.api.agent.agentCode}")
-//    private String agentCode;
-//    @Value("${yc.api.agent.conferCode}")
-//    private String conferCode;
-//    @Value("${yc.api.agent.agentType}")
-//    private String agentType;
-//    @Value("${yc.api.agent.agentNme}")
-//    private String agentNme;
-//    @Value("${yc.api.agent.qlftNo}")
-//    private String qlftNo;
-//    @Value("${yc.api.agent.operatorCode}")
-//    private String operatorCode;
-//    @Value("${yc.api.agent.salesmanNo}")
-//    private String salesmanNo;
-//    @Value("${yc.api.agent.CChaType}")
-//    private String cChaType;
-//    @Value("${yc.api.agent.custNature}")
-//    private String custNature;
-//    @Value("${yc.api.agent.cOprcde}")
-//    private String cOprcde;
-//    @Value("${yc.api.agent.cBsnsTyp}")
-//    private String cBsnsTyp;
-
-//    private Agent agent;
-//
-//    /**
-//     * 获取渠道
-//     */
-//    public Agent gainAgent() {
-//        if (null == agent) {
-//            agent = new Agent();
-//            agent.setAgentCode(agentCode);
-//            agent.setConferCode(conferCode);
-//            agent.setAgentType(agentType);
-//            agent.setAgentNme(agentNme);
-//            agent.setQlftNo(qlftNo);
-//            agent.setCustNature(custNature);
-//            agent.setAgentProfId(qlftNo);
-//            agent.setSubCoNo(conferCode);
-//        }
-//        return agent;
-//    }
-
-}

+ 19 - 0
src/main/java/com/ydtech/config/properties/GuorenApiConfigurationProperties.java

@@ -0,0 +1,19 @@
+package com.ydtech.config.properties;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+@Data
+@Component
+@ConfigurationProperties(prefix = "guoren.api")
+public class GuorenApiConfigurationProperties {
+
+    private String baseUrl;
+
+    private String uploadUrl;
+
+    private String redirectUrl;
+
+
+}

+ 18 - 0
src/main/java/com/ydtech/config/properties/YongchengApiConfigurationProperties.java

@@ -0,0 +1,18 @@
+package com.ydtech.config.properties;
+
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+@Data
+@Component
+@ConfigurationProperties(prefix = "yc.api")
+public class YongchengApiConfigurationProperties {
+
+    // 回调地址
+    private String payCallBack;
+    // 请求地址
+    private String url;
+
+}

+ 1 - 1
src/main/java/com/ydtech/config/properties/ZmApiConfigurationProperties.java → src/main/java/com/ydtech/config/properties/ZhongmeiApiConfigurationProperties.java

@@ -14,7 +14,7 @@ import org.springframework.stereotype.Component;
 @Data
 @Component
 @ConfigurationProperties(prefix = "zm.api")
-public class ZmApiConfigurationProperties {
+public class ZhongmeiApiConfigurationProperties {
 
     private String url;
 

+ 1 - 1
src/main/java/com/ydtech/config/properties/ZjApiConfigurationProperties.java → src/main/java/com/ydtech/config/properties/ZijinApiConfigurationProperties.java

@@ -7,7 +7,7 @@ import org.springframework.stereotype.Component;
 @Data
 @Component
 @ConfigurationProperties(prefix = "zj.api")
-public class ZjApiConfigurationProperties {
+public class ZijinApiConfigurationProperties {
 
     // 为接入方提供获取token服务地址
     private String accessTokenUrl;

+ 0 - 3
src/main/java/com/ydtech/modules/ins/model/guoRen/ChannelInfoDto.java

@@ -14,19 +14,16 @@ import java.util.List;
 @Data
 public class ChannelInfoDto implements ConfigureParameters {
 
-
     @JSONField(name = "areaCode")
     private String areaCode;
     @JSONField(name = "areaName")
     private String areaName;
-
     @JSONField(name = "comName")
     private String comName;
     @JSONField(name = "businessNature")
     private String businessNature;
     @JSONField(name = "comCode")
     private String comCode;
-
     //userCode
     @JSONField(name = "handlerCode")
     private String handlerCode;

+ 0 - 20
src/main/java/com/ydtech/modules/ins/model/guoRen/RequestDto.java

@@ -121,22 +121,6 @@ public class RequestDto {
         //测试环境填”Y”;生产环境填”N”
         rHead.setIftest("N");
 
-
-
-//        rHead.setServeCode("GR0002");
-//        rHead.setChannelCode("jindouyun");
-//        rHead.setInterfaceCode(apiCode);
-//        rHead.setInterfaceUserCode("guoren_tp_jdy");
-//        rHead.setInterfacePwd("Q31gIrhZgQc=");
-//        rHead.setBusinessUuid("");
-//        rHead.setRequestTime(DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss:ssss"));
-////        rHead.setRequestTime("2018-08-17 12:12:12:0005");
-//        rHead.setXmlListSuffix("");
-//        //测试环境填”Y”;生产环境填”N”
-//        rHead.setIftest("Y");
-
-
-
         RequestDto.RequestPackage rpackage = new RequestDto.RequestPackage();
         rpackage.setRHead(rHead);
 
@@ -146,9 +130,5 @@ public class RequestDto {
 
         return JSON.toJSONString(dto);
 
-
-
-
-//        return dto;
     }
 }

+ 5 - 7
src/main/java/com/ydtech/modules/ins/model/yc/YcBuildData.java

@@ -29,11 +29,8 @@ import java.util.stream.Collectors;
 @Component
 public class YcBuildData {
 
-
     //身份证有效期   长期可传:2099-12-30
     public static String ID_CARD_INDATE = "2099-12-30";
-
-
     //接口 车型查询
     public static String API_MODEL = "newQueryVehicleTypesService";
     //接口 报价
@@ -433,18 +430,19 @@ public class YcBuildData {
      * @date: 2023年02月07日 0007
      */
     public static String cleanResponseStr(String responseData) {
-        String str = "";
         String rStr = "";
+        String str = "";
         if (responseData.indexOf("<response>") > 0) {
             rStr = responseData.substring(responseData.indexOf("<response>") + 10, responseData.indexOf("</response>"));
         } else if (responseData.indexOf("<return>") > 0) {
             rStr = responseData.substring(responseData.indexOf("<return>") + 8, responseData.indexOf("</return>"));
         }
-//        if(StringUtils.isEmpty(rStr)){
-//            rStr = responseData.substring(responseData.indexOf("<response>") + 10, responseData.indexOf("</response>"));
-//        }
+        if(StringUtils.isEmpty(rStr)){
+            rStr = responseData.substring(responseData.indexOf("<response>") + 10, responseData.indexOf("</response>"));
+        }
         String lRStr = rStr.replaceAll("&lt;", "<");
         str = lRStr.replaceAll("&gt;", ">");
+
         return str.trim();
     }
 

+ 2 - 4
src/main/java/com/ydtech/modules/ins/model/yc/ruote/Ruote.java

@@ -3,7 +3,7 @@ package com.ydtech.modules.ins.model.yc.ruote;
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
-import com.ydtech.components.InsAlltrustRequestApiComponents;
+import com.ydtech.config.properties.YongchengApiConfigurationProperties;
 import com.ydtech.modules.ins.model.vo.RiskInfoVo;
 import com.ydtech.modules.ins.model.ya.YaQuoteInfoVo;
 import com.ydtech.modules.ins.model.yc.AuthorityDataXml;
@@ -155,7 +155,7 @@ public class Ruote {
      * @author: lig
      * @date: 2023年02月08日 0008
      */
-    public static Ruote buildQuoteParam(YaQuoteInfoVo yaQuoteInfoVo, YcConfigureParameters ycConfigureParameters, InsAlltrustRequestApiComponents apiComponents, AccidentalDrivingVo adVo) {
+    public static Ruote buildQuoteParam(YaQuoteInfoVo yaQuoteInfoVo, YcConfigureParameters ycConfigureParameters, YongchengApiConfigurationProperties apiComponents, AccidentalDrivingVo adVo) {
 
         Ruote m = new Ruote();
         Ruote.RequestLabel requestLabel = new Ruote.RequestLabel();
@@ -173,8 +173,6 @@ public class Ruote {
 
         List<RiskInfoVo> riskList = yaQuoteInfoVo.getRiskList();
 
-
-
         /**
          * 基本信息 base
          */

+ 1 - 2
src/main/java/com/ydtech/modules/ins/scheduler/InsOrderScheduler.java

@@ -39,8 +39,7 @@ public class InsOrderScheduler {
     HuanongService huanongService;
     @Resource
     HengbangService hengbangService;
-    @Resource
-    InsAlltrustApiService insYongchengApiService;
+
 //    @Resource
 //    InsGuoRenApiService insGuoRenApiService;
 

+ 3 - 3
src/main/java/com/ydtech/modules/order/components/ZhongmeiRequestApiComponents.java

@@ -2,7 +2,7 @@ package com.ydtech.modules.order.components;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.serializer.SerializerFeature;
-import com.ydtech.config.properties.ZmApiConfigurationProperties;
+import com.ydtech.config.properties.ZhongmeiApiConfigurationProperties;
 import com.ydtech.constants.InsuranceEnum;
 import com.ydtech.exception.SystemException;
 import com.ydtech.modules.order.entity.api.zhongmei.BaseRequest;
@@ -36,11 +36,11 @@ import java.util.List;
 public class ZhongmeiRequestApiComponents {
 
 
-    private final ZmApiConfigurationProperties properties;
+    private final ZhongmeiApiConfigurationProperties properties;
 
     private final RestTemplate restTemplate;
 
-    public ZhongmeiRequestApiComponents(ZmApiConfigurationProperties zmApiConfigurationProperties, RestTemplate restTemplate) {
+    public ZhongmeiRequestApiComponents(ZhongmeiApiConfigurationProperties zmApiConfigurationProperties, RestTemplate restTemplate) {
         this.properties = zmApiConfigurationProperties;
         this.restTemplate = restTemplate;
     }

+ 21 - 0
src/main/java/com/ydtech/modules/order/components/gouren/GuorenRequestApiComponent.java

@@ -0,0 +1,21 @@
+package com.ydtech.modules.order.components.gouren;
+
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+
+
+/**
+ * @version
+ * @description: 国任财险
+ * @author: wenks
+ * @date: 2023/10/26 15:54
+ **/
+@Slf4j
+@Component
+public class GuorenRequestApiComponent {
+
+
+
+
+}

+ 197 - 0
src/main/java/com/ydtech/modules/order/components/yongcheng/YongchengRequestApiComponents.java

@@ -0,0 +1,197 @@
+package com.ydtech.modules.order.components.yongcheng;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.*;
+import com.fasterxml.jackson.dataformat.xml.XmlMapper;
+import com.ydtech.config.properties.YongchengApiConfigurationProperties;
+import com.ydtech.constants.InsuranceEnum;
+import com.ydtech.exception.SystemException;
+import com.ydtech.modules.ins.model.yc.YcBuildData;
+import com.ydtech.modules.ins.model.yc.accident.Accident;
+import com.ydtech.modules.ins.model.yc.audit.Audit;
+import com.ydtech.modules.ins.model.yc.audit.response.AuditResponse;
+import com.ydtech.modules.ins.model.yc.callbackAnOrder.CallbackAnOrder;
+import com.ydtech.modules.ins.model.yc.imageUp.ImageUp;
+import com.ydtech.modules.ins.model.yc.imageUp.response.ImageUpResponse;
+import com.ydtech.modules.ins.model.yc.modelsQuery.ModelsQueryResponse;
+import com.ydtech.modules.ins.model.yc.modelsQuery.ModelsQueryXml;
+import com.ydtech.modules.ins.model.yc.pay.Pay;
+import com.ydtech.modules.ins.model.yc.pay.response.AccidentResponse;
+import com.ydtech.modules.ins.model.yc.pay.response.PayResponse;
+import com.ydtech.modules.ins.model.yc.policy.Policy;
+import com.ydtech.modules.ins.model.yc.policy.response.PolicyResponse;
+import com.ydtech.modules.ins.model.yc.ruote.Ruote;
+import com.ydtech.modules.ins.model.yc.ruote.response.RuoteResponse;
+import com.ydtech.modules.order.entity.api.yongcheng.constants.RequestUrl;
+import com.ydtech.modules.order.utils.InsuranceLog;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.text.StringEscapeUtils;
+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.util.ObjectUtils;
+import org.springframework.web.client.RestTemplate;
+
+
+/**
+ * @description: 永诚财险
+ * @author: wenks
+ * @date: 2023/10/26 11:26
+ **/
+
+@Slf4j
+@Component
+public class YongchengRequestApiComponents {
+
+    private final RestTemplate restTemplate;
+
+    private final YongchengApiConfigurationProperties apiComponents;
+
+    public YongchengRequestApiComponents(RestTemplate restTemplate, YongchengApiConfigurationProperties apiComponents) {
+        this.restTemplate = restTemplate;
+        this.apiComponents = apiComponents;
+    }
+
+    private ObjectMapper gainXmlMapper() {
+        ObjectMapper xmlMapper = new XmlMapper();
+        xmlMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+        xmlMapper.configure(SerializationFeature.WRAP_ROOT_VALUE, false);
+        xmlMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
+        xmlMapper.setPropertyNamingStrategy(PropertyNamingStrategy.UPPER_CAMEL_CASE);
+        xmlMapper.enable(MapperFeature.USE_STD_BEAN_NAMING);
+        xmlMapper.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true);
+        return xmlMapper;
+    }
+
+
+    /**
+     * @param q      请求参数
+     * @param tClass 响应类型
+     * @param <Q>    Request 请求体
+     * @param <S>    Response 响应体
+     * @return <S>
+     */
+    private <Q, S> S post(Q q, RequestUrl requestUrl, Class<S> tClass) throws JsonProcessingException {
+
+        String url = apiComponents.getUrl() + requestUrl.getUri();
+
+        HttpHeaders httpHeaders = new HttpHeaders();
+        MediaType mediaType = MediaType.parseMediaType("text/xml;charset=UTF-8");
+        httpHeaders.setContentType(mediaType);
+
+        String xmlString = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:tns=\"http://newWS.front.app.echannel.ebiz.alltrust.com/\">";
+        xmlString += "<soapenv:Body>";
+
+        xmlString += gainXmlMapper().writeValueAsString(q);
+
+        xmlString += "</soapenv:Body>\n" +
+                "</soapenv:Envelope>";
+
+        InsuranceLog.infoLog(InsuranceEnum.AICS.getPinyin(), "\n\t---------> URl: {} \n---------> 保险公司:{} {}\n---------> 请求参数:{}", url, InsuranceEnum.AICS.getName(), requestUrl.getDesc(), xmlString);
+        HttpEntity<String> httpEntity = new HttpEntity<>(xmlString, httpHeaders);
+
+        ResponseEntity<String> response = restTemplate.postForEntity(url, httpEntity, String.class);
+        String body = response.getBody();
+
+        String responseStringMsg = StringEscapeUtils.unescapeXml(body);
+        InsuranceLog.infoLog(InsuranceEnum.AICS.getPinyin(), "\n\n---------> 响应参数:{}", responseStringMsg);
+
+        String cleanStr = YcBuildData.cleanResponseStr(responseStringMsg);
+
+        S bean = gainXmlMapper().readValue(cleanStr, tClass);
+
+        if (ObjectUtils.isEmpty(bean)) {
+            throw new SystemException("请求失败");
+        }
+
+        return bean;
+    }
+
+    /**
+     * 车型查询
+     *
+     * @param modelsQueryXml 车型查询 入参实体
+     * @return 出参实体
+     */
+    public ModelsQueryResponse newQueryVehicleTypes(ModelsQueryXml modelsQueryXml) throws JsonProcessingException {
+        return post(modelsQueryXml, RequestUrl.API_MODEL, ModelsQueryResponse.class);
+    }
+
+    /**
+     * 保费计算
+     *
+     * @param ruote 报价 入参实体
+     * @return 出参实体
+     */
+    public RuoteResponse newPremiumXnyCalculation(Ruote ruote) throws JsonProcessingException {
+        return post(ruote, RequestUrl.API_QUOTE, RuoteResponse.class);
+    }
+
+    /**
+     * 核保
+     *
+     * @param audit 核保 入参实体
+     * @return 出参实体
+     */
+    public AuditResponse newXnyUnderwritingService(Audit audit) throws JsonProcessingException {
+        return post(audit, RequestUrl.API_AUDIT, AuditResponse.class);
+    }
+
+    /**
+     * 核保
+     *
+     * @param audit 核保 入参实体
+     * @return 出参实体
+     */
+    public ImageUpResponse newImageUp(ImageUp audit) throws JsonProcessingException {
+        return post(audit, RequestUrl.API_UPLOAD, ImageUpResponse.class);
+    }
+
+
+    /**
+     * 支付链接
+     *
+     * @param pay 支付链接 入参实体
+     * @return 出参实体
+     */
+    public PayResponse newGetPayNo(Pay pay) throws JsonProcessingException {
+        return post(pay, RequestUrl.API_PAY, PayResponse.class);
+    }
+
+
+    /**
+     * 意外险
+     *
+     * @param accident 意外险 入参实体
+     * @return 出参实体
+     */
+    public AccidentResponse newQueryYwCvrgWeb(Accident accident) throws JsonProcessingException {
+        return post(accident, RequestUrl.API_ACCIDENT, AccidentResponse.class);
+    }
+
+
+    /**
+     * 补传回调及订单信息查询接口
+     *
+     * @param callbackAnOrder 补传回调及订单信息查询接口 入参实体
+     * @return 出参实体
+     */
+    public String payCallback(CallbackAnOrder callbackAnOrder) throws JsonProcessingException {
+        return post(callbackAnOrder, RequestUrl.API_ORDER_QUERY, String.class);
+    }
+
+
+    /**
+     * 电子保单
+     *
+     * @param policy 电子保单 入参实体
+     * @return 出参实体
+     */
+    public PolicyResponse dzbdWeb(Policy policy) throws JsonProcessingException {
+        return post(policy, RequestUrl.API_GUARANTEE_SLIP, PolicyResponse.class);
+    }
+
+}

+ 25 - 25
src/main/java/com/ydtech/modules/order/components/zhongmei/ZhongmeiRepeatInsuranceComponents.java

@@ -36,18 +36,17 @@ public class ZhongmeiRepeatInsuranceComponents {
     }
 
 
-
     public QuotedPriceResponse dealRepeatDate(QuotedPriceRequest quotedPriceRequest, QuotedPriceResponse quotedPriceResponse, BaseQuoteInfoVo quoteInfo) {
         String rtnMsgBz = "";
         String rtnMsgBusi = "";
         List<RiskInfoVo> riskList = quoteInfo.getRiskList();
-        if(quotedPriceResponse.getForcePlatformMsg()!=null){
+        if (quotedPriceResponse.getForcePlatformMsg() != null) {
             rtnMsgBz = quotedPriceResponse.getForcePlatformMsg().getAnswer();
         }
-        if(quotedPriceResponse.getBizPlatformMsg()!=null){
+        if (quotedPriceResponse.getBizPlatformMsg() != null) {
             rtnMsgBusi = quotedPriceResponse.getBizPlatformMsg().getAnswer();
         }
-        InsuranceLog.infoLog(InsuranceEnum.ZMBX.getPinyin(), "\n\t---------> {}\n\t---------> {}", "中煤财险重复投保处理", rtnMsgBz+rtnMsgBusi);
+        InsuranceLog.infoLog(InsuranceEnum.ZMBX.getPinyin(), "\n\t---------> {}\n\t---------> {}", "中煤财险重复投保处理", rtnMsgBz + rtnMsgBusi);
        /* rtnMsgBz = "交强险平台返回:号牌号码“晋HQE092”的保单发生重复投保,与其重复投保的其它公司的保单信息如下:投保确认码 02CCIC140022102196416712744293;保单号 PDFA22140123250000001413;起保日期 2022-10-24 00:00;终保日期 2023-10-24 00:00;号牌号码 晋HQE092;号牌种类 02;车架号 LSGBC5356HG101426;发动机号 170971343;地区 山西。";
         rtnMsgBusi = "平台校验:成功 投保查询码:V0101ZMBX140023092205710579353 平台校验,可能存在重复投保,请关注以下平台返回的信息。保单号:6605212022140193005587; 保险公司:中国人寿财产保险公司: 起保日期:2022-10-1600:00:00; 终保日期:2023-10-16; 录单日期:2022-09-15; 险种名称:机动车第三者责任保险: 号牌号码:晋A711BW; 号牌种类代码:02; 号牌底色:01; 车辆识别代号: LGWEF4A52HF424155; 发动机号:1725091016";
 */
@@ -55,11 +54,11 @@ public class ZhongmeiRepeatInsuranceComponents {
         QuotedPriceRequest.ContractDTO.ContractMainDTO contractMainDTOBusi = null;
         List<QuotedPriceRequest.ContractDTO> contractDTOList = quotedPriceRequest.getBusinessData().getContract();
 
-        for(QuotedPriceRequest.ContractDTO contractDTO :contractDTOList){
-            QuotedPriceRequest.ContractDTO.ContractMainDTO contractMainDTO =contractDTO.getContractMain();
-            if("0330".equals(contractMainDTO.getRiskCode())){
+        for (QuotedPriceRequest.ContractDTO contractDTO : contractDTOList) {
+            QuotedPriceRequest.ContractDTO.ContractMainDTO contractMainDTO = contractDTO.getContractMain();
+            if ("0330".equals(contractMainDTO.getRiskCode())) {
                 contractMainDTOBiz = contractDTO.getContractMain();
-            }else{
+            } else {
                 contractMainDTOBusi = contractDTO.getContractMain();
             }
 
@@ -67,13 +66,13 @@ public class ZhongmeiRepeatInsuranceComponents {
         String jqEndDate = "";
         String syEndDate = "";
 
-        if (StringUtils.isNotEmpty(rtnMsgBz) && rtnMsgBz.contains("起保日期")&& rtnMsgBz.contains("终保日期")) {
+        if (StringUtils.isNotEmpty(rtnMsgBz) && rtnMsgBz.contains("起保日期") && rtnMsgBz.contains("终保日期")) {
             String coverageEndDate = rtnMsgBz.substring(rtnMsgBz.indexOf("终保日期") + 5, rtnMsgBz.indexOf("终保日期") + 5 + 16);
             LocalDateTime start = DateTimeUtil.parseLocalDateTime(coverageEndDate, DateTimeUtil.DATETIME_PATTERN_EXT1);
             jqEndDate = DateTimeUtil.getStartTimeOfDayStr(start, DateTimeUtil.DATETIME_PATTERN);
-            contractMainDTOBiz = getPeriodDate(jqEndDate,contractMainDTOBiz);
-            for (RiskInfoVo riskInfoVo : riskList){
-                if(InsuranceRisk.TRAFFIC.getCode().equals(riskInfoVo.getRiskCode())){
+            contractMainDTOBiz = getPeriodDate(jqEndDate, contractMainDTOBiz);
+            for (RiskInfoVo riskInfoVo : riskList) {
+                if (InsuranceRisk.TRAFFIC.getCode().equals(riskInfoVo.getRiskCode())) {
                     riskInfoVo.setStartDate(contractMainDTOBiz.getValidDate());
                     riskInfoVo.setEndDate(contractMainDTOBiz.getExpiryDate());
                 }
@@ -81,14 +80,14 @@ public class ZhongmeiRepeatInsuranceComponents {
         }
 
         // 商业险
-        if (StringUtils.isNotEmpty(rtnMsgBusi) && rtnMsgBusi.contains("起保日期")&& rtnMsgBusi.contains("终保日期"))  {
+        if (StringUtils.isNotEmpty(rtnMsgBusi) && rtnMsgBusi.contains("起保日期") && rtnMsgBusi.contains("终保日期")) {
             String coverageEndDate = rtnMsgBusi.substring(rtnMsgBusi.indexOf("终保日期") + 5, rtnMsgBusi.indexOf("终保日期") + 5 + 10);
             DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
             LocalDateTime start = LocalDate.parse(coverageEndDate, dateTimeFormatter).atStartOfDay();
             syEndDate = DateTimeUtil.getStartTimeOfDayStr(start, DateTimeUtil.DATETIME_PATTERN);
-            contractMainDTOBusi = getPeriodDate(syEndDate,contractMainDTOBusi);
-            for (RiskInfoVo riskInfoVo : riskList){
-                if(InsuranceRisk.BUSINESS.getCode().equals(riskInfoVo.getRiskCode())){
+            contractMainDTOBusi = getPeriodDate(syEndDate, contractMainDTOBusi);
+            for (RiskInfoVo riskInfoVo : riskList) {
+                if (InsuranceRisk.BUSINESS.getCode().equals(riskInfoVo.getRiskCode())) {
                     riskInfoVo.setStartDate(contractMainDTOBiz.getValidDate());
                     riskInfoVo.setEndDate(contractMainDTOBiz.getExpiryDate());
                 }
@@ -101,6 +100,7 @@ public class ZhongmeiRepeatInsuranceComponents {
 
         return zhongmeiRequestApiComponents.quotedPrice(quotedPriceRequest, QuotedPriceResponse.class);
     }
+
     public QuotedPriceResponse dealRepeatDateFormError(QuotedPriceRequest quotedPriceRequest, QuotedPriceResponse quotedPriceResponse, BaseQuoteInfoVo quoteInfo) {
         InsuranceLog.infoLog(InsuranceEnum.ZMBX.getPinyin(), "\n\t---------> {}\n\t---------> {}", "中煤财险重复投保处理", quotedPriceResponse.getHead().getReturnMessage());
         String rtnMsgBusi = quotedPriceResponse.getHead().getReturnMessage();
@@ -112,25 +112,25 @@ public class ZhongmeiRepeatInsuranceComponents {
         QuotedPriceRequest.ContractDTO.ContractMainDTO contractMainDTOBusi = null;
         List<QuotedPriceRequest.ContractDTO> contractDTOList = quotedPriceRequest.getBusinessData().getContract();
 
-        for(QuotedPriceRequest.ContractDTO contractDTO :contractDTOList){
-            QuotedPriceRequest.ContractDTO.ContractMainDTO contractMainDTO =contractDTO.getContractMain();
-            if("0330".equals(contractMainDTO.getRiskCode())){
+        for (QuotedPriceRequest.ContractDTO contractDTO : contractDTOList) {
+            QuotedPriceRequest.ContractDTO.ContractMainDTO contractMainDTO = contractDTO.getContractMain();
+            if ("0330".equals(contractMainDTO.getRiskCode())) {
                 contractMainDTOBiz = contractDTO.getContractMain();
-            }else{
+            } else {
                 contractMainDTOBusi = contractDTO.getContractMain();
             }
 
         }
         String syEndDate = "";
         // 商业险
-        if (StringUtils.isNotEmpty(rtnMsgBusi) && rtnMsgBusi.contains("起保日期")&& rtnMsgBusi.contains("终保日期"))  {
+        if (StringUtils.isNotEmpty(rtnMsgBusi) && rtnMsgBusi.contains("起保日期") && rtnMsgBusi.contains("终保日期")) {
             String coverageEndDate = rtnMsgBusi.substring(rtnMsgBusi.indexOf("终保日期") + 5, rtnMsgBusi.indexOf("终保日期") + 5 + 10);
             DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
             LocalDateTime start = LocalDate.parse(coverageEndDate, dateTimeFormatter).atStartOfDay().plusDays(1);
             syEndDate = DateTimeUtil.getStartTimeOfDayStr(start, DateTimeUtil.DATETIME_PATTERN);
-            contractMainDTOBusi = getPeriodDate(syEndDate,contractMainDTOBusi);
-            for (RiskInfoVo riskInfoVo : riskList){
-                if(InsuranceRisk.BUSINESS.getCode().equals(riskInfoVo.getRiskCode())){
+            contractMainDTOBusi = getPeriodDate(syEndDate, contractMainDTOBusi);
+            for (RiskInfoVo riskInfoVo : riskList) {
+                if (InsuranceRisk.BUSINESS.getCode().equals(riskInfoVo.getRiskCode())) {
                     riskInfoVo.setStartDate(contractMainDTOBiz.getValidDate());
                     riskInfoVo.setEndDate(contractMainDTOBiz.getExpiryDate());
                 }
@@ -140,7 +140,7 @@ public class ZhongmeiRepeatInsuranceComponents {
         return zhongmeiRequestApiComponents.quotedPrice(quotedPriceRequest, QuotedPriceResponse.class);
     }
 
-    private QuotedPriceRequest.ContractDTO.ContractMainDTO  getPeriodDate(String startDate, QuotedPriceRequest.ContractDTO.ContractMainDTO contractMainDTO){
+    private QuotedPriceRequest.ContractDTO.ContractMainDTO getPeriodDate(String startDate, QuotedPriceRequest.ContractDTO.ContractMainDTO contractMainDTO) {
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
         LocalDate localDate = LocalDate.parse(startDate, formatter);
         LocalDate nextYears = localDate.plusYears(1);

+ 11 - 11
src/main/java/com/ydtech/modules/order/components/zijin/ZijinRequestApiComponents.java

@@ -1,7 +1,7 @@
 package com.ydtech.modules.order.components.zijin;
 
 
-import com.ydtech.config.properties.ZjApiConfigurationProperties;
+import com.ydtech.config.properties.ZijinApiConfigurationProperties;
 import com.ydtech.constants.InsuranceEnum;
 import com.ydtech.exception.SystemException;
 import com.ydtech.modules.order.components.ConfigureParametersComponents;
@@ -45,7 +45,7 @@ public class ZijinRequestApiComponents {
 
     private final InsCrawlerOrderComponents insCrawlerOrderComponents;
 
-    private final ZjApiConfigurationProperties zjApiConfigurationProperties;
+    private final ZijinApiConfigurationProperties zijinApiConfigurationProperties;
 
     private final ConfigureParametersComponents configureParametersComponents;
 
@@ -55,11 +55,11 @@ public class ZijinRequestApiComponents {
 
     private final Map<String, ResponseMessageAbstractHandler> handlerMap;
 
-    public ZijinRequestApiComponents(InsCrawlerOrderComponents insCrawlerOrderComponents, ZjApiConfigurationProperties zjApiConfigurationProperties,
+    public ZijinRequestApiComponents(InsCrawlerOrderComponents insCrawlerOrderComponents, ZijinApiConfigurationProperties zijinApiConfigurationProperties,
                                      ConfigureParametersComponents configureParametersComponents, StringRedisTemplate redisTemplate,
                                      RedissonClient redissonClient, Map<String, ResponseMessageAbstractHandler> handlerMap) {
         this.insCrawlerOrderComponents = insCrawlerOrderComponents;
-        this.zjApiConfigurationProperties = zjApiConfigurationProperties;
+        this.zijinApiConfigurationProperties = zijinApiConfigurationProperties;
         this.configureParametersComponents = configureParametersComponents;
         this.redisTemplate = redisTemplate;
         this.redissonClient = redissonClient;
@@ -73,14 +73,14 @@ public class ZijinRequestApiComponents {
     }
 
     public <T, B extends BaseResponse> B requestQuotation(RequestUrl requestUrl, T requestBody, Class<B> responseType, HttpHeaders httpHeaders) {
-        String url = zjApiConfigurationProperties.getUrl() + requestUrl.getUri();
+        String url = zijinApiConfigurationProperties.getUrl() + requestUrl.getUri();
         B b = insCrawlerOrderComponents.request(url, InsuranceEnum.ZKIC, requestUrl.getDesc(), requestBody, responseType, httpHeaders);
         ResultEnum.verifyQuotation(b.getRtnCode(), b.getRtnMsg());
         return b;
     }
 
     public <T, B extends BaseResponse> B request(RequestUrl requestUrl, T requestBody, Class<B> responseType, HttpHeaders httpHeaders) {
-        String url = zjApiConfigurationProperties.getUrl() + requestUrl.getUri();
+        String url = zijinApiConfigurationProperties.getUrl() + requestUrl.getUri();
         return request(url, requestUrl.getDesc(), requestBody, responseType, httpHeaders);
     }
 
@@ -183,7 +183,7 @@ public class ZijinRequestApiComponents {
      * @return 出参实体
      */
     public GetAccessTokenResponse getAccessToken(GetAccessTokenRequest getAccessTokenRequest) {
-        String url = zjApiConfigurationProperties.getAccessTokenUrl();
+        String url = zijinApiConfigurationProperties.getAccessTokenUrl();
         GetAccessTokenResponse response = insCrawlerOrderComponents.request(url, InsuranceEnum.ZKIC, "为接入方提供获取token服务", getAccessTokenRequest, GetAccessTokenResponse.class);
         ResultEnum.verify(response.getRtnCode(), response.getRtnMsg());
         return response;
@@ -300,7 +300,7 @@ public class ZijinRequestApiComponents {
      * @return 出参实体
      */
     public ZbfAggregatePayResponse zbfAggregatePay(ZbfAggregatePayRequest zbfAggregatePayRequest, HttpHeaders httpHeaders) {
-        return request(zjApiConfigurationProperties.getPayUrl(), RequestUrl.ZBF_AGGREGATE_PAY.getDesc(), zbfAggregatePayRequest, ZbfAggregatePayResponse.class, httpHeaders);
+        return request(zijinApiConfigurationProperties.getPayUrl(), RequestUrl.ZBF_AGGREGATE_PAY.getDesc(), zbfAggregatePayRequest, ZbfAggregatePayResponse.class, httpHeaders);
     }
 
     /**
@@ -310,7 +310,7 @@ public class ZijinRequestApiComponents {
      * @return 出参实体
      */
     public QueryOrderDetailResponse getOrderDetail(OrderNoRequest orderNoRequest, HttpHeaders httpHeaders) {
-        String url = zjApiConfigurationProperties.getOrderUrl() + "?orderNo=" + orderNoRequest.getOrderNo();
+        String url = zijinApiConfigurationProperties.getOrderUrl() + "?orderNo=" + orderNoRequest.getOrderNo();
         return request(url, RequestUrl.GET_ORDER_DETAIL.getDesc(), null, QueryOrderDetailResponse.class, httpHeaders);
     }
 
@@ -321,7 +321,7 @@ public class ZijinRequestApiComponents {
      * @return 出参实体
      */
     public QueryOrderStateResponse queryOrderDetail(QueryOrderDetailRequest queryOrderDetailRequest, HttpHeaders httpHeaders) {
-        return request(zjApiConfigurationProperties.getOrderDetailUrl(), RequestUrl.QUERY_ORDER_DETAIL.getDesc(), queryOrderDetailRequest, QueryOrderStateResponse.class, httpHeaders);
+        return request(zijinApiConfigurationProperties.getOrderDetailUrl(), RequestUrl.QUERY_ORDER_DETAIL.getDesc(), queryOrderDetailRequest, QueryOrderStateResponse.class, httpHeaders);
     }
 
 
@@ -344,7 +344,7 @@ public class ZijinRequestApiComponents {
      */
     public String getDownLoadDocumentUrl(String busNo, String busType, String identifyNo) {
         String parameter = String.format("?busNo=%s&busType=%s&identifyNo=%s", busNo, busType, identifyNo);
-        String downLoadDocument = zjApiConfigurationProperties.getDownLoadDocument();
+        String downLoadDocument = zijinApiConfigurationProperties.getDownLoadDocument();
         return downLoadDocument + parameter;
     }
 

+ 20 - 26
src/main/java/com/ydtech/modules/ins/controller/InsGuoRenController.java → src/main/java/com/ydtech/modules/order/controller/GuoRenOrderApiController.java

@@ -1,18 +1,19 @@
-package com.ydtech.modules.ins.controller;
+package com.ydtech.modules.order.controller;
 
 
 import com.ydtech.aop.request.RequestSingleParam;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.ins.model.vo.CarInfoVo;
-import com.ydtech.modules.ins.service.InsGuoRenApiService;
 import com.ydtech.modules.order.entity.vo.AccidentalDrivingQueryVo;
 import com.ydtech.modules.order.entity.vo.AccidentalDrivingVo;
 import com.ydtech.modules.order.entity.vo.BaseQuoteVo;
 import com.ydtech.modules.order.entity.vo.PolicyPrintVo;
+import com.ydtech.modules.order.service.GuorenOrderApiService;
 import com.ydtech.modules.order.service.InsAreaCompanyService;
 import io.swagger.annotations.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
@@ -28,15 +29,15 @@ import javax.validation.Valid;
 @Api(tags = "国任财险API方式对接")
 @RestController
 @RequestMapping("/api/guoRen")
-public class InsGuoRenController {
+public class GuoRenOrderApiController {
 
     private static final Logger log = LoggerFactory.getLogger("guoRen");
 
-    @Resource
-    InsGuoRenApiService insGuoRenApiService;
+    private final GuorenOrderApiService guorenOrderApiService;
 
-    @Resource
-    InsAreaCompanyService insAreaCompanyService;
+    public GuoRenOrderApiController(GuorenOrderApiService guorenOrderApiService) {
+        this.guorenOrderApiService = guorenOrderApiService;
+    }
 
     @ApiOperation(value = "通过渠道编码获取基本信息", notes = "获取出单所需的基本信息")
     @ApiImplicitParams({
@@ -44,15 +45,13 @@ public class InsGuoRenController {
     })
     @GetMapping("/channelInfo/{thirdCode}")
     public HttpResult channelInfo(@PathVariable String thirdCode) {
-        return insGuoRenApiService.gainChannelInfo(thirdCode);
+        return guorenOrderApiService.gainChannelInfo(thirdCode);
     }
 
-
     @ApiOperation(value = "车型查询", notes = "只需要vin码、发动机号、注册日期例:20120512")
     @PostMapping("/modelQuery")
     public HttpResult modelQueryAPI(@RequestBody CarInfoVo carInfo) {
-
-        return insGuoRenApiService.modelsQueryApi(carInfo);
+        return guorenOrderApiService.modelsQueryApi(carInfo);
     }
 
 //    @ApiOperation(value = "VIN码查询", notes = "只需要vin码、发动机号")
@@ -76,71 +75,66 @@ public class InsGuoRenController {
     @ApiOperation(value = "报价")
     @PostMapping("/quote")
     public HttpResult quoteApi(@RequestBody BaseQuoteVo<AccidentalDrivingVo> quoteVo) {
-        return insGuoRenApiService.quoteApi(quoteVo);
+        return guorenOrderApiService.quoteApi(quoteVo);
     }
 
     @ApiOperation(value = "影像上传")
     @PostMapping(value = "/uploadImage")
     public HttpResult uploadImage(@RequestSingleParam(value = "companyId") String companyId) {
-
-        return insGuoRenApiService.uploadImageApi(companyId);
+        return guorenOrderApiService.uploadImageApi(companyId);
     }
 
     @ApiOperation(value = "支付")
     @PostMapping(value = "/pay")
     public HttpResult pay(@RequestSingleParam(value = "companyId") String companyId) {
-
-        return insGuoRenApiService.pay(companyId);
+        return guorenOrderApiService.pay(companyId);
     }
 
     @ApiOperation(value = "核保")
     @PostMapping("/audit")
     public HttpResult auditApi(@RequestSingleParam(value = "companyId") String companyId) {
-        return insGuoRenApiService.auditApi(companyId);
+        return guorenOrderApiService.auditApi(companyId);
     }
 
 
     @ApiOperation(value = "更新订单信息")
     @PostMapping("/updateOrderInfo")
     public HttpResult updateOrderInfoByIns(@RequestSingleParam(value = "companyId") String companyId) {
-        return insGuoRenApiService.insOrderInfo(companyId);
+        return guorenOrderApiService.insOrderInfo(companyId);
     }
 
     @ApiOperation(value = "回调通知")
     @PostMapping(value = "/callBack")
     public HttpResult callBackApi(HttpServletRequest request) {
-        return insGuoRenApiService.callBackApi(request);
+        return guorenOrderApiService.callBackApi(request);
 
     }
 
     @ApiOperation(value = "电子保单")
     @PostMapping("/policyPrint")
     public HttpResult getPolicyPrintApi(@RequestBody PolicyPrintVo policyPrintVo) {
-        return insGuoRenApiService.getPolicyPrintApi(policyPrintVo);
+        return guorenOrderApiService.getPolicyPrintApi(policyPrintVo);
     }
 
-
     /**
      * 同步非车保险
      */
-    @ApiOperation(value = " 同步非车保险")
+    @ApiOperation(value = "同步非车保险")
     @PostMapping("/syncNonAutoIns")
     public HttpResult syncNonAutoIns() {
         //家用车驾乘意外险-山西版(02746425173001)
         String goodsCode = "02746425173001";
-        return HttpResult.ok(insGuoRenApiService.gainNonAutoInsList(goodsCode));
-
+        return HttpResult.ok(guorenOrderApiService.gainNonAutoInsList(goodsCode));
 
     }
 
-
     /**
      * 同步驾意险
      */
     @ApiOperation(value = "同步驾意险")
     @PostMapping("/syncAccidentInsure")
     public HttpResult syncAccidentInsure(@RequestBody @Valid AccidentalDrivingQueryVo accidentalDrivingVo) {
-        return insGuoRenApiService.syncAccidentInsure(accidentalDrivingVo);
+        return guorenOrderApiService.syncAccidentInsure(accidentalDrivingVo);
     }
 
 

+ 26 - 43
src/main/java/com/ydtech/modules/ins/controller/InsAlltrustApiController.java → src/main/java/com/ydtech/modules/order/controller/YongChengOrderApiController.java

@@ -1,7 +1,8 @@
-package com.ydtech.modules.ins.controller;
+package com.ydtech.modules.order.controller;
 
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.fasterxml.jackson.core.JsonProcessingException;
 import com.ydtech.aop.request.RequestSingleParam;
 import com.ydtech.constants.enums.dict.InsOrderStatusEnum;
 import com.ydtech.core.page.HttpResult;
@@ -10,19 +11,16 @@ import com.ydtech.modules.esm.dao.EsmInsAttachInsureDetailsMapper;
 import com.ydtech.modules.esm.dao.EsmInsAttachInsureMapper;
 import com.ydtech.modules.esm.model.EsmInsAttachInsure;
 import com.ydtech.modules.esm.model.EsmInsAttachInsureDetails;
-import com.ydtech.modules.esm.service.InsTaskImageService;
-import com.ydtech.modules.ins.service.InsAlltrustApiService;
-import com.ydtech.modules.order.components.InsOrdersComponents;
 import com.ydtech.modules.order.entity.InsAreaCompany;
 import com.ydtech.modules.order.entity.vo.AccidentalDrivingQueryVo;
 import com.ydtech.modules.order.entity.vo.AccidentalDrivingVo;
 import com.ydtech.modules.order.entity.vo.BaseQuoteVo;
 import com.ydtech.modules.order.entity.vo.PolicyPrintVo;
 import com.ydtech.modules.order.service.InsAreaCompanyService;
+import com.ydtech.modules.order.service.YongchengOrderApiService;
 import io.swagger.annotations.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.validation.Valid;
@@ -38,26 +36,24 @@ import java.util.Map;
 @Api(tags = "永诚API方式对接")
 @RestController
 @RequestMapping("/api/yongCheng")
-public class InsAlltrustApiController {
+public class YongChengOrderApiController {
 
     private static final Logger log = LoggerFactory.getLogger("alltrust");
 
-    @Autowired
-    InsAlltrustApiService insYongchengApiService;
+    private final YongchengOrderApiService yongchengOrderApiService;
 
-    @Autowired
-    InsOrdersComponents insOrdersComponents;
+    private final EsmInsAttachInsureMapper esmInsAttachInsureMapper;
 
-    @Autowired
-    InsTaskImageService insTaskImageService;
+    private final EsmInsAttachInsureDetailsMapper esmInsAttachInsureDetailsMapper;
 
-    @Autowired
-    EsmInsAttachInsureMapper esmInsAttachInsureMapper;
-    @Autowired
-    EsmInsAttachInsureDetailsMapper esmInsAttachInsureDetailsMapper;
-    @Autowired
-    InsAreaCompanyService insAreaCompanyService;
+    private final InsAreaCompanyService insAreaCompanyService;
 
+    public YongChengOrderApiController(YongchengOrderApiService yongchengOrderApiService, EsmInsAttachInsureMapper esmInsAttachInsureMapper, EsmInsAttachInsureDetailsMapper esmInsAttachInsureDetailsMapper, InsAreaCompanyService insAreaCompanyService) {
+        this.yongchengOrderApiService = yongchengOrderApiService;
+        this.esmInsAttachInsureMapper = esmInsAttachInsureMapper;
+        this.esmInsAttachInsureDetailsMapper = esmInsAttachInsureDetailsMapper;
+        this.insAreaCompanyService = insAreaCompanyService;
+    }
 
     @ApiResponses({
             @ApiResponse(code = 500, message = "出现异常"),
@@ -66,28 +62,25 @@ public class InsAlltrustApiController {
     })
     @ApiOperation(value = "永诚API方式 - 报价")
     @PostMapping("/quote")
-//    @MethodLogAnnotation(title = "永诚API方式 - 报价")
-    public HttpResult quoteApi(@RequestBody BaseQuoteVo<AccidentalDrivingVo> quoteVo) {
-//        BaseQuoteInfoVo quoteInfo = insOrdersComponents.getQuoteInfo(quoteVo.getOrderNo());
-        return insYongchengApiService.quoteApi(quoteVo);
+    public HttpResult quoteApi(@RequestBody BaseQuoteVo<AccidentalDrivingVo> quoteVo) throws JsonProcessingException {
+        return yongchengOrderApiService.quoteApi(quoteVo);
     }
 
     @ApiOperation(value = "永诚API方式 - 核保")
     @PostMapping("/audit")
 //    @MethodLogAnnotation(title = "永诚API方式 - 核保")
     public HttpResult auditApi(@RequestSingleParam(value = "companyId") String companyId) {
-        return insYongchengApiService.auditApi(companyId);
+        return yongchengOrderApiService.auditApi(companyId);
     }
 
     @ApiOperation(value = "永诚API方式 - 影像上传")
     @PostMapping(value = "/uploadImage")
     public HttpResult uploadImageApi(@RequestSingleParam(value = "companyId") String companyId) {
 
-        return insYongchengApiService.uploadImageApi(companyId);
+        return yongchengOrderApiService.uploadImageApi(companyId);
     }
 
 
-
 //    @ApiOperation(value = "永诚API方式 - 第三方回调通知(支付+承保)")
 //    @PostMapping(value = "/callBack")
 //    public HttpResult callBackApi(HttpServletRequest request) {
@@ -101,7 +94,7 @@ public class InsAlltrustApiController {
 //            log.info("永诚API方式 - 回调 - 参数:" + name);
 //            if (StringUtils.isNotEmpty(name)) {
 //                CallBackRequest cbr = CallBackRequest.buildCallBackParam(name);
-//                return insYongchengApiService.callBackApi(cbr);
+//                return yongchengOrderApiService.callBackApi(cbr);
 //
 //            }
 //        }
@@ -116,8 +109,7 @@ public class InsAlltrustApiController {
     @ApiOperation(value = "永诚API方式 -电子保单")
     @PostMapping("/getPolicyPrint")
     public HttpResult getPolicyPrintApi(@RequestBody PolicyPrintVo policyPrintVo) {
-//    public HttpResult getPolicyPrintApi(String companyId,String type) {
-        return insYongchengApiService.getPolicyPrintApi(policyPrintVo);
+        return yongchengOrderApiService.getPolicyPrintApi(policyPrintVo);
     }
 
     /**
@@ -126,15 +118,11 @@ public class InsAlltrustApiController {
     @ApiOperation(value = "永诚API方式 -意外险列表")
     @PostMapping("/gainAccidentList")
     public HttpResult<List<EsmInsAttachInsure>> gainAccidentList(@RequestBody @Valid AccidentalDrivingQueryVo accidentalDrivingVo) {
-
         LambdaQueryWrapper<EsmInsAttachInsure> lqw = new LambdaQueryWrapper<EsmInsAttachInsure>();
         lqw.eq(EsmInsAttachInsure::getCompanyId, accidentalDrivingVo.getCompanyCode());
         lqw.eq(accidentalDrivingVo.getSeatNum() > 0, EsmInsAttachInsure::getSeating, accidentalDrivingVo.getSeatNum());
         List<EsmInsAttachInsure> eiaiList = esmInsAttachInsureMapper.selectList(lqw);
         return HttpResult.ok(eiaiList);
-
-//        return insYongchengApiService.gainAccidentList(accidentalDrivingVo);
-//        return insYongchengApiService.gainAccidentList(companyId);
     }
 
     /**
@@ -147,7 +135,7 @@ public class InsAlltrustApiController {
     })
     public HttpResult<List<EsmInsAttachInsureDetails>> gainAccidentSchemeList(@RequestSingleParam(value = "accidentId") String accidentId) {
 
-        LambdaQueryWrapper<EsmInsAttachInsureDetails> lqw = new LambdaQueryWrapper<EsmInsAttachInsureDetails>();
+        LambdaQueryWrapper<EsmInsAttachInsureDetails> lqw = new LambdaQueryWrapper<>();
         lqw.eq(EsmInsAttachInsureDetails::getAttachInsureId, accidentId);
         List<EsmInsAttachInsureDetails> list = esmInsAttachInsureDetailsMapper.selectList(lqw);
 
@@ -162,8 +150,7 @@ public class InsAlltrustApiController {
     @ApiOperation(value = "永诚API方式 - 同步驾意险")
     @PostMapping("/syncAccidentInsure")
     public HttpResult syncAccidentInsure(@RequestBody @Valid AccidentalDrivingQueryVo accidentalDrivingVo) {
-
-        return insYongchengApiService.syncAccidentInsure(accidentalDrivingVo);
+        return yongchengOrderApiService.syncAccidentInsure(accidentalDrivingVo);
     }
 
 
@@ -173,7 +160,7 @@ public class InsAlltrustApiController {
     @ApiOperation(value = "永诚API方式 - 身份证地址获取地区")
     @PostMapping("/addressGainArea")
     public HttpResult syncAccidentInsure(String address) {
-        Map<String, String> ownerMap = insYongchengApiService.gainRegionCode(address);
+        Map<String, String> ownerMap = yongchengOrderApiService.gainRegionCode(address);
 
         if (null == ownerMap) {
             throw new SystemException("地区获取失败,请检查参数是否正确。");
@@ -189,19 +176,18 @@ public class InsAlltrustApiController {
 //    @ApiOperation(value = "永诚API方式 - 同步保司订单状态")
 //    @GetMapping("/syncInsOrderStatus")
 //    public HttpResult syncInsOrderStatus() {
-//        insYongchengApiService.callbackAnOrder();
+//        yongchengOrderApiService.callbackAnOrder();
 //        return HttpResult.ok("");
 //    }
 
 
-
     @GetMapping(value = "/orderStatusBySuborderId/{suborderId}")
     @ApiOperation(value = "永诚API方式 - 手动刷新订单状态 通过子订单ID")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "suborderId", value = "子订单ID", required = true, dataType = "String")
     })
     public HttpResult orderStatusBySuborderId(@PathVariable String suborderId) {
-        return insYongchengApiService.callbackAnOrder(suborderId);
+        return yongchengOrderApiService.callbackAnOrder(suborderId);
     }
 
 
@@ -217,13 +203,10 @@ public class InsAlltrustApiController {
         lqw.gt(InsAreaCompany::getAudittime, LocalDate.now().minusDays(1));
         List<InsAreaCompany> list = insAreaCompanyService.list(lqw);
 
-        list.stream().forEach(a ->{
-            insYongchengApiService.getPayUrlApi(a);
-        });
+        list.forEach(yongchengOrderApiService::getPayUrlApi);
 
         return HttpResult.ok("更新成功");
     }
 
 
-
 }

+ 3 - 3
src/main/java/com/ydtech/modules/order/controller/ZhongMeiOrderApiController.java

@@ -2,7 +2,7 @@ package com.ydtech.modules.order.controller;
 
 
 import com.ydtech.aop.request.RequestSingleParam;
-import com.ydtech.config.properties.ZmApiConfigurationProperties;
+import com.ydtech.config.properties.ZhongmeiApiConfigurationProperties;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.ins.model.vo.GeneralNonCarProductReqVo;
 import com.ydtech.modules.ins.model.vo.GeneralNonCarProductResVo;
@@ -34,9 +34,9 @@ public class ZhongMeiOrderApiController {
 
     private final InsOrdersComponents insOrdersComponents;
 
-    private final ZmApiConfigurationProperties properties;
+    private final ZhongmeiApiConfigurationProperties properties;
 
-    public ZhongMeiOrderApiController(ZhongMeiOrderApiService zhongMeiOrderApiService, InsOrdersComponents insOrdersComponents, ZmApiConfigurationProperties properties) {
+    public ZhongMeiOrderApiController(ZhongMeiOrderApiService zhongMeiOrderApiService, InsOrdersComponents insOrdersComponents, ZhongmeiApiConfigurationProperties properties) {
         this.zhongMeiOrderApiService = zhongMeiOrderApiService;
         this.insOrdersComponents = insOrdersComponents;
         this.properties = properties;

+ 25 - 0
src/main/java/com/ydtech/modules/order/entity/api/yongcheng/constants/RequestUrl.java

@@ -0,0 +1,25 @@
+package com.ydtech.modules.order.entity.api.yongcheng.constants;
+
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor
+public enum RequestUrl {
+
+    API_MODEL("newQueryVehicleTypesService", "车型查询"),
+    API_QUOTE("NewPremiumXnyCalculationService", "报价"),
+    API_AUDIT("NewXnyUnderwritingService", "核保"),
+    API_UPLOAD("newImageUpService", "影像上传"),
+    API_PAY("newGetPayNoService", "支付"),
+    API_GUARANTEE_SLIP("DzbdWebService", "电子保单"),
+    API_ORDER_QUERY("payCallback", "补传回调及订单信息查询接口"),
+    API_ACCIDENT("NewQueryYwCvrgWebService", "意外险");
+
+    private final String uri;
+
+    private final String desc;
+
+
+}

+ 7 - 2
src/main/java/com/ydtech/modules/order/entity/api/zhongmei/constants/enums/ImageTypeEnum.java

@@ -1,5 +1,6 @@
 package com.ydtech.modules.order.entity.api.zhongmei.constants.enums;
 
+import com.ydtech.constants.InsuranceImageEnum;
 import lombok.AllArgsConstructor;
 import lombok.Getter;
 
@@ -22,10 +23,14 @@ public enum ImageTypeEnum {
      * UW_0309	销售环节资料
      */
     UW_0301("UW_0301", "验车资料", new String[]{"C05"}),
-    UW_0302("UW_0302", "个人客户资料", new String[]{"C02", "C03", "C04"}),
+    UW_0302("UW_0302", "个人客户资料", new String[]{
+            InsuranceImageEnum.C02.getCode(), InsuranceImageEnum.D02.getCode(),
+            InsuranceImageEnum.C03.getCode(), InsuranceImageEnum.D03.getCode(),
+            InsuranceImageEnum.C04.getCode(), InsuranceImageEnum.D04.getCode(),
+    }),
     UW_0303("UW_0303", "企业客户资料", new String[]{}),
     UW_0304("UW_0304", "批改资料", new String[]{}),
-    UW_0305("UW_0305", "车辆资料", new String[]{"C01"}),
+    UW_0305("UW_0305", "车辆资料", new String[]{InsuranceImageEnum.C01.getCode(), InsuranceImageEnum.D01.getCode()}),
     UW_0306("UW_0306", "保单批单资料", new String[]{}),
     UW_0309("UW_0309", "销售环节资料", new String[]{});
 

+ 1 - 1
src/main/java/com/ydtech/modules/order/entity/crawler/response/CrawlerVerifyPaymentResponse.java

@@ -14,7 +14,7 @@ public class CrawlerVerifyPaymentResponse extends CrawlerBaseResponse {
      * 缴费状态 0未缴费,1已缴费
      */
     @JsonProperty(value = "state")
-    private Integer state;
+    private int state;
 
     /**
      * 交强险保单号

+ 3 - 56
src/main/java/com/ydtech/modules/ins/service/InsGuoRenApiService.java → src/main/java/com/ydtech/modules/order/service/GuorenOrderApiService.java

@@ -1,25 +1,18 @@
-package com.ydtech.modules.ins.service;
+package com.ydtech.modules.order.service;
 
 import com.ydtech.core.page.HttpResult;
-import com.ydtech.modules.ins.model.guoRen.InsuranceSlipResp;
 import com.ydtech.modules.ins.model.guoRen.NonAutoInsResp;
 import com.ydtech.modules.ins.model.vo.CarInfoVo;
-import com.ydtech.modules.ins.model.ya.CarModel_Req;
-import com.ydtech.modules.ins.model.yc.CallBackRequest;
-import com.ydtech.modules.ins.model.yc.modelsQuery.ModelsQueryResponse;
 import com.ydtech.modules.ins.model.yc.pay.response.AccidentResponse;
-import com.ydtech.modules.order.entity.InsAreaCompany;
 import com.ydtech.modules.order.entity.vo.AccidentalDrivingQueryVo;
 import com.ydtech.modules.order.entity.vo.AccidentalDrivingVo;
 import com.ydtech.modules.order.entity.vo.BaseQuoteVo;
 import com.ydtech.modules.order.entity.vo.PolicyPrintVo;
-import org.springframework.web.bind.annotation.RequestBody;
 
 import javax.servlet.http.HttpServletRequest;
-import java.util.List;
 import java.util.Map;
 
-public interface InsGuoRenApiService {
+public interface GuorenOrderApiService {
 
 
     //=================API 方式=================
@@ -35,28 +28,11 @@ public interface InsGuoRenApiService {
      */
     HttpResult modelsQueryApi(CarInfoVo carInfo);
 
-//    /**
-//     * VIN码查询
-//     */
-//    HttpResult vinQueryApi(CarModel_Req carModelReq);
-    /**
-     * 车型查询接口
-     */
-    List<ModelsQueryResponse.VehicleInfo> modelsQuery(CarModel_Req carModelReq);
-//    List<CarModelDTO> modelsQuery(CarModel_Req carModelReq);
-
-//    /**
-//     * 车价查询
-//     */
-//    HttpResult carPrice(BaseQuoteVo<AccidentalDrivingVo> quoteVo);
-
 
     /**
      * 2 报价
      */
     HttpResult quoteApi(BaseQuoteVo<AccidentalDrivingVo> quoteVo);
-//    HttpResult quoteApi(BaseQuoteInfoVo yaQuoteInfoVo);
-//
 
     /**
      * 3 核保
@@ -85,20 +61,6 @@ public interface InsGuoRenApiService {
      * @return
      */
     HttpResult uploadImageApi(String quoteOrderNo);
-//    /**
-//     * 影像上传
-//     *
-//     * @param record
-//     * @return
-//     */
-//    HttpResult UploadImageApi(InsTaskImage record);
-
-//    /**
-//     * 4 获取短信验证码
-//     */
-//    HttpResult getMessageApi(String orderno);
-
-
 
     /**
      * 非车列表
@@ -107,7 +69,7 @@ public interface InsGuoRenApiService {
     /**
      * (驾意险)意健险方案及险种查询接口
      */
-    public HttpResult gainAccidentList(AccidentalDrivingQueryVo accidentalDrivingVo);
+     HttpResult gainAccidentList(AccidentalDrivingQueryVo accidentalDrivingVo);
 
     /**
      * (驾意险)同步驾意险
@@ -145,20 +107,5 @@ public interface InsGuoRenApiService {
     Map<String, String> gainRegionCode(String address);
 
 
-//
-//    /**
-//     * 4 获取短信验证码
-//     */
-//    HttpResult getMessageApi(String orderno);
-//
-//
-//    /**
-//     * 6 保单信息同步
-//     */
-//    String updatePolicyApi(Map<String, String> paramMap);
-//
-
-
-    //=================API 方式==end===============
 
 }

+ 9 - 41
src/main/java/com/ydtech/modules/ins/service/InsAlltrustApiService.java → src/main/java/com/ydtech/modules/order/service/YongchengOrderApiService.java

@@ -1,28 +1,24 @@
-package com.ydtech.modules.ins.service;
+package com.ydtech.modules.order.service;
 
+import com.fasterxml.jackson.core.JsonProcessingException;
 import com.ydtech.core.page.HttpResult;
-import com.ydtech.modules.ins.model.ya.CarModel_Req;
 import com.ydtech.modules.ins.model.yc.CallBackRequest;
-import com.ydtech.modules.ins.model.yc.modelsQuery.ModelsQueryResponse;
 import com.ydtech.modules.ins.model.yc.pay.response.AccidentResponse;
 import com.ydtech.modules.order.entity.InsAreaCompany;
-import com.ydtech.modules.order.entity.vo.*;
+import com.ydtech.modules.order.entity.vo.AccidentalDrivingQueryVo;
+import com.ydtech.modules.order.entity.vo.AccidentalDrivingVo;
+import com.ydtech.modules.order.entity.vo.BaseQuoteVo;
+import com.ydtech.modules.order.entity.vo.PolicyPrintVo;
 
-import java.util.List;
 import java.util.Map;
 
-public interface InsAlltrustApiService {
-
-
-    //=================API 方式=================
+public interface YongchengOrderApiService {
 
 
     /**
      * 2 报价
      */
-    HttpResult quoteApi(BaseQuoteVo<AccidentalDrivingVo> quoteVo);
-//    HttpResult quoteApi(BaseQuoteInfoVo yaQuoteInfoVo);
-//
+    HttpResult quoteApi(BaseQuoteVo<AccidentalDrivingVo> quoteVo) throws JsonProcessingException;
 
     /**
      * 3 核保
@@ -36,18 +32,6 @@ public interface InsAlltrustApiService {
      * @return
      */
     HttpResult uploadImageApi(String quoteOrderNo);
-//    /**
-//     * 影像上传
-//     *
-//     * @param record
-//     * @return
-//     */
-//    HttpResult UploadImageApi(InsTaskImage record);
-
-//    /**
-//     * 4 获取短信验证码
-//     */
-//    HttpResult getMessageApi(String orderno);
 
     /**
      * 包含发送短信
@@ -66,11 +50,10 @@ public interface InsAlltrustApiService {
      */
     void callbackAnOrder();
 
-
     /**
      * (驾意险)意健险方案及险种查询接口
      */
-    public HttpResult gainAccidentList(AccidentalDrivingQueryVo accidentalDrivingVo);
+    HttpResult gainAccidentList(AccidentalDrivingQueryVo accidentalDrivingVo);
 
     /**
      * (驾意险)同步驾意险
@@ -108,20 +91,5 @@ public interface InsAlltrustApiService {
     Map<String, String> gainRegionCode(String address);
 
 
-//
-//    /**
-//     * 4 获取短信验证码
-//     */
-//    HttpResult getMessageApi(String orderno);
-//
-//
-//    /**
-//     * 6 保单信息同步
-//     */
-//    String updatePolicyApi(Map<String, String> paramMap);
-//
-
-
-    //=================API 方式==end===============
 
 }

+ 12 - 569
src/main/java/com/ydtech/modules/ins/service/impl/InsGuoRenApiServiceImpl.java → src/main/java/com/ydtech/modules/order/service/impl/GuorenOrderApiServiceImpl.java

@@ -1,15 +1,12 @@
-package com.ydtech.modules.ins.service.impl;
+package com.ydtech.modules.order.service.impl;
 
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.json.JSONUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
-import com.ydtech.components.InsAlltrustRequestApiComponents;
 import com.ydtech.constants.InsuranceEnum;
 import com.ydtech.constants.enums.InsQuoteFlow;
 import com.ydtech.constants.enums.InsurKind;
@@ -20,28 +17,20 @@ import com.ydtech.constants.enums.dict.InsOrderStatusEnum;
 import com.ydtech.constants.enums.dict.WhetherEnum;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.exception.SystemException;
-import com.ydtech.modules.admin.service.SysDeptService;
-import com.ydtech.modules.admin.service.SysUserService;
 import com.ydtech.modules.esm.dao.EsmInsAttachInsureDetailsMapper;
 import com.ydtech.modules.esm.dao.EsmInsAttachInsureMapper;
 import com.ydtech.modules.esm.model.EsmInsAttachInsure;
 import com.ydtech.modules.esm.model.EsmInsAttachInsureDetails;
 import com.ydtech.modules.esm.model.EsmInsCompany;
-import com.ydtech.modules.esm.service.EsmAgreementProdService;
-import com.ydtech.modules.esm.service.EsmAgreementService;
 import com.ydtech.modules.esm.service.EsmInsCompanyService;
-import com.ydtech.modules.esm.service.EsmRetailService;
 import com.ydtech.modules.ins.dao.InsAlltrustRegionMapper;
 import com.ydtech.modules.ins.model.InsApiLog;
 import com.ydtech.modules.ins.model.guoRen.*;
 import com.ydtech.modules.ins.model.vo.*;
 import com.ydtech.modules.ins.model.ya.CarModel_Req;
 import com.ydtech.modules.ins.model.ya.YaQuoteInfoVo;
-import com.ydtech.modules.ins.model.yc.AuthorityDataXml;
 import com.ydtech.modules.ins.model.yc.InsAlltrustRegion;
-import com.ydtech.modules.ins.model.yc.YcBuildData;
 import com.ydtech.modules.ins.model.yc.YcConfigureParameters;
-import com.ydtech.modules.ins.model.yc.modelsQuery.ModelsQueryResponse;
 import com.ydtech.modules.ins.model.yc.modelsQuery.ModelsQueryXml;
 import com.ydtech.modules.ins.model.yc.pay.response.AccidentResponse;
 import com.ydtech.modules.ins.model.yc.ruote.Applicant;
@@ -49,8 +38,6 @@ import com.ydtech.modules.ins.model.yc.ruote.Insured;
 import com.ydtech.modules.ins.model.yc.ruote.Ruote;
 import com.ydtech.modules.ins.model.yc.ruote.Vhlowner;
 import com.ydtech.modules.ins.service.InsApiLogService;
-import com.ydtech.modules.ins.service.InsGuoRenApiService;
-import com.ydtech.modules.ins.service.InsTaskHistoryService;
 import com.ydtech.modules.order.components.ConfigureParametersComponents;
 import com.ydtech.modules.order.components.InsOrdersComponents;
 import com.ydtech.modules.order.dao.InsTaskImagesMapper;
@@ -58,9 +45,10 @@ import com.ydtech.modules.order.entity.InsAreaCompany;
 import com.ydtech.modules.order.entity.InsOrders;
 import com.ydtech.modules.order.entity.dto.InsUploadImagesDto;
 import com.ydtech.modules.order.entity.vo.*;
+import com.ydtech.modules.order.service.GuorenOrderApiService;
 import com.ydtech.modules.order.service.InsAreaCompanyService;
 import com.ydtech.modules.order.service.InsOrdersService;
-import com.ydtech.modules.order.service.InsTaskImagesService;
+import com.ydtech.modules.order.service.YongchengOrderApiService;
 import com.ydtech.modules.protocol.utils.AssertionUtils;
 import com.ydtech.utils.*;
 import com.ydtech.utils.baidu.FileUtil;
@@ -78,7 +66,6 @@ import org.springframework.transaction.annotation.Transactional;
 import javax.servlet.http.HttpServletRequest;
 import java.io.File;
 import java.io.FileNotFoundException;
-import java.io.IOException;
 import java.math.BigDecimal;
 import java.time.Instant;
 import java.time.LocalDate;
@@ -89,7 +76,7 @@ import java.util.stream.Collectors;
 
 
 @Service
-public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
+public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
 
 
     private static final Logger log = LoggerFactory.getLogger("guoRen");
@@ -110,8 +97,6 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
     @Value("${api.url}")
     private String apiUrl;
 
-    @Autowired
-    private InsAlltrustRequestApiComponents apiComponents;
 
     @Autowired
     private InsAlltrustRegionMapper insAlltrustRegionMapper;
@@ -148,8 +133,6 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
     private static ChannelInfoDto channelInfo = null;
 
 
-
-
     //
     //==============================API 方式
     //
@@ -194,127 +177,6 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
     }
 
 
-    @Override
-    public List<ModelsQueryResponse.VehicleInfo> modelsQuery(CarModel_Req carModelReq) {
-
-
-//
-//
-////    public List<CarModelDTO> modelsQuery(CarModel_Req carModelReq) {
-//        // 获取协议配置信息
-//        YcConfigureParameters ycConfigureParameters = gainYcConfigParams(carModelReq.getAgreementId());
-//
-//
-//        ModelsQueryXml m = buildModelsQueryParam(carModelReq, ycConfigureParameters);
-//         ObjectMapper xmlMapper = null;
-//
-//        log.info("===永诚--车型查询接口请求开始===");
-//        InsApiLog apiLog = httpPost(xmlMapper, m, YcBuildData.API_MODEL);
-//        String responseData = apiLog.getResponseData();
-//        log.info("===永诚--车型查询接口请求结束===");
-//        try {
-//            String cleanStr = YcBuildData.cleanResponseStr(responseData);
-//            ModelsQueryResponse rd = xmlMapper.readValue(cleanStr, ModelsQueryResponse.class);
-//            return buildCarModel(rd);
-//        } catch (IOException e) {
-//            throw new RuntimeException(e);
-//        }
-        return null;
-    }
-
-
-    public void gainVehicleModel(YcConfigureParameters ycConfigureParameters, CarInfoVo carInfo) {
-
-        CarModel_Req carModelReq = new CarModel_Req();
-        carModelReq.setFrameNo(carInfo.getFrameNo());
-        carModelReq.setEngineNo(carInfo.getEngineNo());
-        carModelReq.setEnrollDate(carInfo.getRegisterDate().replaceAll("-", ""));
-
-        ModelsQueryXml m = buildModelsQueryParam(carModelReq, ycConfigureParameters);
-        ObjectMapper xmlMapper = null;
-
-        log.info("===永诚--车型查询接口请求开始===");
-        String responseData = httpPost(xmlMapper, m, YcBuildData.API_MODEL);
-//        String responseData = apiLog.getResponseData();
-        log.info("===永诚--车型查询接口请求结束===");
-        try {
-            String cleanStr = YcBuildData.cleanResponseStr(responseData);
-            ModelsQueryResponse rd = xmlMapper.readValue(cleanStr, ModelsQueryResponse.class);
-            List<ModelsQueryResponse.VehicleInfo> vehicleInfoList = buildCarModel(rd);
-
-            long count = vehicleInfoList.stream().filter(x -> x.getModelCode().equals(carInfo.getModelCode())).count();
-
-            if (count < 1) {
-                //匹配车辆信息
-                vehicleInfoList.stream().forEach(a -> {
-                    //购置价匹配
-                    if (a.getVehiclePrice().equals(carInfo.getPurchasePrice())) {
-                        carInfo.setModelCode(a.getVehicleId());
-//                        carInfo.setCiModelCode(a.getModelCode());
-                        carInfo.setCiCarName(a.getVehicleName());
-                        carInfo.setModelcname(a.getVehicleName());
-                    }
-                });
-            }
-
-
-        } catch (IOException e) {
-            throw new SystemException("车型查询接口异常,请联系管理。");
-        }
-
-
-    }
-
-
-//    /**
-//     * 车价查询
-//     */
-//    @Override
-//    public HttpResult carPrice(BaseQuoteVo<AccidentalDrivingVo> quoteVo) {
-//
-//        RequestDto rDto = RequestDto.builRequestDto();
-//        RequestDto.RequestPackage rpackage = rDto.getRPackage();
-//
-//
-//        BaseQuoteInfoVo yaQuoteInfoVo = insOrdersComponents.getQuoteInfo(quoteVo.getOrderNo());
-//
-//////        //构造车型信息   获取保险公司车型信息
-////        gainVehicleModel(ycConfigureParameters, yaQuoteInfoVo.getCarInfo());
-//
-//        CarInfoVo carInfo = yaQuoteInfoVo.getCarInfo();
-//        VinQueryReq vinQueryReq = new VinQueryReq();
-//        vinQueryReq.setFrameNo(carInfo.getFrameNo());
-//        vinQueryReq.setLicenseNo(carInfo.getLicenseNo());
-//        vinQueryReq.setEngineNo(carInfo.getEngineNo());
-//
-//        //vin码查询车辆信息
-//        VinQueryResp.DataDTO vinQ = vinQuery(vinQueryReq);
-//
-//        //构造请求参数
-//        CarPriceReq req = CarPriceReq.buildCarPriceParam(yaQuoteInfoVo, vinQ, channelInfo);
-//
-//        //请求参数
-//        rpackage.setRBody(req);
-//        rDto.setRPackage(rpackage);
-//
-//        String bodyStr = JSON.toJSONString(rDto);
-//        String result = HttpUtil.sendPost("https://devyun.guorenpcic.com/api/grchannel-interface/httpCurrency/httpJsonCommonEntrance", bodyStr);
-//
-//        CarPriceResp rest = JsonUtils.toObject(result, CarPriceResp.class);
-////        if(null == rest){
-////            //返回多条
-////            CarPriceListResp restList = JsonUtils.toObject(result, CarPriceListResp.class);
-////        }
-//
-////        // 获取协议配置信息
-////        YcConfigureParameters ycConfigureParameters = gainYcConfigParams(quoteVo.getAgreementId());
-//
-//
-//        return HttpResult.ok("车价查询");
-//
-//    }
-
-
     /**
      * 2 报价-
      */
@@ -323,7 +185,6 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
 
         log.debug("--------报价开始,订单号:{},协议号:{}--------------", quoteVo.getOrderNo(), quoteVo.getAgreementId());
 
-
         // 获取协议配置信息
         ChannelInfoDto channelInfo = gainChannelConfigInfo(quoteVo.getAgreementId());
         if (null == channelInfo) return HttpResult.error("请先配置保险公司渠道信息");
@@ -355,13 +216,11 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
 
         log.debug("车价查询通过");
 
-
         /**
          *  3、保费计算
          */
         PremiumResp.DataDTO premiumResult = premiumQuery(yaQuoteInfoVo, carPriceResult, vinQ);
 
-
         if (null == premiumResult) return HttpResult.error("保费计算失败");
         log.debug("保费计算通过");
 
@@ -382,12 +241,6 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
 
         quoteRespVo.setCompanyId(iac.getId());
 
-
-//        // 获取协议配置信息
-//        YcConfigureParameters ycConfigureParameters = gainYcConfigParams(quoteVo.getAgreementId());
-
-//        //车价编号临时放入reids
-//        RedisUtils.set(redisNum, carPriceResult.getInputvo(), 43200);
         log.debug("--------报价结束,车牌:{},vin:{}--------------", carInfo.getLicenseNo(), carInfo.getVinNo());
 
         return HttpResult.ok("报价成功", quoteRespVo);
@@ -406,8 +259,7 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
         log.debug("----------核保开始,订单号:{}---------", quoteOrderNo);
 
         //子订单
-        InsAreaCompany iac = insAreaCompanyService.getById(quoteOrderNo);
-        AssertionUtils.isEmpty(iac, "订单不存在");
+        InsAreaCompany iac = insAreaCompanyService.getByIdIsExist(quoteOrderNo);
         if (iac != null) {
             // 获取协议配置信息
             ChannelInfoDto channelInfo = gainChannelConfigInfo(iac.getAgreementId());
@@ -464,7 +316,6 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
 
         }
 
-
         if (iac.getOrderstatus().equals(InsOrderStatusEnum.WAIT_AUDIT.getCode())) {
             insAreaCompanyService.updateById(iac);
             return HttpResult.error(auditResp.getData().get(0).getMessage());
@@ -478,9 +329,7 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
         iac.setSyappoint(""); //商业特别约定
 
         if (iac.getOrderstatus().equals(InsOrderStatusEnum.WAIT_PAY.getCode())) {
-//            //获取缴费地址
-//            PayResp.DataDTO payResp = pay(iac);
-//            iac.setPaymentLink(payResp.getPayUrl());
+
             //获取签名地址
             SignatureResp.DataDTO signature = signature(iac);
             if (null == signature) log.error("核保操作:获取签名链接失败");
@@ -546,7 +395,6 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
                     return HttpResult.ok();
                 }
 
-
             }
 
             boolean updateFlag = false;
@@ -614,15 +462,10 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
 
         BaseQuoteInfoVo yaQuoteInfoVo = insOrdersComponents.getQuoteInfo(order.getOrderno());
 
-//        InsuranceSlipResp insuranceSlip = gainInsuranceSlip(yaQuoteInfoVo.getOrderNo());
-
         //获取缴费地址
         PayResp.DataDTO payResp = pay(iac);
         iac.setPaymentLink(payResp.getPayUrl());
 
-//        insAreaCompanyService.updateById(iac);
-
-
         return HttpResult.ok(iac);
     }
 
@@ -643,7 +486,6 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
 
         BaseQuoteInfoVo yaQuoteInfoVo = insOrdersComponents.getQuoteInfo(order.getOrderno());
 
-
         /**
          *  4、投保单保存
          */
@@ -652,22 +494,10 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
         iac.setJqapplyno(insuranceSlip.getData().getProposalNoDetailVo().getProposalNoCI());
         iac.setSyapplyno(insuranceSlip.getData().getProposalNoDetailVo().getProposalNoBI());
 
-
-//        String redisNum = buildCarPriceQueryUidNum(yaQuoteInfoVo.getOrderNo());
-//        String uid = RedisUtils.get(redisNum);
-//        //1、投保单保存
-//        InsuranceSlipResp insuranceSlip = insuranceSlip(yaQuoteInfoVo, uid);
-
-//        if(insuranceSlip.getResultCode() == 1) return HttpResult.error(insuranceSlip.getResultMsg());
-
-//        RedisUtils.setObject(buildInsuranceSlipNum(yaQuoteInfoVo.getOrderNo()),insuranceSlip);
-
         //影像上传
         imageUpdate(iac, channelInfo);
-
         insAreaCompanyService.updateById(iac);
 
-
         return HttpResult.ok();
     }
 
@@ -722,7 +552,6 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
      * 支付   获取支付url
      */
     public PayResp.DataDTO pay(InsAreaCompany iac) {
-
         //构造请求参数
         PayReq req = PayReq.buildParam(iac, redirectUrl, channelInfo);
         String bodyStr = RequestDto.builRequestDto(req, "IIRBT00008");
@@ -741,9 +570,7 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
      * 签名链接
      */
     public SignatureResp.DataDTO signature(InsAreaCompany iac) {
-
         //构造请求参数
-//        PayReq req = PayReq.buildParam(iac, redirectUrl, channelInfo);
         Map req = new HashMap();
         req.put("proposalNo", StringUtils.isEmpty(iac.getJqapplyno()) ? iac.getSyapplyno() : iac.getJqapplyno());
 
@@ -754,9 +581,8 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
         ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
         SignatureResp resp = ResponseDto.buildBody(rest, SignatureResp.class);
 
-        if (null != rest) return resp.getData();
+        return resp.getData();
 
-        return null;
     }
 
     /**
@@ -858,76 +684,6 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
     public HttpResult gainAccidentList(AccidentalDrivingQueryVo accidentalDrivingVo) {
 
         return null;
-//        HttpResult httpResult = new HttpResult();
-//
-//        try {
-////            InsAreaCompany iac = insAreaCompanyService.getById(quoteOrderNo);
-////            InsOrders order = insOrdersService.getById(iac.getOrderno());
-////            if (iac == null) {
-////                return HttpResult.error("报价订单不存在");
-////            }
-//
-//            // 获取协议配置信息
-//            ChannelInfoResp.DataDTO.PrptmainDTO channelInfo = gainChannelConfigInfo(accidentalDrivingVo.getAgreementId());
-//            if(null == channelInfo)return HttpResult.error("请先配置保险公司渠道信息");
-//            this.channelInfo = channelInfo;
-//
-//
-//            //组装参数
-//            Accident accident = Accident.buildPayParam(accidentalDrivingVo, ycConfigureParameters, null);
-//
-//            ObjectMapper xmlMapper = null;
-//            //接口请求
-//            log.debug("=========永诚API方式 - xml请求 - 获取意健险方案及险种查询开始======");
-//            InsApiLog apiLog = httpPost(xmlMapper, accident, YcBuildData.API_ACCIDENT);
-//            log.debug("=========永诚API方式 - xml请求 - 获取意健险方案及险种查询结束!======");
-////            verifyRequest(apiLog, iac,InsQuoteFlow.);
-//            String responseData = apiLog.getResponseData();
-//
-//
-//            String cleanStr = YcBuildData.cleanResponseStr(responseData);
-//            AccidentResponse accidentResp = xmlMapper.readValue(cleanStr, AccidentResponse.class);
-//
-//
-//            if (accidentResp.getHead().getResponseCompleteMessageStatus().getMessageStatusCode().equals("E0000")) {
-//                //清空旧的存入表
-//                LambdaQueryWrapper<EsmInsAttachInsure> lqw = new LambdaQueryWrapper<EsmInsAttachInsure>();
-//                lqw.eq(EsmInsAttachInsure::getCompanyId, accidentalDrivingVo.getCompanyCode());
-//                lqw.eq(EsmInsAttachInsure::getSeating, accidentalDrivingVo.getSeatNum());
-//                esmInsAttachInsureMapper.delete(lqw);
-//
-//                List<ResponseYwCvrg.CvrgList> cList = accidentResp.getResponseYwCvrg().getCvrgList();
-//
-//                List<EsmInsAttachInsure> eiaiList = new ArrayList<>();
-//                cList.stream().forEach(a -> {
-//                    EsmInsAttachInsure ati = new EsmInsAttachInsure();
-//                    ati.setCode(a.getCInsuranceTypeCode());
-//                    ati.setName(a.getCInsuranceType());
-//                    ati.setSeating(accidentalDrivingVo.getSeatNum() + "");
-//                    ati.setCompanyId(accidentalDrivingVo.getCompanyCode());
-//                    ati.setType(AttachInsureEnum.AI001.getCode());
-//                    ati.setEnable(WhetherEnum.YES.getCode());
-//                    ati.setRestrictNum(StringUtils.toInt(a.getNPurchaseLimitsNum()));
-//
-//                    esmInsAttachInsureMapper.insert(ati);
-//                    eiaiList.add(ati);
-//                });
-//
-//
-//                httpResult.setData(eiaiList);
-////                httpResult.setData(accidentResp.getResponseYwCvrg().getCvrgList());
-//                httpResult.setMsg(accidentResp.getHead().getResponseCompleteMessageStatus().getMessageStatusDescription());
-//            } else {
-//                httpResult.setMsg(accidentResp.getHead().getResponseCompleteMessageStatus().getMessageStatusDescription());
-//            }
-//
-//        } catch (SystemException e) {
-//            return HttpResult.error(e.getMessage());
-//        } catch (Exception e) {
-//            e.printStackTrace();
-//            return HttpResult.error("系统错误,请联系管理员");
-//        }
-//        return httpResult;
     }
 
 
@@ -936,16 +692,10 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
      */
     @Override
     public HttpResult syncAccidentInsure(AccidentalDrivingQueryVo accidentalDrivingVo) {
-
-
         //家用车驾乘意外险-山西版(02746425173001)
         String goodsCode = "02746425173001";
         NonAutoInsResp.DataDTO nonAutoIns = gainNonAutoInsList(goodsCode);
 
-
-//        AccidentResponse ar = gainAccidentInsure(accidentalDrivingVo, null);
-//        List<EsmInsAttachInsure> eiaiList = new ArrayList<>();
-
         if (null != nonAutoIns) {
             //清空旧的存入表
             LambdaQueryWrapper<EsmInsAttachInsure> lqw = new LambdaQueryWrapper<EsmInsAttachInsure>();
@@ -954,7 +704,6 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
             lqw.select(EsmInsAttachInsure::getId);
             List<EsmInsAttachInsure> eiaiList = esmInsAttachInsureMapper.selectList(lqw);
 
-
             //删除已经存在的数据
             if (CollUtil.isNotEmpty(eiaiList)) {
 
@@ -983,10 +732,8 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
                 ati.setType(AttachInsureEnum.AI001.getCode());
                 ati.setEnable(WhetherEnum.YES.getCode());
                 ati.setRestrictNum(20);
-
                 esmInsAttachInsureMapper.insert(ati);
 
-
                 AtomicInteger total = new AtomicInteger(0);
                 //具体方案信息
                 a.getProdRiskList().get(0).getProdCvgLiabList().stream().forEach(d -> {
@@ -1017,43 +764,14 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
      */
     @Override
     public AccidentResponse gainAccidentInsure(AccidentalDrivingQueryVo accidentalDrivingVo, NonAutoInsResp.DataDTO.ProdListDTO.ProdRiskListDTO scheme) {
-//        HttpResult httpResult = new HttpResult();
-//
-//        // 获取协议配置信息
-//        YcConfigureParameters ycConfigureParameters = gainYcConfigParams(accidentalDrivingVo.getAgreementId());
-//        //组装参数
-//        Accident accident = Accident.buildPayParam(accidentalDrivingVo, ycConfigureParameters, schemeNo);
-//
-//        ObjectMapper xmlMapper = null;
-//        //接口请求
-//        log.debug("=========永诚API方式 - xml请求 - 获取意健险方案及险种查询开始======");
-//        InsApiLog apiLog = httpPost(xmlMapper, accident, YcBuildData.API_ACCIDENT);
-//        log.debug("=========永诚API方式 - xml请求 - 获取意健险方案及险种查询结束!======");
-////            verifyRequest(apiLog, iac,InsQuoteFlow.);
-//        String responseData = apiLog.getResponseData();
-//
-//
-//        String cleanStr = YcBuildData.cleanResponseStr(responseData);
-//        AccidentResponse accidentResp = null;
-//        try {
-//            accidentResp = xmlMapper.readValue(cleanStr, AccidentResponse.class);
-//        } catch (JsonProcessingException e) {
-//            log.error("转换错误 方法:gainAccidentInsure  类:AccidentResponse");
-//            throw new RuntimeException(e);
-//        }
-//        return accidentResp;
-
 
         return null;
-
-
     }
 
 
     @Override
     @Transactional
     public HttpResult callBackApi(HttpServletRequest request) {
-
         //支付流水号
         String orderNo = request.getParameter("orderNo");
         //承保状态  0未承保 1承保
@@ -1073,25 +791,15 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
 
         List<String> proposalNoList = Arrays.asList(proposalNo.split(":"));
 
-
         if (type.equals("1")) {
 
             LambdaQueryWrapper<InsAreaCompany> lqw = new LambdaQueryWrapper();
             lqw.or(a -> a.eq(InsAreaCompany::getJqapplyno, proposalNoList.get(0)).eq(InsAreaCompany::getSyapplyno, proposalNoList.get(1)));
-//            //交强投保单号查询
-//            lqw.eq(StringUtils.isNotEmpty(param.getCiPolicyAppNo()), InsAreaCompany::getJqapplyno, param.getCiPolicyAppNo());
-//            //商业投保单号查询
-//            lqw.eq(StringUtils.isNotEmpty(param.getBizPolicyAppNo()), InsAreaCompany::getSyapplyno, param.getBizPolicyAppNo());
             InsAreaCompany iac = insAreaCompanyService.getOne(lqw);
 
-
             if (null != iac) {
-//                if (StringUtils.isNotEmpty(param.getBizPolicyNo())) iac.setSypolicyno(param.getBizPolicyNo());
-//                if (StringUtils.isNotEmpty(param.getCiPolicyNo())) iac.setJqpolicyno(param.getCiPolicyNo());
 
                 iac.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
-
-
                 InsOrders order = insOrdersService.getById(iac.getOrderno());
                 if (StringUtils.toInt(order.getOrderstatus()) < StringUtils.toInt(iac.getOrderstatus())) {
                     order.setOrderstatus(iac.getOrderstatus());
@@ -1099,10 +807,8 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
 
                 insAreaCompanyService.updateById(iac);
                 insOrdersService.updateByOrderStatus(order.getOrderno(), order.getOrderstatus());
-
                 return HttpResult.ok("承保");
 
-
             }
         }
         return HttpResult.ok("未承保");
@@ -1126,70 +832,11 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
         requestLabel.setCFstRegYm(carModelReq.getEnrollDate());
         requestLabel.setAuthorityData(ycConfigureParameters.gainAuthorityDataXml());
 
-
         m.setRequestLabel(requestLabel);
 
-
         return m;
     }
 
-
-    /**
-     * @description: 构造返回内容,参考永安
-     * @author: lig
-     * @date: 2023年02月07日 0007
-     */
-    private List<ModelsQueryResponse.VehicleInfo> buildCarModel(ModelsQueryResponse modelsQueryResponse) {
-        List<ModelsQueryResponse.VehicleInfo> vList = modelsQueryResponse.getVehicleInfoList();
-        return vList;
-    }
-
-
-    private <T> String httpPost(ObjectMapper mapper, T requestData, String apiName) {
-
-        String xmlString = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:tns=\"http://newWS.front.app.echannel.ebiz.alltrust.com/\">";
-        xmlString += "<soapenv:Body>";
-        try {
-            mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-            xmlString += mapper.writeValueAsString(requestData);
-
-            xmlString += "</soapenv:Body>\n" +
-                    "</soapenv:Envelope>";
-
-        } catch (JsonProcessingException e) {
-            throw new RuntimeException("永诚API方式-xml转换失败");
-        }
-        String s = HttpXmlUtil.sendPost(apiComponents.getUrl() + apiName, xmlString);
-        return s;
-    }
-
-
-    /**
-     * @description: 拷贝永安方法,可以封装
-     * @author: lig
-     * @date: 2023年02月08日 0008
-     */
-    private void checkEmpty(YaQuoteInfoVo yaQuoteInfoVo) {
-
-        if (yaQuoteInfoVo.getCarInfo() == null) {
-            throw new SystemException("carInfo不能为空!");
-        }
-        if (yaQuoteInfoVo.getPolicyHolderInfo() == null || yaQuoteInfoVo.getInsuredPersonInfo() == null) {
-            throw new SystemException("policyHolderInfo/insuredPersonInfo 不能为空!");
-        }
-        if (yaQuoteInfoVo.getRiskList() == null || yaQuoteInfoVo.getRiskList().size() == 0) {
-            throw new SystemException("riskList 不能为空!");
-        } else {
-            for (RiskInfoVo riskInfoVo : yaQuoteInfoVo.getRiskList()) {
-                if (riskInfoVo.getStartDate() == null || riskInfoVo.getEndDate() == null) {
-                    throw new SystemException("riskList.startDate / riskList.endDate不能为空!");
-                }
-            }
-        }
-
-    }
-
-
     /**
      * 新订单 - 子订单  改造为通用
      *
@@ -1198,10 +845,8 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
      */
     private InsAreaCompany response_order(InsOrders insOrder, QuoteRespVo quoteRespVo, BaseQuoteVo<AccidentalDrivingVo> quoteVo) {
 
-
         EsmInsCompany eic = esmInsCompanyService.getById(quoteVo.getCompanyId());
 
-
         //保存订单信息
         InsAreaCompany insAreaCompany = new InsAreaCompany();
         insAreaCompany.setOrderno(insOrder.getOrderno());
@@ -1215,9 +860,6 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
         insAreaCompany.setInscompany(eic.getNamesimple());
         insAreaCompany.setAgreementId(quoteVo.getAgreementId());
 
-//        insAreaCompany.setJqapplyno(proposalNoDetailVo.getProposalNoCI());
-//        insAreaCompany.setSyapplyno(proposalNoDetailVo.getProposalNoBI());
-
         insAreaCompany.setJqStartDate(quoteRespVo.getStartDateJq());
         insAreaCompany.setJqEndDate(quoteRespVo.getEndDateJq());
 
@@ -1242,10 +884,9 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
         //商业保费 含税
         BigDecimal syPremium = BigDecimal.valueOf(StringUtils.toDouble(premiumResult.getSumPremiumBI()));
 
-
-        boolean jq_falg = jqPremium.doubleValue() > 0 ? true : false;
+        boolean jq_falg = jqPremium.doubleValue() > 0;
         //保存订单信息
-        iac.setReptxt(JSONObject.parseObject(JSONObject.toJSONString(premiumResult)));
+        iac.setReptxt(JSON.parseObject(JSON.toJSONString(premiumResult)));
         iac.setJqpremium(jqPremium);
         iac.setSypremium(syPremium);
         iac.setTaxamount(BigDecimal.valueOf(jq_falg ? quoteRespVo.getTaxAmount() : 0));
@@ -1269,32 +910,13 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
 
     }
 
-
     public static double add(double v1, double v2) {
-
         BigDecimal b1 = new BigDecimal(Double.toString(v1));
-
         BigDecimal b2 = new BigDecimal(Double.toString(v2));
-
         return b1.add(b2).doubleValue();
-
     }
 
 
-    public static String getUserName() {
-
-        return "";
-//        String userName = null;
-//        Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();
-//
-//        if (principal instanceof UserDetails) {
-//            userName = ((UserDetails) principal).getUsername();
-//        } else {
-//            userName = principal.toString();
-//        }
-//        return userName;
-    }
-
     /**
      * 验证远程请求
      *
@@ -1310,20 +932,6 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
         }
 
     }
-//    /**
-//     * 验证远程请求
-//     *
-//     * @author: lig
-//     * @date: 2023年02月22日 0022
-//     */
-//    private void verifyRequest(InsApiLog apiLog, InsAreaCompany insAreaCompany) {
-//        //增加api日志
-//        insApiLogService.insertAsync(new InsApiLog(insAreaCompany, apiLog));
-//        if (StringUtils.isNotEmpty(apiLog.getExceptionMsg())) {
-//            throw new RuntimeException("远程接口调用异常");
-//        }
-//
-//    }
 
     /**
      * 更新api log
@@ -1343,16 +951,10 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
 
     @Override
     public Map<String, String> gainRegionCode(String address) {
-
-//        log.debug("*********永诚API方式 - 身份证地址解析 参数:" + address);
         Map<String, String> m = IDCardUtils.addressResolution(address);
         if (null == m) return null;
         String city = m.get("city");
         String district = m.get("district");
-//        if(StringUtils.isNullOrEmpty(district)){
-//            //第二级赋值到第三级
-//            district = city;
-//        }
 
         List<InsAlltrustRegion> areaList = new ArrayList<>();
         if (StringUtils.isNotEmpty(district)) {
@@ -1388,11 +990,9 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
         //投保人
         Applicant a = m.getRequestLabel().getCondition().getApplicant();
 
-
         String provinceCode = "provinceCode";
         String cityCode = "cityCode";
         String areaCode = "areaCode";
-//        owner.getCAreaCde()
 
         Map<String, String> ownerMap = gainRegionCode(owner.getCWaddress());
         if (null != ownerMap && ownerMap.size() > 0) {
@@ -1424,140 +1024,6 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
         }
     }
 
-//    /**
-//     * 构造回调
-//     * 依赖 buildCallBack
-//     *
-//     * @author: lig
-//     * @date: 2023-05-06
-//     */
-//    private InsAreaCompany buildCallBack(InsAreaCompany iac, CallBackRequest param) {
-//        //正常回调 与 补传回调
-//        if (StringUtils.isNotEmpty(param.getStatus())) {
-//            iac = buildCallBackStatus(iac, param.getStatus());
-//        } else {
-//            if (StringUtils.isNotEmpty(param.getJqstatus())) {
-//                iac = buildCallBackStatus(iac, param.getJqstatus());
-//            }
-//            if (StringUtils.isNotEmpty(param.getSystatus())) {
-//                iac = buildCallBackStatus(iac, param.getSystatus());
-//            }
-//
-//        }
-//        return iac;
-//    }
-
-//    /**
-//     * 构造回调状态
-//     *
-//     * @author: lig
-//     * @date: 2023-05-06
-//     */
-//    private InsAreaCompany buildCallBackStatus(InsAreaCompany iac, String status) {
-//        if (status.equals("9")) {
-//            iac.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
-//            //更新支付连接
-//            log.debug("准备进入获取支付连接######################");
-//            iac = getPayUrlApi(iac);
-//            log.debug("结束 - 准备进入获取支付连接######################");
-//        }
-//        if (status.equals("3")) {
-//            iac.setOrderstatus(InsOrderStatusEnum.TO_BACK.getCode());
-//        }
-//        if (status.equals("1")) {
-//            iac.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
-//        }
-//        return iac;
-//    }
-
-
-//    /**
-//     * 通过修改参数后 报价
-//     *
-//     * @author: lig
-//     * @date: 2023年05月17日 0017
-//     */
-//    private RuoteResponse quoteApiByEdit(Ruote m) {
-//
-//        RuoteResponse rd = null;
-//
-//        log.debug("=========永诚API方式 - xml请求 - (修改参数后)报价开始======");
-//        InsApiLog apiLog = httpPost(xmlMapper, m, YcBuildData.API_QUOTE);
-//        log.debug("=========永诚API方式 - xml请求 - (修改参数后)报价结束!======");
-//        verifyRequest(apiLog, null, InsQuoteFlow.Q_S_0);
-//
-//        String responseData = apiLog.getResponseData();
-//
-//        try {
-//            String cleanStr = YcBuildData.cleanResponseStr(responseData);
-//            rd = xmlMapper.readValue(cleanStr, RuoteResponse.class);
-//
-//
-//        } catch (IOException e) {
-//            log.error("=========永诚API方式 - xml请求 - (修改参数后)报价 错误:" + e.getMessage());
-//            throw new RuntimeException(e);
-//        }
-//        return rd;
-//
-//    }
-
-
-    /**
-     * 请求API接口,返回对象
-     *
-     * @author: lig
-     * @date: 2023年05月18日 0018
-     */
-    private <T> T requestApi(Object m, T response, InsAreaCompany iac, String reqUrl, InsQuoteFlow iqf) {
-//    private Object aaa(T m,T ruoteResponse,InsAreaCompany iac){
-        //6 接口请求
-        log.debug("=========永诚API方式 - xml请求 - {}开始======", iqf.getDesc());
-        String s = httpPost(xmlMapper, m, reqUrl);
-        log.debug("=========永诚API方式 - xml请求 - {}结束!======", iqf.getDesc());
-//        verifyRequest(apiLog, iac, iqf);
-
-//        String responseData = apiLog.getResponseData();
-        String cleanStr = YcBuildData.cleanResponseStr(s);
-//        Object rd = null;
-        try {
-            response = (T) xmlMapper.readValue(cleanStr, response.getClass());
-            return response;
-        } catch (JsonProcessingException e) {
-            log.debug("=========永诚API方式 - xml请求 - {}解析报错:{}", iqf.getDesc(), e.getMessage());
-//            throw new RuntimeException(e);
-            throw new SystemException("请求接口失败,对象转换错误,请联系管理员。");
-        }
-    }
-
-
-//    private boolean gainResultFlag(RuoteResponse rd,Ruote m){
-//        boolean flag = false;
-//        if (null == rd) {
-//            throw new SystemException("远程请求报价失败");
-//        }
-//
-//        if (rd.getHead().getErrorCode().equals("000000")) {
-//            //获取失败
-//            boolean fail = !(StringUtils.isNotEmpty(rd.getVhl().getCQryCdeJQ()) || StringUtils.isNotEmpty(rd.getVhl().getCQryCdeSY()));
-//            if (fail) {
-//                //如果类型错误,修改类型后,继续报价
-//                if (StringUtils.isNotEmpty(rd.getVhl().getCBusType())) {
-//                    //修改类型继续报价
-//                    m.getRequestLabel().getCondition().getVhl().setCBusType(rd.getVhl().getCBusType());
-//                    rd = requestApi(m, new RuoteResponse(), iac, YcBuildData.API_QUOTE, InsQuoteFlow.Q_S_0);
-//                    if (null == rd) return HttpResult.error("远程请求报价失败");
-//                    if (fail) {
-//                        throw new SystemException(rd.getHead().getErrorMessage());
-//                    }
-//                }
-//                throw new SystemException(rd.getHead().getErrorMessage());
-//            }
-//        } else {
-//            throw new SystemException(rd.getHead().getErrorMessage());
-//        }
-//
-//    }
-
 
     /**
      * 获取渠道配置信息
@@ -1580,11 +1046,6 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
      */
     public static QuoteRespVo buildQuoteRespVo(InsOrders insOrder, PremiumResp.DataDTO rd, YaQuoteInfoVo yaQuoteInfoVo) {
 
-
-//        if(CollUtil.isEmpty(rd.getItemVOList())){
-//
-//        }
-
         //交强保费 含税
         BigDecimal jqPremiumBig = BigDecimal.valueOf(StringUtils.toDouble(rd.getSumPremiumCI()));
         //商业保费 含税
@@ -1645,10 +1106,6 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
         quoteRespVo.setRiskList(riskList1);
         quoteRespVo.setKindList(kindRespVoList);
 
-
-        PremiumResp.DataDTO.ItemVOListDTO itemVoListDto = rd.getItemVOList().get(0);
-
-
         quoteRespVo.setCiSumPermium(jqPremiumBig.add(taxPremiumBig).doubleValue());//交强险和车船税合计
         quoteRespVo.setSumPermium(sumPermium.doubleValue());//保费合计
         quoteRespVo.setTaxAmount(taxPremiumBig.doubleValue());//车船税
@@ -1777,8 +1234,6 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
 
         InsuranceSlipResp insuranceSlip = JSON.parseObject(s, InsuranceSlipResp.class);
 
-//        InsuranceSlipResp insuranceSlip = (InsuranceSlipResp) JSON.parse(buildInsuranceSlipNum(orderNo));
-//        InsuranceSlipResp insuranceSlip = (InsuranceSlipResp) RedisUtils.getObject(buildInsuranceSlipNum(orderNo));
         return insuranceSlip;
     }
 
@@ -1820,13 +1275,9 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
         //构造请求参数
         CarPriceReq req = CarPriceReq.buildCarPriceParam(yaQuoteInfoVo, vinQ, channelInfo);
         String bodyStr = RequestDto.builRequestDto(req, "IIRBT00003");
-
         String result = HttpUtil.sendPost(baseUrl, bodyStr, log, "车价查询,车牌:" + yaQuoteInfoVo.getCarInfo().getLicenseNo());
-//        String result = HttpUtil.sendPost(baseUrl, bodyStr);
-
         ResponseDto rest = JSON.parseObject(result, ResponseDto.class);
 
-
         if (rest.getPlatformCode().equals("T0000000")) {
 
             //多条
@@ -1842,7 +1293,7 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
                 return resp.getData();
 
             } else {
-                CarPriceMuchResp.DataDTO.CarsDTO confirmCarMuch = new CarPriceMuchResp.DataDTO.CarsDTO();
+                CarPriceMuchResp.DataDTO.CarsDTO confirmCarMuch;
                 CarInfoVo carInfo = yaQuoteInfoVo.getCarInfo();
 //                //匹配车型
                 //车辆年款不能超过注册日期
@@ -1867,17 +1318,10 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
                     }
                 }
 
-
                 return carPriceQueryMuch(respMuch.getData().getInputvo(), confirmCarMuch, yaQuoteInfoVo.getCarInfo().getLicenseNo());
 
-
             }
 
-
-//            if (resp.getResultCode() == 1) {
-//                throw new SystemException(resp.getResultMsg() == null ? "未获取到车价信息,请联系管理员" : resp.getResultMsg());
-//            }
-//            return resp.getData();
         }
 
         return null;
@@ -1932,6 +1376,7 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
         PremiumReq req = PremiumReq.buildQuoteParam(yaQuoteInfoVo, carPriceResult, vinQ);
         PremiumResp resp = null;
         StringBuffer flag = new StringBuffer();
+
         while (boo) {
             String bodyStr = RequestDto.builRequestDto(req, "IIRBT00004");
             String result = HttpUtil.sendPost(baseUrl, bodyStr, log, "保费计算 |" + flag + ",车牌:" + yaQuoteInfoVo.getCarInfo().getLicenseNo());
@@ -1956,10 +1401,8 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
                     continue;
                 }
 
-
             }
 
-
         }
 
         resp.getData().setCiStartDate(req.getCi().getPrpTmain().getStartDate());
@@ -2179,7 +1622,7 @@ public class InsGuoRenApiServiceImpl implements InsGuoRenApiService {
     /**
      * 构造交强险  商业险 转报code
      *
-     * @param boo true 继续请求
+     * @param xlboo true 继续请求
      * @author: lig
      * @date: 2023年10月13日 0013
      */

+ 65 - 334
src/main/java/com/ydtech/modules/ins/service/impl/InsAlltrustApiServiceImpl.java → src/main/java/com/ydtech/modules/order/service/impl/YongchengOrderApiServiceImpl.java

@@ -1,45 +1,36 @@
-package com.ydtech.modules.ins.service.impl;
+package com.ydtech.modules.order.service.impl;
 
 import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.core.collection.CollUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.*;
-import com.fasterxml.jackson.dataformat.xml.XmlMapper;
-import com.ydtech.components.InsAlltrustRequestApiComponents;
+import com.ydtech.config.properties.YongchengApiConfigurationProperties;
+import com.ydtech.constants.InsuranceEnum;
 import com.ydtech.constants.SysConstants;
-import com.ydtech.constants.enums.InsQuoteFlow;
 import com.ydtech.constants.enums.dict.AttachInsureEnum;
 import com.ydtech.constants.enums.dict.InsOrderStatusEnum;
 import com.ydtech.constants.enums.dict.WhetherEnum;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.exception.SystemException;
-import com.ydtech.modules.admin.service.SysDeptService;
-import com.ydtech.modules.admin.service.SysUserService;
 import com.ydtech.modules.esm.dao.EsmInsAttachInsureDetailsMapper;
 import com.ydtech.modules.esm.dao.EsmInsAttachInsureMapper;
 import com.ydtech.modules.esm.model.EsmInsAttachInsure;
 import com.ydtech.modules.esm.model.EsmInsAttachInsureDetails;
 import com.ydtech.modules.esm.model.EsmInsCompany;
-import com.ydtech.modules.esm.service.EsmAgreementProdService;
-import com.ydtech.modules.esm.service.EsmAgreementService;
 import com.ydtech.modules.esm.service.EsmInsCompanyService;
-import com.ydtech.modules.esm.service.EsmRetailService;
 import com.ydtech.modules.ins.dao.InsAlltrustRegionMapper;
-import com.ydtech.modules.ins.model.InsApiLog;
 import com.ydtech.modules.ins.model.dto.CarInsDateDto;
 import com.ydtech.modules.ins.model.dto.CarInsPolicyDto;
 import com.ydtech.modules.ins.model.vo.CarInfoVo;
 import com.ydtech.modules.ins.model.vo.CustomerInfoVo;
 import com.ydtech.modules.ins.model.vo.QuoteRespVo;
-import com.ydtech.modules.ins.model.vo.RiskInfoVo;
 import com.ydtech.modules.ins.model.ya.CarModel_Req;
-import com.ydtech.modules.ins.model.ya.YaQuoteInfoVo;
-import com.ydtech.modules.ins.model.yc.*;
+import com.ydtech.modules.ins.model.yc.CallBackRequest;
+import com.ydtech.modules.ins.model.yc.InsAlltrustRegion;
+import com.ydtech.modules.ins.model.yc.YcBuildData;
+import com.ydtech.modules.ins.model.yc.YcConfigureParameters;
 import com.ydtech.modules.ins.model.yc.accident.Accident;
 import com.ydtech.modules.ins.model.yc.accident.response.ResponseYwCvrg;
 import com.ydtech.modules.ins.model.yc.audit.Audit;
@@ -58,11 +49,10 @@ import com.ydtech.modules.ins.model.yc.ruote.Base;
 import com.ydtech.modules.ins.model.yc.ruote.Ruote;
 import com.ydtech.modules.ins.model.yc.ruote.response.RuoteResponse;
 import com.ydtech.modules.ins.model.yc.ruote.response.TfiWarnListResponse;
-import com.ydtech.modules.ins.service.InsAlltrustApiService;
 import com.ydtech.modules.ins.service.InsApiLogService;
-import com.ydtech.modules.ins.service.InsTaskHistoryService;
 import com.ydtech.modules.order.components.ConfigureParametersComponents;
 import com.ydtech.modules.order.components.InsOrdersComponents;
+import com.ydtech.modules.order.components.yongcheng.YongchengRequestApiComponents;
 import com.ydtech.modules.order.entity.InsAreaCompany;
 import com.ydtech.modules.order.entity.InsOrders;
 import com.ydtech.modules.order.entity.po.InsTaskImagesBase64;
@@ -70,6 +60,8 @@ import com.ydtech.modules.order.entity.vo.*;
 import com.ydtech.modules.order.service.InsAreaCompanyService;
 import com.ydtech.modules.order.service.InsOrdersService;
 import com.ydtech.modules.order.service.InsTaskImagesService;
+import com.ydtech.modules.order.service.YongchengOrderApiService;
+import com.ydtech.modules.order.utils.InsuranceLog;
 import com.ydtech.modules.protocol.utils.AssertionUtils;
 import com.ydtech.utils.*;
 import com.ydtech.utils.baidu.FileUtil;
@@ -90,18 +82,17 @@ import java.util.stream.Collectors;
 
 
 @Service
-public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
+public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
 
     private static final Logger log = LoggerFactory.getLogger("alltrust");
 
     @Autowired
-    private InsAlltrustRequestApiComponents apiComponents;
+    private YongchengApiConfigurationProperties apiComponents;
 
     @Autowired
-
     private InsAlltrustRegionMapper insAlltrustRegionMapper;
-    @Autowired
 
+    @Autowired
     private InsOrdersComponents insOrdersComponents;
 
     //请求信息列表
@@ -141,48 +132,28 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
     @Autowired
     ConfigureParametersComponents configureParametersComponents;
 
-
-    private ObjectMapper gainXmlMapper() {
-        ObjectMapper xmlMapper = new XmlMapper();
-
-        xmlMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
-        xmlMapper.configure(SerializationFeature.WRAP_ROOT_VALUE, false);
-        xmlMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-        xmlMapper.setPropertyNamingStrategy(PropertyNamingStrategy.UPPER_CAMEL_CASE);
-        xmlMapper.enable(MapperFeature.USE_STD_BEAN_NAMING);
-        xmlMapper.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true);
-        return xmlMapper;
-    }
-
+    @Autowired
+    private YongchengRequestApiComponents yongchengRequestApiComponents;
 
     //
     //==============================API 方式
     //
     public void gainVehicleModel(YcConfigureParameters ycConfigureParameters, CarInfoVo carInfo) {
-
         CarModel_Req carModelReq = new CarModel_Req();
         carModelReq.setFrameNo(carInfo.getFrameNo());
         carModelReq.setEngineNo(carInfo.getEngineNo());
-        carModelReq.setEnrollDate(carInfo.getRegisterDate().replaceAll("-", ""));
-
-        log.info("===永诚--车型查询接口请求   =====参数确认:--" + ycConfigureParameters.getDptCde() + "===");
+        carModelReq.setEnrollDate(carInfo.getRegisterDate().replace("-", ""));
         ModelsQueryXml m = buildModelsQueryParam(carModelReq, ycConfigureParameters);
-
-        log.info("===永诚--车型查询接口请求开始--" + carInfo.getLicenseNo() + "===");
-        String responseData = httpPostResultLog(m, YcBuildData.API_MODEL, "永诚API方式 - 车型查询(vin:" + carInfo.getVinNo() + ") - ");
-
-        AssertionUtils.isEmpty(responseData, "永诚 车型查询接口响应返回空!");
-        log.info("===永诚--车型查询接口请求结束--" + carInfo.getLicenseNo() + "===");
-        ModelsQueryResponse rd = null;
+        ModelsQueryResponse rd;
         try {
-            String cleanStr = YcBuildData.cleanResponseStr(responseData);
-            rd = gainXmlMapper().readValue(cleanStr, ModelsQueryResponse.class);
-
+            rd = yongchengRequestApiComponents.newQueryVehicleTypes(m);
         } catch (IOException e) {
             throw new SystemException("车型查询接口异常,请联系管理。");
         }
 
-        if (CollUtil.isEmpty(rd.getVehicleInfoList())) throw new SystemException("永诚车型库查找失败");
+        if (CollUtil.isEmpty(rd.getVehicleInfoList())) {
+            throw new SystemException("永诚车型库查找失败");
+        }
 
         //车辆年款不能超过注册日期
         List<ModelsQueryResponse.VehicleInfo> vehicleInfoList = rd.getVehicleInfoList().stream().filter(a -> DateTimeUtil.dateIsAfter(carInfo.getRegisterDate(), a.getVehicleYear())).sorted(Comparator.comparing(ModelsQueryResponse.VehicleInfo::getVehiclePrice)).collect(Collectors.toList());
@@ -199,9 +170,8 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
 
             //金额升序
             vehicleInfoList = rd.getVehicleInfoList().stream().sorted(Comparator.comparing(ModelsQueryResponse.VehicleInfo::getVehiclePrice)).collect(Collectors.toList());
-            buildCarInfo(carInfo, rd.getVehicleInfoList().get(0));
+            buildCarInfo(carInfo, vehicleInfoList.get(0));
             return;
-
         }
 
         //匹配的车辆信息数据
@@ -227,24 +197,18 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
      */
     @Override
     @Transactional
-    public HttpResult quoteApi(BaseQuoteVo<AccidentalDrivingVo> quoteVo) {
+    public HttpResult quoteApi(BaseQuoteVo<AccidentalDrivingVo> quoteVo) throws JsonProcessingException {
 
         requestInfoList = new ArrayList<>();
 
         // 获取协议配置信息
         YcConfigureParameters ycConfigureParameters = gainYcConfigParams(quoteVo.getAgreementId());
-
         BaseQuoteInfoVo yaQuoteInfoVo = insOrdersComponents.getQuoteInfo(quoteVo.getOrderNo());
-
         CarInfoVo carInfo = yaQuoteInfoVo.getCarInfo();
 
         //构造车辆信息
         gainVehicleModel(ycConfigureParameters, carInfo);
-
-        InsAreaCompany iac = null;
-
         InsOrders order = insOrdersService.getById(yaQuoteInfoVo.getOrderNo());
-
         AccidentalDrivingVo adVo = quoteVo.getAccidentalDrivingVo();
 
         //组装参数
@@ -254,25 +218,33 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
 
         RuoteResponse rr = null;
         boolean boo = false;
-        boolean isRenewal = true;
         boolean isBiRepeat = true;
-        String textHead = "==========永诚API方式 - 车架号:" + carInfo.getVinNo() + " - 报价 ";
+        String vinNo = carInfo.getVinNo();
+
         while (!boo) {
-            rr = requestApi(m, new RuoteResponse(), iac, YcBuildData.API_QUOTE, InsQuoteFlow.Q_S_0, textHead);
-            if (rr.getHead().getErrorCode().equals("009999") && (rr.getHead().getErrorMessage().contains("车主") || rr.getHead().getErrorMessage().contains("投保人") || rr.getHead().getErrorMessage().contains("被保人")))
+            rr = yongchengRequestApiComponents.newPremiumXnyCalculation(m);
+            //交强
+            m.getRequestLabel().getCondition().getVhl().setCCheckCodeJQ("");
+            m.getRequestLabel().getCondition().getVhl().setCQryCdeJQ("");
+            //商业
+            m.getRequestLabel().getCondition().getVhl().setCCheckCodeSY("");
+            m.getRequestLabel().getCondition().getVhl().setCQryCdeSY("");
+
+            if (rr.getHead().getErrorCode().equals("009999") && (rr.getHead().getErrorMessage().contains("车主") || rr.getHead().getErrorMessage().contains("投保人") || rr.getHead().getErrorMessage().contains("被保人"))) {
                 return HttpResult.error(rr.getHead().getErrorMessage());
+            }
             //处理返回信息
             //1、交强险重复投保处理
             boo = ciRepetitionInsure(rr, m);
             if (!boo) {
-                textHead += " - 交强险重复投保处理 ";
+                InsuranceLog.infoLog(InsuranceEnum.AICS.getPinyin(), "\n\n---------> {} - 交强险重复投保处理", vinNo);
                 continue;
             }
 
             //2、转保处理
             boo = reinsurance(rr, m);
             if (!boo) {
-                textHead += " - 转保处理 ";
+                InsuranceLog.infoLog(InsuranceEnum.AICS.getPinyin(), "\n\n---------> {} - 转保处理", vinNo);
                 continue;
             }
 
@@ -281,24 +253,12 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
                 boo = biRepetitionInsure(rr, m);
                 if (!boo) {
                     isBiRepeat = false;
-                    textHead += " - 商业险日期处理 ";
-                    continue;
+                    InsuranceLog.infoLog(InsuranceEnum.AICS.getPinyin(), "\n\n---------> {} - 商业险日期处理", vinNo);
                 }
             }
 
-            int codeErrorNum = 0;
-            if (codeErrorNum > 3) {
-                boo = true;
-            }
-            //转保验证码错误
-            boo = reinsuranceCodeError(rr, m);
-            if (!boo) {
-                codeErrorNum++;
-                continue;
-            }
-
         }
-        if (null == rr) return HttpResult.error("远程请求报价失败");
+
         StringBuffer sb = new StringBuffer();
         if (rr.getHead().getErrorCode().equals("E0001") && rr.getHead().getErrorMessage().equals("车主省市县码值不符合规范")) {
             sb.append("|永诚 - 保司 - 车主地区自动解析失败");
@@ -319,18 +279,12 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
 
         QuoteRespVo quoteRespVo = YcBuildData.buildQuoteRespVo(order, rr, yaQuoteInfoVo);
         //8 生成订单
-        iac = response_order(order, quoteRespVo, m, rr, quoteVo);
-
+        InsAreaCompany iac = response_order(order, quoteRespVo, m, rr, quoteVo);
         quoteRespVo.setCompanyId(iac.getId());
 
-        //查询码交强
-        String queryCodeJq = rr.getVhl().getCQryCdeJQ();
-        //查询码商业
-        String queryCodeSy = rr.getVhl().getCQryCdeSY();
-
-        order.setOwnerinfo(JSONObject.parseObject(JSONObject.toJSONString(yaQuoteInfoVo.getOwnerInfo())));
-        order.setInsureinfo(JSONObject.parseObject(JSONObject.toJSONString(yaQuoteInfoVo.getInsuredPersonInfo())));
-        order.setApplyinfo(JSONObject.parseObject(JSONObject.toJSONString(yaQuoteInfoVo.getPolicyHolderInfo())));
+        order.setOwnerinfo(JSON.parseObject(JSON.toJSONString(yaQuoteInfoVo.getOwnerInfo())));
+        order.setInsureinfo(JSON.parseObject(JSON.toJSONString(yaQuoteInfoVo.getInsuredPersonInfo())));
+        order.setApplyinfo(JSON.parseObject(JSON.toJSONString(yaQuoteInfoVo.getPolicyHolderInfo())));
 
         insOrdersService.updateById(order);
         if (CollUtil.isNotEmpty(requestInfoList)) {
@@ -341,7 +295,6 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
 
     }
 
-
     /**
      * 报价  交强险 重复 投保业务处理
      */
@@ -353,12 +306,9 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
 
             //截取0 到 机动车交通事故强制险
             String ciMsg = errorMsg;
-
             //终保日期
             String coverageEndDate = ciMsg.substring(ciMsg.indexOf("终保日期") + 5, ciMsg.indexOf("终保日期") + 5 + 16);
-
             LocalDateTime start = DateTimeUtil.parseLocalDateTime(coverageEndDate, DateTimeUtil.DATETIME_PATTERN_EXT1);
-
             LocalDateTime end = start.plusYears(1L).minusDays(1L);
             String newStartDate = DateTimeUtil.getStartTimeOfDayStr(start, DateTimeUtil.DATETIME_PATTERN);
             if (start.getHour() > 0) {
@@ -369,10 +319,8 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
             String newEndDate = DateTimeUtil.getEndTimeOfDayStr(end, DateTimeUtil.DATETIME_PATTERN);
             System.err.println("新起:" + newStartDate);
             System.err.println("新止:" + newEndDate);
-
             CarInsDateDto cidd = Base.buildInsDate(newStartDate, newEndDate);
 
-
             m.getRequestLabel().getCondition().getBase().setTInsrncBgnTmJQ(cidd.getStartDate());
             m.getRequestLabel().getCondition().getBase().setTInsrncEndTmJQ(cidd.getEndDate());
             m.getRequestLabel().getCondition().getBase().setCImmeffMrk(cidd.isForthwith() ? "1" : "0");
@@ -401,11 +349,9 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
 
             if (null == tfiWarnData) return true;
 
-
             //截取0 到 机动车交通事故强制险
             String ciMsg = tfiWarnData.getWarnMessage();
             requestInfoList.add(ciMsg);
-
             if (ciMsg.contains("终保日期: 以上为所有结果信息")) return true;
 
             //终保日期
@@ -423,14 +369,8 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
             m.getRequestLabel().getCondition().getBase().setTInsrncEndTmSY(newEndDate);
 
             //转保信息清空  重新报价
-            m.getRequestLabel().getCondition().getVhl().setCQryCdeJQ(null);
-            m.getRequestLabel().getCondition().getVhl().setCCheckCodeJQ(null);
-
-            m.getRequestLabel().getCondition().getVhl().setCCheckCodeSY(null);
-            m.getRequestLabel().getCondition().getVhl().setCQryCdeSY(null);
             m.getRequestLabel().getCondition().getVhl().setCBusType("0");
 
-
             return false;
 
         }
@@ -508,7 +448,6 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
     @Override
     @Transactional
     public HttpResult auditApi(String quoteOrderNo) {
-        String logNo = String.format("(日志号:%s)", IPUtil.gainServerNo());
         //子订单
         InsAreaCompany iac = insAreaCompanyService.getByIdIsExist(quoteOrderNo);
         InsOrders order = insOrdersService.getById(iac.getOrderno());
@@ -516,11 +455,11 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
         YcConfigureParameters ycConfigureParameters = gainYcConfigParams(iac.getAgreementId());
 
         //车主
-        CustomerInfoVo ownerInfo = JSON.parseObject(order.getOwnerinfo().toJSONString(), CustomerInfoVo.class);
+        CustomerInfoVo ownerInfo = order.getOwnerinfo().toJavaObject(CustomerInfoVo.class);
         //被保人
-        CustomerInfoVo insureInfo = JSON.parseObject(order.getInsureinfo().toJSONString(), CustomerInfoVo.class);
+        CustomerInfoVo insureInfo = order.getInsureinfo().toJavaObject(CustomerInfoVo.class);
         //投保人
-        CustomerInfoVo applyInfo = JSON.parseObject(order.getApplyinfo().toJSONString(), CustomerInfoVo.class);
+        CustomerInfoVo applyInfo = order.getApplyinfo().toJavaObject(CustomerInfoVo.class);
         //组装参数
         Audit m = Audit.buildAuditParam(ownerInfo, insureInfo, applyInfo, ycConfigureParameters, iac);
 
@@ -531,14 +470,8 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
         m.getRequestLabel().getCondition().getCustomer().setCCity(insureProvinceData.get(1));
         m.getRequestLabel().getCondition().getCustomer().setCCounty(insureProvinceData.get(2));
 
-        //接口请求
-        String responseData = httpPostResultLog(m, YcBuildData.API_AUDIT, "永诚API方式 - 核保(订单号:" + iac.getId() + ")(车牌号:" + order.getLicenseno() + ") - ");
-        AssertionUtils.isEmpty(responseData, logNo + "核保请求超时请重试。");
-
-        String cleanStr = YcBuildData.cleanResponseStr(responseData);
         try {
-            AuditResponse rd = gainXmlMapper().readValue(cleanStr, AuditResponse.class);
-
+            AuditResponse rd = yongchengRequestApiComponents.newXnyUnderwritingService(m);
             if (rd.getResponseHead().getReturnCode().equals("E0001") && rd.getResponseHead().getReturnMessage().contains("核保时间需要小于起保日期")) {
                 throw new SystemException("核保请求异常,请重试核保。");
             }
@@ -566,7 +499,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
                 buildOrderStatus(order, iac);
 
             } else {
-                throw new SystemException(logNo + "核保失败,车牌号:" + order.getLicenseno() + " ," + rd.getResponseHead().getReturnMessage());
+                throw new SystemException("核保失败,车牌号:" + order.getLicenseno() + " ," + rd.getResponseHead().getReturnMessage());
             }
 
             iac.setAuditid(StpUtil.getLoginId().toString());
@@ -581,7 +514,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
                 //获取缴费地址
                 getPayUrlApi(iac);
             }
-            log.info(logNo + "车牌号:" + order.getLicenseno() + ",永诚核保未获取缴费地址,状态为:" + InsOrderStatusEnum.matchKey(iac.getOrderstatus()).getDesc());
+            log.info("车牌号:" + order.getLicenseno() + ",永诚核保未获取缴费地址,状态为:" + InsOrderStatusEnum.matchKey(iac.getOrderstatus()).getDesc());
             insAreaCompanyService.updateById(iac);
             insOrdersService.updateById(order);
             return HttpResult.ok("核保操作成功");
@@ -615,17 +548,9 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
             //组装参数
             //接口请求
             ImageUp iUp = ImageUp.buildImageUpParam(order, ycConfigureParameters, a.getBase64String(), a.getImageType());
-            ObjectMapper xmlMapper = gainXmlMapper();
-            //接口请求
-//            apiLog = httpPost(xmlMapper, iUp, YcBuildData.API_UPLOAD);
-            String responseData = httpPostResultLog(iUp, YcBuildData.API_UPLOAD, logNo + "永诚API方式(车牌号:)" + order.getLicenseno() + " - 影像上传 - " + iUp.getNewImgUpLoadInfoRequest().getRequestBase().getPicTureName() + " - ");
-            AssertionUtils.isEmpty(responseData, logNo + "永诚影像上传失败,请重试。");
             try {
-                String cleanStr = YcBuildData.cleanResponseStr(responseData);
-                log.error("===永诚API方式--上传影像清洗返回参数:" + cleanStr);
-                ImageUpResponse iur = xmlMapper.readValue(cleanStr, ImageUpResponse.class);
-
-            } catch (IOException e) {
+                ImageUpResponse imageUpResponse = yongchengRequestApiComponents.newImageUp(iUp);
+            } catch (JsonProcessingException e) {
                 e.printStackTrace();
                 log.error("===永诚API方式--上传影像报错:" + e.getMessage());
                 throw new SystemException("系统错误,请联系管理员");
@@ -648,15 +573,8 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
             YcConfigureParameters ycConfigureParameters = gainYcConfigParams(iac.getAgreementId());
             //组装参数
             Pay pay = Pay.buildPayParam(iac, ycConfigureParameters.gainAuthorityDataXml(), apiComponents.getPayCallBack());
-
-            ObjectMapper xmlMapper = gainXmlMapper();
             //接口请求
-            log.debug("=========永诚API方式 - xml请求 - 获取缴费链接开始======");
-            String responseData = httpPostResultLog(pay, YcBuildData.API_PAY, "永诚API方式 - 获取缴费链接 - ");
-            log.debug("=========永诚API方式 - xml请求 - 获取缴费链接结束!======");
-
-            String cleanStr = YcBuildData.cleanResponseStr(responseData);
-            PayResponse payResp = xmlMapper.readValue(cleanStr, PayResponse.class);
+            PayResponse payResp = yongchengRequestApiComponents.newGetPayNo(pay);
 
             if (payResp.getReturnCode().equals("E0000")) {
                 iac.setPaymentLink(payResp.getPayTransUrl());
@@ -681,7 +599,9 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
         InsOrders order = insOrdersService.getById(iac.getOrderno());
         AssertionUtils.isEmpty(iac, "报价订单不存在");
 
-        if (StringUtils.isEmpty(iac.getAgreementId())) return HttpResult.error("协议号空");
+        if (StringUtils.isEmpty(iac.getAgreementId())) {
+            return HttpResult.error("协议号空");
+        }
 
         // 获取协议配置信息
         YcConfigureParameters ycConfigureParameters = gainYcConfigParams(iac.getAgreementId());
@@ -691,14 +611,9 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
         CallbackAnOrder o = CallbackAnOrder.buildCallbackAnOrderParam(iac, ycConfigureParameters.gainAuthorityDataXml(), type);
 
         //接口请求
-        String respData = httpPostResultLog(o, YcBuildData.API_ORDER_QUERY, "永诚API方式 - 补传回调 - ");
-
-        String cleanStr = YcBuildData.cleanResponseStr(respData);
-
-        if (StringUtils.isNotEmpty(cleanStr)) {
-            if (cleanStr.equals("账户不存在或没有权限")) return HttpResult.ok("账户不存在或没有权限");
+        try {
+            String cleanStr = yongchengRequestApiComponents.payCallback(o);
             CallBackRequest param = CallBackRequest.buildCallBackParam(cleanStr);
-
             log.info("永诚API方式 - 补传回调 - 参数:{},车牌号:{}", JSON.toJSONString(param), order.getLicenseno());
 
             //成功
@@ -736,6 +651,8 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
                 return HttpResult.error(param.getMessage());
             }
             return HttpResult.ok("操作成功,状态已更新。");
+        } catch (JsonProcessingException jsonProcessingException) {
+            jsonProcessingException.printStackTrace();
         }
 
         throw new SystemException("获取支付连接失败");
@@ -751,12 +668,11 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
         lqw.gt(InsAreaCompany::getAudittime, LocalDate.now().minusDays(1));
         List<InsAreaCompany> list = insAreaCompanyService.list(lqw);
 
-        if (null != list && list.size() > 0) {
-            list.stream().forEach(a -> {
+        if (null != list && !list.isEmpty()) {
+            list.forEach(a -> {
                 callbackAnOrder(a.getId());
             });
         }
-
     }
 
     /**
@@ -803,13 +719,11 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
 
         } else if (insFlag.equals("ds")) {//单商
             String syUrl = gainExistCarInsPolicy(licensePlate + sybd, licensePlate);
-
             if (StringUtils.isNotEmpty(syUrl)) {
                 cipDto.setSyUrl(syUrl);
                 return HttpResult.ok(cipDto);
             }
         } else if (insFlag.equals("js")) {//交商业
-
             String syUrl = gainExistCarInsPolicy(licensePlate + sybd, licensePlate);
             String jqFlagUrl = gainExistCarInsPolicy(licensePlate + jqbz, licensePlate);
             String jqUrl = gainExistCarInsPolicy(licensePlate + jqbd, licensePlate);
@@ -822,22 +736,15 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
             }
         }
 
-
         // 获取协议配置信息
         YcConfigureParameters ycConfigureParameters = gainYcConfigParams(iac.getAgreementId());
         String policyNo = policyPrintVo.getRiskCode().equals("0507") ? iac.getJqpolicyno() : iac.getSypolicyno();
         //组装参数
         Policy p = Policy.buildPolicyParam(policyNo, ycConfigureParameters.gainAuthorityDataXml());
-        ObjectMapper xmlMapper = gainXmlMapper();
-
         //接口请求
-        String responseData = httpPostResultLog(p, YcBuildData.API_GUARANTEE_SLIP, "车牌号:" + order.getLicenseno() + ",永诚API方式 - 获取保单 - ");
-
-        String cleanStr = YcBuildData.cleanResponseStr(responseData);
 
         try {
-            PolicyResponse pResp = xmlMapper.readValue(cleanStr, PolicyResponse.class);
-
+            PolicyResponse pResp = yongchengRequestApiComponents.dzbdWeb(p);
             if (pResp.getHead().getResponseCompleteMessageStatus().getMessageStatusCode().equals("E0000")) {
 
                 //标志
@@ -872,7 +779,6 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
             throw new SystemException("获取支付连接失败");
         }
 
-
     }
 
 
@@ -885,19 +791,11 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
 
         // 获取协议配置信息
         YcConfigureParameters ycConfigureParameters = gainYcConfigParams(accidentalDrivingVo.getAgreementId());
-
         //组装参数
         Accident accident = Accident.buildPayParam(accidentalDrivingVo, ycConfigureParameters, null);
 
-        ObjectMapper xmlMapper = gainXmlMapper();
-        //接口请求
-        log.debug("=========永诚API方式 - xml请求 - 获取意健险方案及险种查询开始======");
-        String responseData = httpPostResultLog(accident, YcBuildData.API_ACCIDENT, "永诚API方式 - 获取意健险方案及险种 - ");
-        log.debug("=========永诚API方式 - xml请求 - 获取意健险方案及险种查询结束!======");
-
-        String cleanStr = YcBuildData.cleanResponseStr(responseData);
         try {
-            AccidentResponse accidentResp = xmlMapper.readValue(cleanStr, AccidentResponse.class);
+            AccidentResponse accidentResp = yongchengRequestApiComponents.newQueryYwCvrgWeb(accident);
 
             if (accidentResp.getHead().getResponseCompleteMessageStatus().getMessageStatusCode().equals("E0000")) {
                 //清空旧的存入表
@@ -918,7 +816,6 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
                     ati.setType(AttachInsureEnum.AI001.getCode());
                     ati.setEnable(WhetherEnum.YES.getCode());
                     ati.setRestrictNum(StringUtils.toInt(a.getNPurchaseLimitsNum()));
-
                     esmInsAttachInsureMapper.insert(ati);
                     eiaiList.add(ati);
                 });
@@ -1016,27 +913,17 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
      */
     @Override
     public AccidentResponse gainAccidentInsure(AccidentalDrivingQueryVo accidentalDrivingVo, String schemeNo) {
-        HttpResult httpResult = new HttpResult();
-
         // 获取协议配置信息
         YcConfigureParameters ycConfigureParameters = gainYcConfigParams(accidentalDrivingVo.getAgreementId());
         //组装参数
         Accident accident = Accident.buildPayParam(accidentalDrivingVo, ycConfigureParameters, schemeNo);
 
-        ObjectMapper xmlMapper = gainXmlMapper();
-        //接口请求
-        log.debug("=========永诚API方式 - xml请求 - 获取意健险方案及险种查询开始======");
-        String responseData = httpPostResultLog(accident, YcBuildData.API_ACCIDENT, "永诚API方式 - 获取意健险方案及险种 - ");
-        log.debug("=========永诚API方式 - xml请求 - 获取意健险方案及险种查询结束!======");
-        String cleanStr = YcBuildData.cleanResponseStr(responseData);
-        AccidentResponse accidentResp = null;
         try {
-            accidentResp = xmlMapper.readValue(cleanStr, AccidentResponse.class);
+            return yongchengRequestApiComponents.newQueryYwCvrgWeb(accident);
         } catch (JsonProcessingException e) {
             log.error("转换错误 方法:gainAccidentInsure  类:AccidentResponse");
             throw new SystemException(e.getMessage());
         }
-        return accidentResp;
 
     }
 
@@ -1044,7 +931,6 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
     @Override
     @Transactional
     public HttpResult callBackApi(CallBackRequest param) {
-
         //成功
         if (param.getResult().equals("0")) {
             LambdaQueryWrapper<InsAreaCompany> lqw = new LambdaQueryWrapper();
@@ -1098,89 +984,10 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
         requestLabel.setMotorTypeCode("11");
         requestLabel.setCFstRegYm(carModelReq.getEnrollDate());
         requestLabel.setAuthorityData(ycConfigureParameters.gainAuthorityDataXml(ycConfigureParameters));
-
         m.setRequestLabel(requestLabel);
-
-
         return m;
     }
 
-    /**
-     * @description: 构造返回内容,参考永安
-     * @author: lig
-     * @date: 2023年02月07日 0007
-     */
-    private List<ModelsQueryResponse.VehicleInfo> buildCarModel(ModelsQueryResponse modelsQueryResponse) {
-        List<ModelsQueryResponse.VehicleInfo> vList = modelsQueryResponse.getVehicleInfoList();
-        return vList;
-    }
-
-    /**
-     * 日志返回处理
-     *
-     * @author: lig
-     * @date: 2023年09月02日 0002
-     */
-    private <T> String httpPostResultLog(T requestData, String apiName, String textHead) {
-
-        String xmlString = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:tns=\"http://newWS.front.app.echannel.ebiz.alltrust.com/\">";
-        xmlString += "<soapenv:Body>";
-        try {
-
-            ObjectMapper xmlMapper = new XmlMapper();
-            xmlMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
-            xmlMapper.configure(SerializationFeature.WRAP_ROOT_VALUE, false);
-            xmlMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-            xmlMapper.setPropertyNamingStrategy(PropertyNamingStrategy.UPPER_CAMEL_CASE);
-            xmlMapper.enable(MapperFeature.USE_STD_BEAN_NAMING);
-            xmlMapper.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true);
-
-            xmlString += xmlMapper.writeValueAsString(requestData);
-
-            xmlString += "</soapenv:Body>\n" +
-                    "</soapenv:Envelope>";
-
-        } catch (JsonProcessingException e) {
-            throw new RuntimeException("永诚API方式-xml转换失败");
-        }
-//        InsApiLog iplog = HttpXmlUtil.sendXmlPost(apiComponents.getUrl() + apiName, xmlString);
-        String responseString = HttpXmlUtil.sendXmlPostReq(apiComponents.getUrl() + apiName, xmlString, log, textHead);
-        if (StringUtils.isEmpty(responseString)) {
-            try {
-                Thread.sleep(1000);
-            } catch (InterruptedException e) {
-                throw new RuntimeException(e);
-            }
-            responseString = HttpXmlUtil.sendXmlPostReq(apiComponents.getUrl() + apiName, xmlString, log, "《二次请求》" + textHead);
-
-        }
-        return responseString;
-
-    }
-
-    /**
-     * @description: 拷贝永安方法,可以封装
-     * @author: lig
-     * @date: 2023年02月08日 0008
-     */
-    private void checkEmpty(YaQuoteInfoVo yaQuoteInfoVo) {
-        if (yaQuoteInfoVo.getCarInfo() == null) {
-            throw new SystemException("carInfo不能为空!");
-        }
-        if (yaQuoteInfoVo.getPolicyHolderInfo() == null || yaQuoteInfoVo.getInsuredPersonInfo() == null) {
-            throw new SystemException("policyHolderInfo/insuredPersonInfo 不能为空!");
-        }
-        if (yaQuoteInfoVo.getRiskList() == null || yaQuoteInfoVo.getRiskList().size() == 0) {
-            throw new SystemException("riskList 不能为空!");
-        } else {
-            for (RiskInfoVo riskInfoVo : yaQuoteInfoVo.getRiskList()) {
-                if (riskInfoVo.getStartDate() == null || riskInfoVo.getEndDate() == null) {
-                    throw new SystemException("riskList.startDate / riskList.endDate不能为空!");
-                }
-            }
-        }
-
-    }
 
     /**
      * 新订单 - 子订单
@@ -1190,7 +997,6 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
      */
     private InsAreaCompany response_order(InsOrders insOrder, QuoteRespVo quoteRespVo, Ruote requestData, RuoteResponse responseData, BaseQuoteVo<AccidentalDrivingVo> quoteVo) {
 
-
         //交强保费 含税
         double jqPremium = StringUtils.toDouble(responseData.getBase().getNBefTaxPrmJQ()) + StringUtils.toDouble(responseData.getBase().getNAppTaxAmtJQ());
         //商业保费 含税
@@ -1259,37 +1065,6 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
         return b1.add(b2).doubleValue();
     }
 
-    /**
-     * 验证远程请求
-     *
-     * @author: lig
-     * @date: 2023年02月22日 0022
-     */
-    private void verifyRequest(InsApiLog apiLog, InsAreaCompany insAreaCompany, InsQuoteFlow iqf) {
-        //增加api日志
-        insApiLogService.insertAsync(new InsApiLog(insAreaCompany, apiLog, iqf));
-        if (StringUtils.isNotEmpty(apiLog.getExceptionMsg())) {
-            throw new SystemException("远程接口调用异常");
-//            throw new RuntimeException("远程接口调用异常");
-        }
-
-    }
-
-    /**
-     * 更新api log
-     *
-     * @author: lig
-     * @date: 2023-03-21
-     */
-    private void updateApiLog(InsApiLog apiLog, InsAreaCompany iac) {
-        if (null != apiLog && null != iac) {
-            apiLog.setOrderNo(StringUtils.toString(iac.getId()));
-//            apiLog.setOrderStatus(iac.getOrderstatus());
-            insApiLogService.UpdateAsync(apiLog);
-        }
-
-    }
-
     @Override
     public Map<String, String> gainRegionCode(String address) {
 
@@ -1366,7 +1141,6 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
             address.replaceAll("开县", "开州区");
         }
 
-
         Map<String, String> m = IDCardUtils.addressResolution(address);
         if (null == m) return null;
         String city = m.get("city");
@@ -1380,7 +1154,6 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
             areaList = insAlltrustRegionMapper.selectList(lqw);
         }
 
-
         //如果地区查不到 用城市当地区查
         if (null == areaList || areaList.size() < 1) {
             LambdaQueryWrapper<InsAlltrustRegion> cityLqw = new LambdaQueryWrapper<>();
@@ -1400,7 +1173,6 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
             areaList = insAlltrustRegionMapper.selectList(cityLqw);
         }
 
-
         if (null != areaList && areaList.size() > 0) {
             rMap.put("provinceCode", areaList.get(0).getProvinceCode());
             rMap.put("cityCode", areaList.get(0).getCityCode());
@@ -1420,7 +1192,6 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
         //投保人
         CustomerInfoVo applicant = yaQuoteInfoVo.getPolicyHolderInfo();
 
-
         Map<String, String> ownerMap = null;
         //被保人省市区
         Map<String, String> insureMap = null;
@@ -1440,26 +1211,21 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
         }
 
         if (CollUtil.isEmpty(ownerProvinceData)) {
-
             ownerProvinceData = new ArrayList<>();
             //处理地区 车主
             ownerMap = gainRegionCode(owner.getAddr(), "车主");
-
         }
 
         if (CollUtil.isEmpty(insuredProvinceData)) {
             insuredProvinceData = new ArrayList<>();
             //处理地区 被保人
             insureMap = gainRegionCode(insured.getAddr(), "被保人");
-
         }
 
         if (CollUtil.isEmpty(applicantProvinceData)) {
-
             applicantProvinceData = new ArrayList<>();
             //处理地区 投保人
             applicantMap = gainRegionCode(applicant.getAddr(), "投保人");
-
         }
 
         StringBuffer sb = new StringBuffer();
@@ -1479,14 +1245,12 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
             ownerProvinceData.add(ownerMap.get("provinceCode"));
             ownerProvinceData.add(ownerMap.get("cityCode"));
             ownerProvinceData.add(ownerMap.get("areaCode"));
-
         }
 
         if (CollUtil.isNotEmpty(insureMap)) {
             insuredProvinceData.add(insureMap.get("provinceCode"));
             insuredProvinceData.add(insureMap.get("cityCode"));
             insuredProvinceData.add(insureMap.get("areaCode"));
-
         }
 
         if (CollUtil.isNotEmpty(applicantMap)) {
@@ -1495,11 +1259,9 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
             applicantProvinceData.add(applicantMap.get("areaCode"));
         }
 
-
         //构造参数
         buildRegionParam(m, yaQuoteInfoVo, ownerProvinceData, insuredProvinceData, applicantProvinceData);
 
-
     }
 
 
@@ -1549,37 +1311,12 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
         return iac;
     }
 
-    /**
-     * 请求API接口,返回对象
-     *
-     * @author: lig
-     * @date: 2023年05月18日 0018
-     */
-    private <T> T requestApi(Object m, T response, InsAreaCompany iac, String reqUrl, InsQuoteFlow iqf, String textHead) {
-        String responseData = httpPostResultLog(m, reqUrl, textHead);
-        if (responseData.contains("报价返回信息异常")) {
-            throw new SystemException("永诚报价请求负荷,永诚建议请稍后重试。");
-        }
-
-        String cleanStr = YcBuildData.cleanResponseStr(responseData);
-        try {
-
-            response = (T) gainXmlMapper().readValue(cleanStr, response.getClass());
-            return response;
-        } catch (JsonProcessingException e) {
-            log.debug("=========永诚API方式 - xml请求 - {}解析报错:{}", iqf.getDesc(), e.getMessage());
-            throw new SystemException("请求接口失败,对象转换错误,请联系管理员。");
-        }
-    }
-
-
     private YcConfigureParameters gainYcConfigParams(String agreementId) {
         YcConfigureParameters ycConfigureParameters = new YcConfigureParameters();
         configureParametersComponents.toEntity(ycConfigureParameters, agreementId);
         return ycConfigureParameters;
     }
 
-
     /**
      * 获取车险保单
      *
@@ -1599,11 +1336,9 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
      */
     public String gainExistCarInsPolicy(String fileName, String licensePlate) {
         String dir = SysConstants.CAR_INS_POLICY + "/" + licensePlate + "/";
-
         return FileUtil.fileExist(dir, fileName, uploadFilePath, apiUrl + showFileUrl);
     }
 
-
     private void buildOrderStatus(InsOrders order, InsAreaCompany iac) {
 
         String iacStatus = iac.getOrderstatus();
@@ -1614,7 +1349,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
             order.setOrderstatus(iac.getOrderstatus());
         } else if (iacStatus.equals(InsOrderStatusEnum.WAIT_AUDIT.getCode()) && orderStatus.equals(InsOrderStatusEnum.QUOTE_ING.getCode())) {
             order.setOrderstatus(iac.getOrderstatus());
-        } else if (iacStatus.equals(InsOrderStatusEnum.WAIT_PAY.getCode()) && !orderStatus.equals(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode())) {
+        } else if (iacStatus.equals(InsOrderStatusEnum.WAIT_PAY.getCode())) {
             order.setOrderstatus(iac.getOrderstatus());
         } else if (iacStatus.equals(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode())) {
             order.setOrderstatus(iac.getOrderstatus());
@@ -1624,7 +1359,6 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
 
     }
 
-
     private void buildCarInfo(CarInfoVo carInfo, ModelsQueryResponse.VehicleInfo vehicleInfo) {
         carInfo.setModelCode(vehicleInfo.getVehicleId());
         carInfo.setCiCarName(vehicleInfo.getVehicleName());
@@ -1633,20 +1367,17 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
 
     }
 
-
     private void buildRegionParam(Ruote m, BaseQuoteInfoVo yaQuoteInfoVo, List<String> ownerProvinceData, List<String> insuredProvinceData, List<String> applicantProvinceData) {
         yaQuoteInfoVo.getOwnerInfo().setProvinceData(ownerProvinceData);
         m.getRequestLabel().getCondition().getVhlowner().setCProvince(ownerProvinceData.get(0));
         m.getRequestLabel().getCondition().getVhlowner().setCCity(ownerProvinceData.get(1));
         m.getRequestLabel().getCondition().getVhlowner().setCCounty(ownerProvinceData.get(2));
 
-
         yaQuoteInfoVo.getInsuredPersonInfo().setProvinceData(insuredProvinceData);
         m.getRequestLabel().getCondition().getInsured().setCProvince(insuredProvinceData.get(0));
         m.getRequestLabel().getCondition().getInsured().setCCity(insuredProvinceData.get(1));
         m.getRequestLabel().getCondition().getInsured().setCCounty(insuredProvinceData.get(2));
 
-
         yaQuoteInfoVo.getPolicyHolderInfo().setProvinceData(applicantProvinceData);
         m.getRequestLabel().getCondition().getApplicant().setCProvince(applicantProvinceData.get(0));
         m.getRequestLabel().getCondition().getApplicant().setCCity(applicantProvinceData.get(1));

+ 12 - 31
src/main/java/com/ydtech/utils/HttpXmlUtil.java

@@ -1,24 +1,11 @@
 package com.ydtech.utils;
 
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.*;
-import com.fasterxml.jackson.dataformat.xml.XmlMapper;
 import com.ydtech.exception.SystemException;
-import com.ydtech.modules.ins.model.InsApiLog;
-import com.ydtech.modules.ins.model.yc.YcBuildData;
-import com.ydtech.modules.ins.model.yc.ruote.response.RuoteResponse;
 import lombok.extern.slf4j.Slf4j;
 import okhttp3.*;
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.HttpStatus;
-import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.text.StringEscapeUtils;
 import org.slf4j.Logger;
 
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
 import java.util.concurrent.Executors;
 import java.util.concurrent.TimeUnit;
 import java.util.regex.Matcher;
@@ -130,15 +117,14 @@ public class HttpXmlUtil {
      */
     public static String sendXmlPostReq(String url, String xmlString, Logger log, String textHead) {
 
-//        System.out.println("请求参数=" + xmlString);
-        if (null != log) log.debug(textHead + "XML请求url:{},\n请求参数:{}", url, xmlString);
+        if (null != log) {
+            log.debug(textHead + "XML请求url:{},\n请求参数:{}", url, xmlString);
+        }
 
         String responseString = null;
-//        Response response = new Response.Builder().addHeader("Connection", "close").build();
         Response response = null;
         try {
 
-
             MediaType mediaType = MediaType.parse("text/xml");
             RequestBody reqBody = RequestBody.create(mediaType, xmlString);
             Request request = new Request.Builder()
@@ -160,9 +146,13 @@ public class HttpXmlUtil {
             e.printStackTrace();
             throw new SystemException("远程接口请求失败,请联系管理员。");
         } finally {
-            if (null != log) textHead = StringUtils.toString(textHead, "123456789");
+            if (null != log) {
+                textHead = StringUtils.toString(textHead, "123456789");
+            }
+
             url = StringUtils.toString(url, "");
-            String responseStringMsg = StringUtils.isNotEmpty(responseString) ? responseString.replaceAll("\n", "").replaceAll("&lt;", "<").replaceAll("&gt;", ">") : "";
+            String responseStringMsg = StringEscapeUtils.unescapeXml(responseString);
+
             log.debug(textHead + "XML返回url:{},\n响应参数:{}", url, responseStringMsg);
 
             if (StringUtils.isEmpty(responseString)) {
@@ -222,19 +212,15 @@ public class HttpXmlUtil {
             throw new SystemException("远程接口请求失败,请联系管理员。");
         } finally {
 
-//            System.err.println("response.body():"+response.body().string());
-
-            if(StringUtils.isEmpty(responseString)){
-
+            if (StringUtils.isEmpty(responseString)) {
                 Headers headers = response.headers();
                 for (int i = 0, size = headers.size(); i < size; i++) {
                     System.err.println("headers:" + headers.name(i) + ": " + headers.value(i));
                 }
-            }else {
+            } else {
                 System.err.println("通过");
             }
 
-
             response.close();
         }
 
@@ -243,9 +229,4 @@ public class HttpXmlUtil {
 
     }
 
-    public static void main(String[] args) {
-        sendXmlPostReqBase("http://www.yongcheng.com:17002/newQueryVehicleTypesService", "");
-    }
-
-
 }

+ 1 - 20
src/main/java/com/ydtech/utils/InsUtils.java

@@ -1,32 +1,13 @@
 package com.ydtech.utils;
 
-import cn.hutool.json.JSONUtil;
-import com.fasterxml.jackson.annotation.JsonProperty;
 import com.ydtech.constants.enums.dict.InsOrderStatusEnum;
 import com.ydtech.modules.ins.model.dto.CarInsDateDto;
-import com.ydtech.modules.ins.model.yc.modelsQuery.ModelsQueryResponse;
-import com.ydtech.modules.ins.service.impl.InsGuoRenApiServiceImpl;
 import com.ydtech.modules.order.entity.InsAreaCompany;
 import com.ydtech.modules.order.entity.InsOrders;
-import com.ydtech.utils.baidu.FileUtil;
-import lombok.Data;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.math.BigDecimal;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URL;
-import java.net.URLConnection;
-import java.time.DayOfWeek;
+
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.LocalTime;
-import java.util.*;
-import java.util.logging.Handler;
-import java.util.stream.Collectors;
 
 /**
  * 保险业务涉及的工具类

+ 14 - 20
src/main/resources/application-prod.yml

@@ -140,21 +140,21 @@ wechat:
     componentSecret: 75b7d4cda453b2075dec23f849278bc0
 ya:
   callbackUrl: http://www.baoxianzhanggui.com:8080/order/yongAn/updatePolicy
-#  comCode: 214040020000
-#  consumerAccessKey: xE1cA7dK
-#  consumerID: 102120
-#  matchCode: 10212014040001
+  #  comCode: 214040020000
+  #  consumerAccessKey: xE1cA7dK
+  #  consumerID: 102120
+  #  matchCode: 10212014040001
   url:
     https://api.yaic.com.cn/auto/issue
   url.sign: https://api.yaic.com.cn/auto/debug/generate-access-key
 #  userCode: 10061765
+
 ##永诚
 yc:
   #api方式
   api:
-    pay:
-      # 回调地址
-      callBack: http://sxzgkj.baoxianzhanggui.com/web-api/api/yongCheng/callBack
+    # 回调地址
+    payCallBack: http://sxzgkj.baoxianzhanggui.com/web-api/api/yongCheng/callBack
     url: http://www.yongcheng.com:17002/
   #    url: http://140.206.189.151:17000/
 
@@ -179,8 +179,8 @@ zm:
   vinSearch:
     url: ${zm.domain}/vinSearch
   api:
-#    source: 326
-#    token: THIRDSCOuloft2020052818346904zmYBSXXHTQ
+    #    source: 326
+    #    token: THIRDSCOuloft2020052818346904zmYBSXXHTQ
     url: https://www.echinacoal.com/singlePlatform/
     imageUrl: https://www.echinacoal.com/singlePlatform/others/
     smsUrl: https://www.echinacoal.com/singlePlatform/prpall/
@@ -218,20 +218,14 @@ logging:
   path: /ins/logs
 
 
-
 # api url
 api:
   url: http://sxzgkj.baoxianzhanggui.com/web-api
 
 
-# 国任
+# 国任财险生产
 guoRen:
-  # 生产
-  baseUrl: https://rbt.guorenpcic.com/api/grchannel-interface/httpCurrency/httpJsonCommonEntrance
-  uploadUrl: https://rbt.guorenpcic.com/api/grecar/photo/upload
-  redirectUrl: http://sxzgkj.baoxianzhanggui.com/web-api/api/guoRen/callBack
-
-  # 测试
-  #  baseUrl: https://devyun.guorenpcic.com/api/grchannel-interface/httpCurrency/httpJsonCommonEntrance
-  #  uploadUrl: https://devyun.guorenpcic.com/api/grecar/photo/upload
-#  redirectUrl: http://127.0.0.1:8080/api/guoRen/callBack
+  api:
+    baseUrl: https://rbt.guorenpcic.com/api/grchannel-interface/httpCurrency/httpJsonCommonEntrance
+    uploadUrl: https://rbt.guorenpcic.com/api/grecar/photo/upload
+    redirectUrl: http://sxzgkj.baoxianzhanggui.com/web-api/api/guoRen/callBack

+ 2 - 7
src/main/resources/application-test.yml

@@ -244,11 +244,7 @@ yc:
     #      cBsnsTyp: 19002
     #    userName: tianqin
     #    password: 123456
-    pay:
-      # 回调地址
-      #      callBack: http://39.98.239.48/web-api/api/yongCheng/callBack
-      callBack: http://sxzgkj.baoxianzhanggui.com/web-api/api/yongCheng/callBack
-    #      callBack: http://47.92.254.66:8080/api/yongCheng/callBack
+    payCallBack: http://sxzgkj.baoxianzhanggui.com/web-api/api/yongCheng/callBack
     url: http://www.yongcheng.com:17002/
   #    url: http://140.206.189.151:17000/
 
@@ -329,8 +325,7 @@ api:
 
 # 国任财险测试
 guoRen:
+  api:
     baseUrl: https://devyun.guorenpcic.com/api/grchannel-interface/httpCurrency/httpJsonCommonEntrance
     uploadUrl: https://devyun.guorenpcic.com/api/grecar/photo/upload
     redirectUrl: http://39.98.239.48/web-api/api/guoRen/callBack
-
-#  redirectUrl: http://127.0.0.1:8080/api/guoRen/callBack