Explorar o código

Merge remote-tracking branch 'origin/test' into test

785834757 %!s(int64=2) %!d(string=hai) anos
pai
achega
52a694ba49
Modificáronse 39 ficheiros con 2013 adicións e 390 borrados
  1. 5 0
      pom.xml
  2. 5 2
      src/main/java/com/ydtech/config/resttemplate/CustomResponseErrorHandler.java
  3. 2 0
      src/main/java/com/ydtech/config/resttemplate/RestTemplateConfig.java
  4. 6 0
      src/main/java/com/ydtech/constants/InsuranceImageEnum.java
  5. 2 2
      src/main/java/com/ydtech/modules/fee/dto/FeeFactorInfoDto.java
  6. 47 20
      src/main/java/com/ydtech/modules/fee/service/impl/FeeRuleSchemeServiceImpl.java
  7. 160 54
      src/main/java/com/ydtech/modules/ins/model/guoren/PremiumReq.java
  8. 12 3
      src/main/java/com/ydtech/modules/ins/model/guoren/PremiumResp.java
  9. 205 0
      src/main/java/com/ydtech/modules/ins/utils/CompressUtil.java
  10. 131 0
      src/main/java/com/ydtech/modules/order/components/gouren/GuorenDuplicateInsuranceComponent.java
  11. 23 24
      src/main/java/com/ydtech/modules/order/components/huatai/HuaTaiRequestApiComponents.java
  12. 208 0
      src/main/java/com/ydtech/modules/order/components/huatai/HuiTaiUploadImageComponents.java
  13. 15 14
      src/main/java/com/ydtech/modules/order/controller/HuaTaiOrderApiController.java
  14. 11 0
      src/main/java/com/ydtech/modules/order/entity/InsOrders.java
  15. 4 3
      src/main/java/com/ydtech/modules/order/entity/api/huatai/constants/HuaTaiTransCode.java
  16. 64 0
      src/main/java/com/ydtech/modules/order/entity/api/huatai/constants/ImageTypeCode.java
  17. 1 1
      src/main/java/com/ydtech/modules/order/entity/api/huatai/request/HuaTaiInsurancePolicyPrintRequest.java
  18. 1 1
      src/main/java/com/ydtech/modules/order/entity/api/huatai/request/HuaTaiPaymentUrlRequest.java
  19. 204 0
      src/main/java/com/ydtech/modules/order/entity/api/huatai/request/HuaTaiSaveFileIdxRequest.java
  20. 6 1
      src/main/java/com/ydtech/modules/order/entity/api/huatai/request/HuaTaiSubmitRequest.java
  21. 50 0
      src/main/java/com/ydtech/modules/order/entity/api/huatai/request/HuaTaiUploadImageRequest.java
  22. 366 0
      src/main/java/com/ydtech/modules/order/entity/api/huatai/response/HuaTaiImageInitParamResponse.java
  23. 22 1
      src/main/java/com/ydtech/modules/order/entity/api/huatai/response/HuaTaiInsurancePolicyPrintResponse.java
  24. 2 2
      src/main/java/com/ydtech/modules/order/entity/api/huatai/response/HuaTaiOrderStatusResponse.java
  25. 24 0
      src/main/java/com/ydtech/modules/order/entity/api/huatai/response/HuaTaiSubmitResponse.java
  26. 20 0
      src/main/java/com/ydtech/modules/order/entity/api/huatai/response/HuaTaiUploadImageResponse.java
  27. 17 4
      src/main/java/com/ydtech/modules/order/entity/api/zijin/constants/enums/FileTypeEnum.java
  28. 2 1
      src/main/java/com/ydtech/modules/order/service/HuaTaiOrderApiService.java
  29. 7 0
      src/main/java/com/ydtech/modules/order/service/InsTaskImagesService.java
  30. 8 6
      src/main/java/com/ydtech/modules/order/service/impl/GuorenOrderApiServiceImpl.java
  31. 269 153
      src/main/java/com/ydtech/modules/order/service/impl/HuaTaiOrderApiServiceImpl.java
  32. 9 3
      src/main/java/com/ydtech/modules/order/service/impl/InsOrdersServiceImpl.java
  33. 10 0
      src/main/java/com/ydtech/modules/order/service/impl/InsTaskImagesServiceImpl.java
  34. 24 62
      src/main/java/com/ydtech/modules/order/service/impl/YongchengOrderApiServiceImpl.java
  35. 5 5
      src/main/java/com/ydtech/modules/order/service/impl/ZhongMeiOrderApiServiceImpl.java
  36. 12 12
      src/main/java/com/ydtech/modules/protocol/entity/dto/PtlAgreementProductCostsSaveDto.java
  37. 12 12
      src/main/java/com/ydtech/modules/protocol/entity/po/PtlAgreementProductCosts.java
  38. 38 4
      src/main/java/com/ydtech/utils/baidu/FileUtil.java
  39. 4 0
      src/main/resources/mapper/modules/order/InsOrdersMapper.xml

+ 5 - 0
pom.xml

@@ -512,6 +512,11 @@
         </dependency>
 
 
+        <dependency>
+            <groupId>net.lingala.zip4j</groupId>
+            <artifactId>zip4j</artifactId>
+            <version>1.3.2</version>
+        </dependency>
         <!-- rabbitmq依赖 -->
         <!--        <dependency>-->
         <!--            <groupId>org.springframework.boot</groupId>-->

+ 5 - 2
src/main/java/com/ydtech/config/resttemplate/CustomResponseErrorHandler.java

@@ -19,12 +19,15 @@ public class CustomResponseErrorHandler implements ResponseErrorHandler {
     @Override
     public void handleError(ClientHttpResponse response) throws IOException {
         if (response.getStatusCode() == HttpStatus.REQUEST_TIMEOUT) {
-            throw new SystemException("服务器请求超时, 请重试!");
+            throw new SystemException("网络超时, 请重试!");
         }
         if (response.getStatusCode().value() > 500) {
-            throw new SystemException("远程服务器异常, 请重试!");
+            throw new SystemException("网络异常, 请重试!");
         }
         throw new SystemException("请求异常" + response.getStatusText());
     }
 
 }
+
+
+

+ 2 - 0
src/main/java/com/ydtech/config/resttemplate/RestTemplateConfig.java

@@ -14,8 +14,10 @@ import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.http.client.ClientHttpRequestFactory;
 import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
+import org.springframework.http.converter.BufferedImageHttpMessageConverter;
 import org.springframework.web.client.RestTemplate;
 
+import java.util.Arrays;
 import java.util.Collections;
 
 @Configuration

+ 6 - 0
src/main/java/com/ydtech/constants/InsuranceImageEnum.java

