Explorar el Código

1.紫金财险修改

wks hace 3 años
padre
commit
a3f3993daa

+ 1 - 1
src/main/java/com/ydtech/config/resttemplate/RestTemplateRequestInterceptor.java

@@ -30,4 +30,4 @@ public class RestTemplateRequestInterceptor implements ClientHttpRequestIntercep
         return execute;
     }
 
-}
+}

+ 2 - 2
src/main/java/com/ydtech/modules/order/components/InsCrawlerOrderComponents.java

@@ -28,7 +28,7 @@ public class InsCrawlerOrderComponents {
         HttpEntity<T> yaQuoteInfoVoHttpEntity = new HttpEntity<>(requestBody, httpHeaders);
 
         String request = JSON.toJSONString(requestBody);
-        InsuranceLog.infoLog(logId, "---------> {} \n\t---------> URL: {} \n\t---------> 请求参数: {}", message, url, request);
+        InsuranceLog.infoLog(logId, "\n\t---------> {} \n\t---------> URL: {} \n\t---------> 请求参数: {}", message, url, request);
         ResponseEntity<B> stringResponseEntity = restTemplate.postForEntity(url, yaQuoteInfoVoHttpEntity, responseType);
         B body = stringResponseEntity.getBody();
         if (body == null) {
@@ -36,7 +36,7 @@ public class InsCrawlerOrderComponents {
         }
 
         String response = JSON.toJSONString(body);
-        InsuranceLog.infoLog(logId, "---------> {} \n\t---------> 响应参数:{}", message, response);
+        InsuranceLog.infoLog(logId, "\n\t---------> {} \n\t---------> 响应参数:{}", message, response);
         return body;
     }
 

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

@@ -61,11 +61,11 @@ public class ZhongmeiRequestApiComponents {
         httpHeaders.setContentType(MediaType.APPLICATION_JSON);
 
         String jsonString = JSON.toJSONString(q, SerializerFeature.WriteMapNullValue, SerializerFeature.WriteNullStringAsEmpty);
-        InsuranceLog.infoLog(InsuranceEnum.ZMBX.getPinyin(), "---------> URl: {} \n---------> 请求参数:{}", url, jsonString);
+        InsuranceLog.infoLog(InsuranceEnum.ZMBX.getPinyin(), "\n\t---------> URl: {} \n---------> 请求参数:{}", url, jsonString);
         // 加密
         String sessionKey = properties.getSessionKey();
         String s = AESUtilsWithDataBase.encryptECBPK5Hex(jsonString, sessionKey);
-        InsuranceLog.infoLog(InsuranceEnum.ZMBX.getPinyin(), "---------> 加密后的参数:{}", s);
+        InsuranceLog.infoLog(InsuranceEnum.ZMBX.getPinyin(), "\n\t---------> 加密后的参数:{}", s);
         HttpEntity<String> httpEntity = new HttpEntity<>(s, httpHeaders);
         ResponseEntity<String> response = restTemplate.postForEntity(url, httpEntity, String.class);
         String body = response.getBody();

+ 9 - 0
src/main/java/com/ydtech/modules/order/components/zj/ZijinDuplicateInsuranceComponents.java

@@ -1,6 +1,7 @@
 package com.ydtech.modules.order.components.zj;
 
 
+import com.ydtech.exception.SystemException;
 import com.ydtech.modules.order.entity.api.zj.constants.enums.CalculateFlagEnum;
 import com.ydtech.modules.order.entity.api.zj.constants.enums.ResultEnum;
 import com.ydtech.modules.order.entity.api.zj.request.CalculatePremiumRequest;
@@ -64,11 +65,14 @@ public class ZijinDuplicateInsuranceComponents {
             CalculatePremiumRequest.BaseInfoDTO baseInfo = calculatePremiumRequest.getBaseInfo();
             String calculateFlag = baseInfo.getCalculateFlag();
 
+            boolean jq = true;
+            boolean sy = true;
             // 交强险
             if (CalculateFlagEnum.CF_0.getCode().equals(calculateFlag) || CalculateFlagEnum.CF_2.getCode().equals(calculateFlag)) {
                 String jqEndDate = getTheExpiryDate(rtnMsg, JQ_REGEX);
                 if (!jqEndDate.isEmpty()) {
                     baseInfo.setTrafficTime(jqEndDate);
+                    jq = false;
                 }
             }
 
@@ -77,9 +81,14 @@ public class ZijinDuplicateInsuranceComponents {
                 String syEndDate = getTheExpiryDate(rtnMsg, SY_REGEX);
                 if (!syEndDate.isEmpty()) {
                     baseInfo.setBusinessTime(syEndDate);
+                    sy = false;
                 }
             }
 
+            if (jq && sy){
+                throw new SystemException(rtnMsg);
+            }
+
             return zijinRequestApiComponents.calculatePremium(calculatePremiumRequest, httpHeaders);
         }
         return calculatePremiumResponse;

+ 6 - 6
src/main/java/com/ydtech/modules/order/entity/api/zj/request/CalculatePremiumRequest.java

@@ -25,7 +25,6 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.AllArgsConstructor;
 import lombok.Data;
-import lombok.Getter;
 import lombok.NoArgsConstructor;
 
 import java.io.Serializable;
@@ -717,11 +716,11 @@ public class CalculatePremiumRequest implements Serializable {
         @JsonProperty("isInvokeJingYou")
         private String isInvokeJingYou;
 
-//        /**
-//         * 交强险过户日期
-//         */
-//        @JsonProperty("makeDateJQ")
-//        private String makeDateJQ;
+        /**
+         * 交强险过户日期
+         */
+        @JsonProperty("makeDateJQ")
+        private String makeDateJQ;
 
 
         public VehicleInfoDTO(CarInfoVo carInfo, ModelQueryResponse.VehicleModelInfosDTO vehicleModelInfosDTO, String actualValue) {
@@ -730,6 +729,7 @@ public class CalculatePremiumRequest implements Serializable {
             if (carInfo.isTransferFlag()) {
                 this.chgOwnerFlag = "1";
                 this.makeDate = carInfo.getIssueDate();
+                this.makeDateJQ = carInfo.getIssueDate();
             } else {
                 this.chgOwnerFlag = "0";
             }

+ 2 - 0
src/main/java/com/ydtech/modules/order/service/impl/InsOrdersServiceImpl.java

@@ -1,6 +1,7 @@
 package com.ydtech.modules.order.service.impl;
 
 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.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -237,6 +238,7 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
 
         //add 解决返回null页面错误  lig 2023-09-14
         if(null == orderAndAreaCompany.getExtendInfo()) orderAndAreaCompany.setExtendInfo("");
+        if(null == orderAndAreaCompany.getCrossInsurance()) orderAndAreaCompany.setCrossInsurance(JSON.parseArray("[]"));
         return HttpResult.ok("success", orderAndAreaCompany);
     }
 

+ 2 - 2
src/main/java/com/ydtech/modules/order/utils/AESUtilsWithDataBase.java

@@ -107,10 +107,10 @@ public class AESUtilsWithDataBase {
 
 
     public static <T> T decryptMessage(String s, Class<T> c, String message, String sessionKey) {
-        InsuranceLog.infoLog(InsuranceEnum.ZMBX.getPinyin(), "---------> 解密前的参数:{}", s);
+        InsuranceLog.infoLog(InsuranceEnum.ZMBX.getPinyin(), "\n\t---------> 解密前的参数:{}", s);
         // 解密
         String text = decryptECBPK5Hex(s.replace("\n", ""), sessionKey);
-        InsuranceLog.infoLog(InsuranceEnum.ZMBX.getPinyin(), "---------> {}:{}", message, text);
+        InsuranceLog.infoLog(InsuranceEnum.ZMBX.getPinyin(), "\n\t---------> {}:{}", message, text);
         return JSON.parseObject(text, c);
     }