@@ -13,6 +13,11 @@ import lombok.Getter;
 @AllArgsConstructor
 public enum InsuranceImageEnum {
 
+
+    XC00("XC00", "新车合格证"),
+    GC00("GC00", "购车发票"),
+    GX00("GX00", "关系证明"),
+
     C01("C01", "行驶证正面"),
     D01("D01", "行驶证反面"),
 
@@ -25,6 +30,7 @@ public enum InsuranceImageEnum {
     C04("C04", "被保人身份证正面"),
     D04("D04", "被保人身份证反面");
 
+
 //    C0500("C0500", "验车照(车架)"),
 //    C0501("C0501", "验车照(后左)"),
 //    C0502("C0502", "验车照(后右)"),

+ 2 - 2
src/main/java/com/ydtech/modules/fee/dto/FeeFactorInfoDto.java

@@ -21,9 +21,9 @@ public class FeeFactorInfoDto {
     @ApiModelProperty("匹配顺序")
     private Integer matchSequence;
     @ApiModelProperty("区间最小值")
-    private Integer minRangeVal;
+    private Double minRangeVal;
     @ApiModelProperty("区间最大值")
-    private Integer maxRangeVal;
+    private Double maxRangeVal;
     @ApiModelProperty("多选字符串列表")
     private String multipleSelectVal;
     @ApiModelProperty("单选字符串")

+ 47 - 20
src/main/java/com/ydtech/modules/fee/service/impl/FeeRuleSchemeServiceImpl.java

@@ -479,8 +479,8 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         factor6.setMatchSequence(6);
         if(checkFactorConfigWithArea(factorCost.getMinSeats(),factorCost.getMaxSeats(),factor6,factorCost)){
             factor6.setNeedMatch(true);
-            factor6.setMinRangeVal(factorCost.getMinSeats());
-            factor6.setMaxRangeVal(factorCost.getMaxSeats());
+            factor6.setMinRangeVal((double)factorCost.getMinSeats());
+            factor6.setMaxRangeVal((double)factorCost.getMaxSeats());
         }else{
             //如果方案中未录入,则不校验该项因子
             factor6.setNeedMatch(false);
@@ -493,8 +493,8 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         factor7.setMatchSequence(7);
         if(checkFactorConfigWithArea(factorCost.getMinPurchasePrice(),factorCost.getMaxPurchasePrice(),factor7,factorCost)){
             factor7.setNeedMatch(true);
-            factor7.setMinRangeVal(factorCost.getMinPurchasePrice());
-            factor7.setMaxRangeVal(factorCost.getMaxPurchasePrice());
+            factor7.setMinRangeVal((double)factorCost.getMinPurchasePrice());
+            factor7.setMaxRangeVal((double)factorCost.getMaxPurchasePrice());
         }else{
             //如果方案中未录入,则不校验该项因子
             factor7.setNeedMatch(false);
@@ -507,8 +507,8 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         factor8.setMatchSequence(8);
         if(checkFactorConfigWithArea(factorCost.getMinApprovedLoadCapacity(),factorCost.getMaxApprovedLoadCapacity(),factor8,factorCost)){
             factor8.setNeedMatch(true);
-            factor8.setMinRangeVal(factorCost.getMinApprovedLoadCapacity());
-            factor8.setMaxRangeVal(factorCost.getMaxApprovedLoadCapacity());
+            factor8.setMinRangeVal((double)factorCost.getMinApprovedLoadCapacity());
+            factor8.setMaxRangeVal((double)factorCost.getMaxApprovedLoadCapacity());
         }else{
             //如果方案中未录入,则不校验该项因子
             factor8.setNeedMatch(false);
@@ -521,8 +521,8 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         factor9.setMatchSequence(9);
         if(checkFactorConfigWithArea(factorCost.getMinCompulsoryInsurancePremium(),factorCost.getMaxCompulsoryInsurancePremium(),factor9,factorCost)){
             factor9.setNeedMatch(true);
-            factor9.setMinRangeVal(factorCost.getMinCompulsoryInsurancePremium());
-            factor9.setMaxRangeVal(factorCost.getMaxCompulsoryInsurancePremium());
+            factor9.setMinRangeVal((double)factorCost.getMinCompulsoryInsurancePremium());
+            factor9.setMaxRangeVal((double)factorCost.getMaxCompulsoryInsurancePremium());
         }else{
             //如果方案中未录入,则不校验该项因子
             factor9.setNeedMatch(false);
@@ -535,8 +535,8 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         factor10.setMatchSequence(10);
         if(checkFactorConfigWithArea(factorCost.getMinTaxAmount(),factorCost.getMaxTaxAmount(),factor10,factorCost)){
             factor10.setNeedMatch(true);
-            factor10.setMinRangeVal(factorCost.getMinTaxAmount());
-            factor10.setMaxRangeVal(factorCost.getMaxTaxAmount());
+            factor10.setMinRangeVal((double)factorCost.getMinTaxAmount());
+            factor10.setMaxRangeVal((double)factorCost.getMaxTaxAmount());
         }else{
             //如果方案中未录入,则不校验该项因子
             factor10.setNeedMatch(false);
@@ -549,8 +549,8 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         factor11.setMatchSequence(11);
         if(checkFactorConfigWithArea(factorCost.getMinTheThreePremium(),factorCost.getMaxTheThreePremium(),factor11,factorCost)){
             factor11.setNeedMatch(true);
-            factor11.setMinRangeVal(factorCost.getMinTheThreePremium()*10000);
-            factor11.setMaxRangeVal(factorCost.getMaxTheThreePremium()*10000);
+            factor11.setMinRangeVal((double)factorCost.getMinTheThreePremium()*10000);
+            factor11.setMaxRangeVal((double)factorCost.getMaxTheThreePremium()*10000);
         }else{
             //如果方案中未录入,则不校验该项因子
             factor11.setNeedMatch(false);
@@ -563,8 +563,8 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         factor12.setMatchSequence(12);
         if(checkFactorConfigWithArea(factorCost.getMinOnboardProductsPremium(),factorCost.getMaxOnboardProductsPremium(),factor12,factorCost)){
             factor12.setNeedMatch(true);
-            factor12.setMinRangeVal(factorCost.getMinOnboardProductsPremium());
-            factor12.setMaxRangeVal(factorCost.getMaxOnboardProductsPremium());
+            factor12.setMinRangeVal((double)factorCost.getMinOnboardProductsPremium());
+            factor12.setMaxRangeVal((double)factorCost.getMaxOnboardProductsPremium());
         }else{
             //如果方案中未录入,则不校验该项因子
             factor12.setNeedMatch(false);
@@ -578,8 +578,8 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         factor13.setMatchSequence(13);
         if(checkFactorConfigWithArea(factorCost.getMinCommercialInsuranceDiscount(),factorCost.getMaxCommercialInsuranceDiscount(),factor13,factorCost)){
             factor13.setNeedMatch(true);
-            factor13.setMinRangeVal(factorCost.getMinCommercialInsuranceDiscount());
-            factor13.setMaxRangeVal(factorCost.getMaxCommercialInsuranceDiscount());
+            factor13.setMinRangeVal((double)factorCost.getMinCommercialInsuranceDiscount());
+            factor13.setMaxRangeVal((double)factorCost.getMaxCommercialInsuranceDiscount());
         }else{
             //如果方案中未录入,则不校验该项因子
             factor13.setNeedMatch(false);
@@ -606,8 +606,8 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         factor15.setMatchSequence(15);
         if(checkFactorConfigWithArea(factorCost.getMinScore(),factorCost.getMaxScore(),factor15,factorCost)){
             factor15.setNeedMatch(true);
-            factor15.setMinRangeVal(factorCost.getMinScore());
-            factor15.setMaxRangeVal(factorCost.getMaxScore());
+            factor15.setMinRangeVal((double)factorCost.getMinScore());
+            factor15.setMaxRangeVal((double)factorCost.getMaxScore());
         }else{
             //如果方案中未录入,则不校验该项因子
             factor15.setNeedMatch(false);
@@ -620,8 +620,8 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         factor16.setMatchSequence(16);
         if(checkFactorConfigWithArea(factorCost.getMinLossRation(),factorCost.getMaxLossRation(),factor16,factorCost)){
             factor16.setNeedMatch(true);
-            factor16.setMinRangeVal(factorCost.getMinLossRation());
-            factor16.setMaxRangeVal(factorCost.getMaxLossRation());
+            factor16.setMinRangeVal((double)factorCost.getMinLossRation());
+            factor16.setMaxRangeVal((double)factorCost.getMaxLossRation());
         }else{
             //如果方案中未录入,则不校验该项因子
             factor16.setNeedMatch(false);
@@ -717,6 +717,33 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         return result;
     }
 
+    /**
+     * 判断区间类因子是否需要匹配
+     * @param minVal
+     * @param maxVal
+     * @param factorInfoDto
+     * @param productCosts
+     * @return
+     */
+    private boolean checkFactorConfigWithArea(Double minVal, Double maxVal,FeeFactorInfoDto factorInfoDto,PtlAgreementProductCosts productCosts) {
+        boolean result=false; //默认不需要匹配
+        if(minVal!=null&&maxVal!=null){
+            if(minVal==0&&maxVal==0){//初始化没有配置的时候,全部默认的0,这种不需要匹配
+                result=false;
+            }else{
+                if(minVal<=maxVal){
+                    result=true;
+                }else{
+                    throw new SystemException("协议ID:"+productCosts.getAgreementId()+" 方案序号:"+productCosts.getId()+" 费用因子:"+factorInfoDto.getFactorName()+"配置有问题,请检查!");
+                }
+            }
+        }else if(minVal!=null && maxVal==null){
+            throw new SystemException("协议ID:"+productCosts.getAgreementId()+" 方案序号:"+productCosts.getId()+" 费用因子:"+factorInfoDto.getFactorName()+"配置有问题,请检查!");
+        }else if(minVal==null&&maxVal!=null){
+            throw new SystemException("协议ID:"+productCosts.getAgreementId()+" 方案序号:"+productCosts.getId()+" 费用因子:"+factorInfoDto.getFactorName()+"配置有问题,请检查!");
+        }
+        return result;
+    }
 
 
 

+ 160 - 54
src/main/java/com/ydtech/modules/ins/model/guoren/PremiumReq.java

@@ -8,16 +8,18 @@ import com.fasterxml.jackson.annotation.JsonProperty;
 import com.ydtech.constants.enums.InsurKind;
 import com.ydtech.constants.enums.InsurKindGuoRen;
 import com.ydtech.modules.ins.model.dto.CarInsDateDto;
-import com.ydtech.modules.ins.model.vo.CarInfoVo;
+import com.ydtech.modules.ins.model.vo.CustomerInfoVo;
 import com.ydtech.modules.ins.model.vo.KindInfoVo;
 import com.ydtech.modules.ins.model.vo.RiskInfoVo;
 import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
+import com.ydtech.utils.DateTimeUtil;
 import com.ydtech.utils.InsUtils;
 import com.ydtech.utils.StringUtils;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 
 import java.math.BigDecimal;
+import java.time.LocalDateTime;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -30,10 +32,15 @@ import java.util.List;
 @Data
 public class PremiumReq {
 
-
+    /**
+     * 交强险实体
+     */
     @JsonProperty(value = "ci")
     @JSONField(name = "ci")
     private CiDTO ci;
+    /**
+     * 商业险实体
+     */
     @JsonProperty(value = "bi")
     @JSONField(name = "bi")
     private BiDTO bi;
@@ -44,6 +51,7 @@ public class PremiumReq {
     @JSONField(name = "uuid")
     private String uuid;
 
+
     /**
      * 构造保费计算请求参数
      *
@@ -52,7 +60,8 @@ public class PremiumReq {
      */
     @JsonIgnore
     public static PremiumReq buildQuoteParam(BaseQuoteInfoVo yaQuoteInfoVo, CarPriceResp.DataDTO carPriceResult, VinQueryResp.DataDTO vinQ, boolean isNoCar) {
-        CarInfoVo carInfo = yaQuoteInfoVo.getCarInfo();
+        CustomerInfoVo ownerInfo = yaQuoteInfoVo.getOwnerInfo();
+
         List<RiskInfoVo> riskList = yaQuoteInfoVo.getRiskList();
         List<KindInfoVo> kindInfoVList = yaQuoteInfoVo.getKindList();
 
@@ -60,35 +69,26 @@ public class PremiumReq {
 
         riskList.forEach(a -> {
             if (a.getRiskCode().equals("0507")) {
-                CiDTO ciDto = buildCiDto(a, isNoCar);
+                CiDTO ciDto = buildCiDto(ownerInfo, a, isNoCar);
                 quoteReq.setCi(ciDto);
             }
             if (a.getRiskCode().equals("0510")) {
-                BiDTO biDto = buildBiDto(a, kindInfoVList, carPriceResult, vinQ, isNoCar);
+                BiDTO biDto = buildBiDto(ownerInfo, a, kindInfoVList, carPriceResult, vinQ, isNoCar);
                 quoteReq.setBi(biDto);
             }
         });
 
         //未投保交强
         if (null == quoteReq.getCi()) {
-            CiDTO ciDto = buildCiDto(null, false);
+            CiDTO ciDto = buildCiDto(ownerInfo, null, false);
             quoteReq.setCi(ciDto);
         }
         //未投保商业
         if (null == quoteReq.getBi()) {
-            BiDTO biDto = buildBiDto(null, null, null, null, false);
+            BiDTO biDto = buildBiDto(ownerInfo, null, null, null, null, false);
             quoteReq.setBi(biDto);
         }
 
-
-//        Optional<RiskInfoVo> ciRiskInfo = riskList.stream().filter(x -> x.getRiskCode().equals("0507")).findFirst();
-//        Optional<RiskInfoVo> biRiskInfo = riskList.stream().filter(x -> x.getRiskCode().equals("0510")).findFirst();
-//
-//        CiDTO ciDto = buildCiDto(ciRiskInfo.get(),kindInfoVList);
-//        BiDTO biDto = buildBiDto(biRiskInfo.get(), kindInfoVList);
-//        quoteReq.setCi(ciDto);
-//        quoteReq.setBi(biDto);
-
         //车价查询uid
         quoteReq.setUuid(carPriceResult.getInputvo());
         //不超过业实际参考价格上下30%
@@ -105,16 +105,12 @@ public class PremiumReq {
      * @date: 2023-08-15
      */
     @JsonIgnore
-    public static CiDTO buildCiDto(RiskInfoVo ciRiskInfo, boolean isNoCar) {
-
-
+    public static CiDTO buildCiDto(CustomerInfoVo ownerInfo, RiskInfoVo ciRiskInfo, boolean isNoCar) {
         CiDTO ciDto = new CiDTO();
         ciDto.setPrpTrenewal(new ArrayList<>());
         ciDto.setPrpTmainRate(new CiDTO.PrpTmainRateDTO());
         ciDto.setCalculateFlagCI("");
         ciDto.setEditType("NEW");
-
-
         /**
          * 主信息
          */
@@ -123,39 +119,31 @@ public class PremiumReq {
         ciPrpTmain.setSignDate(DateUtil.formatDate(new Date()));
         ciPrpTmain.setStartHour("0");
         ciPrpTmain.setEndHour("24");
-
-
         /**
          * 险种列表
          */
         List<CiDTO.PrptitemkindListDTO> prptitemkindList = new ArrayList<>();
-
         /**
          * 车船税
          */
         CiDTO.PrpTcarshipTaxDTO prpTcarshipTax = new CiDTO.PrpTcarshipTaxDTO();
         prpTcarshipTax.setPaidCertificate("");
-
         //交强起保
         if (null != ciRiskInfo) {
             ciDto.setCalculateFlagCI("1");
             //构造保险日期
             CarInsDateDto cidd = InsUtils.buildCiInsDate(ciRiskInfo.getStartDate(), ciRiskInfo.getEndDate());
             ciDto.setInputRisk("1");
-
             ciPrpTmain.setStartDate(cidd.getStartDate());
             ciPrpTmain.setEndDate(cidd.getEndDate());
-
             //转保验证码
             ciPrpTmain.setAnswer("");
-
             //即时起保标识	immeValiFlag	字符串	N	即时起保必传1
             ciPrpTmain.setImmeValiFlag(cidd.isForthwith() ? "1" : "");
             //即时终保时间	immeValidEndDate	字符串	N	即时起保必传
             ciPrpTmain.setImmeValidStartDate(cidd.isForthwith() ? cidd.getStartDate() : "");
             //即时终保时间	immeValidEndDate	字符串	N	即时起保必传 (YYYY-MM-DD HH:MM:SS)
             ciPrpTmain.setImmeValidEndDate(cidd.isForthwith() ? cidd.getEndDate() : "");
-
             if (isNoCar) {
                 //非车标识      车+非车必传:1
                 ciPrpTmain.setNoCarFlag("1");
@@ -163,14 +151,6 @@ public class PremiumReq {
                 ciPrpTmain.setOrderFlag("N");
             }
 
-            /**
-             * 车辆信息对象
-             */
-            CiDTO.PrpTitemCarDTO ciPrpTitemCar = new CiDTO.PrpTitemCarDTO();
-            ciPrpTitemCar.setClauseType("F40");
-            ciDto.setPrpTitemCar(ciPrpTitemCar);
-
-
             /**
              * 平台交互信息
              */
@@ -178,30 +158,31 @@ public class PremiumReq {
             //转保业务必传,传上次保费计算返回对应查询码,否则传空
             ciInsureDemand.setDemandNo("");
             ciDto.setCiInsureDemand(ciInsureDemand);
-
-
             prpTcarshipTax.setTaxRelifFlag("1");
             ciDto.setPrpTcarshipTax(prpTcarshipTax);
-
-
             prptitemkindList = buildCiKindList(ciRiskInfo);
-
-
         } else {
-
             ciDto.setInputRisk("0");
             ciPrpTmain.setStartDate("");
             ciPrpTmain.setEndDate("");
-
             prpTcarshipTax.setTaxRelifFlag("");
             ciDto.setPrpTcarshipTax(prpTcarshipTax);
 
         }
+        /**
+         * 车辆信息对象
+         */
+        CiDTO.PrpTitemCarDTO ciPrpTitemCar = new CiDTO.PrpTitemCarDTO();
+        ciPrpTitemCar.setClauseType("F40");
+        ciPrpTitemCar.setCarOwner(ownerInfo.getName());
+        ciPrpTitemCar.setCarOwnerIdentifyNumber(ownerInfo.getIdentifyNumber());
+        ciPrpTitemCar.setOtherNature("0");
 
-        ciDto.setPrptitemkindList(prptitemkindList);
+        ciDto.setPrpTitemCar(ciPrpTitemCar);
 
-        ciDto.setPrpTmain(ciPrpTmain);
 
+        ciDto.setPrptitemkindList(prptitemkindList);
+        ciDto.setPrpTmain(ciPrpTmain);
 //        /**
 //         * 特别约定
 //         */
@@ -218,18 +199,15 @@ public class PremiumReq {
      * @date: 2023-08-15
      */
     @JsonIgnore
-    public static BiDTO buildBiDto(RiskInfoVo biRiskInfo, List<KindInfoVo> kindInfoVList, CarPriceResp.DataDTO carPriceResult, VinQueryResp.DataDTO vinQ, boolean isNoCar) {
+    public static BiDTO buildBiDto(CustomerInfoVo ownerInfo, RiskInfoVo biRiskInfo, List<KindInfoVo> kindInfoVList, CarPriceResp.DataDTO carPriceResult, VinQueryResp.DataDTO vinQ, boolean isNoCar) {
         BiDTO biDto = new BiDTO();
         biDto.setPrpTmainRate(new BiDTO.PrpTmainRateDTO());
         biDto.setPrpTChargingPostDataList(new ArrayList<>());
-
         BiDTO.CiInsureDemandDTO bidtoCiInsureDemandDto = new BiDTO.CiInsureDemandDTO();
         bidtoCiInsureDemandDto.setDemandNo("");
         biDto.setCiInsureDemand(bidtoCiInsureDemandDto);
-
         biDto.setCiInsureDemandPay(new ArrayList<>());
         biDto.setCiInsureDemandWarningClaim(new ArrayList<>());
-
         biDto.setPrpTrenewal(new ArrayList<>());
         biDto.setPrptengageList(new ArrayList<>());
 
@@ -238,7 +216,6 @@ public class PremiumReq {
          */
         BiDTO.PrpTmainDTO biPrpTmain = new BiDTO.PrpTmainDTO();
         biPrpTmain.setImmeValidEndDate("");
-
         /**
          * 车辆信息对象
          */
@@ -247,6 +224,9 @@ public class PremiumReq {
         biPrpTitemCar.setTermsSystem("04");
         biPrpTitemCar.setClauseType("F54");
 
+        biPrpTitemCar.setCarOwner(ownerInfo.getName());
+        biPrpTitemCar.setCarOwnerIdentifyNumber(ownerInfo.getIdentifyNumber());
+        biPrpTitemCar.setOtherNature("0");
 
         biPrpTitemCar.setCiInsureDemandPay(new ArrayList<>());
         biPrpTitemCar.setCiInsureDemandWarningClaim(new ArrayList());
@@ -498,7 +478,6 @@ public class PremiumReq {
     private static List<CiDTO.PrptitemkindListDTO> buildCiKindList(RiskInfoVo ciRiskInfo) {
         List<CiDTO.PrptitemkindListDTO> prptitemkindList = new ArrayList<>();
         CiDTO.PrptitemkindListDTO prptitemkind = new CiDTO.PrptitemkindListDTO();
-
         prptitemkind.setKindCode("BZ");
         prptitemkind.setKindName("机动车交通事故责任强制保险");
         prptitemkind.setStartDate(ciRiskInfo.getStartDate());
@@ -510,7 +489,6 @@ public class PremiumReq {
         prptitemkind.setNoTaxPremium("");
         prptitemkind.setTaxFee("");
         prptitemkind.setFlag("2 03");
-
         prptitemkindList.add(prptitemkind);
         return prptitemkindList;
 
@@ -519,54 +497,98 @@ public class PremiumReq {
     @NoArgsConstructor
     @Data
     public static class CiDTO {
+
         @JsonProperty(value = "prpTrenewal")
         @JSONField(name = "prpTrenewal")
         private List<?> prpTrenewal;
+
         @JsonProperty(value = "prpTitemCar")
         @JSONField(name = "prpTitemCar")
         private PrpTitemCarDTO prpTitemCar;
+
         @JsonProperty(value = "prpTmain")
         @JSONField(name = "prpTmain")
         private PrpTmainDTO prpTmain;
+
         @JsonProperty(value = "inputRisk")
         @JSONField(name = "inputRisk")
         private String inputRisk;
+
         @JsonProperty(value = "prptitemkindList")
         @JSONField(name = "prptitemkindList")
         private List<PrptitemkindListDTO> prptitemkindList;
+
         @JsonProperty(value = "calculateFlagCI")
         @JSONField(name = "calculateFlagCI")
         private String calculateFlagCI;
+
         @JsonProperty(value = "ciInsureDemand")
         @JSONField(name = "ciInsureDemand")
         private CiInsureDemandDTO ciInsureDemand;
+
         @JsonProperty(value = "editType")
         @JSONField(name = "editType")
         private String editType;
+
         @JsonProperty(value = "prpTmainRate")
         @JSONField(name = "prpTmainRate")
         private PrpTmainRateDTO prpTmainRate;
+
         @JsonProperty(value = "prpTcarshipTax")
         @JSONField(name = "prpTcarshipTax")
         private PrpTcarshipTaxDTO prpTcarshipTax;
 
+        public void setTrafficTime(String coverageEndDate) {
+            LocalDateTime start = DateTimeUtil.parseLocalDateTime(coverageEndDate, DateTimeUtil.DATETIME_PATTERN);
+            String newStartDate;
+            String newEndDate;
+            //及时起保
+            if (start.getHour() > 0) {
+                LocalDateTime end = start.plusYears(1L);
+                newStartDate = DateTimeUtil.format(start, DateTimeUtil.DATETIME_PATTERN);
+                newEndDate = DateTimeUtil.format(end, DateTimeUtil.DATETIME_PATTERN);
+
+                this.getPrpTmain().setStartHour(StringUtils.toString(start.getHour()));
+                this.getPrpTmain().setEndHour(StringUtils.toString(start.getHour()));
+                this.getPrpTmain().setImmeValidStartDate(newStartDate);
+                this.getPrpTmain().setImmeValidEndDate(newStartDate);
+                this.getPrpTmain().setImmeValiFlag("1");
+
+            } else {
+                LocalDateTime end = start.plusYears(1L).minusDays(1L);
+                newStartDate = DateTimeUtil.getStartTimeOfDayStr(start, DateTimeUtil.DATETIME_PATTERN);
+                newEndDate = DateTimeUtil.getEndTimeOfDayStr(end, DateTimeUtil.DATETIME_PATTERN);
+            }
+
+            this.getPrpTmain().setStartDate(newStartDate);
+            this.getPrpTmain().setEndDate(newEndDate);
+            this.getPrptitemkindList().get(0).setStartDate(newStartDate);
+            this.getPrptitemkindList().get(0).setEndDate(newEndDate);
+        }
+
         @NoArgsConstructor
         @Data
         public static class PrpTitemCarDTO {
+
             @JsonProperty(value = "clauseTypeSystem")
             @JSONField(name = "clauseTypeSystem")
             private String clauseTypeSystem;
+
             @JsonProperty(value = "clauseType")
             @JSONField(name = "clauseType")
             private String clauseType;
+
             @JsonProperty(value = "termsSystem")
             @JSONField(name = "termsSystem")
             private String termsSystem;
+
             @JsonProperty(value = "carOwner")
             @JSONField(name = "carOwner")
             private String carOwner;
+
             @JsonProperty(value = "otherNature")
             @JSONField(name = "otherNature")
+
             private String otherNature;
             @JsonProperty(value = "carOwnerIdentifyNumber")
             @JSONField(name = "carOwnerIdentifyNumber")
@@ -576,50 +598,65 @@ public class PremiumReq {
         @NoArgsConstructor
         @Data
         public static class PrpTmainDTO {
+
             @JsonProperty(value = "endDate")
             @JSONField(name = "endDate")
             private String endDate;
+
             @JsonProperty(value = "noCarFlag")
             @JSONField(name = "noCarFlag")
             private String noCarFlag;
+
             @JsonProperty(value = "immeValiFlag")
             @JSONField(name = "immeValiFlag")
             private String immeValiFlag;
+
             @JsonProperty(value = "signDate")
             @JSONField(name = "signDate")
             private String signDate;
+
             @JsonProperty(value = "inputDate")
             @JSONField(name = "inputDate")
             private String inputDate;
+
             @JsonProperty(value = "endHour")
             @JSONField(name = "endHour")
             private String endHour;
+
             @JsonProperty(value = "immeValidEndDate")
             @JSONField(name = "immeValidEndDate")
             private String immeValidEndDate;
+
             @JsonProperty(value = "answer")
             @JSONField(name = "answer")
             private String answer;
+
             @JsonProperty(value = "startHour")
             @JSONField(name = "startHour")
             private String startHour;
+
             @JsonProperty(value = "orderFlag")
             @JSONField(name = "orderFlag")
             private String orderFlag;
+
             @JsonProperty(value = "immeValidStartDate")
             @JSONField(name = "immeValidStartDate")
             private String immeValidStartDate;
+
             @JsonProperty(value = "simpleOrderFlag")
             @JSONField(name = "simpleOrderFlag")
             private String simpleOrderFlag;
+
             @JsonProperty(value = "startDate")
             @JSONField(name = "startDate")
             private String startDate;
+
         }
 
         @NoArgsConstructor
         @Data
         public static class CiInsureDemandDTO {
+
             @JsonProperty(value = "demandNo")
             @JSONField(name = "demandNo")
             private String demandNo;
@@ -634,9 +671,11 @@ public class PremiumReq {
         @NoArgsConstructor
         @Data
         public static class PrpTcarshipTaxDTO {
+
             @JsonProperty(value = "taxRelifFlag")
             @JSONField(name = "taxRelifFlag")
             private String taxRelifFlag;
+
             @JsonProperty(value = "paidCertificate")
             @JSONField(name = "paidCertificate")
             private String paidCertificate;
@@ -645,36 +684,47 @@ public class PremiumReq {
         @NoArgsConstructor
         @Data
         public static class PrptitemkindListDTO {
+
             @JsonProperty(value = "amount")
             @JSONField(name = "amount")
             private String amount;
+
             @JsonProperty(value = "kindCode")
             @JSONField(name = "kindCode")
             private String kindCode;
+
             @JsonProperty(value = "flag")
             @JSONField(name = "flag")
             private String flag;
+
             @JsonProperty(value = "endDate")
             @JSONField(name = "endDate")
             private String endDate;
+
             @JsonProperty(value = "isDeductible")
             @JSONField(name = "isDeductible")
             private String isDeductible;
+
             @JsonProperty(value = "rate")
             @JSONField(name = "rate")
             private String rate;
+
             @JsonProperty(value = "deductible")
             @JSONField(name = "deductible")
             private String deductible;
+
             @JsonProperty(value = "kindName")
             @JSONField(name = "kindName")
             private String kindName;
+
             @JsonProperty(value = "taxFee")
             @JSONField(name = "taxFee")
             private String taxFee;
+
             @JsonProperty(value = "noTaxPremium")
             @JSONField(name = "noTaxPremium")
             private String noTaxPremium;
+
             @JsonProperty(value = "startDate")
             @JSONField(name = "startDate")
             private String startDate;
@@ -684,46 +734,87 @@ public class PremiumReq {
     @NoArgsConstructor
     @Data
     public static class BiDTO {
+
         @JsonProperty(value = "prpTrenewal")
         @JSONField(name = "prpTrenewal")
         private List<?> prpTrenewal;
+
         @JsonProperty(value = "prptengageList")
         @JSONField(name = "prptengageList")
         private List<?> prptengageList;
+
         @JsonProperty(value = "prpTitemCar")
         @JSONField(name = "prpTitemCar")
         private PrpTitemCarDTO prpTitemCar;
+
         @JsonProperty(value = "prpTmain")
         @JSONField(name = "prpTmain")
         private PrpTmainDTO prpTmain;
+
         @JsonProperty(value = "inputRisk")
         @JSONField(name = "inputRisk")
         private String inputRisk;
+
         @JsonProperty(value = "calculateFlagBI")
         @JSONField(name = "calculateFlagBI")
         private String calculateFlagBI;
+
         @JsonProperty(value = "prptitemkindList")
         @JSONField(name = "prptitemkindList")
         private List<PrptitemkindListDTO> prptitemkindList;
+
         @JsonProperty(value = "ciInsureDemand")
         @JSONField(name = "ciInsureDemand")
         private CiInsureDemandDTO ciInsureDemand;
+
         @JsonProperty(value = "prpTChargingPostDataList")
         @JSONField(name = "prpTChargingPostDataList")
         private List<?> prpTChargingPostDataList;
+
         @JsonProperty(value = "ciInsureDemandPay")
         @JSONField(name = "ciInsureDemandPay")
         private List<?> ciInsureDemandPay;
+
         @JsonProperty(value = "editType")
         @JSONField(name = "editType")
         private String editType;
+
         @JsonProperty(value = "ciInsureDemandWarningClaim")
         @JSONField(name = "ciInsureDemandWarningClaim")
         private List<?> ciInsureDemandWarningClaim;
+
         @JsonProperty(value = "prpTmainRate")
         @JSONField(name = "prpTmainRate")
         private PrpTmainRateDTO prpTmainRate;
 
+        public void setBusinessTime(String coverageEndDate) {
+            LocalDateTime start = DateTimeUtil.parseLocalDateTime(coverageEndDate, DateTimeUtil.DATETIME_PATTERN);
+            String newStartDate;
+            String newEndDate;
+            //及时起保
+            if (start.getHour() > 0) {
+                LocalDateTime end = start.plusYears(1L);
+                newStartDate = DateTimeUtil.format(start, DateTimeUtil.DATETIME_PATTERN);
+                newEndDate = DateTimeUtil.format(end, DateTimeUtil.DATETIME_PATTERN);
+                this.getPrpTmain().setStartHour(StringUtils.toString(start.getHour()));
+                this.getPrpTmain().setEndHour(StringUtils.toString(start.getHour()));
+                this.getPrpTmain().setImmeValidStartDate(newStartDate);
+                this.getPrpTmain().setImmeValidEndDate(newStartDate);
+                this.getPrpTmain().setImmeValiFlag("1");
+
+            } else {
+                LocalDateTime end = start.plusYears(1L).minusDays(1L);
+                newStartDate = DateTimeUtil.getStartTimeOfDayStr(start, DateTimeUtil.DATETIME_PATTERN);
+                newEndDate = DateTimeUtil.getEndTimeOfDayStr(end, DateTimeUtil.DATETIME_PATTERN);
+            }
+            this.getPrpTmain().setStartDate(newStartDate);
+            this.getPrpTmain().setEndDate(newEndDate);
+            this.getPrptitemkindList().forEach(x -> {
+                x.setStartDate(newStartDate);
+                x.setEndDate(newEndDate);
+            });
+        }
+
         @NoArgsConstructor
         @Data
         public static class PrpTitemCarDTO {
@@ -809,11 +900,23 @@ public class PremiumReq {
             @JSONField(name = "pureElectricBatteryType")
             private String pureElectricBatteryType;
 
+            @JsonProperty(value = "carOwner")
+            @JSONField(name = "carOwner")
+            private String carOwner;
+
+            @JsonProperty(value = "otherNature")
+            @JSONField(name = "otherNature")
+            private String otherNature;
+
+            @JsonProperty(value = "carOwnerIdentifyNumber")
+            @JSONField(name = "carOwnerIdentifyNumber")
+            private String carOwnerIdentifyNumber;
         }
 
         @NoArgsConstructor
         @Data
         public static class PrpTmainDTO {
+
             @JsonProperty(value = "endDate")
             @JSONField(name = "endDate")
             private String endDate;
@@ -859,11 +962,13 @@ public class PremiumReq {
             @JsonProperty(value = "startDate")
             @JSONField(name = "startDate")
             private String startDate;
+
         }
 
         @NoArgsConstructor
         @Data
         public static class CiInsureDemandDTO {
+
             @JsonProperty(value = "demandNo")
             @JSONField(name = "demandNo")
             private String demandNo;
@@ -872,6 +977,7 @@ public class PremiumReq {
         @NoArgsConstructor
         @Data
         public static class PrpTmainRateDTO {
+
             @JsonProperty(value = "demandNo")
             @JSONField(name = "demandNo")
             private String demandNo;

+ 12 - 3
src/main/java/com/ydtech/modules/ins/model/guoren/PremiumResp.java

@@ -105,7 +105,7 @@ public class PremiumResp {
         private Object lastYearEndDate;
         @JsonProperty(value = "prpTChargingPostDataList")
         @JSONField(name = "prpTChargingPostDataList")
-        private List<?> prpTChargingPostDataList;
+        private List<PrpTChargingPostData> prpTChargingPostDataList;
         @JsonProperty(value = "ciLossCondition")
         @JSONField(name = "ciLossCondition")
         private Integer ciLossCondition;
@@ -138,13 +138,14 @@ public class PremiumResp {
         private Object bidemandNo;
         @JsonProperty(value = "bireCoverMsg")
         @JSONField(name = "bireCoverMsg")
-        private Object bireCoverMsg;
+        private String bireCoverMsg;
         @JsonProperty(value = "biprofit")
         @JSONField(name = "biprofit")
         private Integer biprofit;
         @JsonProperty(value = "prpTenGearAllocationFeeList")
         @JSONField(name = "prpTenGearAllocationFeeList")
-        private List<?> prpTenGearAllocationFeeList;
+        private List<PrpTenGearAllocationFeeVo> prpTenGearAllocationFeeList;
+
         @JsonProperty(value = "ciInsureDemandPay")
         @JSONField(name = "ciInsureDemandPay")
         private List<CIInsureDemandPayVo> ciInsureDemandPay;
@@ -220,6 +221,14 @@ public class PremiumResp {
             private String InsurerArea;
         }
 
+        @NoArgsConstructor
+        @Data
+        public static class PrpTChargingPostData{}
+
+        @NoArgsConstructor
+        @Data
+        public static class PrpTenGearAllocationFeeVo{}
+
         @NoArgsConstructor
         @Data
         public static class CarShipTaxRespVODTO {

+ 205 - 0
src/main/java/com/ydtech/modules/ins/utils/CompressUtil.java

@@ -0,0 +1,205 @@
+package com.ydtech.modules.ins.utils;
+
+import lombok.extern.slf4j.Slf4j;
+import net.lingala.zip4j.core.ZipFile;
+import net.lingala.zip4j.exception.ZipException;
+import net.lingala.zip4j.model.FileHeader;
+import net.lingala.zip4j.model.ZipParameters;
+import net.lingala.zip4j.util.Zip4jConstants;
+import org.apache.commons.lang3.StringUtils;
+
+import java.io.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.zip.GZIPInputStream;
+
+/**
+ * @Author CXP
+ * @Date 2023/11/9 11:18
+ */
+@Slf4j
+public class CompressUtil {
+
+
+    /**
+     * GZip 解压缩
+     *
+     * @param byteArray GZip格式的压缩字节数组
+     * @return 解压缩后的字符串结果
+     */
+    public static String unCompress(byte[] byteArray) {
+        if (byteArray == null || byteArray.length == 0) {
+            return null;
+        }
+        String unCompressString = null;
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        ByteArrayInputStream in = new ByteArrayInputStream(byteArray);
+        try {
+            GZIPInputStream gzip = new GZIPInputStream(in);
+            byte[] buffer = new byte[256];
+            int n;
+            while ((n = gzip.read(buffer)) >= 0) {
+                out.write(buffer, 0, n);
+            }
+            unCompressString = out.toString();
+            gzip.close();
+        } catch (IOException e) {
+            log.error(e.getMessage(), e);
+        } finally {
+            try {
+                out.close();
+                in.close();
+            } catch (IOException e) {
+                log.error(e.getMessage(), e);
+            }
+        }
+        return unCompressString;
+    }
+
+    /**
+     * 使用给定密码压缩指定文件或文件夹到指定位置.
+     * <p>
+     * dest可传最终压缩文件存放的绝对路径,也可以传存放目录,也可以传null或者""
+     * 如果传null或者""则将压缩文件存放在当前目录,即跟源文件同目录,压缩文件名取源文件名,以.zip为后缀;
+     * 如果以路径分隔符(File.separator)结尾,则视为目录,压缩文件名取源文件名,以.zip为后缀,否则视为文件名.
+     *
+     * @param src         要压缩的文件或文件夹路径
+     * @param dest        压缩文件存放路径
+     * @param isCreateDir 是否在压缩文件里创建目录,仅在压缩文件为目录时有效.
+     *                    如果为false,将直接压缩目录下文件到压缩文件.
+     * @param passwd      压缩使用的密码
+     * @return 最终的压缩文件存放的绝对路径, 如果为null则说明压缩失败.
+     */
+    public static String zip(String src, String dest, boolean isCreateDir, String passwd) {
+        File srcFile = new File(src);
+        dest = buildDestinationZipFilePath(srcFile, dest);
+        ZipParameters parameters = new ZipParameters();
+        // 压缩方式
+        parameters.setCompressionMethod(Zip4jConstants.COMP_DEFLATE);
+        // 压缩级别
+        parameters.setCompressionLevel(Zip4jConstants.DEFLATE_LEVEL_NORMAL);
+        if (!StringUtils.isEmpty(passwd)) {
+            parameters.setEncryptFiles(true);
+            // 加密方式
+            parameters.setEncryptionMethod(Zip4jConstants.ENC_METHOD_STANDARD);
+            parameters.setPassword(passwd.toCharArray());
+        }
+        try {
+            ZipFile zipFile = new ZipFile(dest);
+            if (srcFile.isDirectory()) {
+                // 如果不创建目录的话,将直接把给定目录下的文件压缩到压缩文件,即没有目录结构
+                if (!isCreateDir) {
+                    File[] subFiles = srcFile.listFiles();
+                    ArrayList<File> temp = new ArrayList<File>();
+                    Collections.addAll(temp, subFiles);
+                    zipFile.addFiles(temp, parameters);
+                    return dest;
+                }
+                zipFile.addFolder(srcFile, parameters);
+            } else {
+                zipFile.addFile(srcFile, parameters);
+            }
+            return dest;
+        } catch (ZipException e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    /**
+     * @param source
+     *            原始文件路径
+     * @param dest
+     *            解压路径
+     * @param password
+     *            解压文件密码(可以为空)
+     */
+    public static void unZip(String source, String dest, String password,String fileName,String licensePlate) {
+        try {
+            File zipFile = new File(source);
+            // 首先创建ZipFile指向磁盘上的.zip文件
+            ZipFile zFile = new ZipFile(zipFile);
+            zFile.setFileNameCharset("UTF-8");
+            File destDir = new File(dest);
+            if (!destDir.exists()) {
+                destDir.mkdirs();
+            }
+            if (zFile.isEncrypted()) {
+                // 设置密码
+                zFile.setPassword(password.toCharArray());
+            }
+            // 将文件抽出到解压目录(解压)
+            zFile.extractAll(dest);
+            List<FileHeader> headerList = zFile.getFileHeaders();
+            List<File> extractedFileList = new ArrayList<File>();
+            for (FileHeader fileHeader : headerList) {
+                if (!fileHeader.isDirectory()) {
+                    extractedFileList.add(new File(destDir, fileHeader.getFileName()));
+                }
+            }
+            File[] extractedFiles = new File[extractedFileList.size()];
+            extractedFileList.toArray(extractedFiles);
+            for (File f : extractedFileList) {
+                if(f.getName().contains("_bz6")){
+                    f.renameTo(new File(dest+licensePlate+"-交强险标志.pdf"));
+                }else{
+                    f.renameTo(new File(dest+fileName));
+                }
+                System.out.println(f.getAbsolutePath() + "文件解压成功!");
+            }
+            zipFile.delete();
+        } catch (ZipException e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 构建压缩文件存放路径,如果不存在将会创建
+     * 传入的可能是文件名或者目录,也可能不传,此方法用以转换最终压缩文件的存放路径
+     *
+     * @param srcFile   源文件
+     * @param destParam 压缩目标路径
+     * @return 正确的压缩文件存放路径
+     */
+    private static String buildDestinationZipFilePath(File srcFile, String destParam) {
+        if (StringUtils.isEmpty(destParam)) {
+            if (srcFile.isDirectory()) {
+                destParam = srcFile.getParent() + File.separator + srcFile.getName() + ".zip";
+            } else {
+                String fileName = srcFile.getName().substring(0, srcFile.getName().lastIndexOf("."));
+                destParam = srcFile.getParent() + File.separator + fileName + ".zip";
+            }
+        } else {
+            // 在指定路径不存在的情况下将其创建出来
+            createDestDirectoryIfNecessary(destParam);
+            if (destParam.endsWith(File.separator)) {
+                String fileName = "";
+                if (srcFile.isDirectory()) {
+                    fileName = srcFile.getName();
+                } else {
+                    fileName = srcFile.getName().substring(0, srcFile.getName().lastIndexOf("."));
+                }
+                destParam += fileName + ".zip";
+            }
+        }
+        return destParam;
+    }
+
+    /**
+     * 在必要的情况下创建压缩文件存放目录,比如指定的存放路径并没有被创建
+     *
+     * @param destParam 指定的存放路径,有可能该路径并没有被创建
+     */
+    private static void createDestDirectoryIfNecessary(String destParam) {
+        File destDir = null;
+        if (destParam.endsWith(File.separator)) {
+            destDir = new File(destParam);
+        } else {
+            destDir = new File(destParam.substring(0, destParam.lastIndexOf(File.separator)));
+        }
+        if (!destDir.exists()) {
+            destDir.mkdirs();
+        }
+    }
+}

+ 131 - 0
src/main/java/com/ydtech/modules/order/components/gouren/GuorenDuplicateInsuranceComponent.java

@@ -0,0 +1,131 @@
+package com.ydtech.modules.order.components.gouren;
+
+
+import com.ydtech.exception.SystemException;
+import com.ydtech.modules.ins.model.guoren.PremiumReq;
+import com.ydtech.modules.ins.model.guoren.PremiumResp;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+import org.springframework.util.ObjectUtils;
+
+import java.text.SimpleDateFormat;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @description: 国任财险重复投保
+ * @author: wenks
+ * @date: 2023/11/8 10:40
+ **/
+@Component
+public class GuorenDuplicateInsuranceComponent {
+
+    public static final String THE_FIRST_REGEX = "终保日期(.+?);";
+
+    public static final String THE_SECOND_REGEX = ".+终保日期(.+?);";
+
+    public static final String JQ = "交强险";
+
+    public static final String SY = "商业险";
+
+    protected static final Map<Integer, String> dateFormatMap;
+
+    static {
+        dateFormatMap = new HashMap<>();
+        dateFormatMap.put(8, "yyyyMMdd");
+        dateFormatMap.put(10, "yyyyMMddHH");
+        dateFormatMap.put(12, "yyyyMMddHHmm");
+        dateFormatMap.put(16, "yyyyMMddHHmmss");
+    }
+
+    /**
+     * 获取终保日期
+     *
+     * @param rtnMsg 返回信息
+     * @param regex  正则
+     * @return 终保日期
+     */
+    public static String getEndDate(String rtnMsg, String regex) {
+        String endDate = getTheExpiryDate(rtnMsg, regex);
+        if (!endDate.isEmpty()) {
+            return endDate;
+        }
+        return "";
+    }
+
+    /**
+     * 获取终保日期
+     *
+     * @param message 重复投保返回信息
+     * @param regex   正则内容
+     * @return
+     */
+    public static String getTheExpiryDate(String message, String regex) {
+        Pattern pattern = Pattern.compile(regex);
+        String replace = message.replace("\r", ";").replace("\n", ";");
+        Matcher m = pattern.matcher(replace);
+
+        boolean b = m.find();
+        if (b) {
+            try {
+                String group = m.group(1);
+                String startDate = group.replace(":", "").replace("-", "").replace(" ", "");
+                String string = dateFormatMap.get(startDate.length());
+                SimpleDateFormat dateFormat = new SimpleDateFormat(string);
+                SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                return simpleDateFormat.format(dateFormat.parse(startDate));
+            } catch (Exception e) {
+                throw new SystemException(message);
+            }
+        }
+        throw new SystemException(message);
+    }
+
+    public boolean processor(PremiumResp resp, List<String> requestInfoList, PremiumReq req) {
+        String syEndDate = "";
+        PremiumResp.DataDTO data = resp.getData();
+        if(ObjectUtils.isEmpty(data)){
+            throw new SystemException("程序异常请联系管理员");
+        }
+
+        if (StringUtils.isNotEmpty(data.getBireCoverMsg()) && data.getBireCoverMsg().contains("重复投保")) {
+            requestInfoList.add(data.getBireCoverMsg());
+            syEndDate = getTheExpiryDate(data.getBireCoverMsg(), THE_FIRST_REGEX);
+            // 商业险
+            PremiumReq.BiDTO bi = req.getBi();
+            bi.setBusinessTime(syEndDate);
+            return true;
+        }
+
+        String resultMsg = resp.getResultMsg();
+        //1. 交强重复投保 替换日期重新报价
+        if (StringUtils.isNotEmpty(resultMsg) && resultMsg.contains("重复投保")) {
+            requestInfoList.add(resultMsg);
+            String jqEndDate = getEndDate(resultMsg, THE_FIRST_REGEX);
+            if (resp.getResultMsg().contains(SY)) {
+                syEndDate = getEndDate(resultMsg, THE_SECOND_REGEX);
+            }
+
+            if(StringUtils.isNotEmpty(syEndDate)){
+                // 商业险
+                PremiumReq.BiDTO bi = req.getBi();
+                bi.setBusinessTime(syEndDate);
+            }
+
+            if(StringUtils.isNotEmpty(jqEndDate)){
+                // 交强
+                PremiumReq.CiDTO ci = req.getCi();
+                ci.setTrafficTime(jqEndDate);
+            }
+            return true;
+        }
+
+        return false;
+
+    }
+
+
+}

+ 23 - 24
src/main/java/com/ydtech/modules/order/components/huatai/HuaTaiRequestApiComponents.java

@@ -10,8 +10,6 @@ import com.ydtech.modules.order.entity.api.huatai.HuaTaiBaseResponse;
 import com.ydtech.modules.order.entity.api.huatai.HuaTaiEncryptReq;
 import com.ydtech.modules.order.entity.api.huatai.HuaTaiEncryptRes;
 import com.ydtech.modules.order.entity.api.huatai.constants.HuaTaiTransCode;
-import com.ydtech.modules.order.entity.api.huatai.request.HuaTaiQuotedPriceRequest;
-import com.ydtech.modules.order.entity.api.huatai.response.HuaTaiQuotedPriceResponse;
 import com.ydtech.modules.order.entity.api.huatai.request.*;
 import com.ydtech.modules.order.entity.api.huatai.response.*;
 import com.ydtech.modules.order.utils.AESUtilsWithDataBase;
@@ -27,6 +25,7 @@ import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Component;
 import org.springframework.util.ObjectUtils;
 import org.springframework.web.client.RestTemplate;
+
 import java.security.SecureRandom;
 import java.util.List;
 
@@ -70,19 +69,19 @@ public class HuaTaiRequestApiComponents {
         InsuranceLog.infoLog(InsuranceEnum.HTIC.getPinyin(), "\n\t---------> URl: {} \n---------> 请求参数:{}", url, busReqString);
         // ----加密starting------------
         //1.先获取16位随机字符串 Key
-        String key=generateRadomStr(8);
+        String key = generateRadomStr(8);
         //2.使用Base64加密请求报文
-        String base64ReqJson= Base64Utils.getBase64Encode(busReqString);
+        String base64ReqJson = Base64Utils.getBase64Encode(busReqString);
         //3. 使用AES算法 秘钥Key  对 base64ReqJson加密
-         String busiContent= AESUtilsWithDataBase.encryptECBPK5Base64(base64ReqJson, key);
+        String busiContent = AESUtilsWithDataBase.encryptECBPK5Base64(base64ReqJson, key);
         //4.对Key 使用RSA算法进行加密
-        String accessToken="";
-        try{
-            accessToken= RSAUtils.rsaEncrypt(key, properties.getHuaTaiPublicKey(),"utf-8");
-        }catch (Exception e){
+        String accessToken = "";
+        try {
+            accessToken = RSAUtils.rsaEncrypt(key, properties.getHuaTaiPublicKey(), "utf-8");
+        } catch (Exception e) {
             throw new SystemException("RSA加密获取accessToken失败!");
         }
-        HuaTaiEncryptReq encryptReq=new HuaTaiEncryptReq();
+        HuaTaiEncryptReq encryptReq = new HuaTaiEncryptReq();
         encryptReq.setInsuredCode(properties.getInsuredCode());
         encryptReq.setSourceCode(properties.getSourceCode());
         encryptReq.setBusiContent(busiContent);
@@ -92,25 +91,25 @@ public class HuaTaiRequestApiComponents {
         HttpEntity<String> httpEntity = new HttpEntity<>(jsonString, httpHeaders);
         //----加密endding------------
         ResponseEntity<String> response = restTemplate.postForEntity(url, httpEntity, String.class);
-        String   body = response.getBody();
+        String body = response.getBody();
 
         InsuranceLog.infoLog(InsuranceEnum.HTIC.getPinyin(), "\n\t---------> 解密前的参数:{}", body);
         // ------解密starting---------
-        HuaTaiEncryptRes encryptRes=JSON.parseObject(body,HuaTaiEncryptRes.class);
+        HuaTaiEncryptRes encryptRes = JSON.parseObject(body, HuaTaiEncryptRes.class);
         //1.通过自己的私钥对key进行解密
-        String resAccessToken="";
-        try{
-            resAccessToken=RSAUtils.rsaDecrypt(encryptRes.getAccessToken(),properties.getSelfPrivateKey(),"UTF-8");
-        }catch (Exception e){
+        String resAccessToken = "";
+        try {
+            resAccessToken = RSAUtils.rsaDecrypt(encryptRes.getAccessToken(), properties.getSelfPrivateKey(), "UTF-8");
+        } catch (Exception e) {
             throw new SystemException("RSA解密获取accessToken失败!");
         }
         //2.用key解密出出参报文
-        String aseDecryptStr=AESUtilsWithDataBase.decryptECBPK5Base64(encryptRes.getBusiContent(),resAccessToken);
+        String aseDecryptStr = AESUtilsWithDataBase.decryptECBPK5Base64(encryptRes.getBusiContent(), resAccessToken);
         //3.使用Base64解密最终返回报文
         String text = Base64Utils.getBase64Decode(aseDecryptStr);
         // ------解密ending---------
         InsuranceLog.infoLog(InsuranceEnum.HTIC.getPinyin(), "\n\t---------> {}:{}", "响应参数", text);
-        S t= JSON.parseObject(text, tClass);
+        S t = JSON.parseObject(text, tClass);
         if (ObjectUtils.isEmpty(t)) {
             throw new SystemException("请求失败");
         }
@@ -190,10 +189,9 @@ public class HuaTaiRequestApiComponents {
     /**
      * 上传影像 传入订单信息,查询是否生成保单成功
      */
- /*   public void uploadImage(UploadImageRequest request, Class<UploadImageResponse> tClass) {
-        //  imageRequest(request, tClass, true);
+    public HuaTaiUploadImageResponse uploadImage(HuaTaiUploadImageRequest request, Class<HuaTaiUploadImageResponse> tClass) {
+        return routineRequest(request, tClass, true, "");
     }
-*/
 
     /**
      * 缴费查询
@@ -228,9 +226,9 @@ public class HuaTaiRequestApiComponents {
 
     public <T extends HuaTaiBaseResponse> void validationResults(T t) {
         if ("-1".equals(t.getHead().getReturnCode())) {
-            if(StringUtils.isNotEmpty(t.getHead().getReturnMessage())&& t.getHead().getReturnMessage().contains("商业险重复投保") && t.getHead().getReturnMessage().contains("重复投保的本公司的保单信息")){
+            if (StringUtils.isNotEmpty(t.getHead().getReturnMessage()) && t.getHead().getReturnMessage().contains("商业险重复投保") && t.getHead().getReturnMessage().contains("重复投保的本公司的保单信息")) {
 
-            }else{
+            } else {
                 throw new SystemException(t.getHead().getReturnMessage());
             }
 
@@ -240,10 +238,11 @@ public class HuaTaiRequestApiComponents {
 
     /**
      * 生成对应长度的随机字符串
+     *
      * @param length
      * @return
      */
-    private static   String generateRadomStr(int length) {
+    private static String generateRadomStr(int length) {
         SecureRandom random = new SecureRandom();
         byte[] bytes = new byte[length];
         random.nextBytes(bytes);

+ 208 - 0
src/main/java/com/ydtech/modules/order/components/huatai/HuiTaiUploadImageComponents.java

@@ -0,0 +1,208 @@
+package com.ydtech.modules.order.components.huatai;
+
+import com.ydtech.exception.SystemException;
+import com.ydtech.modules.order.entity.api.huatai.constants.ImageTypeCode;
+import com.ydtech.modules.order.entity.api.huatai.request.HuaTaiSaveFileIdxRequest;
+import com.ydtech.modules.order.entity.api.huatai.response.HuaTaiImageInitParamResponse;
+import com.ydtech.modules.order.entity.dto.InsUploadImagesDto;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.http.*;
+import org.springframework.stereotype.Component;
+import org.springframework.util.ObjectUtils;
+import org.springframework.web.client.RestTemplate;
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.UUID;
+
+
+/**
+ * @description: 华泰财险 影像上传
+ * @author: wenks
+ * @date: 2023/11/9 15:53
+ **/
+
+@Component
+@RequiredArgsConstructor
+@Slf4j
+public class HuiTaiUploadImageComponents {
+
+    private final RestTemplate restTemplate;
+    private static final String INIT_PARAM = "/h5img/app/ImgManager/initParam.cmd?t=";
+    private static final String FILE_UPLOAD = "/h5img/fileupload";
+    private static final String SAVE_FILE_IDX = "/h5img/app/ImgManager/saveFileIdx.cmd";
+
+    /**
+     * 上传影像
+     *
+     * @param url                 上传url
+     * @param insUploadImagesDtos 影像信息
+     */
+    public void uploadImage(String url, List<InsUploadImagesDto> insUploadImagesDtos) {
+        URL u;
+        try {
+            u = new URL(url);
+        } catch (MalformedURLException e) {
+            throw new SystemException("华泰文件上传路劲解析失败");
+        }
+        String domain = u.getProtocol() + "://" + u.getAuthority();
+        String query = u.getQuery();
+        String[] params = query.split("&");
+        String token = null;
+        for (String param : params) {
+            String[] pair = param.split("=");
+            if (pair[0].equals("token")) {
+                token = pair[1];
+            }
+        }
+
+        HuaTaiImageInitParamResponse initParamResponse = initParam(domain, token);
+        List<HuaTaiImageInitParamResponse.TypeSelectVosDTO.ChildrenDTO> childrenDTO = initParamResponse.getChildrenDTO();
+        for (InsUploadImagesDto insUploadImagesDto : insUploadImagesDtos) {
+            String imageType = insUploadImagesDto.getImageType();
+            String fileName = insUploadImagesDto.getFileName();
+            String substring = fileName.substring(fileName.lastIndexOf("."));
+            String file = getUUIDUpper() + substring;
+
+            for (ImageTypeCode fileTypeEnum : ImageTypeCode.values()) {
+                boolean contains = Arrays.asList(fileTypeEnum.getImagesType()).contains(imageType);
+                if (contains) {
+                    HuaTaiImageInitParamResponse.TypeSelectVosDTO.ChildrenDTO childrenDTO1 = HuaTaiImageInitParamResponse.filteringTypeCode(childrenDTO, fileTypeEnum.getCode());
+                    FileuploadResult fileupload = fileupload(domain, token, initParamResponse, insUploadImagesDto.getFilePath(), file);
+                    saveFileIdx(domain, token, initParamResponse, fileupload, fileName, childrenDTO1);
+                }
+            }
+        }
+
+    }
+
+    /**
+     * 初始化参数获取 配置信息
+     *
+     * @param domain 域名
+     * @param token  token
+     * @return
+     */
+    private HuaTaiImageInitParamResponse initParam(String domain, String token) {
+        HttpHeaders httpHeaders = new HttpHeaders();
+        // token
+        httpHeaders.set("Cookie", "token=" + token);
+        String initParamUrl = domain + INIT_PARAM + System.currentTimeMillis();
+        HttpEntity<Object> httpEntity = new HttpEntity<>(null, httpHeaders);
+        ResponseEntity<HuaTaiImageInitParamResponse> response = restTemplate.exchange(initParamUrl, HttpMethod.GET, httpEntity, HuaTaiImageInitParamResponse.class);
+        return response.getBody();
+    }
+
+    /**
+     * 文件上传返回文件路劲
+     *
+     * @return 文件路劲
+     */
+    private FileuploadResult fileupload(String domain, String token, HuaTaiImageInitParamResponse initParamResponse, String path, String fileName) {
+        File file = new File(path);
+        byte[] bytes = file2byte(file);
+        double v = (double) bytes.length / 1024;
+        HttpHeaders httpHeaders = new HttpHeaders();
+        httpHeaders.setAccept(Collections.singletonList(MediaType.MULTIPART_FORM_DATA));
+        httpHeaders.set("Bucket", initParamResponse.getStorageType());
+        httpHeaders.set("Bussmodule", initParamResponse.getBussType());
+        httpHeaders.set("Bussno", initParamResponse.getBussNo());
+
+        // token
+        httpHeaders.set("Token", token);
+        // 文件名称
+        httpHeaders.set("Filename", fileName);
+        httpHeaders.setContentType(MediaType.IMAGE_JPEG);
+        HttpEntity<byte[]> httpEntity = new HttpEntity<>(bytes, httpHeaders);
+
+        String fileuploadUrl = domain + FILE_UPLOAD;
+        ResponseEntity<String> response = restTemplate.postForEntity(fileuploadUrl, httpEntity, String.class);
+        return new FileuploadResult(response.getBody(), v);
+    }
+
+
+    /**
+     * 服务端保存
+     *
+     * @param token       token
+     * @param response    请求
+     * @param fileName    文件名称
+     * @param childrenDTO 上传的文件类型
+     */
+    private void saveFileIdx(String domain, String token, HuaTaiImageInitParamResponse response, FileuploadResult fileupload, String fileName,
+                             HuaTaiImageInitParamResponse.TypeSelectVosDTO.ChildrenDTO childrenDTO) {
+        HuaTaiSaveFileIdxRequest huaTaiSaveFileIdxRequest = new HuaTaiSaveFileIdxRequest(token, response, fileupload, fileName, childrenDTO);
+        huaTaiSaveFileIdxRequest.getFileIdxVo().setImgId(System.currentTimeMillis());
+        HttpHeaders httpHeaders = new HttpHeaders();
+        httpHeaders.setContentType(MediaType.APPLICATION_JSON);
+        httpHeaders.set("Cookie", "token=" + token);
+        HttpEntity<HuaTaiSaveFileIdxRequest> httpEntity = new HttpEntity<>(huaTaiSaveFileIdxRequest, httpHeaders);
+        String saveFileIdxUrl = domain + SAVE_FILE_IDX;
+        restTemplate.postForEntity(saveFileIdxUrl, httpEntity, String.class);
+    }
+
+
+    @AllArgsConstructor
+    @Data
+    public static class FileuploadResult {
+
+        private String filePath;
+
+        private double fileSize;
+
+    }
+
+
+    /**
+     * 获取uuid文件名
+     *
+     * @return UUID名
+     */
+    public static String getUUIDUpper() {
+        return UUID.randomUUID().toString().replace("-", "").toUpperCase();
+    }
+
+    /**
+     * 获取uuid文件名
+     *
+     * @return UUID名
+     */
+    public static String getUUIDLower() {
+        return UUID.randomUUID().toString().replace("-", "").toLowerCase();
+    }
+
+    /**
+     * 将文件转换成byte数组
+     *
+     * @param file 文件
+     * @return 字节
+     */
+    public static byte[] file2byte(File file) {
+        byte[] buffer;
+        try (FileInputStream fis = new FileInputStream(file); ByteArrayOutputStream bos = new ByteArrayOutputStream()) {
+            byte[] b = new byte[1024];
+            int n;
+            while ((n = fis.read(b)) != -1) {
+                bos.write(b, 0, n);
+            }
+            buffer = bos.toByteArray();
+            return buffer;
+        } catch (IOException ignored) {
+            throw new SystemException("文件转换异常");
+        }
+    }
+
+}
+
+
+

+ 15 - 14
src/main/java/com/ydtech/modules/order/controller/HuaTaiOrderApiController.java

@@ -4,25 +4,26 @@ 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.QuoteRespVo;
-import com.ydtech.modules.ins.model.ya.CarModelDTO;
 import com.ydtech.modules.order.aop.QuoteVerification;
 import com.ydtech.modules.order.components.InsOrdersComponents;
-import com.ydtech.modules.order.entity.api.zhongmei.request.ApprovedRequest;
-import com.ydtech.modules.order.entity.api.zhongmei.request.CoverageRequest;
-import com.ydtech.modules.order.entity.vo.*;
+import com.ydtech.modules.order.components.huatai.HuiTaiUploadImageComponents;
+import com.ydtech.modules.order.entity.crawler.vo.CrawlerPolicyPrintVo;
+import com.ydtech.modules.order.entity.dto.InsUploadImagesDto;
+import com.ydtech.modules.order.entity.vo.AccidentalDrivingVo;
+import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
+import com.ydtech.modules.order.entity.vo.BaseQuoteVo;
+import com.ydtech.modules.order.entity.vo.PolicyPrintVo;
 import com.ydtech.modules.order.service.HuaTaiOrderApiService;
-import com.ydtech.modules.order.service.ZhongMeiOrderApiService;
-import com.ydtech.modules.order.utils.AESUtilsWithDataBase;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import javax.validation.Valid;
-import java.util.List;
+import java.util.Collections;
 
 
 @Api(tags = "华泰财险 API ")
@@ -63,7 +64,7 @@ public class HuaTaiOrderApiController {
 
     @PostMapping("/getPolicyPrint")
     @ApiOperation(value = "电子保单")//3.12.	电子保单下载接口
-    public HttpResult<List<String>> getPolicyPrint(@RequestBody PolicyPrintVo policyPrintVo) {
+    public HttpResult<CrawlerPolicyPrintVo> getPolicyPrint(@RequestBody PolicyPrintVo policyPrintVo) {
         return this.huaTaiOrderApiService.getPolicyPrint(policyPrintVo);
     }
 
@@ -79,10 +80,10 @@ public class HuaTaiOrderApiController {
         return this.huaTaiOrderApiService.auditStatusQuery(companyId);
     }
 
-/*    @PostMapping("/getPaymentUrl")
-    @ApiOperation(value = "支付码获取")//3.8.	电子投保单确认及缴费短信发送接口    都为后端自动触发调用 前端不触发 暂时注释
-    public HttpResult<Object> getPaymentUrl(@RequestSingleParam(value = "companyId") String companyId) {
-        return this.huaTaiOrderApiService.getPaymentUrl(companyId);
-    }*/
+    /*    @PostMapping("/getPaymentUrl")
+        @ApiOperation(value = "支付码获取")//3.8.	电子投保单确认及缴费短信发送接口    都为后端自动触发调用 前端不触发 暂时注释
+        public HttpResult<Object> getPaymentUrl(@RequestSingleParam(value = "companyId") String companyId) {
+            return this.huaTaiOrderApiService.getPaymentUrl(companyId);
+        }*/
 
 }

+ 11 - 0
src/main/java/com/ydtech/modules/order/entity/InsOrders.java

@@ -48,6 +48,17 @@ public class InsOrders implements Serializable {
     @TableField(value = "quoteno")
     private String quoteno;
 
+    /**
+     * 承保 保险公司编号
+     */
+    @TableField(value = "company_id")
+    private String companyId;
+    /**
+     * 承保 保险名称
+     */
+    @TableField(value = "ins_company")
+    private String insCompany;
+
     /**
      * 报价状态
      */

+ 4 - 3
src/main/java/com/ydtech/modules/order/entity/api/huatai/constants/HuaTaiTransCode.java

@@ -21,16 +21,17 @@ public class HuaTaiTransCode {
     public static final String SAVE = "Save";
 
     //提交核保
-    public static final String SUBMIT = "Submit";
+    public static final String SUBMIT = "submit";
 
     //见费出单结果查询接口
     public static final String ORDER_CONFIRM = "OrderConfirm";
+    public static final String UPLOAD_IMAGE = "UploadImage";
 
     //非电子投保单缴费申请接口
-    public static final String ORDER_APPLY = "OrderApply";
+    public static final String VERIFICATIONCODESEND = "VERIFICATIONCODESEND";
 
     //电子保单下载
-    public static final String INSURANCE_POLICY_PRINT = "InsurancePolicyPrint";
+    public static final String ELEC_DOWN = "ElecDown";
 
 
 }

+ 64 - 0
src/main/java/com/ydtech/modules/order/entity/api/huatai/constants/ImageTypeCode.java

@@ -0,0 +1,64 @@
+package com.ydtech.modules.order.entity.api.huatai.constants;
+
+import com.ydtech.constants.InsuranceImageEnum;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+
+/**
+ * @description: 华泰财险图片类型
+ * @author: wenks
+ * @date: 2023/11/9 12:01
+ **/
+
+@Getter
+@AllArgsConstructor
+public enum ImageTypeCode {
+
+    I_5001("5001", "验车照片", new String[]{}),
+    I_5002("5002", "验车单", new String[]{}),
+    I_5999("5999", "其它", new String[]{}),
+    I_5003("5003", "自助验车照片", new String[]{}),
+    I_4001("4001", "投保单", new String[]{}),
+    I_4002("4002", "上年保险凭证", new String[]{}),
+    I_4003("4003", "完税/免税/减税凭证", new String[]{}),
+    I_4004("4004", "费率浮动告知书", new String[]{}),
+    I_4005("4005", "异地车在本地使用证明", new String[]{}),
+    I_4444("4444", "双录资料", new String[]{}),
+    I_4999("4999", "其它", new String[]{}),
+    I_2001("2001", "身份证", new String[]{}),
+    I_2007("2007", "投保人身份证", new String[]{
+            InsuranceImageEnum.C03.getCode(),
+            InsuranceImageEnum.D03.getCode(),
+    }),
+    I_2008("2008", "被保险人身份证", new String[]{
+            InsuranceImageEnum.C04.getCode(),
+            InsuranceImageEnum.D04.getCode(),
+    }),
+    I_2009("2009", "车主身份证", new String[]{
+            InsuranceImageEnum.C02.getCode(),
+            InsuranceImageEnum.D02.getCode(),
+    }),
+    I_1001("1001", "组织机构代码证", new String[]{}),
+    I_1999("1999", "其他", new String[]{}),
+    I_3001("3001", "行驶证", new String[]{
+            InsuranceImageEnum.C01.getCode(),
+            InsuranceImageEnum.D01.getCode(),
+    }),
+    I_3002("3002", "购车发票/二手车交易发票", new String[]{
+            InsuranceImageEnum.GC00.getCode(),
+    }),
+    I_3003("3003", "出厂合格证", new String[]{}),
+    I_3004("3004", "机动车辆登记证书", new String[]{}),
+    I_3005("3005", "道路运输许可证", new String[]{}),
+    I_3999("3999", "其它", new String[]{}),
+    I_3006("3006", "新能源充电桩", new String[]{});
+
+    private final String code;
+
+    private final String name;
+
+    private final String[] imagesType;
+
+
+}

+ 1 - 1
src/main/java/com/ydtech/modules/order/entity/api/huatai/request/HuaTaiInsurancePolicyPrintRequest.java

@@ -20,7 +20,7 @@ public class HuaTaiInsurancePolicyPrintRequest extends HuaTaiBaseRequest {
     @Override
     public void setHead(HuaTaiBaseRequestHead head) {
         super.setHead(head);
-        super.getHead().setTransCode(HuaTaiTransCode.INSURANCE_POLICY_PRINT);
+        super.getHead().setTransCode(HuaTaiTransCode.ELEC_DOWN);
     }
 
     //保单号

+ 1 - 1
src/main/java/com/ydtech/modules/order/entity/api/huatai/request/HuaTaiPaymentUrlRequest.java

@@ -25,7 +25,7 @@ public class HuaTaiPaymentUrlRequest extends HuaTaiBaseRequest {
     @Override
     public void setHead(HuaTaiBaseRequestHead head) {
         super.setHead(head);
-        super.getHead().setTransCode(HuaTaiTransCode.ORDER_APPLY);
+        super.getHead().setTransCode(HuaTaiTransCode.VERIFICATIONCODESEND);
     }
 
     //操作员代码

+ 204 - 0
src/main/java/com/ydtech/modules/order/entity/api/huatai/request/HuaTaiSaveFileIdxRequest.java

@@ -0,0 +1,204 @@
+package com.ydtech.modules.order.entity.api.huatai.request;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.ydtech.modules.order.components.huatai.HuiTaiUploadImageComponents;
+import com.ydtech.modules.order.entity.api.huatai.response.HuaTaiImageInitParamResponse;
+import lombok.Data;
+
+@Data
+public class HuaTaiSaveFileIdxRequest {
+
+    @JsonProperty("token")
+    private String token;
+
+    @JsonProperty("fileIdxVo")
+    private FileIdxVoDTO fileIdxVo;
+
+    public HuaTaiSaveFileIdxRequest(String token, HuaTaiImageInitParamResponse response, HuiTaiUploadImageComponents.FileuploadResult fileupload, String fileName,
+                                    HuaTaiImageInitParamResponse.TypeSelectVosDTO.ChildrenDTO childrenDTO) {
+        this.token = token;
+        this.fileIdxVo = new FileIdxVoDTO(response, fileupload, fileName, childrenDTO);
+    }
+
+    @Data
+    public static class FileIdxVoDTO {
+
+        @JsonProperty("rotate")
+        private Integer rotate;
+
+        @JsonProperty("rotateStart")
+        private Integer rotateStart;
+
+        @JsonProperty("optionFlag")
+        private Integer optionFlag;
+
+        @JsonProperty("imgId")
+        private Long imgId;
+
+        @JsonProperty("createTime")
+        private Long createTime;
+
+        @JsonProperty("createUser")
+        private String createUser;
+
+        @JsonProperty("createUserName")
+        private String createUserName;
+
+        @JsonProperty("appSource")
+        private String appSource;
+
+        @JsonProperty("docId")
+        private Integer docId;
+
+        @JsonProperty("bussNo")
+        private String bussNo;
+
+        @JsonProperty("bussType")
+        private String bussType;
+
+        @JsonProperty("bussTypeName")
+        private String bussTypeName;
+
+        @JsonProperty("riskCode")
+        private String riskCode;
+
+        @JsonProperty("riskCodeName")
+        private String riskCodeName;
+
+        @JsonProperty("comCode")
+        private String comCode;
+
+        @JsonProperty("comName")
+        private String comName;
+
+        @JsonProperty("bussDate")
+        private String bussDate;
+
+        @JsonProperty("validFlag")
+        private Integer validFlag;
+
+        @JsonProperty("uploadNode")
+        private String uploadNode;
+
+        @JsonProperty("appendPath")
+        private String appendPath;
+
+        @JsonProperty("editable")
+        private Boolean editable;
+
+        @JsonProperty("deletable")
+        private Boolean deletable;
+
+        @JsonProperty("voType")
+        private String voType;
+
+        @JsonProperty("archType")
+        private String archType;
+
+        @JsonProperty("picFileFlag")
+        private Integer picFileFlag;
+
+        @JsonProperty("fileSize")
+        private Double fileSize;
+
+        @JsonProperty("fileSizeFormat")
+        private String fileSizeFormat;
+
+        @JsonProperty("fileOrgName")
+        private String fileOrgName;
+
+        @JsonProperty("fileTitle")
+        private String fileTitle;
+
+        @JsonProperty("fileName")
+        private String fileName;
+
+        @JsonProperty("typePath")
+        private String typePath;
+
+        @JsonProperty("typePathName")
+        private String typePathName;
+
+        @JsonProperty("typeName")
+        private String typeName;
+
+        @JsonProperty("picMaxSize")
+        private Integer picMaxSize;
+
+        @JsonProperty("picQuality")
+        private Integer picQuality;
+
+        @JsonProperty("error")
+        private Integer error;
+
+        @JsonProperty("checked")
+        private Boolean checked;
+
+        @JsonProperty("uploadStatus")
+        private Integer uploadStatus;
+
+        @JsonProperty("showIdx")
+        private Integer showIdx;
+
+        @JsonProperty("uploadTime")
+        private Integer uploadTime;
+
+        @JsonProperty("storageType")
+        private String storageType;
+
+        public FileIdxVoDTO(HuaTaiImageInitParamResponse response, HuiTaiUploadImageComponents.FileuploadResult fileupload, String fileName,
+                            HuaTaiImageInitParamResponse.TypeSelectVosDTO.ChildrenDTO childrenDTO) {
+            this.rotate = 0;
+            this.rotateStart = 0;
+            this.optionFlag = 2;
+            this.createTime = System.currentTimeMillis();
+
+            // 初始化的时候获取参数
+            this.createUser = response.getOptUserId();
+            this.createUserName = response.getOptUserName();
+            this.appSource = response.getAppSource();
+            this.docId = response.getDocId();
+            this.bussNo = response.getBussNo();
+            this.bussType = response.getBussType();
+            this.bussTypeName = response.getBussTypeName();
+            this.riskCode = response.getRiskCode();
+            this.riskCodeName = response.getRiskCodeName();
+            this.comCode = response.getComCode();
+            this.comName = response.getComName();
+            this.bussDate = response.getBussDate();
+            this.validFlag = 1;
+            this.uploadNode = response.getUploadNode();
+            this.appendPath = fileupload.getFilePath().substring(0,fileupload.getFilePath().lastIndexOf("/")+1);
+            this.editable = true;
+            this.deletable = true;
+            this.voType = "C";
+            this.archType = response.getArchType();
+
+            this.picFileFlag = 1;
+            this.fileSize = fileupload.getFileSize();
+            this.fileSizeFormat = String.format("%.2f", fileupload.getFileSize()) + "KB";
+
+            String uuidLower = HuiTaiUploadImageComponents.getUUIDLower();
+            String substring = fileName.substring(fileName.lastIndexOf("."));
+
+            this.fileTitle = uuidLower;
+            this.fileOrgName = uuidLower + substring;
+
+            this.fileName = fileupload.getFilePath().substring(fileupload.getFilePath().lastIndexOf("/")+1);;
+
+            this.typePath = childrenDTO.getTypePath();
+            this.typePathName = childrenDTO.getTypePathName();
+            this.typeName = childrenDTO.getLabel();
+            this.picMaxSize = childrenDTO.getPicMaxSize();
+            this.picQuality = childrenDTO.getPicQuality();
+
+            this.error = 0;
+            this.uploadStatus = 3;
+            this.showIdx = 30;
+            this.uploadTime = 154;
+            this.storageType = response.getStorageType();
+        }
+
+    }
+
+}

+ 6 - 1
src/main/java/com/ydtech/modules/order/entity/api/huatai/request/HuaTaiSubmitRequest.java

@@ -141,6 +141,7 @@ public class HuaTaiSubmitRequest extends HuaTaiBaseRequest  {
                     this.platFormMessage = new PlatFormMessage(syQuerySequenceNo,huaTaiConfigureParameters);
                 }
                 contractDto.setContractMain(contractMain);
+                contractDto.setPlatFormMessage(platFormMessage);
                 contractDTOS.add(contractDto);
             }
             return contractDTOS;
@@ -395,7 +396,11 @@ public class HuaTaiSubmitRequest extends HuaTaiBaseRequest  {
                 this.email = customerInfoVo.getEmail();
             }
             if("2".equals(role)){
-                this.carInsuredRelation = "1";
+                if(customerInfoVo.isOwner()){
+                    this.carInsuredRelation = "1";
+                }else{
+                    this.carInsuredRelation = "2";
+                }
             }
             this.aiRelation = "01";
             this.workUnit = "其他";

+ 50 - 0
src/main/java/com/ydtech/modules/order/entity/api/huatai/request/HuaTaiUploadImageRequest.java

@@ -0,0 +1,50 @@
+package com.ydtech.modules.order.entity.api.huatai.request;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.ydtech.modules.order.entity.InsAreaCompany;
+import com.ydtech.modules.order.entity.api.huatai.HuaTaiBaseRequest;
+import com.ydtech.modules.order.entity.api.huatai.HuaTaiBaseRequestHead;
+import com.ydtech.modules.order.entity.api.huatai.constants.HuaTaiTransCode;
+import com.ydtech.modules.order.entity.config.HuaTaiConfigureParameters;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+@Data
+public class HuaTaiUploadImageRequest extends HuaTaiBaseRequest {
+
+    private static final long serialVersionUID = -4923735011853043030L;
+
+    @Override
+    public void setHead(HuaTaiBaseRequestHead head) {
+        super.setHead(head);
+        super.getHead().setTransCode(HuaTaiTransCode.UPLOAD_IMAGE);
+    }
+
+    //支付交易号
+    @JsonProperty("bizNo")
+    private String bizNo;
+
+    //操作员代码
+    @JsonProperty("loginComCode")
+    private String loginComCode;
+
+
+    public HuaTaiUploadImageRequest(InsAreaCompany insAreaCompany, HuaTaiConfigureParameters huaTaiConfigureParameters){
+        this.loginComCode = huaTaiConfigureParameters.getComCode();
+        if(StringUtils.isNotEmpty(insAreaCompany.getJqapplyno()) && StringUtils.isNotEmpty(insAreaCompany.getSyapplyno())){
+            this.bizNo = insAreaCompany.getJqapplyno();
+        }else if(StringUtils.isNotEmpty(insAreaCompany.getJqapplyno())){
+            this.bizNo = insAreaCompany.getJqapplyno();
+        }else if(StringUtils.isNotEmpty(insAreaCompany.getSyapplyno())){
+            this.bizNo = insAreaCompany.getSyapplyno();
+        }
+    }
+
+}

+ 366 - 0
src/main/java/com/ydtech/modules/order/entity/api/huatai/response/HuaTaiImageInitParamResponse.java

@@ -0,0 +1,366 @@
+package com.ydtech.modules.order.entity.api.huatai.response;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+@NoArgsConstructor
+@Data
+public class HuaTaiImageInitParamResponse {
+
+
+    @JsonProperty("accessKeyVo")
+    private AccessKeyVoDTO accessKeyVo;
+
+    @JsonProperty("appSource")
+    private String appSource;
+
+    @JsonProperty("archType")
+    private String archType;
+
+    @JsonProperty("arriveNotify")
+    private Integer arriveNotify;
+
+    @JsonProperty("bucket")
+    private String bucket;
+
+    @JsonProperty("bussDate")
+    private String bussDate;
+
+    @JsonProperty("bussNo")
+    private String bussNo;
+
+    @JsonProperty("bussType")
+    private String bussType;
+
+    @JsonProperty("bussTypeName")
+    private String bussTypeName;
+
+    @JsonProperty("comCode")
+    private String comCode;
+
+    @JsonProperty("comName")
+    private String comName;
+
+    @JsonProperty("docId")
+    private Integer docId;
+
+    @JsonProperty("documentFile")
+    private String documentFile;
+
+    @JsonProperty("dstKey")
+    private String dstKey;
+
+    @JsonProperty("extendInfo")
+    private Object extendInfo;
+
+    @JsonProperty("imgVersion")
+    private String imgVersion;
+
+    @JsonProperty("initTime")
+    private Long initTime;
+
+    @JsonProperty("maxFileSize")
+    private Integer maxFileSize;
+
+    @JsonProperty("maxShowIdx")
+    private Double maxShowIdx;
+
+    @JsonProperty("maxUnUploadNum")
+    private Integer maxUnUploadNum;
+
+    @JsonProperty("mediaFile")
+    private String mediaFile;
+
+    @JsonProperty("netType")
+    private String netType;
+
+    @JsonProperty("optUserId")
+    private String optUserId;
+
+    @JsonProperty("optUserName")
+    private String optUserName;
+
+    @JsonProperty("pictureFile")
+    private String pictureFile;
+
+    @JsonProperty("riskCode")
+    private String riskCode;
+
+    @JsonProperty("riskCodeName")
+    private String riskCodeName;
+
+    @JsonProperty("showDelete")
+    private Integer showDelete;
+
+    @JsonProperty("showImgType")
+    private Object showImgType;
+
+    @JsonProperty("storageType")
+    private String storageType;
+
+    @JsonProperty("supportFileTypes")
+    private String supportFileTypes;
+
+    @JsonProperty("token")
+    private String token;
+
+    @JsonProperty("typeSelectVos")
+    private List<TypeSelectVosDTO> typeSelectVos;
+
+    @JsonProperty("typeTreeNodeVo")
+    private TypeTreeNodeVoDTO typeTreeNodeVo;
+
+    @JsonProperty("typeTreeNodeVos")
+    private Object typeTreeNodeVos;
+
+    @JsonProperty("uploadNode")
+    private String uploadNode;
+
+    @JsonProperty("uploadedFileList")
+    private List<String> uploadedFileList;
+
+    @JsonProperty("viewShowType")
+    private String viewShowType;
+
+    @JsonProperty("viewType")
+    private String viewType;
+
+    public List<TypeSelectVosDTO.ChildrenDTO> getChildrenDTO() {
+        return this.getTypeSelectVos().stream().map(TypeSelectVosDTO::getChildren).flatMap(List::stream).collect(Collectors.toList());
+    }
+
+    public static TypeSelectVosDTO.ChildrenDTO filteringTypeCode(List<TypeSelectVosDTO.ChildrenDTO> list, String typeCode){
+        return list.stream().filter(x -> x.getTypeCode().equals(typeCode)).collect(Collectors.toList()).get(0);
+    }
+
+    @NoArgsConstructor
+    @Data
+    public static class AccessKeyVoDTO {
+        @JsonProperty("accessKeyId")
+        private String accessKeyId;
+        @JsonProperty("accessKeySecret")
+        private String accessKeySecret;
+        @JsonProperty("endpoint")
+        private Object endpoint;
+        @JsonProperty("ossRegion")
+        private String ossRegion;
+        @JsonProperty("token")
+        private String token;
+    }
+
+    @NoArgsConstructor
+    @Data
+    public static class TypeTreeNodeVoDTO {
+        @JsonProperty("acceptDragDrop")
+        private Integer acceptDragDrop;
+        @JsonProperty("archType")
+        private String archType;
+        @JsonProperty("bussNo")
+        private String bussNo;
+        @JsonProperty("bussType")
+        private String bussType;
+        @JsonProperty("bussTypeName")
+        private String bussTypeName;
+        @JsonProperty("children")
+        private List<ChildrenDTO> children;
+        @JsonProperty("count")
+        private Integer count;
+        @JsonProperty("docId")
+        private Integer docId;
+        @JsonProperty("docMaxSize")
+        private Integer docMaxSize;
+        @JsonProperty("label")
+        private String label;
+        @JsonProperty("limitSumCount")
+        private Integer limitSumCount;
+        @JsonProperty("lockFlag")
+        private Integer lockFlag;
+        @JsonProperty("medMaxSize")
+        private Integer medMaxSize;
+        @JsonProperty("nodeType")
+        private String nodeType;
+        @JsonProperty("parentTypeCode")
+        private Object parentTypeCode;
+        @JsonProperty("picMaxSize")
+        private Integer picMaxSize;
+        @JsonProperty("picQuality")
+        private Integer picQuality;
+        @JsonProperty("readable")
+        private Integer readable;
+        @JsonProperty("riskCode")
+        private String riskCode;
+        @JsonProperty("riskCodeName")
+        private String riskCodeName;
+        @JsonProperty("typeCode")
+        private String typeCode;
+        @JsonProperty("typePath")
+        private Object typePath;
+        @JsonProperty("typePathName")
+        private Object typePathName;
+        @JsonProperty("writable")
+        private Integer writable;
+
+        @NoArgsConstructor
+        @Data
+        public static class ChildrenDTO {
+            @JsonProperty("acceptDragDrop")
+            private Integer acceptDragDrop;
+            @JsonProperty("archType")
+            private Object archType;
+            @JsonProperty("bussNo")
+            private Object bussNo;
+            @JsonProperty("bussType")
+            private Object bussType;
+            @JsonProperty("bussTypeName")
+            private Object bussTypeName;
+            @JsonProperty("children")
+            private Object children;
+            @JsonProperty("count")
+            private Integer count;
+            @JsonProperty("docId")
+            private Object docId;
+            @JsonProperty("docMaxSize")
+            private Integer docMaxSize;
+            @JsonProperty("label")
+            private String label;
+            @JsonProperty("limitSumCount")
+            private Integer limitSumCount;
+            @JsonProperty("lockFlag")
+            private Integer lockFlag;
+            @JsonProperty("medMaxSize")
+            private Integer medMaxSize;
+            @JsonProperty("nodeType")
+            private String nodeType;
+            @JsonProperty("parentTypeCode")
+            private String parentTypeCode;
+            @JsonProperty("picMaxSize")
+            private Integer picMaxSize;
+            @JsonProperty("picQuality")
+            private Integer picQuality;
+            @JsonProperty("readable")
+            private Integer readable;
+            @JsonProperty("riskCode")
+            private Object riskCode;
+            @JsonProperty("riskCodeName")
+            private Object riskCodeName;
+            @JsonProperty("typeCode")
+            private String typeCode;
+            @JsonProperty("typePath")
+            private Object typePath;
+            @JsonProperty("typePathName")
+            private Object typePathName;
+            @JsonProperty("writable")
+            private Integer writable;
+        }
+    }
+
+    @NoArgsConstructor
+    @Data
+    public static class TypeSelectVosDTO {
+        @JsonProperty("acceptDragDrop")
+        private Integer acceptDragDrop;
+        @JsonProperty("archType")
+        private String archType;
+        @JsonProperty("bussNo")
+        private String bussNo;
+        @JsonProperty("bussType")
+        private String bussType;
+        @JsonProperty("bussTypeName")
+        private String bussTypeName;
+        @JsonProperty("children")
+        private List<ChildrenDTO> children;
+        @JsonProperty("count")
+        private Integer count;
+        @JsonProperty("docId")
+        private Integer docId;
+        @JsonProperty("docMaxSize")
+        private Integer docMaxSize;
+        @JsonProperty("label")
+        private String label;
+        @JsonProperty("limitSumCount")
+        private Integer limitSumCount;
+        @JsonProperty("lockFlag")
+        private Integer lockFlag;
+        @JsonProperty("medMaxSize")
+        private Integer medMaxSize;
+        @JsonProperty("nodeType")
+        private String nodeType;
+        @JsonProperty("parentTypeCode")
+        private String parentTypeCode;
+        @JsonProperty("picMaxSize")
+        private Integer picMaxSize;
+        @JsonProperty("picQuality")
+        private Integer picQuality;
+        @JsonProperty("readable")
+        private Integer readable;
+        @JsonProperty("riskCode")
+        private String riskCode;
+        @JsonProperty("riskCodeName")
+        private String riskCodeName;
+        @JsonProperty("typeCode")
+        private String typeCode;
+        @JsonProperty("typePath")
+        private String typePath;
+        @JsonProperty("typePathName")
+        private String typePathName;
+        @JsonProperty("writable")
+        private Integer writable;
+
+        @NoArgsConstructor
+        @Data
+        public static class ChildrenDTO {
+            @JsonProperty("acceptDragDrop")
+            private Integer acceptDragDrop;
+            @JsonProperty("archType")
+            private String archType;
+            @JsonProperty("bussNo")
+            private String bussNo;
+            @JsonProperty("bussType")
+            private String bussType;
+            @JsonProperty("bussTypeName")
+            private String bussTypeName;
+            @JsonProperty("children")
+            private Object children;
+            @JsonProperty("count")
+            private Integer count;
+            @JsonProperty("docId")
+            private Integer docId;
+            @JsonProperty("docMaxSize")
+            private Integer docMaxSize;
+            @JsonProperty("label")
+            private String label;
+            @JsonProperty("limitSumCount")
+            private Integer limitSumCount;
+            @JsonProperty("lockFlag")
+            private Integer lockFlag;
+            @JsonProperty("medMaxSize")
+            private Integer medMaxSize;
+            @JsonProperty("nodeType")
+            private String nodeType;
+            @JsonProperty("parentTypeCode")
+            private String parentTypeCode;
+            @JsonProperty("picMaxSize")
+            private Integer picMaxSize;
+            @JsonProperty("picQuality")
+            private Integer picQuality;
+            @JsonProperty("readable")
+            private Integer readable;
+            @JsonProperty("riskCode")
+            private String riskCode;
+            @JsonProperty("riskCodeName")
+            private String riskCodeName;
+            @JsonProperty("typeCode")
+            private String typeCode;
+            @JsonProperty("typePath")
+            private String typePath;
+            @JsonProperty("typePathName")
+            private String typePathName;
+            @JsonProperty("writable")
+            private Integer writable;
+        }
+    }
+}

+ 22 - 1
src/main/java/com/ydtech/modules/order/entity/api/huatai/response/HuaTaiInsurancePolicyPrintResponse.java

@@ -2,10 +2,12 @@ package com.ydtech.modules.order.entity.api.huatai.response;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.ydtech.modules.order.entity.api.huatai.HuaTaiBaseResponse;
+import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NoArgsConstructor;
 
+import java.io.Serializable;
 import java.util.List;
 
 @EqualsAndHashCode(callSuper = true)
@@ -21,6 +23,25 @@ public class HuaTaiInsurancePolicyPrintResponse extends HuaTaiBaseResponse {
 
     //下载地址(列表)
     @JsonProperty("registResult")
-     private List<String> elecDownLoadResultList;
+     private List<ElecDownLoadResultDto> elecDownLoadResultList;
 
+    @AllArgsConstructor
+    @NoArgsConstructor
+    @Data
+    public static class ElecDownLoadResultDto implements Serializable {
+
+
+        private static final long serialVersionUID = -8643088689280577161L;
+        //
+        @JsonProperty("bzDownFlag")
+        private String bzDownFlag;
+
+        // 电子保单下载链接
+        @JsonProperty("downURL")
+        private String downURL;
+
+        //
+        @JsonProperty("previewTotalPage")
+        private String previewTotalPage;
+    }
 }

+ 2 - 2
src/main/java/com/ydtech/modules/order/entity/api/huatai/response/HuaTaiOrderStatusResponse.java

@@ -19,7 +19,7 @@ public class HuaTaiOrderStatusResponse extends HuaTaiBaseResponse {
 
     //支付明细
     @JsonProperty("payDetaiList")
-    private List<PayDetaiList> payDetaiList;
+    private List<PayDetaiDto> payDetaiList;
 
     //支付交易号
     @JsonProperty("poaCode")
@@ -32,7 +32,7 @@ public class HuaTaiOrderStatusResponse extends HuaTaiBaseResponse {
     @AllArgsConstructor
     @NoArgsConstructor
     @Data
-    public static class PayDetaiList implements Serializable {
+    public static class PayDetaiDto implements Serializable {
 
         private static final long serialVersionUID = -8143740622862273324L;
 

+ 24 - 0
src/main/java/com/ydtech/modules/order/entity/api/huatai/response/HuaTaiSubmitResponse.java

@@ -52,5 +52,29 @@ public class HuaTaiSubmitResponse extends HuaTaiBaseResponse {
         // 业务类型
         @JsonProperty("uWType")
         private String uWType;
+        //
+        @JsonProperty("cellPhone")
+        private String cellPhone;
+        //
+        @JsonProperty("relationNo")
+        private String relationNo;
+        //
+        @JsonProperty("serialNumber")
+        private String serialNumber;
+        //
+        @JsonProperty("underWirteMessage")
+        private String underWirteMessage;
+        //
+        @JsonProperty("underWriteMessagePpcf")
+        private String underWriteMessagePpcf;
+        //
+        @JsonProperty("underWriteMessageToperson")
+        private String underWriteMessageToperson;
+        //
+        @JsonProperty("underWriteMessageToreview")
+        private String underWriteMessageToreview;
+        //
+        @JsonProperty("underWriteNewDataValidMSG")
+        private String underWriteNewDataValidMSG;
     }
 }

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

@@ -0,0 +1,20 @@
+package com.ydtech.modules.order.entity.api.huatai.response;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.ydtech.modules.order.entity.api.huatai.HuaTaiBaseResponse;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+@Data
+public class HuaTaiUploadImageResponse extends HuaTaiBaseResponse {
+
+
+    private static final long serialVersionUID = 5666208696137342547L;
+    //上传影像的地址
+    @JsonProperty("url")
+    private String url;
+
+}

+ 17 - 4
src/main/java/com/ydtech/modules/order/entity/api/zijin/constants/enums/FileTypeEnum.java

@@ -1,5 +1,6 @@
 package com.ydtech.modules.order.entity.api.zijin.constants.enums;
 
+import com.ydtech.constants.InsuranceImageEnum;
 import lombok.AllArgsConstructor;
 import lombok.Getter;
 
@@ -15,7 +16,9 @@ public enum FileTypeEnum {
     FT_1("1", "验车照片", new String[]{"C05"}),
     FT_2("2", "其他车辆证件", new String[]{}),
     FT_3("3", "其他客户证件", new String[]{}),
-    FT_4("4", "车辆购置证明", new String[]{}),
+    FT_4("4", "车辆购置证明", new String[]{
+            InsuranceImageEnum.GC00.getCode()
+    }),
     FT_5("5", "过户证明", new String[]{}),
     FT_6("6", "退保证明", new String[]{}),
     FT_7("7", "单证", new String[]{}),
@@ -24,10 +27,20 @@ public enum FileTypeEnum {
     FT_19("19", "实名缴费证明", new String[]{}),
     FT_51("51", "银行卡", new String[]{}),
     FT_52("52", "驾驶证", new String[]{}),
-    FT_53("53", "身份证", new String[]{"C02", "D02", "C03", "D03", "C04", "D04"}),
+    FT_53("53", "身份证", new String[]{
+            InsuranceImageEnum.C02.getCode(),
+            InsuranceImageEnum.D02.getCode(),
+            InsuranceImageEnum.C03.getCode(),
+            InsuranceImageEnum.D03.getCode(),
+            InsuranceImageEnum.C04.getCode(),
+            InsuranceImageEnum.D04.getCode(),
+    }),
     FT_54("54", "增值税发票", new String[]{}),
-    FT_55("55", "车辆合格证", new String[]{}),
-    FT_56("56", "行驶证", new String[]{"C01", "D01"}),
+    FT_55("55", "车辆合格证", new String[]{InsuranceImageEnum.XC00.getCode()}),
+    FT_56("56", "行驶证", new String[]{
+            InsuranceImageEnum.C01.getCode(),
+            InsuranceImageEnum.D01.getCode(),
+    }),
     FT_41("41", "充电桩影像资料", new String[]{}),
     FT_42("42", "是否为新能源证明材料", new String[]{});
 

+ 2 - 1
src/main/java/com/ydtech/modules/order/service/HuaTaiOrderApiService.java

@@ -4,6 +4,7 @@ import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.ins.model.ya.CarModelDTO;
 import com.ydtech.modules.order.entity.api.zhongmei.request.ApprovedRequest;
 import com.ydtech.modules.order.entity.api.zhongmei.request.CoverageRequest;
+import com.ydtech.modules.order.entity.crawler.vo.CrawlerPolicyPrintVo;
 import com.ydtech.modules.order.entity.vo.AccidentalDrivingQueryVo;
 import com.ydtech.modules.order.entity.vo.AccidentalDrivingVo;
 import com.ydtech.modules.order.entity.vo.PolicyPrintVo;
@@ -25,7 +26,7 @@ public interface HuaTaiOrderApiService extends BaseOrderService<AccidentalDrivin
      *
      * @return 响应
      */
-    HttpResult<List<String>> getPolicyPrint(PolicyPrintVo policyPrintVo);
+    HttpResult<CrawlerPolicyPrintVo> getPolicyPrint(PolicyPrintVo policyPrintVo);
 
     /**
      * 缴费查询

+ 7 - 0
src/main/java/com/ydtech/modules/order/service/InsTaskImagesService.java

@@ -3,6 +3,7 @@ package com.ydtech.modules.order.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.order.entity.dto.InsTaskImagesDto;
+import com.ydtech.modules.order.entity.dto.InsUploadImagesDto;
 import com.ydtech.modules.order.entity.po.InsTaskImages;
 import com.ydtech.modules.order.entity.po.InsTaskImagesBase64;
 import com.ydtech.modules.order.entity.vo.InsTaskImagesVo;
@@ -43,4 +44,10 @@ public interface InsTaskImagesService extends IService<InsTaskImages> {
      */
     List<InsTaskImagesBase64> findByOrderNo(String orderNo);
 
+    /**
+     * 获取文件路径信息
+     * @param orderNo
+     * @return
+     */
+    List<InsUploadImagesDto> findImageByOrderNo(String orderNo);
 }

+ 8 - 6
src/main/java/com/ydtech/modules/order/service/impl/GuorenOrderApiServiceImpl.java

@@ -20,6 +20,7 @@ import com.ydtech.modules.ins.model.vo.*;
 import com.ydtech.modules.ins.model.ya.YaQuoteInfoVo;
 import com.ydtech.modules.order.components.ConfigureParametersComponents;
 import com.ydtech.modules.order.components.InsOrdersComponents;
+import com.ydtech.modules.order.components.gouren.GuorenDuplicateInsuranceComponent;
 import com.ydtech.modules.order.components.gouren.GuorenRequestApiComponent;
 import com.ydtech.modules.order.dao.InsTaskImagesMapper;
 import com.ydtech.modules.order.entity.InsAreaCompany;
@@ -54,6 +55,7 @@ import org.apache.commons.httpclient.methods.multipart.StringPart;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -98,8 +100,9 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
 
     private final GuorenRequestApiComponent guorenRequestApiComponent;
 
+    private final GuorenDuplicateInsuranceComponent guorenDuplicateInsuranceComponent;
 
-    public GuorenOrderApiServiceImpl(GuorenApiConfigurationProperties properties, InsOrdersComponents insOrdersComponents, GuorenRequestApiComponent guorenRequestApiComponent, InsAreaCompanyService insAreaCompanyService, InsOrdersService insOrdersService, EsmInsCompanyService esmInsCompanyService, ConfigureParametersComponents configureParametersComponents, InsTaskImagesMapper insTaskImagesMapper) {
+    public GuorenOrderApiServiceImpl(GuorenApiConfigurationProperties properties, InsOrdersComponents insOrdersComponents, GuorenRequestApiComponent guorenRequestApiComponent, InsAreaCompanyService insAreaCompanyService, InsOrdersService insOrdersService, EsmInsCompanyService esmInsCompanyService, ConfigureParametersComponents configureParametersComponents, InsTaskImagesMapper insTaskImagesMapper, GuorenDuplicateInsuranceComponent guorenDuplicateInsuranceComponent) {
         this.properties = properties;
         this.insOrdersComponents = insOrdersComponents;
         this.guorenRequestApiComponent = guorenRequestApiComponent;
@@ -108,6 +111,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
         this.esmInsCompanyService = esmInsCompanyService;
         this.configureParametersComponents = configureParametersComponents;
         this.insTaskImagesMapper = insTaskImagesMapper;
+        this.guorenDuplicateInsuranceComponent = guorenDuplicateInsuranceComponent;
     }
 
     /**
@@ -272,8 +276,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
         } else {
             return HttpResult.error("核保操作失败,状态:" + InsOrderStatusEnum.matchKey(iac.getOrderstatus()).getDesc());
         }
-        insAreaCompanyService.updateById(iac);
-        insOrdersService.updateByOrderStatus(order.getOrderno(), order.getOrderstatus());
+        insAreaCompanyService.updateCompanyAndOrders(iac);
         log.debug("----------核保结束,订单号:{}---------", quoteOrderNo);
         return HttpResult.ok();
     }
@@ -497,8 +500,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
                     order.setOrderstatus(iac.getOrderstatus());
                 }
 
-                insAreaCompanyService.updateById(iac);
-                insOrdersService.updateByOrderStatus(order.getOrderno(), order.getOrderstatus());
+                insAreaCompanyService.updateCompanyAndOrders(iac);
                 return HttpResult.ok("承保");
 
             }
@@ -844,7 +846,7 @@ public class GuorenOrderApiServiceImpl implements GuorenOrderApiService {
             req.getCi().getPrpTmain().setAnswer(null);
             req.getBi().getPrpTmain().setAnswer(null);
             //1、 交强险重复投保 替换时间
-            boo = buildCiRepeatParam(resp, requestInfoList, req);
+            boo = guorenDuplicateInsuranceComponent.processor(resp, requestInfoList, req);
             if (boo) {
                 flag.append("重复投保处理 |");
                 continue;

+ 269 - 153
src/main/java/com/ydtech/modules/order/service/impl/HuaTaiOrderApiServiceImpl.java

@@ -2,36 +2,31 @@ package com.ydtech.modules.order.service.impl;
 
 import cn.hutool.core.util.ArrayUtil;
 import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
 import com.ydtech.constants.enums.InsuranceRisk;
 import com.ydtech.constants.enums.dict.InsOrderStatusEnum;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.exception.SystemException;
 import com.ydtech.modules.fee.service.FeeRuleSchemeService;
-import com.ydtech.modules.ins.model.request.Response;
 import com.ydtech.modules.ins.model.vo.*;
 import com.ydtech.modules.ins.model.ya.YaQuoteInfoVo;
-import com.ydtech.modules.ins.model.zm.ZmCarModel;
 import com.ydtech.modules.order.components.ConfigureParametersComponents;
 import com.ydtech.modules.order.components.huatai.HuaTaiRequestApiComponents;
+import com.ydtech.modules.order.components.huatai.HuiTaiUploadImageComponents;
 import com.ydtech.modules.order.constants.InsuranceTypeCorrespondence;
 import com.ydtech.modules.order.entity.InsAreaCompany;
 import com.ydtech.modules.order.entity.InsOrders;
 import com.ydtech.modules.order.entity.TaxArrears;
 import com.ydtech.modules.order.entity.api.huatai.HuaTaiBaseRequestHead;
-import com.ydtech.modules.order.entity.api.huatai.request.HuaTaiQuotedPriceRequest;
-import com.ydtech.modules.order.entity.api.huatai.response.HuaTaiQuotedPriceResponse;
 import com.ydtech.modules.order.entity.api.huatai.request.*;
 import com.ydtech.modules.order.entity.api.huatai.response.*;
-import com.ydtech.modules.order.entity.api.zhongmei.constants.TimeConstants;
-import com.ydtech.modules.order.entity.api.zhongmei.constants.enums.SubmitStatus;
-import com.ydtech.modules.order.entity.api.zhongmei.request.ModelsQueryRequest;
-import com.ydtech.modules.order.entity.api.zhongmei.response.ModelsQueryResponse;
 import com.ydtech.modules.order.entity.config.HuaTaiConfigureParameters;
-import com.ydtech.modules.order.entity.config.ZmConfigureParameters;
+import com.ydtech.modules.order.entity.crawler.vo.CrawlerPolicyPrintVo;
+import com.ydtech.modules.order.entity.dto.InsUploadImagesDto;
 import com.ydtech.modules.order.entity.filter.CarModelsFilterUtils;
-import com.ydtech.modules.order.entity.vo.*;
+import com.ydtech.modules.order.entity.vo.AccidentalDrivingVo;
+import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
+import com.ydtech.modules.order.entity.vo.BaseQuoteVo;
+import com.ydtech.modules.order.entity.vo.PolicyPrintVo;
 import com.ydtech.modules.order.service.*;
 import com.ydtech.modules.protocol.entity.po.PtlAgreementAttribution;
 import com.ydtech.modules.protocol.service.PtlAgreementAttributionService;
@@ -42,13 +37,11 @@ import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.ObjectUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Value;
-import org.springframework.core.ParameterizedTypeReference;
 import org.springframework.stereotype.Service;
 
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
 import java.util.stream.Collectors;
 
 @Service
@@ -71,6 +64,8 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
 
     private final InsFeeOrderService insFeeOrderService;
 
+    private final HuiTaiUploadImageComponents huiTaiUploadImageComponents;
+
 
     @Value("${upload.file.path}")
     private String uploadFilePath;
@@ -81,10 +76,15 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
     @Value("${api.url}")
     private String apiUrl;
 
-    public HuaTaiOrderApiServiceImpl(InsOrdersService insOrdersService, InsAreaCompanyService insAreaCompanyService, InsTaskImagesService insTaskImagesService,
+    public HuaTaiOrderApiServiceImpl(InsOrdersService insOrdersService,
+                                     InsAreaCompanyService insAreaCompanyService,
+                                     InsTaskImagesService insTaskImagesService,
                                      HuaTaiRequestApiComponents huaTaiRequestApiComponents,
-                                     ConfigureParametersComponents configureParametersComponents, PtlAgreementAttributionService ptlAgreementAttributionService,
-                                     FeeRuleSchemeService feeRuleSchemeService, InsFeeOrderService insFeeOrderService) {
+                                     ConfigureParametersComponents configureParametersComponents,
+                                     PtlAgreementAttributionService ptlAgreementAttributionService,
+                                     FeeRuleSchemeService feeRuleSchemeService,
+                                     InsFeeOrderService insFeeOrderService,
+                                     HuiTaiUploadImageComponents huiTaiUploadImageComponents) {
         this.insOrdersService = insOrdersService;
         this.insAreaCompanyService = insAreaCompanyService;
         this.insTaskImagesService = insTaskImagesService;
@@ -93,6 +93,7 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
         this.ptlAgreementAttributionService = ptlAgreementAttributionService;
         this.feeRuleSchemeService = feeRuleSchemeService;
         this.insFeeOrderService = insFeeOrderService;
+        this.huiTaiUploadImageComponents = huiTaiUploadImageComponents;
     }
 
     @Override
@@ -115,7 +116,7 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
         List<HuaTaiModelsQueryResponse.CarModelDto> carModelDtos = huaTaiRequestApiComponents.modelQuery(huaTaiModelsQueryRequest, HuaTaiModelsQueryResponse.class);
 
         List<HuaTaiModelsQueryResponse.CarModelDto.FullCarDataDto> fullCarDataDtos = new ArrayList<>();
-        for(HuaTaiModelsQueryResponse.CarModelDto carModelDto : carModelDtos){
+        for (HuaTaiModelsQueryResponse.CarModelDto carModelDto : carModelDtos) {
             fullCarDataDtos.add(carModelDto.getFullCarData());
         }
         // 2.2 过滤车型
@@ -125,17 +126,17 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
 
         HuaTaiActualValueResponse actualValueResponse = null;
         for (RiskInfoVo riskInfoVo : quoteInfo.getRiskList()) {
-            if("0510".equals(riskInfoVo.getRiskCode())){
+            if ("0510".equals(riskInfoVo.getRiskCode())) {
                 String startDate = riskInfoVo.getStartDate();
-                HuaTaiActualValueRequest huaTaiActualValueRequest = new HuaTaiActualValueRequest(carInfo,fullCarDataDto,startDate);
+                HuaTaiActualValueRequest huaTaiActualValueRequest = new HuaTaiActualValueRequest(carInfo, fullCarDataDto, startDate);
                 huaTaiActualValueRequest.setHead(baseRequestHead);
-                actualValueResponse = huaTaiRequestApiComponents.actualValue(huaTaiActualValueRequest,HuaTaiActualValueResponse.class);
+                actualValueResponse = huaTaiRequestApiComponents.actualValue(huaTaiActualValueRequest, HuaTaiActualValueResponse.class);
             }
         }
 
 
         // 3 组装报价参数
-        HuaTaiQuotedPriceRequest quotedPriceRequest = new HuaTaiQuotedPriceRequest(quoteInfo, fullCarDataDto,actualValueResponse, zmQuoteVo.getAccidentalDrivingVo(), huaTaiConfigureParameters);
+        HuaTaiQuotedPriceRequest quotedPriceRequest = new HuaTaiQuotedPriceRequest(quoteInfo, fullCarDataDto, actualValueResponse, zmQuoteVo.getAccidentalDrivingVo(), huaTaiConfigureParameters);
         quotedPriceRequest.setHead(baseRequestHead);
 
         HuaTaiQuotedPriceResponse quotedPriceResponse = huaTaiRequestApiComponents.quotedPrice(quotedPriceRequest, HuaTaiQuotedPriceResponse.class);
@@ -147,6 +148,7 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
 
     /**
      * 转投保接口
+     *
      * @param companyId 子订单号
      * @return
      */
@@ -159,7 +161,7 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
         YaQuoteInfoVo yaQuoteInfoVo = new YaQuoteInfoVo(insOrders);
 
         // 2. 调用转投保接口
-        HuaTaiSubmitResponse response = submitForUnderwriting(yaQuoteInfoVo,insAreaCompany, huaTaiConfigureParameters);
+        HuaTaiSubmitResponse response = submitForUnderwriting(yaQuoteInfoVo, insAreaCompany, huaTaiConfigureParameters);
 
         /**
          * 0	下发修改
@@ -176,78 +178,78 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
         String syStatus = "";
         StringBuffer jqNotion = new StringBuffer();
         StringBuffer syNotion = new StringBuffer();
-        for(HuaTaiSubmitResponse.AppliResult appliResult:response.getAppliResult()){
+        for (HuaTaiSubmitResponse.AppliResult appliResult : response.getAppliResult()) {
             appliResult.getStatus();
-            if(StringUtils.isNotEmpty(insAreaCompany.getJqapplyno())){
+            if (StringUtils.isNotEmpty(insAreaCompany.getJqapplyno())) {
                 haveJQFlag = true;
-                if(insAreaCompany.getJqapplyno().equals(appliResult.getContractNo())){
+                if (insAreaCompany.getJqapplyno().equals(appliResult.getContractNo())) {
                     jqStatus = appliResult.getStatus();
-                    for(HuaTaiSubmitResponse.Notion notion:appliResult.getNotion()){
-                        jqNotion.append(notion.getUWResult()+",");
+                    for (HuaTaiSubmitResponse.Notion notion : appliResult.getNotion()) {
+                        jqNotion.append(notion.getUWNotion() + ",");
                     }
                 }
             }
-            if(StringUtils.isNotEmpty(insAreaCompany.getSyapplyno()) && insAreaCompany.getSyapplyno().equals(appliResult.getContractNo())){
+            if (StringUtils.isNotEmpty(insAreaCompany.getSyapplyno()) && insAreaCompany.getSyapplyno().equals(appliResult.getContractNo())) {
                 haveSYFlag = true;
-                if(insAreaCompany.getJqapplyno().equals(appliResult.getContractNo())){
+                if (insAreaCompany.getJqapplyno().equals(appliResult.getContractNo())) {
                     syStatus = appliResult.getStatus();
-                    for(HuaTaiSubmitResponse.Notion notion:appliResult.getNotion()){
-                        syNotion.append(notion.getUWResult()+",");
+                    for (HuaTaiSubmitResponse.Notion notion : appliResult.getNotion()) {
+                        syNotion.append(notion.getUWNotion() + ",");
                     }
                 }
             }
         }
         String totalStatus = "";
         //同保交商
-        if(haveJQFlag && haveSYFlag){
+        if (haveJQFlag && haveSYFlag) {
             //自核通过 和 强制自核
-            if("4,7".contains(jqStatus) && "4,7".contains(syStatus)){
+            if ("4,7".contains(jqStatus) && "4,7".contains(syStatus)) {
                 totalStatus = "4";
             }
             //转人工和转复核
-            if("1,3".contains(jqStatus) || "1,3".contains(syStatus)){
+            if ("1,3".contains(jqStatus) || "1,3".contains(syStatus)) {
                 totalStatus = "1";
             }
-            if("0,6,7".contains(jqStatus) || "0,6,7".contains(syStatus)){
+            if ("0,6,7".contains(jqStatus) || "0,6,7".contains(syStatus)) {
                 totalStatus = "0";
             }
-        }else if((haveJQFlag && !haveSYFlag)||(!haveJQFlag && haveSYFlag)){//单保交强或单保商业
+        } else if ((haveJQFlag && !haveSYFlag) || (!haveJQFlag && haveSYFlag)) {//单保交强或单保商业
             String status = jqStatus;
-            if(StringUtils.isNotEmpty(syStatus)){
+            if (StringUtils.isNotEmpty(syStatus)) {
                 status = syStatus;
             }
-            if("4,7".contains(status)){
+            if ("4,7".contains(status)) {
                 totalStatus = "4";
-            }else if("1,3".contains(status)){
+            } else if ("1,3".contains(status)) {
                 totalStatus = "1";
-            }else if("0,6,7".contains(status)){
+            } else if ("0,6,7".contains(status)) {
                 totalStatus = "0";
             }
         }
 
 
-        if("4".equals(totalStatus)){
+        if ("4".equals(totalStatus)) {
             //再调用缴费接口获取缴费链接
-            HuaTaiPaymentUrlRequest huaTaiPaymentUrlRequest = new HuaTaiPaymentUrlRequest(insAreaCompany,huaTaiConfigureParameters);
-            huaTaiPaymentUrlRequest.setHead(new HuaTaiBaseRequestHead(huaTaiConfigureParameters));
-            HuaTaiPaymentUrlResponse paymentUrlResponse = huaTaiRequestApiComponents.getPaymentUrl(huaTaiPaymentUrlRequest, HuaTaiPaymentUrlResponse.class);
-            if(StringUtils.isNotEmpty(paymentUrlResponse.getPayUrl())){
-                insAreaCompany.setPaymentLink(paymentUrlResponse.getPayUrl());
+            String payUrl = getPaymentUrl(insAreaCompany, huaTaiConfigureParameters);
+            if (StringUtils.isNotEmpty(payUrl)) {
+                insAreaCompany.setPaymentLink(payUrl);
+                insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
+                insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
+                return HttpResult.ok("核保成功");
+            } else {
+                insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_AUDIT.getCode());
+                insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
+                return HttpResult.error("获取支付链接失败");
             }
-            insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
-            insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
-            return HttpResult.ok("核保成功");
-        }else if("1".equals(totalStatus)){
+        } else if ("1".equals(totalStatus)) {
             //再次调用提交核保接口
-            HuaTaiSubmitStatusQueryRequest huaTaiSubmitStatusQueryRequest = new HuaTaiSubmitStatusQueryRequest(insAreaCompany,huaTaiConfigureParameters,"1");
-            huaTaiSubmitStatusQueryRequest.setHead(new HuaTaiBaseRequestHead(huaTaiConfigureParameters));
-            HuaTaiSubmitStatusQueryResponse submitStatusQueryResponse = huaTaiRequestApiComponents.submitStatus(huaTaiSubmitStatusQueryRequest, HuaTaiSubmitStatusQueryResponse.class);
+            HuaTaiSubmitStatusQueryResponse submitStatusQueryResponse = submitStatus(insAreaCompany, huaTaiConfigureParameters, "1");
             //根据核保返回信息进行更新
             insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_AUDIT.getCode());
             insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
             return HttpResult.error("已转人工核保");
-        }else {
-            String notion = jqNotion.toString()+syNotion.toString();
+        } else {
+            String notion = jqNotion.toString() + syNotion.toString();
             insAreaCompany.setOrderstatus(InsOrderStatusEnum.TO_BACK.getCode());
             insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
             return HttpResult.error(notion);
@@ -256,12 +258,28 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
 
     @Override
     public HttpResult<Object> submitImage(String companyId) {
+        InsAreaCompany insAreaCompany = insAreaCompanyService.getById(companyId);
+
+        // 1. 协议id获取配置实体
+        HuaTaiConfigureParameters huaTaiConfigureParameters = configureParametersComponents.toEntity(HuaTaiConfigureParameters.class, insAreaCompany.getAgreementId());
+        InsOrders insOrders = insOrdersService.getById(insAreaCompany.getOrderno());
+        List<InsUploadImagesDto> insUploadImagesDtoList = insTaskImagesService.findImageByOrderNo(insOrders.getOrderno());
+        if (insUploadImagesDtoList.isEmpty()) {
+            throw new SystemException("请检查影像是否上传了");
+        }
+        HuaTaiUploadImageRequest request = new HuaTaiUploadImageRequest(insAreaCompany, huaTaiConfigureParameters);
+        request.setHead(new HuaTaiBaseRequestHead(huaTaiConfigureParameters));
+        //调用华泰影像接口获取上传链接地址
+        HuaTaiUploadImageResponse response = huaTaiRequestApiComponents.uploadImage(request, HuaTaiUploadImageResponse.class);
+        //爬虫方式进行图片上传
+        huiTaiUploadImageComponents.uploadImage(response.getUrl(), insUploadImagesDtoList);
         return HttpResult.ok("上传文件成功");
     }
 
 
     /**
      * 缴费查询
+     *
      * @param companyId 子订单号
      * @return
      */
@@ -275,112 +293,127 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
         if (insAreaCompany.getOrderstatus().equals(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode())) {
             return HttpResult.ok(InsOrderStatusEnum.ACCEPT_INSURANCE.getDesc());
         }
-
         // 2. 组装请求体
-        HuaTaiOrderStatusRequest orderStatusRequest = new HuaTaiOrderStatusRequest(insAreaCompany,huaTaiConfigureParameters);
+        HuaTaiOrderStatusRequest orderStatusRequest = new HuaTaiOrderStatusRequest(insAreaCompany, huaTaiConfigureParameters);
         orderStatusRequest.setHead(new HuaTaiBaseRequestHead(huaTaiConfigureParameters));
-
         HuaTaiOrderStatusResponse orderStatusResponse = huaTaiRequestApiComponents.orderStatus(orderStatusRequest, HuaTaiOrderStatusResponse.class);
-        return HttpResult.ok("");
-    }
-
-
- /*   *//**
-     * 缴费查询
-     * @param companyId 子订单号
-     * @return
-     *//*
-    @Override
-    public HttpResult<Object> getPaymentUrl(String companyId) {
-        InsAreaCompany insAreaCompany = insAreaCompanyService.getByInsOrderNo(companyId);
-
-        // 1. 协议id获取配置实体
-        HuaTaiConfigureParameters huaTaiConfigureParameters = configureParametersComponents.toEntity(HuaTaiConfigureParameters.class, insAreaCompany.getAgreementId());
 
-        if (insAreaCompany.getOrderstatus().equals(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode())) {
-            return HttpResult.ok(InsOrderStatusEnum.ACCEPT_INSURANCE.getDesc());
+        boolean jqExistFlag = false;
+        boolean syExistFlag = false;
+        String jqFailReason = "";
+        String syFailReason = "";
+        List<HuaTaiOrderStatusResponse.PayDetaiDto> payDetaiList = orderStatusResponse.getPayDetaiList();
+        for (HuaTaiOrderStatusResponse.PayDetaiDto payDetai : payDetaiList) {
+            insAreaCompany.getJqapplyno();
+            //交强保单号存值
+            if (StringUtils.isNotEmpty(insAreaCompany.getJqapplyno()) && insAreaCompany.getJqapplyno().equals(payDetai.getBUSINESSNO())) {
+                if ("1".equals(payDetai.getPOLICYSTATUS())) {
+                    jqExistFlag = true;
+                    insAreaCompany.setJqpolicyno(payDetai.getPOLICYNO());
+                } else {
+                    jqFailReason = payDetai.getFAILREASON();
+                }
+            }
+            //商业保单号存值
+            if (StringUtils.isNotEmpty(insAreaCompany.getSyapplyno()) && insAreaCompany.getSyapplyno().equals(payDetai.getBUSINESSNO())) {
+                if ("1".equals(payDetai.getPOLICYSTATUS())) {
+                    syExistFlag = true;
+                    insAreaCompany.setSypolicyno(payDetai.getPOLICYNO());
+                } else {
+                    syFailReason = payDetai.getFAILREASON();
+                }
+            }
+        }
+        if (jqExistFlag || syExistFlag) {
+            insAreaCompany.setOrderstatus(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
+            insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
+            return HttpResult.ok("保单生成成功");
+        } else {
+            if (StringUtils.isNotEmpty(jqFailReason) || StringUtils.isNotEmpty(syFailReason)) {
+                return HttpResult.error("保单生成失败,原因为:" + jqFailReason + syFailReason);
+            } else {
+                return HttpResult.error("保单生成失败,华泰返回异常,请联系管理员排查!");
+            }
         }
+    }
+
 
-        // 2. 组装请求体  调用缴费接口获取缴费链接
-        HuaTaiPaymentUrlRequest huaTaiPaymentUrlRequest = new HuaTaiPaymentUrlRequest(insAreaCompany,huaTaiConfigureParameters);
+    private String getPaymentUrl(InsAreaCompany insAreaCompany, HuaTaiConfigureParameters huaTaiConfigureParameters) {
+        String payUrl = "";
+        HuaTaiPaymentUrlRequest huaTaiPaymentUrlRequest = new HuaTaiPaymentUrlRequest(insAreaCompany, huaTaiConfigureParameters);
         huaTaiPaymentUrlRequest.setHead(new HuaTaiBaseRequestHead(huaTaiConfigureParameters));
         HuaTaiPaymentUrlResponse paymentUrlResponse = huaTaiRequestApiComponents.getPaymentUrl(huaTaiPaymentUrlRequest, HuaTaiPaymentUrlResponse.class);
-        if(StringUtils.isNotEmpty(paymentUrlResponse.getPayUrl())){
-            insAreaCompany.setPaymentLink(paymentUrlResponse.getPayUrl());
+        if (StringUtils.isNotEmpty(paymentUrlResponse.getPayUrl())) {
+            payUrl = paymentUrlResponse.getPayUrl();
         }
-        insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
-        insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
-        return HttpResult.ok("核保成功");
-    }*/
+        return payUrl;
+    }
 
     /**
-     *电子保单下载接口
+     * 电子保单下载接口
+     *
      * @param policyPrintVo
      * @return
      */
     @Override
-    public HttpResult<List<String>> getPolicyPrint(PolicyPrintVo policyPrintVo) {
+    public HttpResult<CrawlerPolicyPrintVo> getPolicyPrint(PolicyPrintVo policyPrintVo) {
         InsAreaCompany insAreaCompany = insAreaCompanyService.getById(policyPrintVo.getCompanyId());
         // 1. 协议id获取配置实体
         HuaTaiConfigureParameters huaTaiConfigureParameters = configureParametersComponents.toEntity(HuaTaiConfigureParameters.class, insAreaCompany.getAgreementId());
-        InsOrders order = insOrdersService.getById(insAreaCompany.getOrderno());
-        String policyNo;
+        InsOrders insOrders = insOrdersService.getById(insAreaCompany.getOrderno());
+        String licensePlate = insOrders.getLicenseno();
+        YaQuoteInfoVo yaQuoteInfoVo = new YaQuoteInfoVo(insOrders);
+        String password = yaQuoteInfoVo.getInsuredPersonInfo().getIdentifyNumber();
         String riskCode = policyPrintVo.getRiskCode();
+        // 2. 组装请求体
+        HuaTaiInsurancePolicyPrintRequest request = new HuaTaiInsurancePolicyPrintRequest();
         if (InsuranceRisk.TRAFFIC.getCode().equals(riskCode)) {
-            policyNo = insAreaCompany.getJqpolicyno();
+            request.setBusinessNo(insAreaCompany.getJqpolicyno());
         } else if (InsuranceRisk.BUSINESS.getCode().equals(riskCode)) {
-            policyNo = insAreaCompany.getJqpolicyno();
+            request.setBusinessNo(insAreaCompany.getSypolicyno());
         } else {
             throw new SystemException("险种代码不存在");
         }
-
-        // 2. 组装请求体
-        HuaTaiInsurancePolicyPrintRequest request = new HuaTaiInsurancePolicyPrintRequest();
-        request.setBusinessNo(policyNo);
+        request.setHead(new HuaTaiBaseRequestHead(huaTaiConfigureParameters));
         HuaTaiInsurancePolicyPrintResponse response = huaTaiRequestApiComponents.insurancePolicyPrint(request, HuaTaiInsurancePolicyPrintResponse.class);
-        if("0000".equals(response.getRegistResult())){
-            List<String> urlList = response.getElecDownLoadResultList();
+        CrawlerPolicyPrintVo crawlerPolicyPrintVo = new CrawlerPolicyPrintVo();
+        if ("0".equals(response.getHead().getReturnCode())) {
+            List<HuaTaiInsurancePolicyPrintResponse.ElecDownLoadResultDto> urlList = response.getElecDownLoadResultList();
             //接口文档与返回示例不一致,待联调后修改
 
-
-          /*  if(urlList!=null && !urlList.isEmpty()){
-               String url = urlList.get(0);
-               String templateName = "";
-               if("DZ_AJ".equals(code)){
-                   templateName = "-交强险标志.pdf";
-               }else if("DZ_AE".equals(code)){
-                   if("0330".equals(request.getRiskCode())){
-                       templateName = "-交强险保单.pdf";
-                   }else {
-                       templateName = "-商业险保单.pdf";
-                   }
-               }
-                String transferUrl = gainCarInsPolicy(url, licensePlate + templateName, licensePlate);
-                List<String> transferUrlList = new ArrayList<>();
-                transferUrlList.add(transferUrl);
-                response.setDownloadUrl(transferUrlList);
-            }*/
-        }else{
-            return HttpResult.error("获取华泰电子保单失败:"+response.getRegistResult());
+            if (urlList != null && !urlList.isEmpty()) {
+                for (HuaTaiInsurancePolicyPrintResponse.ElecDownLoadResultDto elecDownLoadResultDto : urlList) {
+                    String url = elecDownLoadResultDto.getDownURL();
+                    if (InsuranceRisk.TRAFFIC.getCode().equals(riskCode)) {
+                        crawlerPolicyPrintVo.setJqxPolicyUrl(gainCarInsPolicy(url, licensePlate + "-交强险保单.pdf", licensePlate, password));
+                        crawlerPolicyPrintVo.setJqxFlagUrl(gainCarInsPolicy(url, licensePlate + "-交强险标志.pdf", licensePlate, password));
+                    } else if (InsuranceRisk.BUSINESS.getCode().equals(riskCode)) {
+                        crawlerPolicyPrintVo.setSyxPolicyUrl(gainCarInsPolicy(url, licensePlate + "-商业险保单.pdf", licensePlate, password));
+                    }
+                    /**
+                     * 先下载到本地,然后再解压到固定路径
+                     */
+                }
+            }
+        } else {
+            return HttpResult.error("获取华泰电子保单失败:" + response.getRegistResult());
         }
-        return HttpResult.ok("下载成功"/*, response.getDownloadUrl()*/);
+        return HttpResult.ok("下载成功", crawlerPolicyPrintVo);
     }
 
-    public String gainCarInsPolicy(String url, String fileName, String licensePlate) {
+    public String gainCarInsPolicy(String url, String fileName, String licensePlate, String password) {
         String dir = "carInsPolicy/" + licensePlate + "/";
-        return FileUtil.netUrlToFile(url, dir, fileName, uploadFilePath, apiUrl + showFileUrl);
+        return FileUtil.netUrlStoreToLocal(url, dir, fileName, uploadFilePath, apiUrl + showFileUrl, password, licensePlate);
     }
 
     /**
-     *
      * @param yaQuoteInfoVo
      * @param insAreaCompany
      * @param huaTaiConfigureParameters
      * @return
      */
-    public HuaTaiSubmitResponse submitForUnderwriting(YaQuoteInfoVo yaQuoteInfoVo, InsAreaCompany insAreaCompany,HuaTaiConfigureParameters huaTaiConfigureParameters) {
-        HuaTaiSubmitRequest submitRequest = new HuaTaiSubmitRequest(yaQuoteInfoVo,insAreaCompany,huaTaiConfigureParameters);
-
+    public HuaTaiSubmitResponse submitForUnderwriting(YaQuoteInfoVo yaQuoteInfoVo, InsAreaCompany insAreaCompany, HuaTaiConfigureParameters huaTaiConfigureParameters) {
+        HuaTaiSubmitRequest submitRequest = new HuaTaiSubmitRequest(yaQuoteInfoVo, insAreaCompany, huaTaiConfigureParameters);
         submitRequest.setHead(new HuaTaiBaseRequestHead(huaTaiConfigureParameters));
         return huaTaiRequestApiComponents.submit(submitRequest, HuaTaiSubmitResponse.class);
     }
@@ -392,31 +425,29 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
         double syDiscount = 0;
         String jqApplyNo = "";
         String syApplyNo = "";
-        List<HuaTaiQuotedPriceResponse.ContractDto.CoverageDto> syCoverageDtoList =null;
+        List<HuaTaiQuotedPriceResponse.ContractDto.CoverageDto> syCoverageDtoList = null;
         HuaTaiQuotedPriceResponse.ContractDto.TaxDto taxDto = null;
         List<HuaTaiQuotedPriceResponse.ContractDto> contractDtoList = quotedPriceResponse.getBusinessData().getContract();
-        for(HuaTaiQuotedPriceResponse.ContractDto contractDto:contractDtoList){
+        for (HuaTaiQuotedPriceResponse.ContractDto contractDto : contractDtoList) {
             HuaTaiQuotedPriceResponse.ContractDto.ContractMainDto contractMain = contractDto.getContractMain();
-            if("1002".equals(contractMain.getRiskCode())){
+            if ("1002".equals(contractMain.getRiskCode())) {
                 taxDto = contractDto.getTax();
                 jqDiscount = contractMain.getTotalAdjustRate();
                 jqPremium = contractMain.getTotalPremium();
                 jqApplyNo = contractMain.getContractNo();
-            }else{
+            } else {
                 syCoverageDtoList = contractDto.getCoverage();
                 syDiscount = contractMain.getTotalAdjustRate();
                 syPremium = contractMain.getTotalPremium();
                 syApplyNo = contractMain.getContractNo();
             }
         }
-
         QuoteRespVo quoteRespVo = new QuoteRespVo();
-
         List<RiskInfoVo> riskList = yaQuoteInfoVo.getRiskList();
         // 报价险种放入保费
         List<QuoteRiskRespVo> riskList1 = QuoteRiskRespVo.toQuoteRiskRespVoList(riskList, jqPremium, syPremium);
 
-        for(QuoteRiskRespVo quoteRiskRespVo:riskList1){
+        for (QuoteRiskRespVo quoteRiskRespVo : riskList1) {
             if (InsuranceRisk.TRAFFIC.getCode().equals(quoteRiskRespVo.getRiskCode())) {
                 quoteRespVo.setStartDateJq(quoteRiskRespVo.getStartDate());
                 quoteRespVo.setEndDateJq(quoteRiskRespVo.getEndDate());
@@ -446,7 +477,6 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
                 kindList1.add(kind);
             }
         }
-
         quoteRespVo.setRiskList(riskList1);
         quoteRespVo.setKindList(kindList1);
         quoteRespVo.setJqPremium(jqPremium);
@@ -458,7 +488,7 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
 
         double sumPayTax = 0;
         if (!ObjectUtils.isEmpty(taxDto)) {
-            sumPayTax =  taxDto.getSumTax();
+            sumPayTax = taxDto.getSumTax();
         }
         quoteRespVo.setCiSumPermium(CalculateUtils.add(jqPremium, sumPayTax));//交强险和车船税合计
         quoteRespVo.setSumPermium(CalculateUtils.add(jqPremium, syPremium, sumPayTax));//保费合计
@@ -480,22 +510,22 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
         List<HuaTaiQuotedPriceResponse.ContractDto> contractDtoList = quotedPriceResponse.getBusinessData().getContract();
         String jqQuerySequenceNo = " ";
         String syQuerySequenceNo = " ";
-        for(HuaTaiQuotedPriceResponse.ContractDto contractDto:contractDtoList) {
+        for (HuaTaiQuotedPriceResponse.ContractDto contractDto : contractDtoList) {
             HuaTaiQuotedPriceResponse.ContractDto.ContractMainDto contractMain = contractDto.getContractMain();
             HuaTaiQuotedPriceResponse.ContractDto.PlatFormMessageDto platFormMessageDto = contractDto.getPlatFormMessage();
             if ("1002".equals(contractMain.getRiskCode())) {
                 jqQuerySequenceNo = platFormMessageDto.getQuerySequenceNo();
                 taxDto = contractDto.getTax();
                 // 车船税
-                TaxArrears taxArrears = new TaxArrears("往年欠税",taxDto.getSumTaxDefault(), taxDto.getSumOverdue());
+                TaxArrears taxArrears = new TaxArrears("往年欠税", taxDto.getSumTaxDefault(), taxDto.getSumOverdue());
                 List<TaxArrears> taxArrearsList = Collections.singletonList(taxArrears);
                 insAreaCompany.setTaxArrears(JSON.parseArray(JSON.toJSONString(taxArrearsList)));
                 quoteRespVo.setTaxArrears(taxArrearsList);
-            }else{
+            } else {
                 syQuerySequenceNo = platFormMessageDto.getQuerySequenceNo();
             }
         }
-        insAreaCompany.setInsOrderNo(jqQuerySequenceNo+"-"+syQuerySequenceNo);
+        insAreaCompany.setInsOrderNo(jqQuerySequenceNo + "-" + syQuerySequenceNo);
         quoteRespVo.setCompanyId(insAreaCompany.getId());
         insAreaCompanyService.insertCompanyAndOrders(insAreaCompany);
         return HttpResult.ok(quotedPriceResponse.getHead().getReturnMessage(), quoteRespVo);
@@ -503,12 +533,13 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
 
     /**
      * 提交核保及查询核保状态接口
+     *
      * @param companyId
      * @return
      */
     @Override
     public HttpResult<Object> auditStatusQuery(String companyId) {
-        InsAreaCompany insAreaCompany = insAreaCompanyService.getByInsOrderNo(companyId);
+        InsAreaCompany insAreaCompany = insAreaCompanyService.getById(companyId);
         // 1. 协议id获取配置实体
         HuaTaiConfigureParameters huaTaiConfigureParameters = configureParametersComponents.toEntity(HuaTaiConfigureParameters.class, insAreaCompany.getAgreementId());
 
@@ -517,26 +548,111 @@ public class HuaTaiOrderApiServiceImpl implements HuaTaiOrderApiService {
         }
 
         // 2. 组装请求体
-        HuaTaiSubmitStatusQueryRequest submitStatusQueryRequest = new HuaTaiSubmitStatusQueryRequest();
-        submitStatusQueryRequest.setHead(new HuaTaiBaseRequestHead(huaTaiConfigureParameters));
-
-        HuaTaiSubmitStatusQueryResponse submitStatusQueryResponse = huaTaiRequestApiComponents.submitStatus(submitStatusQueryRequest, HuaTaiSubmitStatusQueryResponse.class);
-        String underWriteInd="";
+        boolean haveJQFlag = false;
+        boolean haveSYFlag = false;
+        String jqStatus = "";
+        String syStatus = "";
+        StringBuffer jqNotion = new StringBuffer();
+        StringBuffer syNotion = new StringBuffer();
+        HuaTaiSubmitStatusQueryResponse submitStatusQueryResponse = submitStatus(insAreaCompany, huaTaiConfigureParameters, "2");
+        for (HuaTaiSubmitStatusQueryResponse.AppliResult appliResult : submitStatusQueryResponse.getAppliResult()) {
+            if (StringUtils.isNotEmpty(insAreaCompany.getJqapplyno())) {
+                haveJQFlag = true;
+                if (insAreaCompany.getJqapplyno().equals(appliResult.getContractNo())) {
+                    jqStatus = appliResult.getUnderWriteFlag();
+                    for (HuaTaiSubmitStatusQueryResponse.Notion notion : appliResult.getNotion()) {
+                        jqNotion.append(notion.getUWNotion() + ",");
+                    }
+                }
+            }
+            if (StringUtils.isNotEmpty(insAreaCompany.getSyapplyno()) && insAreaCompany.getSyapplyno().equals(appliResult.getContractNo())) {
+                haveSYFlag = true;
+                if (insAreaCompany.getJqapplyno().equals(appliResult.getContractNo())) {
+                    syStatus = appliResult.getUnderWriteFlag();
+                    for (HuaTaiSubmitStatusQueryResponse.Notion notion : appliResult.getNotion()) {
+                        syNotion.append(notion.getUWNotion() + ",");
+                    }
+                }
+            }
+        }
+        /**
+         * 0	初始状态默认值
+         * 1	已通过核保已实收
+         * 2	待修改
+         * 4	主动撤回(出单员撤回)
+         * 6	下发修改(核保员下发)
+         * 8	已通过核保未实收
+         * 9	待核保
+         */
+        String totalUnderWriteInd = "";
+        //同保交商
+        if (haveJQFlag && haveSYFlag) {
+            //已通过核保未实收
+            if ("8".contains(jqStatus) && "8".contains(syStatus)) {
+                totalUnderWriteInd = "8";
+            } else if ("1".contains(jqStatus) || "1".contains(syStatus)) {
+                totalUnderWriteInd = "1";
+            } else if ("9".contains(jqStatus) || "9".contains(syStatus)) {
+                totalUnderWriteInd = "9";
+            } else {
+                totalUnderWriteInd = "6";
+            }
+        } else if ((haveJQFlag && !haveSYFlag) || (!haveJQFlag && haveSYFlag)) {//单保交强或单保商业
+            String status = jqStatus;
+            if (StringUtils.isNotEmpty(syStatus)) {
+                status = syStatus;
+            }
+            if ("8".contains(status)) {
+                totalUnderWriteInd = "8";
+            } else if ("1".contains(status)) {
+                totalUnderWriteInd = "1";
+            } else if ("9".contains(status)) {
+                totalUnderWriteInd = "9";
+            } else {
+                totalUnderWriteInd = "6";
+            }
+        }
+        String underWriteInd = "";
         // 3. 通过返回核保状态修改状态
-        if ("核保通过".equals(underWriteInd) || "自动核保".equals(underWriteInd)) {
-//            insAreaCompany.setPaymentLink(submitStatusQueryResponse.getPayUrl());//需要调用接口获取支付链接
-            insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());//当核保状态返回核保通过时,调整保单状态为已核保待缴费
-            insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
-            return HttpResult.ok(underWriteInd);
-        }else if("核保不通过".equals(underWriteInd)){//当状态为核保不通过时,调整保单状态为报价中
+        if ("8".equals(totalUnderWriteInd)) {
+            //再调用缴费接口获取缴费链接
+            String payUrl = getPaymentUrl(insAreaCompany, huaTaiConfigureParameters);
+            if (StringUtils.isNotEmpty(payUrl)) {
+                insAreaCompany.setPaymentLink(payUrl);
+                insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
+                insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
+                return HttpResult.ok("核保成功");
+            } else {
+                insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_AUDIT.getCode());
+                insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
+                return HttpResult.error("获取支付链接失败");
+            }
+        } else if ("6".equals(underWriteInd)) {//当状态为核保不通过时,调整保单状态为报价中
+            String notion = jqNotion.toString() + syNotion.toString();
             insAreaCompany.setOrderstatus(InsOrderStatusEnum.QUOTE_ING.getCode());
             insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
-            return HttpResult.error("核保不通过:"/*+submitStatusQueryResponse.getIssuedReason()*/);//需要处理放入核保原因
-        }else {
+            return HttpResult.error("核保不通过:" + notion);//需要处理放入核保原因
+        } else if ("9".equals(underWriteInd)) {//当状态为核保不通过时,调整保单状态为报价中
+            return HttpResult.ok("正在核保中");//需要处理放入核保原因
+        } else {
             return HttpResult.ok(underWriteInd);
         }
     }
 
+    /**
+     * 提交核保或核保查询接口
+     *
+     * @param insAreaCompany
+     * @param huaTaiConfigureParameters
+     * @param operateType               1为提交 2为查询
+     * @return
+     */
+    private HuaTaiSubmitStatusQueryResponse submitStatus(InsAreaCompany insAreaCompany, HuaTaiConfigureParameters huaTaiConfigureParameters, String operateType) {
+        HuaTaiSubmitStatusQueryRequest huaTaiSubmitStatusQueryRequest = new HuaTaiSubmitStatusQueryRequest(insAreaCompany, huaTaiConfigureParameters, operateType);
+        huaTaiSubmitStatusQueryRequest.setHead(new HuaTaiBaseRequestHead(huaTaiConfigureParameters));
+        HuaTaiSubmitStatusQueryResponse submitStatusQueryResponse = huaTaiRequestApiComponents.submitStatus(huaTaiSubmitStatusQueryRequest, HuaTaiSubmitStatusQueryResponse.class);
+        return submitStatusQueryResponse;
+    }
 }
 
 

+ 9 - 3
src/main/java/com/ydtech/modules/order/service/impl/InsOrdersServiceImpl.java

@@ -3,7 +3,6 @@ package com.ydtech.modules.order.service.impl;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.PageInfo;
 import com.github.pagehelper.page.PageMethod;
@@ -102,6 +101,13 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
         InsAreaCompany insAreaCompany = insAreaCompanyService.getOne(wrapper);
         if (!ObjectUtils.isEmpty(insAreaCompany)) {
             InsOrders insOrders = getById(orderNo);
+
+            // 承保设置保险公司
+            if (InsOrderStatusEnum.ACCEPT_INSURANCE.getCode().equals(orderStatus)) {
+                insOrders.setCompanyId(insAreaCompany.getCompanyId());
+                insOrders.setInsCompany(insAreaCompany.getInscompany());
+            }
+
             insOrders.setOrderstatus(insAreaCompany.getOrderstatus());
             updateById(insOrders);
         }
@@ -145,11 +151,11 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
         InsOrders insOrders = new InsOrders(user, dept, quoteInfoVo);
         InsOrders insOrders1 = baseMapper.selectById(quoteInfoVo.getOrderNo());
 
-        if(ObjectUtils.isEmpty(insOrders1)){
+        if (ObjectUtils.isEmpty(insOrders1)) {
             insOrders1 = insOrders;
         }
         // 3 订单操作
-        if (!userId.equals(insOrders1.getUserid()) || StringUtils.isEmpty(quoteInfoVo.getOrderNo())){
+        if (!userId.equals(insOrders1.getUserid()) || StringUtils.isEmpty(quoteInfoVo.getOrderNo())) {
             // 存入订单
             String orderno = IdGenerate.nextId();
             insOrders.setOrderno(orderno);

+ 10 - 0
src/main/java/com/ydtech/modules/order/service/impl/InsTaskImagesServiceImpl.java

@@ -96,6 +96,16 @@ public class InsTaskImagesServiceImpl extends ServiceImpl<InsTaskImagesMapper, I
         }
         return list;
     }
+    @Override
+    public List<InsUploadImagesDto> findImageByOrderNo(String orderNo) {
+        List<InsUploadImagesDto> insUploadImagesDtos = baseMapper.getByOrderNoInsUploadImagesDtoList(orderNo);
+        // 使用 imagesId 去重
+        List<InsUploadImagesDto> deduplication = insUploadImagesDtos.stream().collect(
+                Collectors.collectingAndThen(
+                        Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(InsUploadImagesDto::getImageId))), ArrayList::new));
+
+        return deduplication;
+    }
 
 
 }

+ 24 - 62
src/main/java/com/ydtech/modules/order/service/impl/YongchengOrderApiServiceImpl.java

@@ -208,10 +208,11 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
 
     /**
      * 组装参数
+     *
      * @param quoteVo
      * @return
      */
-    private Ruote builderParams(BaseQuoteVo<AccidentalDrivingVo> quoteVo,BaseQuoteInfoVo yaQuoteInfoVo){
+    private Ruote builderParams(BaseQuoteVo<AccidentalDrivingVo> quoteVo, BaseQuoteInfoVo yaQuoteInfoVo) {
         // 获取协议配置信息
         YcConfigureParameters ycConfigureParameters = gainYcConfigParams(quoteVo.getAgreementId());
         CarInfoVo carInfo = yaQuoteInfoVo.getCarInfo();
@@ -229,13 +230,14 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
 
     /**
      * 递归获取报价请求结果
+     *
      * @param m
      * @param vinNo
      * @return
      * @throws JsonProcessingException
      */
-    private RuoteResponse getResponse(Ruote m,String vinNo) throws JsonProcessingException {
-        Boolean boo = false;
+    private RuoteResponse getResponse(Ruote m, String vinNo) throws JsonProcessingException {
+        boolean boo = false;
         boolean isBiRepeat = true;
         RuoteResponse rr = yongchengRequestApiComponents.newPremiumXnyCalculation(m);
         //交强
@@ -253,23 +255,22 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
         boo = ciRepetitionInsure(rr, m);
         if (!boo) {
             InsuranceLog.infoLog(InsuranceEnum.AICS.getPinyin(), "\n\n---------> {} - 交强险重复投保处理", vinNo);
-            rr = this.getResponse(m,vinNo);
+            rr = this.getResponse(m, vinNo);
         }
 
         //2、转保处理
         boo = reinsurance(rr, m);
         if (!boo) {
             InsuranceLog.infoLog(InsuranceEnum.AICS.getPinyin(), "\n\n---------> {} - 转保处理", vinNo);
-            rr = this.getResponse(m,vinNo);
+            rr = this.getResponse(m, vinNo);
         }
 
         if (isBiRepeat) {
             //3、商业险日期处理
             boo = biRepetitionInsure(rr, m);
             if (!boo) {
-                isBiRepeat = false;
                 InsuranceLog.infoLog(InsuranceEnum.AICS.getPinyin(), "\n\n---------> {} - 商业险日期处理", vinNo);
-                rr = this.getResponse(m,vinNo);
+                rr = this.getResponse(m, vinNo);
             }
         }
 
@@ -277,12 +278,14 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
         boo = reinsuranceCodeError(rr, m);
         if (!boo) {
             InsuranceLog.infoLog(InsuranceEnum.AICS.getPinyin(), "\n\n---------> {} - 转保处理", vinNo);
+            rr = this.getResponse(m, vinNo);
         }
         return rr;
     }
 
     /**
      * 获取错误信息
+     *
      * @param rr
      * @return
      */
@@ -307,15 +310,14 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
     public HttpResult quoteApi(BaseQuoteVo<AccidentalDrivingVo> quoteVo) throws JsonProcessingException {
 
         requestInfoList = new ArrayList<>();
-
         //获取报价信息
         BaseQuoteInfoVo yaQuoteInfoVo = insOrdersComponents.getQuoteInfo(quoteVo.getOrderNo());
 
         //build参数
-        Ruote m = this.builderParams(quoteVo,yaQuoteInfoVo);
+        Ruote m = this.builderParams(quoteVo, yaQuoteInfoVo);
 
         //递归报价
-        RuoteResponse rr = this.getResponse(m,yaQuoteInfoVo.getCarInfo().getVinNo());
+        RuoteResponse rr = this.getResponse(m, yaQuoteInfoVo.getCarInfo().getVinNo());
 
         //错误信息
         StringBuilder errorInfo = this.getErrorInfo(rr);
@@ -333,14 +335,13 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
 
         QuoteRespVo quoteRespVo = YcBuildData.buildQuoteRespVo(order, rr, yaQuoteInfoVo);
         //8 生成订单
-        InsAreaCompany iac = response_order(order, quoteRespVo, m, rr, quoteVo);
+        InsAreaCompany iac = responseOrder(order, quoteRespVo, m, rr, quoteVo);
         quoteRespVo.setCompanyId(iac.getId());
-
         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)) {
             quoteRespVo.getWarnMessageList().addAll(requestInfoList);
         }
@@ -352,7 +353,6 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
     //endregion
 
 
-
     /**
      * 报价  交强险 重复 投保业务处理
      */
@@ -442,7 +442,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
      */
     public boolean reinsuranceCodeError(RuoteResponse rr, Ruote m) {
 
-        if (rr.getHead().getErrorCode().equals("009999") && rr.getHead().getErrorMessage().contains("录入的校验码有误")) {
+        if (rr.getHead().getErrorMessage().contains("录入的校验码有误")) {
             requestInfoList.add(rr.getHead().getErrorMessage());
             //转保信息清空  重新报价
             m.getRequestLabel().getCondition().getVhl().setCBusType("0");
@@ -485,24 +485,19 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
                 if (StringUtils.isNotEmpty(cCheckCodeSY)) {
                     recognitionRequest.setSyImage(cCheckCodeSY);
                 }
-
                 RecognitionResponse recognition = verificationCodeIdentification.recognition(recognitionRequest);
-
                 m.getRequestLabel().getCondition().getVhl().setCBusType("2");
                 RecognitionResponse.Code data = recognition.getData();
-
                 //交强
                 if (StringUtils.isNotEmpty(cCheckCodeJQ)) {
                     m.getRequestLabel().getCondition().getVhl().setCCheckCodeJQ(data.getJqImageCode());
                     m.getRequestLabel().getCondition().getVhl().setCQryCdeJQ(rr.getVhl().getCQryCdeJQ());
                 }
-
                 //商业
                 if (StringUtils.isNotEmpty(cCheckCodeSY)) {
                     m.getRequestLabel().getCondition().getVhl().setCCheckCodeSY(data.getSyImageCode());
                     m.getRequestLabel().getCondition().getVhl().setCQryCdeSY(rr.getVhl().getCQryCdeSY());
                 }
-
                 return false;
 
             }
@@ -561,8 +556,6 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
                 } else if (statusJq.equals("9") || statusSy.equals("9")) {
                     iac.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
                 }
-                //构造订单状态
-                buildOrderStatus(order, iac);
 
             } else {
                 throw new SystemException("核保失败,车牌号:" + order.getLicenseno() + " ," + rd.getResponseHead().getReturnMessage());
@@ -581,8 +574,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
                 getPayUrlApi(iac);
             }
             log.info("车牌号:" + order.getLicenseno() + ",永诚核保未获取缴费地址,状态为:" + InsOrderStatusEnum.matchKey(iac.getOrderstatus()).getDesc());
-            insAreaCompanyService.updateById(iac);
-            insOrdersService.updateById(order);
+            insAreaCompanyService.updateCompanyAndOrders(iac);
             return HttpResult.ok("核保操作成功");
 
         } catch (JsonProcessingException jsonProcessingException) {
@@ -699,15 +691,9 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
                 StringBuffer sss = new StringBuffer();
                 sss.append("变更前订单状态:" + order.getOrderstatus());
                 sss.append("变更前子订单状态:" + iac.getOrderstatus());
-
-                //构造订单状态
-                buildOrderStatus(order, iac);
-
                 sss.append("变更后订单状态:" + order.getOrderstatus());
                 log.info("-----------订单状态变动----------:" + sss);
-
-                insAreaCompanyService.updateById(iac);
-                insOrdersService.updateById(order);
+                insAreaCompanyService.updateCompanyAndOrders(iac);
 
             } else {
                 //失败原因
@@ -733,9 +719,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
         List<InsAreaCompany> list = insAreaCompanyService.list(lqw);
 
         if (null != list && !list.isEmpty()) {
-            list.forEach(a -> {
-                callbackAnOrder(a.getId());
-            });
+            list.forEach(a -> callbackAnOrder(a.getId()));
         }
     }
 
@@ -917,7 +901,6 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
             }
         }
 
-
         //查询接口
         List<EsmInsAttachInsure> insAttachInsureList = new ArrayList<>();
         AccidentResponse ar = gainAccidentInsure(accidentalDrivingVo, null);
@@ -1038,7 +1021,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
 
                     AtomicInteger total = new AtomicInteger(0);
                     List<ResponseYwCvrg.CvrgList> cListDetails = arCode.getResponseYwCvrg().getCvrgList();
-                    cListDetails.stream().forEach(d -> {
+                    cListDetails.forEach(d -> {
 
                         EsmInsAttachInsureDetails atiDetails = new EsmInsAttachInsureDetails();
                         atiDetails.setAttachInsureId(ati.getId());
@@ -1104,8 +1087,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
                     order.setOrderstatus(iac.getOrderstatus());
                 }
 
-                insAreaCompanyService.updateById(iac);
-                insOrdersService.updateByOrderStatus(order.getOrderno(), order.getOrderstatus());
+                insAreaCompanyService.updateCompanyAndOrders(iac);
 
                 //支付后 手工确认意外险
             } else {
@@ -1148,8 +1130,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
      * @author: lig
      * @date: 2023年02月16日 0016
      */
-    private InsAreaCompany response_order(InsOrders insOrder, QuoteRespVo quoteRespVo, Ruote requestData, RuoteResponse responseData, BaseQuoteVo<AccidentalDrivingVo> quoteVo) {
-
+    private InsAreaCompany responseOrder(InsOrders insOrder, QuoteRespVo quoteRespVo, Ruote requestData, RuoteResponse responseData, BaseQuoteVo<AccidentalDrivingVo> quoteVo) {
         //交强保费 含税
         double jqPremium = StringUtils.toDouble(responseData.getBase().getNBefTaxPrmJQ()) + StringUtils.toDouble(responseData.getBase().getNAppTaxAmtJQ());
         //商业保费 含税
@@ -1164,14 +1145,14 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
 
         EsmInsCompany eic = esmInsCompanyService.getById(quoteVo.getCompanyId());
 
-        boolean jq_falg = jqPremium > 0;
+        boolean jqFalg = jqPremium > 0;
         //保存订单信息
         InsAreaCompany insAreaCompany = new InsAreaCompany();
         insAreaCompany.setOrderno(insOrder.getOrderno());
         insAreaCompany.setReptxt(JSON.parseObject(JSON.toJSONString(responseData)));
-        insAreaCompany.setJqpremium(BigDecimal.valueOf(jq_falg ? jqPremium : 0));
+        insAreaCompany.setJqpremium(BigDecimal.valueOf(jqFalg ? jqPremium : 0));
         insAreaCompany.setSypremium(BigDecimal.valueOf(syPremium));
-        insAreaCompany.setTaxamount(BigDecimal.valueOf(jq_falg ? quoteRespVo.getTaxAmount() : 0));
+        insAreaCompany.setTaxamount(BigDecimal.valueOf(jqFalg ? quoteRespVo.getTaxAmount() : 0));
         insAreaCompany.setSumpremium(BigDecimal.valueOf(quoteRespVo.getSumPermium()));
         insAreaCompany.setOrderstatus(InsOrderStatusEnum.QUOTE_ING.getCode());
 
@@ -1493,25 +1474,6 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
         return FileUtil.fileExist(dir, fileName, uploadFilePath, apiUrl + showFileUrl);
     }
 
-    private void buildOrderStatus(InsOrders order, InsAreaCompany iac) {
-
-        String iacStatus = iac.getOrderstatus();
-        String orderStatus = order.getOrderstatus();
-        if (orderStatus.equals(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode())) return;
-
-        if (iacStatus.equals(InsOrderStatusEnum.WAIT_PAY.getCode()) && orderStatus.equals(InsOrderStatusEnum.WAIT_AUDIT.getCode())) {
-            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())) {
-            order.setOrderstatus(iac.getOrderstatus());
-        } else if (iacStatus.equals(InsOrderStatusEnum.ACCEPT_INSURANCE.getCode())) {
-            order.setOrderstatus(iac.getOrderstatus());
-        } else if (iacStatus.equals(InsOrderStatusEnum.TO_BACK.getCode()) && orderStatus.equals(InsOrderStatusEnum.WAIT_AUDIT.getCode())) {
-            order.setOrderstatus(iac.getOrderstatus());
-        }
-
-    }
 
     private void buildCarInfo(CarInfoVo carInfo, ModelsQueryResponse.VehicleInfo vehicleInfo) {
         carInfo.setModelCode(vehicleInfo.getVehicleId());

+ 5 - 5
src/main/java/com/ydtech/modules/order/service/impl/ZhongMeiOrderApiServiceImpl.java

@@ -144,8 +144,8 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
         redisKey.append(BRAND_MODEL_KEY);
         redisKey.append(modelName);
         //从缓存中查数据
-        if (!Objects.isNull(redisTemplate.opsForValue().get(modelName.toString()))) {
-            String carModeStr = redisTemplate.opsForValue().get(modelName.toString());
+        if (!Objects.isNull(redisTemplate.opsForValue().get(modelName))) {
+            String carModeStr = redisTemplate.opsForValue().get(modelName);
             List<CarModelDTO> carModelDTOS = JSON.parseArray(carModeStr, CarModelDTO.class);
             return HttpResult.ok(carModelDTOS);
         }
@@ -157,8 +157,8 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
 
         List<CarModelDTO> map = SimpleStadarCarDTOConvert.INSTANCE.map(car);
         //数据存储到缓存中
-        if (map.size() > 0) {
-            redisTemplate.opsForValue().set(modelName.toString(), JSON.toJSONString(map), VIN_SEARCH_KEY_TIME, TimeUnit.HOURS);
+        if (!map.isEmpty()) {
+            redisTemplate.opsForValue().set(modelName, JSON.toJSONString(map), VIN_SEARCH_KEY_TIME, TimeUnit.HOURS);
         }
         return HttpResult.ok(map);
     }
@@ -364,7 +364,7 @@ public class ZhongMeiOrderApiServiceImpl implements ZhongMeiOrderApiService {
         if (InsuranceRisk.TRAFFIC.getCode().equals(riskCode)) {
             policyNo = insAreaCompany.getJqpolicyno();
         } else if (InsuranceRisk.BUSINESS.getCode().equals(riskCode)) {
-            policyNo = insAreaCompany.getJqpolicyno();
+            policyNo = insAreaCompany.getSypolicyno();
         } else {
             throw new SystemException("险种代码不存在");
         }

+ 12 - 12
src/main/java/com/ydtech/modules/protocol/entity/dto/PtlAgreementProductCostsSaveDto.java

@@ -96,10 +96,10 @@ public class PtlAgreementProductCostsSaveDto implements Serializable {
     private Integer maxSeats;
 
     @ApiModelProperty("货车吨位数(最小)")
-    private Integer minTruckTonnage;
+    private Double minTruckTonnage;
 
     @ApiModelProperty("货车吨位数(最大)")
-    private Integer maxTruckTonnage;
+    private Double maxTruckTonnage;
 
     @ApiModelProperty("新车购置价(最小)")
     private Integer minPurchasePrice;
@@ -108,10 +108,10 @@ public class PtlAgreementProductCostsSaveDto implements Serializable {
     private Integer maxPurchasePrice;
 
     @ApiModelProperty("核定载质量(最小)")
-    private Integer minApprovedLoadCapacity;
+    private Double minApprovedLoadCapacity;
 
     @ApiModelProperty("核定载质量(最大)")
-    private Integer maxApprovedLoadCapacity;
+    private Double maxApprovedLoadCapacity;
 
     @ApiModelProperty("交强险保费(最小)")
     private Integer minCompulsoryInsurancePremium;
@@ -138,28 +138,28 @@ public class PtlAgreementProductCostsSaveDto implements Serializable {
     private Integer maxOnboardProductsPremium;
 
     @ApiModelProperty("商业险折扣(最小)")
-    private Integer minCommercialInsuranceDiscount;
+    private Double minCommercialInsuranceDiscount;
 
     @ApiModelProperty("商业险折扣(最大)")
-    private Integer maxCommercialInsuranceDiscount;
+    private Double maxCommercialInsuranceDiscount;
 
     @ApiModelProperty("交强险折扣(最小)")
-    private Integer minCompulsoryInsuranceDiscount;
+    private Double minCompulsoryInsuranceDiscount;
 
     @ApiModelProperty("交强险折扣(最大)")
-    private Integer maxCompulsoryInsuranceDiscount;
+    private Double maxCompulsoryInsuranceDiscount;
 
     @ApiModelProperty("保司评分(最小)")
-    private Integer minScore;
+    private Double minScore;
 
     @ApiModelProperty("保司评分(最大)")
-    private Integer maxScore;
+    private Double maxScore;
 
     @ApiModelProperty("预期赔付率(最小)")
-    private Integer minLossRation;
+    private Double minLossRation;
 
     @ApiModelProperty("预期赔付率(最大)")
-    private Integer maxLossRation;
+    private Double maxLossRation;
 
     @ApiModelProperty("车牌号")
     private String licenseNumber;

+ 12 - 12
src/main/java/com/ydtech/modules/protocol/entity/po/PtlAgreementProductCosts.java

@@ -217,13 +217,13 @@ public class PtlAgreementProductCosts implements Serializable {
      * 货车吨位数(最小)
      */
     @TableField(value = "min_truck_tonnage")
-    private Integer minTruckTonnage;
+    private Double minTruckTonnage;
 
     /**
      * 货车吨位数(最大)
      */
     @TableField(value = "max_truck_tonnage")
-    private Integer maxTruckTonnage;
+    private Double maxTruckTonnage;
 
     /**
      * 新车购置价(最小)
@@ -241,13 +241,13 @@ public class PtlAgreementProductCosts implements Serializable {
      * 核定载质量(最小)
      */
     @TableField(value = "min_approved_load_capacity")
-    private Integer minApprovedLoadCapacity;
+    private Double minApprovedLoadCapacity;
 
     /**
      * 核定载质量(最大)
      */
     @TableField(value = "max_approved_load_capacity")
-    private Integer maxApprovedLoadCapacity;
+    private Double maxApprovedLoadCapacity;
 
     /**
      * 交强险保费(最小)
@@ -301,49 +301,49 @@ public class PtlAgreementProductCosts implements Serializable {
      * 商业险折扣(最小)
      */
     @TableField(value = "min_commercial_insurance_discount")
-    private Integer minCommercialInsuranceDiscount;
+    private Double minCommercialInsuranceDiscount;
 
     /**
      * 商业险折扣(最大)
      */
     @TableField(value = "max_commercial_insurance_discount")
-    private Integer maxCommercialInsuranceDiscount;
+    private Double maxCommercialInsuranceDiscount;
 
     /**
      * 交强险折扣(最小)
      */
     @TableField(value = "min_compulsory_insurance_discount")
-    private Integer minCompulsoryInsuranceDiscount;
+    private Double minCompulsoryInsuranceDiscount;
 
     /**
      * 交强险折扣(最大)
      */
     @TableField(value = "max_compulsory_insurance_discount")
-    private Integer maxCompulsoryInsuranceDiscount;
+    private Double maxCompulsoryInsuranceDiscount;
 
     /**
      * 保司评分(最小)
      */
     @TableField(value = "min_score")
-    private Integer minScore;
+    private Double minScore;
 
     /**
      * 保司评分(最大)
      */
     @TableField(value = "max_score")
-    private Integer maxScore;
+    private Double maxScore;
 
     /**
      * 预期赔付率(最小)
      */
     @TableField(value = "min_loss_ration")
-    private Integer minLossRation;
+    private Double minLossRation;
 
     /**
      * 预期赔付率(最大)
      */
     @TableField(value = "max_loss_ration")
-    private Integer maxLossRation;
+    private Double maxLossRation;
 
     /**
      * 车牌号

+ 38 - 4
src/main/java/com/ydtech/utils/baidu/FileUtil.java

@@ -1,5 +1,6 @@
 package com.ydtech.utils.baidu;
 
+import com.ydtech.modules.ins.utils.CompressUtil;
 import com.ydtech.utils.StringUtils;
 
 import java.io.*;
@@ -172,15 +173,48 @@ public class FileUtil {
         }
 
     }
+    public static String netUrlStoreToLocal(String url, String dir, String fileName, String path, String showUrl,String password,String licensePlate) {
+        if (StringUtils.isEmpty(url)) return "";
+        String showPath = String.format("%s%s%s", showUrl, dir, fileName);
+        String uploadPath = path + dir;
+
+        try {
+
+            //存在
+            File existFile = new File(uploadPath + fileName);
+            if (existFile.exists()) {
+                System.err.println("存在的文件:" + existFile.getPath());
+                System.err.println("存在的文件的展示地址:" + showPath);
+                return showPath;
+            }
+
+            File folder = new File(uploadPath);
+            if (!folder.isDirectory()) {
+                folder.mkdirs();
+            }
+
+            URI u = URI.create(url);
+            InputStream inputStream = u.toURL().openStream();
+            File file = new File(uploadPath + licensePlate+".zip");
+            copyInputStreamToFile(inputStream, file);
+
+            CompressUtil.unZip(file.getPath(),uploadPath,password,fileName,licensePlate);
+            file.delete();
+            return showPath;
 
+        } catch (MalformedURLException e) {
+            throw new RuntimeException(e);
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+
+    }
     public static void main(String[] args) {
         String licensePlate = "晋ABCDEF";
-        String url = "http://eserviceinterface.ciitc.com.cn/ePolicyServices/insurancePolicy.do?downFiles=key&amp&pkid=a7370fea493945868b8ca847d3ef9d9e";
+        String url = "https://gears.pc.ehuatai.com:9040/P/PYr63mm";
         String dir = "carInsPolicy/" + licensePlate + "/";
-        String fileName = licensePlate + "-交强险保单.pdf";
+        String fileName = licensePlate + ".zip";
         String path = "D:/upload/";
         String showUrl = "http://127.0.0.1:8080/upload/";
-        netUrlToFile(url, dir, fileName, path, showUrl);
-
     }
 }

+ 4 - 0
src/main/resources/mapper/modules/order/InsOrdersMapper.xml

@@ -8,6 +8,8 @@
         <id property="orderno" column="orderno" jdbcType="VARCHAR"/>
         <result property="quoteno" column="quoteno" jdbcType="VARCHAR"/>
         <result property="orderstatus" column="orderstatus" jdbcType="VARCHAR"/>
+        <result property="companyId" column="company_id" jdbcType="VARCHAR"/>
+        <result property="insCompany" column="ins_company" jdbcType="VARCHAR"/>
         <result property="carinfo" column="carinfo" javaType="com.alibaba.fastjson.JSONObject"
                 typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
         <result property="userid" column="userid" jdbcType="VARCHAR"/>
@@ -272,6 +274,8 @@
     <select id="selectByOrderQueryVo" resultMap="BaseResultMap"  parameterType="com.ydtech.modules.order.entity.vo.OrderQueryVo">
         select o.orderno,
         o.quoteno,
+        o.company_id,
+        o.ins_company,
         o.orderstatus,
         o.carinfo,
         o.userid,