Ver código fonte

Merge branch 'test' into test-xq2

# Conflicts:
#	src/main/java/com/ydtech/modules/order/entity/crawler/request/CrawlerQuoteRequest.java
xuqiang 11 meses atrás
pai
commit
7a0ce11d53
37 arquivos alterados com 622 adições e 44 exclusões
  1. 1 1
      src/main/java/com/ydtech/config/resttemplate/RestTemplateConfig.java
  2. 1 1
      src/main/java/com/ydtech/constants/InsuranceEnum.java
  3. 4 0
      src/main/java/com/ydtech/modules/admin/service/SysUserService.java
  4. 32 9
      src/main/java/com/ydtech/modules/fee/dto/vo/RuleAttrMappingVo.java
  5. 4 0
      src/main/java/com/ydtech/modules/fee/service/impl/FeeRuleSchemeServiceNewImpl.java
  6. 9 1
      src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyIncomeServiceImpl.java
  7. 12 0
      src/main/java/com/ydtech/modules/ins/model/vo/QuoteRespVo.java
  8. 37 0
      src/main/java/com/ydtech/modules/order/components/FileComponents.java
  9. 16 0
      src/main/java/com/ydtech/modules/order/controller/InsAreaCompanyController.java
  10. 2 1
      src/main/java/com/ydtech/modules/order/controller/YangGuangOrderApiController.java
  11. 5 2
      src/main/java/com/ydtech/modules/order/controller/ZhongMeiOrderApiController.java
  12. 12 0
      src/main/java/com/ydtech/modules/order/entity/InsAreaCompany.java
  13. 14 0
      src/main/java/com/ydtech/modules/order/entity/InsAreaCompanyAccidentalDriving.java
  14. 1 1
      src/main/java/com/ydtech/modules/order/entity/api/yangguang/request/YangGuangAccuracyCalculateRequest.java
  15. 3 3
      src/main/java/com/ydtech/modules/order/entity/api/zijin/request/CalculatePremiumRequest.java
  16. 6 0
      src/main/java/com/ydtech/modules/order/entity/api/zijin/response/CalculatePremiumResponse.java
  17. 12 0
      src/main/java/com/ydtech/modules/order/entity/crawler/request/CrawlerQuoteRequest.java
  18. 53 0
      src/main/java/com/ydtech/modules/order/entity/crawler/request/CtCrawlerLoginRequest.java
  19. 31 0
      src/main/java/com/ydtech/modules/order/entity/crawler/response/CrawlerQuoteResponse.java
  20. 27 0
      src/main/java/com/ydtech/modules/order/entity/crawler/response/CtCrawlerBaseResponse.java
  21. 12 0
      src/main/java/com/ydtech/modules/order/entity/vo/AuditExportVo.java
  22. 6 0
      src/main/java/com/ydtech/modules/order/entity/vo/BaseQuoteVo.java
  23. 12 0
      src/main/java/com/ydtech/modules/order/entity/vo/InsOrdersEditingVo.java
  24. 5 0
      src/main/java/com/ydtech/modules/order/entity/vo/OrderVo.java
  25. 3 0
      src/main/java/com/ydtech/modules/order/service/InsOrderPdfUrlService.java
  26. 10 0
      src/main/java/com/ydtech/modules/order/service/impl/ExcelExportServiceImpl.java
  27. 3 0
      src/main/java/com/ydtech/modules/order/service/impl/InsAreaCompanyServiceImpl.java
  28. 101 4
      src/main/java/com/ydtech/modules/order/service/impl/InsCrawlerOrderServiceImpl.java
  29. 66 0
      src/main/java/com/ydtech/modules/order/service/impl/InsOrderPdfUrlServiceImpl.java
  30. 36 9
      src/main/java/com/ydtech/modules/order/service/impl/InsOrdersServiceImpl.java
  31. 56 8
      src/main/java/com/ydtech/modules/order/service/impl/YangGuangOrderApiServiceImpl.java
  32. 11 0
      src/main/java/com/ydtech/modules/order/service/impl/ZijinOrderApiServiceImpl.java
  33. 5 0
      src/main/java/com/ydtech/modules/protocol/entity/dto/PtlAgreementAttributionDto.java
  34. 1 1
      src/main/java/com/ydtech/modules/protocols/service/impl/PtlAgreementProductCostsNewServiceImpl.java
  35. 2 1
      src/main/java/com/ydtech/modules/scheme/service/impl/RuleFilteringServiceImpl.java
  36. 1 1
      src/main/resources/mapper/modules/order/InsAreaCompanyMapper.xml
  37. 10 1
      src/main/resources/mapper/modules/order/InsOrdersMapper.xml

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

@@ -41,7 +41,7 @@ public class RestTemplateConfig {
     private static final int IDLE_CONNECTIONS = 30;
 
     // 返回数据的超时时间
-    private static final int SOCKET_TIMEOUT = 90 * 1000;
+    private static final int SOCKET_TIMEOUT = 180 * 1000;
 
     // 连接上服务器的超时时间
     private static final int CONNECT_TIMEOUT = 3 * 1000;

+ 1 - 1
src/main/java/com/ydtech/constants/InsuranceEnum.java

@@ -85,7 +85,7 @@ public enum InsuranceEnum {
     ZSIC("ZSIC", "浙商财产保险股份有限公司", ""),
     ZYBX("ZYBX", "中原农业保险股份有限公司", ""),
     ZYIC("ZYIC", "中意财产保险有限公司", ""),
-    SNPIC("SNPIC", "申能财产保险股份有限公司", "");
+    SNBX("SNBX", "申能财产保险股份有限公司", "shenneng");
 
     private final String code;
 

+ 4 - 0
src/main/java/com/ydtech/modules/admin/service/SysUserService.java

@@ -16,6 +16,7 @@ import com.ydtech.modules.admin.model.dto.*;
 import com.ydtech.modules.admin.model.vo.*;
 import com.ydtech.modules.base.model.dto.PageDto;
 import com.ydtech.modules.base.model.vo.PageVo;
+import org.springframework.util.ObjectUtils;
 
 import java.util.List;
 import java.util.Map;
@@ -382,6 +383,9 @@ public interface SysUserService extends BaseIService<SysUser> {
      */
     default SysUser judgmentIncumbency(String id) {
         SysUser user = getById(id);
+        if(ObjectUtils.isEmpty(user)){
+            throw new SystemException("用户或密码错误!!");
+        }
         if (!UserWorkStatus.UWS_1.getCode().equals(user.getStatus())) {
             throw new SystemException("审核未通过、请联系管理员");
         }

+ 32 - 9
src/main/java/com/ydtech/modules/fee/dto/vo/RuleAttrMappingVo.java

@@ -1,5 +1,6 @@
 package com.ydtech.modules.fee.dto.vo;
 
+import com.alibaba.fastjson.JSONObject;
 import com.ydtech.constants.enums.InsurKind;
 import com.ydtech.constants.enums.dict.ZmTransferType;
 import com.ydtech.constants.enums.dict.insurance.VehicleType;
@@ -90,6 +91,13 @@ public class RuleAttrMappingVo {
         //商业起保日期
         ruleAttrMappingVoList.add(new RuleAttrMappingVo("SyStartTime", insAreaCompany.getSyStartDate()));
 
+        String isImportedCar = "1";
+        if (carInfo.getFrameNo() != null && !carInfo.getFrameNo().isEmpty() && carInfo.getFrameNo().charAt(0) == 'L') {
+            isImportedCar = "0";
+        }
+        // 判断是否是进口车
+        ruleAttrMappingVoList.add(new RuleAttrMappingVo("IsImportedCar", isImportedCar));
+
         // 中煤不浮动原因
         if (Objects.nonNull(quoteRespVo)) {
             String rateFloatFlag = ZmTransferType.getByCode(quoteRespVo.getRateFloatFlag());
@@ -121,6 +129,10 @@ public class RuleAttrMappingVo {
 
         //发证日期
         ruleAttrMappingVoList.add(new RuleAttrMappingVo("DateofIssuance", carInfo.getIssueDate()));
+
+        // 初登日期是否与发证日期一致
+        ruleAttrMappingVoList.add(new RuleAttrMappingVo("SameDate", carInfo.getRegisterDate().equals(carInfo.getIssueDate()) ? "1" : "0"));
+
         //车长
 //        ruleAttrMappingVoList.add(new RuleAttrMappingVo("VehicleLength", carInfo.getCarLength()));
         //转续保 交强
@@ -383,9 +395,13 @@ public class RuleAttrMappingVo {
                 .map(InsAreaCompany::getXyhGrade)
                 .map(String::valueOf)
                 .ifPresent(x -> ruleAttrMappingVoList.add(new RuleAttrMappingVo("XyhGrade", x)));
-
+        // 红黄蓝车系 阳光
+        Optional.ofNullable(insAreaCompany)
+                .map(InsAreaCompany::getSeriesTypeActualName)
+                .map(String::valueOf)
+                .ifPresent(x -> ruleAttrMappingVoList.add(new RuleAttrMappingVo("SeriesTypeActualName", x)));
         //数值型总评分
-        Pattern pattern = Pattern.compile("[0-9]*");
+        Pattern pattern = Pattern.compile("\\d+(\\.\\d+)?");
         if (insAreaCompany.getScore() != null) {
             if (pattern.matcher(insAreaCompany.getScore()).matches()) {
                 //数值型评分
@@ -426,13 +442,20 @@ public class RuleAttrMappingVo {
         ruleAttrMappingVoList.add(new RuleAttrMappingVo("TotalPayoutRate", String.valueOf(insAreaCompany.getLossRation())));
         //太平绿黄红区
         ruleAttrMappingVoList.add(new RuleAttrMappingVo("GreenYellowAndRedAreas", insAreaCompany.getTpColorScore()));
-        if (insAreaCompany.getAccidentalDriving() != null) {
-            //非车名称
-            ruleAttrMappingVoList.add(new RuleAttrMappingVo("NonCarName", insAreaCompany.getAccidentalDriving()
-                    .getRideRiskName()));
-            //非车份数
-            ruleAttrMappingVoList.add(new RuleAttrMappingVo("NonCarQuantity",
-                    String.valueOf(insAreaCompany.getAccidentalDriving().getQuantity())));
+        if (insAreaCompany.getApiType() == 2) {
+            if (insAreaCompany.getAccidentInfo() != null && !insAreaCompany.getAccidentInfo().isEmpty()) {
+                //非车名称
+                ruleAttrMappingVoList.add(new RuleAttrMappingVo("NonCarName", ((JSONObject) insAreaCompany.getAccidentInfo().get(0)).getString("projectName")));
+                //非车份数
+                Integer quantity = ((JSONObject) insAreaCompany.getAccidentInfo().get(0)).getInteger("quantity");
+                ruleAttrMappingVoList.add(new RuleAttrMappingVo("NonCarQuantity",
+                        String.valueOf(quantity)));
+            }
+        }else if(insAreaCompany.getApiType() == 1){
+            if (Objects.nonNull(insAreaCompany.getAccidentalDriving())){
+                ruleAttrMappingVoList.add(new RuleAttrMappingVo("NonCarName", insAreaCompany.getAccidentalDriving().getRideRiskName()));
+                ruleAttrMappingVoList.add(new RuleAttrMappingVo("NonCarQuantity", String.valueOf(insAreaCompany.getAccidentalDriving().getQuantity())));
+            }
         }
         //真假单交
         ruleAttrMappingVoList.add(new RuleAttrMappingVo("IsDJQ", insAreaCompany.getIsDjq()));

+ 4 - 0
src/main/java/com/ydtech/modules/fee/service/impl/FeeRuleSchemeServiceNewImpl.java

@@ -3223,6 +3223,8 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
         equalsMap.add("JqCharacterBasedRating");
         //商业字符型评分
         equalsMap.add("SyCharacterBasedRating");
+        // 阳光红黄蓝车系
+        equalsMap.add("SeriesTypeActualName");
 
 
 
@@ -3258,6 +3260,8 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
         equalsMap.add("JqCharacterBasedRating");
         //商业字符型评分
         equalsMap.add("SyCharacterBasedRating");
+        // 阳光红黄蓝车系
+        equalsMap.add("SeriesTypeActualName");
 
 
 

+ 9 - 1
src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyIncomeServiceImpl.java

@@ -1572,7 +1572,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
                         insPlyIncome.setJqOtherCostsProportion(insPlyIncomeVo.getJqOtherCostsProportion());
                     }
 
-                    if (syNoTaxPremium != null && insPlyIncomeVo.getSyOtherCostsProportion() != null && insPlyIncomeVo.getSyOtherCostsProportion().compareTo(BigDecimal.ZERO) != 0) {
+                    if (syNoTaxPremium != null && insPlyIncomeVo.getSyOtherCostsProportion() != null ) {
                         insPlyIncome.setSyOtherCostsProportion(insPlyIncome.getSyOtherCostsProportion());
                         insPlyIncome.setSyOtherCostsPremium(getBigDecimal(syNoTaxPremium, insPlyIncomeVo.getSyOtherCostsProportion()));
                     }
@@ -1585,6 +1585,12 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
                 }
             }
 
+            BigDecimal dividedAmount = jqNoTaxPremium.divide(new BigDecimal("1.06"), 5, BigDecimal.ROUND_DOWN);
+            insPlyIncome.setJqNoTaxPremium(dividedAmount);
+            BigDecimal taxPremium = insPlyIncome.getTaxPremium();
+            BigDecimal noTaxPremium = taxPremium.divide(new BigDecimal("1.06"), 5, BigDecimal.ROUND_DOWN);
+            insPlyIncome.setNoTaxPremium(noTaxPremium);
+
 
             if ("0".equals(insPlyIncomeVo.getIsNotDocumentary()) && "0".equals(insPlyIncomeVo.getIsNotCar())) {  //保险  手续费 =不含税保费* 手续费比例
                 insPlyIncome.setCommissionFeevalue(this.calculateTotal(insPlyIncome.getJqSuperviseCostsPremiums(), insPlyIncome.getSySuperviseCostsPremiums(), null)); // 手续费
@@ -1594,6 +1600,8 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
                 insPlyIncome.setOtherFeevalue(this.calculateTotal(insPlyIncome.getJqOtherCostsPremium(), insPlyIncome.getSyOtherCostsPremium(), null));
                 insPlyIncome.setOtherFeerate(this.calculateTotal(insPlyIncome.getJqOtherCostsProportion(), insPlyIncome.getSyOtherCostsProportion(), null));
                 insPlyIncome.setAllFeeValue(this.calculateTotal(insPlyIncome.getOtherFeevalue(), null, null));//总金额
+
+
             }
             if ("0".equals(insPlyIncomeVo.getIsNotDocumentary()) && "1".equals(insPlyIncomeVo.getIsNotCar())) {// 非车
                 insPlyIncome.setCommissionFeevalue(this.calculateTotal(insPlyIncome.getNoSuperviseCostsPremiums(), null, null));  // 非车手续费

+ 12 - 0
src/main/java/com/ydtech/modules/ins/model/vo/QuoteRespVo.java

@@ -202,6 +202,12 @@ public class QuoteRespVo {
     @ApiModelProperty("自主定价系数")
     private String pricingCoefficient;
 
+    @ApiModelProperty("自主定价系数上限")
+    private String pricingCoefficientUpper;
+
+    @ApiModelProperty("自主定价系数下限")
+    private String pricingCoefficientLower;
+
     @ApiModelProperty("费用查看")
     private Boolean feeView;
 
@@ -238,12 +244,18 @@ public class QuoteRespVo {
     @ApiModelProperty("永安商业费用浮动")
     private String bifeeFloat;
 
+    @ApiModelProperty("永安商业折扣")
+    private String yaBusinessDiscount;
+
     @ApiModelProperty("人保商业折扣")
     private String preDiscount;
 
     @ApiModelProperty("报价记录")
     private List<SysQuoteRecord> quoteRecords;
 
+    @ApiModelProperty("大地 不浮动原因")
+    private String reasonNoFluctuation;
+
     public void setJqClaims(String jqClaims) {
         this.jqClaims = StringUtils.isEmpty(jqClaims) ? null : jqClaims;
     }

+ 37 - 0
src/main/java/com/ydtech/modules/order/components/FileComponents.java

@@ -6,6 +6,7 @@ import net.lingala.zip4j.core.ZipFile;
 import net.lingala.zip4j.exception.ZipException;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
+import org.springframework.web.multipart.MultipartFile;
 
 import java.io.File;
 import java.io.IOException;
@@ -77,6 +78,42 @@ public class FileComponents {
         }
     }
 
+    public String gainCarInsPolicyNew(MultipartFile file, String subOrderId, boolean flag) {
+        try {
+            String dir = uploadFilePath + "carInsPolicyNew/" + subOrderId + "/";
+            String showPath = apiUrl + showFileUrl + "carInsPolicyNew/" + subOrderId + "/" + file.getOriginalFilename();
+
+            File existFile = new File(dir + file.getOriginalFilename());
+            if (existFile.exists()) {
+                if (!flag) {
+                    return showPath; // 已存在且不要求覆盖
+                } else {
+                    existFile.delete(); // 删除旧文件
+                }
+            }
+
+            File folder = new File(dir);
+            if (!folder.isDirectory()) {
+                folder.mkdirs();
+            }
+
+            // 将上传的文件保存到本地
+            File destFile = new File(dir + file.getOriginalFilename());
+            file.transferTo(destFile);
+
+            return showPath;
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new SystemException("文件上传异常");
+        }
+    }
+
+//    public static boolean uploadCarInsPolicyNew(MultipartFile file, String fileName, String subOrderId, boolean flag) {
+//        FileComponents fileComponents = new FileComponents();
+//        String policyPath = fileComponents.gainCarInsPolicyNew(file, fileName, subOrderId, flag);
+//        return true;
+//    }
+
     public static void unzipFile(String url, String zipPath, String zipName, String password, String newFileName) throws ZipException,
             IOException {
         String path = zipPath + zipName;

+ 16 - 0
src/main/java/com/ydtech/modules/order/controller/InsAreaCompanyController.java

@@ -17,6 +17,7 @@ import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
 import java.util.List;
 
@@ -165,4 +166,19 @@ public class InsAreaCompanyController {
         List<InsOrderPayDateRecord> list=insOrderPayDateRecordService.updateOrderDateRecord(subOrderId);
         return HttpResult.ok(list);
     }
+
+    @PostMapping("/uploadInsurancePolicy")
+    @ApiOperation("手动上传保单")
+    public HttpResult<String> uploadInsurancePolicy(@RequestParam("subOrderId") String subOrderId,
+                                                    @RequestParam("policyType") String policyType,
+                                                    @RequestParam("file") MultipartFile file) {
+        if(subOrderId.contains(",")){
+            subOrderId = subOrderId.replaceAll(",","");
+        }
+        if(policyType.contains(",")){
+            policyType = policyType.replaceAll(",","");
+        }
+        insOrderPdfUrlService.uploadInsurancePolicy(file,policyType,subOrderId,true);
+        return HttpResult.ok("上传成功",file.getOriginalFilename());
+    }
 }

+ 2 - 1
src/main/java/com/ydtech/modules/order/controller/YangGuangOrderApiController.java

@@ -4,6 +4,7 @@ import com.fasterxml.jackson.core.JsonProcessingException;
 import com.ydtech.aop.request.RequestSingleParam;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.ins.model.vo.QuoteRespVo;
+import com.ydtech.modules.order.aop.AuditVerification;
 import com.ydtech.modules.order.aop.QuoteVerification;
 import com.ydtech.modules.order.components.InsOrdersComponents;
 import com.ydtech.modules.order.entity.api.yangguang.response.YangGuangGetNonVehicleProductsResponse;
@@ -54,7 +55,7 @@ public class YangGuangOrderApiController {
         return this.yangGuangOrderApiService.upload(companyId);
     }
 
-
+    @AuditVerification("核保")
     @PostMapping("/submit")
     @ApiOperation("投保单提交")
     public HttpResult<Object> submit(@RequestSingleParam(value = "companyId") String companyId) throws Exception {

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

@@ -56,8 +56,11 @@ public class ZhongMeiOrderApiController {
     @ApiOperation(value = "车型查询接口")
     public HttpResult<List<CarModelDTO>> modelsQuery(@RequestBody ModelsQueryQueryVo modelsQueryQueryVo) {
         List<CarModelDTO> map = this.zhongMeiOrderApiService.modelsQuery(modelsQueryQueryVo.getModelName());
-        List<CarModelDTO> carModelDTOS =
-                map.stream().sorted(Comparator.comparing(CarModelDTO::getReplacementValue)).collect(Collectors.toList());
+        List<CarModelDTO> carModelDTOS = map.stream()
+                .sorted(Comparator.comparing(
+                        dto -> Float.parseFloat(dto.getReplacementValue())
+                ))
+                .collect(Collectors.toList());
         if (!StringUtils.isEmpty(modelsQueryQueryVo.getMarketYear())) {
             List<CarModelDTO> collect = carModelDTOS.stream().filter(x -> !StringUtils.isEmpty(x.getMarketYear()) && x.getMarketYear().startsWith(modelsQueryQueryVo.getMarketYear())).collect(Collectors.toList());
             return HttpResult.ok(collect);

+ 12 - 0
src/main/java/com/ydtech/modules/order/entity/InsAreaCompany.java

@@ -607,6 +607,18 @@ public class InsAreaCompany implements Serializable {
     @TableField(value = "xyh_grade")
     private String xyhGrade;
 
+    /**
+     * 自主定价系数
+     */
+    @TableField(value = "pricing_coefficient")
+    private String pricingCoefficient;
+
+    /**
+     * 大地 不浮动原因
+     */
+    @TableField(value = "reason_no_fluctuation")
+    private String reasonNoFluctuation;
+
     //入口总金额
     @TableField(exist = false)
     private BigDecimal entranceAllFee;

+ 14 - 0
src/main/java/com/ydtech/modules/order/entity/InsAreaCompanyAccidentalDriving.java

@@ -118,6 +118,20 @@ public class InsAreaCompanyAccidentalDriving implements Serializable {
             this.setRideRiskCode(jsonObject.getString("rideRiskCode"));
             this.setQuantity(jsonObject.getInteger("quantity"));
             this.setCompanyId(t.getCompanyId());
+        }else if(t.getCompanyId().equals("XDCX1000000")){
+            //国任
+            JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(t.getAccidentalDrivingVo()));
+            this.setRideRiskCode(jsonObject.getString("goodsCode"));
+            this.setRideRiskName(jsonObject.getString("goodsName"));
+            this.setQuantity(jsonObject.getInteger("quantity"));
+            this.setCompanyId(t.getCompanyId());
+        }else if(t.getCompanyId().equals("HTIC1000000")){
+            // 华泰
+            JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(t.getAccidentalDrivingVo()));
+            this.setRideRiskCode(jsonObject.getString("mealcode"));
+            this.setRideRiskCode(jsonObject.getString("productname"));
+            this.setQuantity(jsonObject.getInteger("num"));
+            this.setCompanyId(t.getCompanyId());
         }
     }
 }

+ 1 - 1
src/main/java/com/ydtech/modules/order/entity/api/yangguang/request/YangGuangAccuracyCalculateRequest.java

@@ -230,7 +230,7 @@ public class YangGuangAccuracyCalculateRequest extends YangGuangBaseRequest{
                                              BaseQuoteVo<List<YgQuoteAccidentVo>> quoteVo,boolean isRepeat,String remarkCi,String remarkBi) {
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
         this.RequestNo = "accuracyCalculate";
-        this.UnderWritingRate = quoteVo.getCoefficient();
+        this.UnderWritingRate = quoteVo.getPricingCoefficient();
         this.ComCode = ygConfigureParameters.getComCode();
         this.HandlerCode = ygConfigureParameters.getHandlerCode();
         this.TongxinNo = ygConfigureParameters.getTongxinNo() == null ? "" : ygConfigureParameters.getTongxinNo();

+ 3 - 3
src/main/java/com/ydtech/modules/order/entity/api/zijin/request/CalculatePremiumRequest.java

@@ -144,7 +144,7 @@ public class CalculatePremiumRequest implements Serializable {
             itemKindList.add(ItemKindListDTO.getCompulsoryInsurance());
         }
         // 车辆信息
-        this.vehicleInfo = new VehicleInfoDTO(quoteInfoVo.getCarInfo(), vehicleModelInfosDTO, actualValue);
+        this.vehicleInfo = new VehicleInfoDTO(quoteInfoVo.getCarInfo(), vehicleModelInfosDTO, actualValue, modelQueryResponse);
         this.orderId = modelQueryResponse.getOrderId();
         this.orderNo = modelQueryResponse.getOrderNo();
         this.orderOrigin = zjConfigureParameters.getAppKey();
@@ -876,7 +876,7 @@ public class CalculatePremiumRequest implements Serializable {
         private String makeDateJQ;
 
 
-        public VehicleInfoDTO(CarInfoVo carInfo, ModelQueryResponse.VehicleModelInfosDTO vehicleModelInfosDTO, String actualValue) {
+        public VehicleInfoDTO(CarInfoVo carInfo, ModelQueryResponse.VehicleModelInfosDTO vehicleModelInfosDTO, String actualValue, ModelQueryResponse modelQueryResponse) {
             this.actualValue = actualValue;
             this.agreeActualValue = actualValue;
             if (carInfo.isTransferFlag()) {
@@ -936,7 +936,7 @@ public class CalculatePremiumRequest implements Serializable {
             this.oriPurchasePrice = vehicleModelInfosDTO.getPurchasePrice();
             this.oriBrandName = vehicleModelInfosDTO.getModelName();
             this.oriModelName = vehicleModelInfosDTO.getModelName();
-            this.vehicleStyleUniqueId = vehicleModelInfosDTO.getVehicleId();
+//            this.vehicleStyleUniqueId = vehicleModelInfosDTO.getVehicleId();
             this.isInvokeJingYou = "1";
 
             //纯电动 燃料电池 插电式混合动力 归属为新能源产品

+ 6 - 0
src/main/java/com/ydtech/modules/order/entity/api/zijin/response/CalculatePremiumResponse.java

@@ -530,6 +530,9 @@ public class CalculatePremiumResponse extends BaseResponse implements Serializab
         @JsonProperty("carName")
         private String carName;
 
+        @JsonProperty("carValue")
+        private Float carValue;
+
         @JsonProperty("modelIdCode")
         private String modelIdCode;
 
@@ -547,6 +550,9 @@ public class CalculatePremiumResponse extends BaseResponse implements Serializab
 
         @JsonProperty("vehicleFamily")
         private String vehicleFamily;
+
+        @JsonProperty("vehicleStyleUniqueId")
+        private String vehicleStyleUniqueId;
     }
 
     @NoArgsConstructor

+ 12 - 0
src/main/java/com/ydtech/modules/order/entity/crawler/request/CrawlerQuoteRequest.java

@@ -76,6 +76,11 @@ public class CrawlerQuoteRequest extends BaseQuoteInfoVo {
      */
     private String carChecker;
 
+    /**
+     * 永安商业折扣
+     */
+    private String yaBusinessDiscount;
+
     /**
      * 人保赔付优化申请
      */
@@ -86,9 +91,16 @@ public class CrawlerQuoteRequest extends BaseQuoteInfoVo {
      */
     private String applyNo;
 
+    /**
+     * 恒邦折扣
+     */
+    private String hopecoefficient;
+
     /**
      * 华农参数
      */
     private String permitComName;
 
+
+
 }

+ 53 - 0
src/main/java/com/ydtech/modules/order/entity/crawler/request/CtCrawlerLoginRequest.java

@@ -0,0 +1,53 @@
+package com.ydtech.modules.order.entity.crawler.request;
+
+import cn.hutool.core.collection.CollUtil;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.ydtech.modules.protocol.entity.dto.PtlAgreementAttributionDto;
+import com.ydtech.utils.StringUtils;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.util.LinkedHashMap;
+
+@Data
+@NoArgsConstructor
+public class CtCrawlerLoginRequest implements Serializable {
+
+    private static final long serialVersionUID = 01404102263425770704305L;
+
+    /**
+     * 账号
+     */
+    @JsonProperty(value = "username")
+    private String username;
+
+    /**
+     * 密码
+     */
+    @JsonProperty(value = "pwd")
+    private String pwd;
+
+    /**
+     * 归属信息
+     */
+    @JsonProperty(value = "other")
+    private LinkedHashMap<String, String> other;
+
+    @JsonProperty(value = "check")
+    private String check;
+
+    public CtCrawlerLoginRequest(PtlAgreementAttributionDto attribution) {
+        this.username = attribution.getUsername();
+        this.pwd = attribution.getPassword();
+
+    }
+
+    public CtCrawlerLoginRequest(PtlAgreementAttributionDto attribution, String sendcode, CtCrawlerLoginRequest request) {
+        this.username = attribution.getUsername();
+        this.pwd = attribution.getPassword();
+        if(CollUtil.isNotEmpty(attribution.getFields())){
+            this.other = attribution.getFields().stream().collect(LinkedHashMap::new, (m, v) -> m.put(v.getField(), v.getValue()), LinkedHashMap::putAll);
+        }
+    }
+}

+ 31 - 0
src/main/java/com/ydtech/modules/order/entity/crawler/response/CrawlerQuoteResponse.java

@@ -362,8 +362,39 @@ public class CrawlerQuoteResponse extends CrawlerBaseResponse {
         @JsonProperty("BiDiscount")
         private String biDiscount;
 
+        /**
+         * 总赔付率
+         */
+        @JsonProperty("loss_ration")
+        private String lossRation;
+
+        /**
+         * 交强赔付率
+         */
+        @JsonProperty("jq_loss_ration")
+        private String jqLossRation;
+
+        /**
+         * 商业赔付率
+         */
+        @JsonProperty("sy_loss_ration")
+        private String syLossRation;
+
+        /**
+         * 恒邦商业折扣率
+         * @return
+         */
+        @JsonProperty("hopecoefficient")
+        private String hopecoefficient;
 
 
+        /**
+         * 大地不浮动原因
+         * @return
+         */
+        @JsonProperty("reason_no_fluctuation")
+        private String reasonNoFluctuation;
+
         public String getDiscount() {
             return StringUtils.isEmpty(discount) ? "0" : discount;
         }

+ 27 - 0
src/main/java/com/ydtech/modules/order/entity/crawler/response/CtCrawlerBaseResponse.java

@@ -0,0 +1,27 @@
+package com.ydtech.modules.order.entity.crawler.response;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class CtCrawlerBaseResponse implements Serializable {
+
+    private static final long serialVersionUID = 0436050477325473777054L;
+
+    /**
+     * 状态码
+     */
+    @JsonProperty("code")
+    private Integer code;
+    /**
+     * 返回信息
+     */
+    @JsonProperty("message")
+    private String message;
+
+    @JsonProperty("data")
+    private Object data;
+
+}

+ 12 - 0
src/main/java/com/ydtech/modules/order/entity/vo/AuditExportVo.java

@@ -172,5 +172,17 @@ public class AuditExportVo {
     @ExcelProperty("补录订单")
     private String isExternal;
 
+    @ApiModelProperty("一级分销人员")
+    @ExcelIgnore
+    private String firstLevelUserId;
+
+    @ApiModelProperty("二级分销人员")
+    @ExcelIgnore
+    private String twoLevelUserId;
+
+    @ApiModelProperty("三级分销人员")
+    @ExcelIgnore
+    private String threeLevelUserId;
+
 
 }

+ 6 - 0
src/main/java/com/ydtech/modules/order/entity/vo/BaseQuoteVo.java

@@ -188,4 +188,10 @@ public class BaseQuoteVo<T> {
     @ApiModelProperty("人保赔付优化申请")
     private String preDiscount;
 
+    @ApiModelProperty("永安商业折扣")
+    private String yaBusinessDiscount;
+
+    @ApiModelProperty("阳光商业自主定价系数")
+    private String pricingCoefficient;
+
 }

+ 12 - 0
src/main/java/com/ydtech/modules/order/entity/vo/InsOrdersEditingVo.java

@@ -242,6 +242,15 @@ public class InsOrdersEditingVo extends InsOrders implements Serializable {
         @ApiModelProperty("交商合并经营成本率")
         private String mergeCostRate;
 
+        @ApiModelProperty("向阳花评分")
+        private String xyhGrade;
+
+        @ApiModelProperty("红黄蓝车系")
+        private String seriesTypeActualName;
+
+        @ApiModelProperty("自主定价系数")
+        private String pricingCoefficient;
+
         @ApiModelProperty("交强出口费用")
         private BigDecimal jqExportFee;
 
@@ -335,6 +344,9 @@ public class InsOrdersEditingVo extends InsOrders implements Serializable {
             this.syLossRation = insAreaCompany.getSyLossRation();
             this.ubiPredictedInfoScore = insAreaCompany.getUbiPredictedInfoScore();
             this.mergeCostRate = insAreaCompany.getMergeCostRate();
+            this.xyhGrade = insAreaCompany.getXyhGrade();
+            this.seriesTypeActualName = insAreaCompany.getSeriesTypeActualName();
+            this.pricingCoefficient = insAreaCompany.getPricingCoefficient();
             this.feeMatchErrMsg = insAreaCompany.getFeeMatchErrMsg();
             this.quoteErrMsg = insAreaCompany.getQuoteErrMsg();
             this.orderStatusInfo = InsOrderStatusEnum.matchKey(insAreaCompany.getOrderstatus()).getDesc();

+ 5 - 0
src/main/java/com/ydtech/modules/order/entity/vo/OrderVo.java

@@ -543,5 +543,10 @@ public class OrderVo implements Serializable {
     @ApiModelProperty("权益类型")
     private Integer equityType;
 
+    @ApiModelProperty("红黄蓝车系")
+    private String seriesTypeActualName;
+
+    @ApiModelProperty("向阳花评分")
+    private String xyhGrade;
 
 }

+ 3 - 0
src/main/java/com/ydtech/modules/order/service/InsOrderPdfUrlService.java

@@ -3,6 +3,7 @@ package com.ydtech.modules.order.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.ydtech.modules.order.entity.dto.ReadPdfUrlListDto;
 import com.ydtech.modules.order.entity.po.InsOrderPdfUrl;
+import org.springframework.web.multipart.MultipartFile;
 
 /**
 * @author Administrator
@@ -24,4 +25,6 @@ public interface InsOrderPdfUrlService extends IService<InsOrderPdfUrl> {
      *  @Description:
      */ 
     ReadPdfUrlListDto productOrderPdf(String subOrderId);
+
+    String uploadInsurancePolicy(MultipartFile file, String policyType, String subOrderId, boolean flag);
 }

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

@@ -92,6 +92,16 @@ public class ExcelExportServiceImpl implements ExcelExportService {
             }else if(item.getIsExternal().equals("1")){
                 item.setIsExternal("是");
             }
+            //判断是否存在分销人员 如果不存在则分销金额为0
+            if (item.getFirstLevelUserId() == null || item.getFirstLevelUserId().equals("")){
+                item.setFirstDetailPremiums("0");
+            }
+            if (item.getTwoLevelUserId() == null || item.getTwoLevelUserId().equals("")){
+                item.setSecondDetailPremiums("0");
+            }
+            if (item.getThreeLevelUserId() == null || item.getThreeLevelUserId().equals("")){
+                item.setThirdDetailPremiums("0");
+            }
         });
         return auditExportList;
     }

+ 3 - 0
src/main/java/com/ydtech/modules/order/service/impl/InsAreaCompanyServiceImpl.java

@@ -959,6 +959,8 @@ public class InsAreaCompanyServiceImpl extends ServiceImpl<InsAreaCompanyMapper,
         //处理子订单重新赋值   add  by hxl  2024-07-01  处理编辑数据不更新的bug
         InsAreaCompany insAreaCompany = insOrdersEditingVo.getInsAreaCompanyList().get(0);
         insAreaCompany = getNewEntity(insAreaCompany, insOrdersEditingVo, ptlAgreement);
+        // 更新对接人
+        insAreaCompany.setDockingPerson(ptlAgreement.getDockingPerson());
         this.updateById(insAreaCompany);
 
         // add  by  hxl   2025-01-09 添加外部订单的维护人
@@ -969,6 +971,7 @@ public class InsAreaCompanyServiceImpl extends ServiceImpl<InsAreaCompanyMapper,
             insAreaCompany.setLeaderId(sysUser.getLeaderId());
             insAreaCompany.setLeaderName(sysUser.getLeaderName());
         }
+
         //更新轨迹表
         // if(insOrdersEditingVo.getStageFlag()==1){
         insOrdersTrackService.addingTrajectories(insAreaCompany);

+ 101 - 4
src/main/java/com/ydtech/modules/order/service/impl/InsCrawlerOrderServiceImpl.java

@@ -1,5 +1,6 @@
 package com.ydtech.modules.order.service.impl;
 
+import cn.hutool.core.collection.CollUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -49,6 +50,7 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.data.redis.core.StringRedisTemplate;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
 import org.springframework.util.ObjectUtils;
 
 import javax.imageio.ImageIO;
@@ -154,6 +156,10 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
         crawlerQuoteRequest.setDiscount(t.getDiscount());
         // 是否需要验车
         crawlerQuoteRequest.setIsInspect(t.getIsInspect());
+        // 永安商业折扣
+        crawlerQuoteRequest.setYaBusinessDiscount(t.getYaBusinessDiscount());
+        // 恒邦折扣
+        crawlerQuoteRequest.setHopecoefficient(t.getCoefficient());
         // 上次订单
         if (StringUtils.isNotEmpty(t.getLastCompanyId())) {
             InsAreaCompany insAreaCompany = insAreaCompanyService.getById(t.getLastCompanyId());
@@ -290,6 +296,15 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
             }
         } else if (t.getCompanyId().equals("PICC000000")) {
             quoteRespVo.setPreDiscount(response.getOther().getBiDiscount());
+        } else if (t.getCompanyId().equals("CCIC1000000")) {
+            quoteRespVo.setSyAdjustRate(response.getOther().getHopecoefficient());
+            // 浮动原因 设置为过户车  并保存到主订单上
+            if (quoteRespVo.getReasonNoFluctuation().equals("1")) {
+                InsOrders insOrders = insOrdersService.getById(quoteInfoVo.getOrderNo());
+                JSONObject carinfo = insOrders.getCarinfo();
+                carinfo.put("transferFlag", true);
+                insOrdersService.updateById(insOrders);
+            }
         }
 
         //处理订单信息
@@ -588,6 +603,8 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
         quoteRespVo.setCifeeFloat(other.getCifeeFloat());
         // 商业费用浮动
         quoteRespVo.setBifeeFloat(other.getBifeeFloat());
+        // 永安商业折扣
+        quoteRespVo.setYaBusinessDiscount(other.getSyDiscount());
 
         quoteRespVo.setTotalAdjustRate(StringUtils.toDouble(other.getDiscount()));
         quoteRespVo.setJqAdjustRate(other.getJqDiscount());
@@ -646,6 +663,10 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
         if(other.getBiDiscount() != null && !other.getBiDiscount().isEmpty()){
             quoteRespVo.setPreDiscount(other.getBiDiscount());
         }
+        // 大地不浮动原因
+        if(other.getReasonNoFluctuation() != null){
+            quoteRespVo.setReasonNoFluctuation(other.getReasonNoFluctuation());
+        }
         return quoteRespVo;
     }
 
@@ -653,14 +674,25 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
                                       PtlAgreementAttribution ptlAgreementAttribution,
                                       InsAreaCompanyAccidentalDriving insAreaCompanyAccidentalDriving,
                                       BaseQuoteInfoVo quoteInfoVo) {
+
+        // 赋值非车份数
+        if (quoteRespVo.getAccidentInfo() != null && !quoteRespVo.getAccidentInfo().isEmpty()) {
+            AccidentResponseVo o = quoteRespVo.getAccidentInfo().get(0);
+            if (Objects.nonNull(o)) {
+                o.setQuantity(String.valueOf(insAreaCompanyAccidentalDriving.getQuantity()));
+                //  爬虫返回的驾意险名称有可能和系统内的不一致  重置下驾意险名称
+                o.setProjectName(insAreaCompanyAccidentalDriving.getRideRiskName());
+            }
+        }
+
         //保存订单信息
         InsAreaCompany insAreaCompany = new InsAreaCompany(quoteRespVo, ptlAgreementAttribution);
-//在修改中
+
+        //在修改中
         insAreaCompany.setCarInfo(JSON.toJSONString(quoteInfoVo.getCarInfo()));
         insAreaCompany.setOwnerInfo(JSON.toJSONString(quoteInfoVo.getOwnerInfo()));
         insAreaCompany.setApplyInfo(JSON.toJSONString(quoteInfoVo.getPolicyHolderInfo()));
         insAreaCompany.setInsureInfo(JSON.toJSONString(quoteInfoVo.getInsuredPersonInfo()));
-
         insAreaCompany.setTaxArrears(JSON.parseArray(JSON.toJSONString(quoteRespVo.getTaxArrears())));
 
         // 此单是否需要验车
@@ -724,7 +756,25 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
             insAreaCompany.setExtendInfo(extendInfo.toString());
         }
 
+        // 赔付率
+        if(Objects.nonNull(response.getOther().getLossRation())) {
+            quoteRespVo.setLossRation(Double.parseDouble(response.getOther().getLossRation()));
+            insAreaCompany.setLossRation(Double.parseDouble(response.getOther().getLossRation()));
+        }
+        // 交强赔付率
+        if(Objects.nonNull(response.getOther().getJqLossRation())) {
+            quoteRespVo.setJqLossRation(Double.parseDouble(response.getOther().getJqLossRation()));
+            insAreaCompany.setJqLossRation(Double.parseDouble(response.getOther().getJqLossRation()));
+        }
+        // 商业赔付率
+        if(Objects.nonNull(response.getOther().getSyLossRation())) {
+            quoteRespVo.setSyLossRation(Double.parseDouble(response.getOther().getSyLossRation()));
+            insAreaCompany.setSyLossRation(Double.parseDouble(response.getOther().getSyLossRation()));
+        }
 
+        if(Objects.nonNull(response.getOther().getReasonNoFluctuation())){
+            insAreaCompany.setReasonNoFluctuation(response.getOther().getReasonNoFluctuation());
+        }
 
         insAreaCompanyService.insertCompanyAndOrders(insAreaCompany, insAreaCompanyAccidentalDriving);
         //清空驾意险信息 重新复制
@@ -865,6 +915,12 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
                 .isEmpty()) ? vo.getJyxInfoList()
                 .get(0)
                 .getJyxPolicyUrl() : null;
+
+        if(!CollectionUtils.isEmpty(vo.getJyxInfoList())){
+            CrawlerPolicyPrintVo.JyxInfoListDTO jyxInfoListDTO = vo.getJyxInfoList().get(0);
+            insAreaCompany.setJyPolicyNo(jyxInfoListDTO.getApplication());
+        }
+
         InsAreaCompanyExternalPolicy insAreaCompanyExternalPolicy = new InsAreaCompanyExternalPolicy(insAreaCompany.getId(), vo.getJqxPolicyUrl(), vo.getSyxPolicyUrl(), jyPath, vo.getJqxFlagUrl());
         return new ReadPdfUrlListDto(insAreaCompanyExternalPolicy, insAreaCompany, null);
     }
@@ -1045,7 +1101,7 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
     public JSONObject sendLoginSmsCode(PtlAgreementAttributionDto agreementAttributionDto) {
 //        InsAreaCompany insAreaCompany = insAreaCompanyService.getById(companyId);
         PtlAgreementAttribution attribution = ptlAgreementAttributionService.getOne(new LambdaQueryWrapper<PtlAgreementAttribution>()
-                .eq(PtlAgreementAttribution::getTemplateId,agreementAttributionDto.getTemplateId()));
+                .eq(PtlAgreementAttribution::getId,agreementAttributionDto.getId()));
 
         PtlAgreementAttributionDto attributionDto = new PtlAgreementAttributionDto();
         BeanUtils.copyProperties(attribution, attributionDto);
@@ -1068,6 +1124,7 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
         // 泰山发送验证码
         if (attribution.getInsCompanyId().equals("TSBX1000000")){
             TsCrawlerLoginRequest crawlerLoginRequest = new TsCrawlerLoginRequest(attributionDto);
+
             TsCrawlerBaseResponse tsResponse = insCrawlerOrderComponents.request(apiUrl, InsuranceEnum.TSBX.getCode(), "获取验证码",
                     crawlerLoginRequest, TsCrawlerBaseResponse.class);
             if (!tsResponse.getCode().equals(200)) {
@@ -1076,8 +1133,24 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
             // 将返回参数放入redis
             redisTemplate.opsForValue().set(InsuranceEnum.TSBX.getCode()+OrderCacheConstant.BS_ACCESS_TOKEN + attributionDto.getUsername(), JSON.toJSONString(tsResponse.getData()), OrderCacheConstant.TS_ACCESS_TOKEN_TIME,
                     TimeUnit.SECONDS);
+            response = (JSONObject) JSON.toJSON(tsResponse);
+        }
+        // 诚泰发送验证码
+        if (attribution.getInsCompanyId().equals("CHAC1000000")){
+            CtCrawlerLoginRequest crawlerLoginRequest = new CtCrawlerLoginRequest(attributionDto);
+            LinkedHashMap<String,String> other = new LinkedHashMap<>();
+            other.put("phone",agreementAttributionDto.getPhone());
+            crawlerLoginRequest.setOther(other);
+            crawlerLoginRequest.setCheck("zs");
+            response = insCrawlerOrderComponents.request(apiUrl, InsuranceEnum.CHAC.getCode(), "获取验证码",
+                    crawlerLoginRequest, JSONObject.class);
+            if (!response.getInteger("code").equals(200)) {
+                throw new SystemException(response.getString("message"));
+            }
+            // 将返回参数放入redis
+            redisTemplate.opsForValue().set(InsuranceEnum.CHAC.getCode()+OrderCacheConstant.BS_ACCESS_TOKEN + attributionDto.getUsername(), JSON.toJSONString(response.getString("data")), OrderCacheConstant.TS_ACCESS_TOKEN_TIME,
+                    TimeUnit.SECONDS);
         }
-//        if (attribution.getInsCompanyId().equals(""))
         return response;
     }
 
@@ -1127,6 +1200,30 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
                 throw new SystemException("验证码已失效!请重新发送!");
             }
         }
+        else if(companyCode.equals(InsuranceEnum.CHAC.getCode())){
+            CtCrawlerLoginRequest ctCrawlerLoginRequest = new CtCrawlerLoginRequest();
+            ctCrawlerLoginRequest.setUsername(agreement.getAttribution().getUsername());
+            ctCrawlerLoginRequest.setPwd(agreement.getAttribution().getPassword());
+            ctCrawlerLoginRequest.setOther(new LinkedHashMap<>());
+            ctCrawlerLoginRequest.getOther().put("phone",agreement.getAttribution().getPhone());
+            ctCrawlerLoginRequest.getOther().put("mescoed",agreement.getAgreement().getSmsCode());
+            PtlAgreementAttributionDto attribution = agreement.getAttribution();
+            if(CollUtil.isNotEmpty(attribution.getFields())){
+                ctCrawlerLoginRequest.getOther().putAll(attribution.getFields().stream().collect(LinkedHashMap::new, (m, v) -> m.put(v.getField(), v.getValue()), LinkedHashMap::putAll));
+            }
+            ctCrawlerLoginRequest.setCheck("zs");
+            // 组装 Other 信息
+            Map<String,String> otherMap = new HashMap<>();
+            agreement.getAttribution().getFields().forEach(item->{
+                otherMap.put(item.getField(),item.getValue());
+            });
+            JSONObject response = insCrawlerOrderComponents.request(apiUrl, agreement.getAgreement().getPartnerCompaniesId(), "登录",
+                    ctCrawlerLoginRequest, JSONObject.class);
+            if (response.getInteger("code") != 200) {
+                throw new SystemException("登录失败:" + response.getString("token"));
+            }
+
+        }
         else{
             // 正常登录流程
         }

+ 66 - 0
src/main/java/com/ydtech/modules/order/service/impl/InsOrderPdfUrlServiceImpl.java

@@ -1,9 +1,11 @@
 package com.ydtech.modules.order.service.impl;
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ydtech.constants.InsuranceEnum;
 import com.ydtech.exception.SystemException;
 import com.ydtech.modules.base.controller.BaseController;
+import com.ydtech.modules.order.components.FileComponents;
 import com.ydtech.modules.order.dao.InsOrderPdfUrlMapper;
 import com.ydtech.modules.order.entity.InsAreaCompany;
 import com.ydtech.modules.order.entity.InsAreaCompanyExternalPolicy;
@@ -16,6 +18,7 @@ import com.ydtech.utils.OrderUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
 
 import java.util.ArrayList;
 import java.util.Date;
@@ -82,6 +85,9 @@ public class InsOrderPdfUrlServiceImpl extends ServiceImpl<InsOrderPdfUrlMapper,
     @Autowired
     private YangGuangOrderApiService yangGuangOrderApiService;
 
+    @Autowired
+    private FileComponents fileComponents;
+
 
     /**
      *  @version
@@ -136,6 +142,62 @@ public class InsOrderPdfUrlServiceImpl extends ServiceImpl<InsOrderPdfUrlMapper,
         return readPdfUrlList(subOrderId,true);
     }
 
+    @Override
+    public String uploadInsurancePolicy(MultipartFile file, String policyType, String subOrderId, boolean flag) {
+        boolean existsFlag = true;
+        String policyPath = fileComponents.gainCarInsPolicyNew(file, subOrderId, flag);
+        if(StringUtils.isBlank(policyPath)){
+            throw  new SystemException("文件上传失败");
+        }
+        // pdf 表中插入数据
+        InsAreaCompany insAreaCompany = insAreaCompanyService.getById(subOrderId);
+        if(Objects.isNull(insAreaCompany)){
+            throw new SystemException("订单不存在");
+        }
+        InsOrderPdfUrl entityBySubOrderId = insOrderPdfUrlMapper.findEntityBySubOrderId(subOrderId);
+        if(Objects.isNull(entityBySubOrderId)){
+            existsFlag = false;
+            // 创建一个新的数据
+            entityBySubOrderId = new InsOrderPdfUrl();
+            entityBySubOrderId.setSubOrderNo(subOrderId);
+            entityBySubOrderId.setRiskCode(insAreaCompany.getProduct());
+        }
+        if (policyType.equals("1")) {
+            if(insAreaCompany.getJqapplyno().equals("")){
+                throw new SystemException("未查询到交强保单号");
+            }
+            entityBySubOrderId.setJqNo(insAreaCompany.getJqapplyno());
+            entityBySubOrderId.setJqUrl(policyPath);
+        }
+        if (policyType.equals("2")){
+            if(insAreaCompany.getJqapplyno().equals("")){
+                throw new SystemException("未查询到交强保单号");
+            }
+            entityBySubOrderId.setJqNo(insAreaCompany.getJqapplyno());
+            entityBySubOrderId.setJqSignUrl(policyPath);
+        }
+        if (policyType.equals("3")){
+            if(insAreaCompany.getSyapplyno().equals("")){
+                throw new SystemException("未查询到商业保单号");
+            }
+            entityBySubOrderId.setSyNo(insAreaCompany.getSyapplyno());
+            entityBySubOrderId.setSyUrl(policyPath);
+        }
+        if (policyType.equals("4")){
+            if (insAreaCompany.getCrossInsurance().size() > 0) {
+                entityBySubOrderId.setJyNo(((JSONObject) insAreaCompany.getCrossInsurance().get(0)).getString("application"));
+                entityBySubOrderId.setJyUrl(policyPath);
+            }else{
+                throw new SystemException("未查询到驾意保单号");
+            }
+        }
+        if(!existsFlag) {
+            insOrderPdfUrlMapper.insert(entityBySubOrderId);
+        }else{
+            insOrderPdfUrlMapper.updateById(entityBySubOrderId);
+        }
+        return policyPath;
+    }
 
 
     public  ReadPdfUrlListDto  insertOrderPdfData(InsAreaCompany subOrder,InsOrders insOrders,boolean flag,InsOrderPdfUrl jqUrlEntity){
@@ -215,6 +277,10 @@ public class InsOrderPdfUrlServiceImpl extends ServiceImpl<InsOrderPdfUrlMapper,
             jyPolicyNo = OrderUtils.getJyPolicyNo(subOrder.getCompanyId(), String.valueOf(subOrder.getApiType()==null?1:subOrder.getApiType()), subOrder.getCrossInsurance().toString(), insOrders.getIsExternal()==null?"0":String.valueOf(insOrders.getIsExternal()));
         }
         subOrder.setJyPolicyNo(jyPolicyNo);
+        if(subOrder.getApiType()!=null && subOrder.getApiType()==2){
+            return insCrawlerOrderService.getPolicyByCompanyIdPdfList(subOrder,insOrders,flag);
+        }
+
         if(insOrders.getIsExternal()!=null && insOrders.getIsExternal() ==1){
             //外部订单
             return insAreaCompanyExternalPolicyService.getPolicyByCompanyIdPdfList(subOrder,insOrders);

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

@@ -1991,9 +1991,9 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
      * 转换非车
      */
     public BaseQuoteVo convertDriving(BaseQuoteVo<QuoteAccidentalDrivingVo> baseQuoteVo) {
-        if (baseQuoteVo.getCompanyId().equals("HTIC1000000")) {
-            return baseQuoteVo;
-        }
+//        if (baseQuoteVo.getCompanyId().equals("HTIC1000000")) {
+//            return baseQuoteVo;
+//        }
 
         if (baseQuoteVo.getAccidentalDrivingVo().getProjectCode() == null) {
             baseQuoteVo.setAccidentalDrivingVo(null);
@@ -2027,7 +2027,17 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
             guoRenBaseQuoteVo.getAccidentalDrivingVo().setRiskCode(byProjectCode.getRiskCode());
             guoRenBaseQuoteVo.getAccidentalDrivingVo().setQuantity(baseQuoteVo.getAccidentalDrivingVo().getQuantity());
             return guoRenBaseQuoteVo;
-        } else if (baseQuoteVo.getCompanyId().equals("ZAPA1000000")) {
+        } else if (baseQuoteVo.getCompanyId().equals("SNBX1000000")){
+            BaseQuoteVo<Object> shennengBaseQuoteVo = new BaseQuoteVo<>();
+            BeanUtils.copyProperties(baseQuoteVo, shennengBaseQuoteVo);
+            JSONObject accidentalDrivingVo = new JSONObject();
+            InsDrivingIntentionInsurance byProjectCode = insDrivingIntentionInsuranceService.getByProjectCode(baseQuoteVo.getCompanyId(), baseQuoteVo.getAccidentalDrivingVo().getProjectCode());
+            accidentalDrivingVo.put("code", byProjectCode.getProjectCode());
+            accidentalDrivingVo.put("name", baseQuoteVo.getAccidentalDrivingVo().getProjectName());
+            accidentalDrivingVo.put("quantity", baseQuoteVo.getAccidentalDrivingVo().getQuantity());
+            shennengBaseQuoteVo.setAccidentalDrivingVo(accidentalDrivingVo);
+            return shennengBaseQuoteVo;
+        }else if (baseQuoteVo.getCompanyId().equals("ZAPA1000000")) {
             //众安
             BaseQuoteVo<Object> zhongAnBaseQuoteVo = new BaseQuoteVo<>();
             BeanUtils.copyProperties(baseQuoteVo, zhongAnBaseQuoteVo);
@@ -2109,6 +2119,13 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
             InsDrivingIntentionInsurance byProjectCode = insDrivingIntentionInsuranceService.getByProjectCode(baseQuoteVo.getCompanyId(), baseQuoteVo.getAccidentalDrivingVo().getProjectCode());
             taiPingBaseQuoteVo.setAccidentalDrivingVo(JSONObject.parseObject(byProjectCode.getRequestData()));
             return taiPingBaseQuoteVo;
+        } else if (baseQuoteVo.getCompanyId().equals("HTIC1000000")) {
+            //华泰
+            BaseQuoteVo<Object> huaTaiBaseQuoteVo = new BaseQuoteVo<>();
+            BeanUtils.copyProperties(baseQuoteVo, huaTaiBaseQuoteVo);
+            InsDrivingIntentionInsurance byProjectCode = insDrivingIntentionInsuranceService.getByProjectCode(baseQuoteVo.getCompanyId(), baseQuoteVo.getAccidentalDrivingVo().getProjectCode());
+            huaTaiBaseQuoteVo.setAccidentalDrivingVo(JSONObject.parseObject(byProjectCode.getRequestData()));
+            return huaTaiBaseQuoteVo;
         } else if (baseQuoteVo.getCompanyId().equals("HNIC1000000")) {
             //华农
             BaseQuoteVo<Object> huaNongBaseQuoteVo = new BaseQuoteVo<>();
@@ -2148,13 +2165,13 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
             return dajiaBaseQuoteVo;
         } else if (baseQuoteVo.getCompanyId().equals("BPIC1000000")) {
             // 渤海财险
-            BaseQuoteVo<List<BoHaiQuoteAccidentVo>> bohaiBaseQuoteVo = new BaseQuoteVo<>();
+            BaseQuoteVo<Object> bohaiBaseQuoteVo = new BaseQuoteVo<>();
             BeanUtils.copyProperties(baseQuoteVo, bohaiBaseQuoteVo);
             QuoteAccidentalDrivingVo accidentalDrivingVo = baseQuoteVo.getAccidentalDrivingVo();
-            BoHaiQuoteAccidentVo boHaiQuoteAccidentVo = new BoHaiQuoteAccidentVo();
-            boHaiQuoteAccidentVo.setPackageCode(accidentalDrivingVo.getProjectCode());
-            boHaiQuoteAccidentVo.setProductCode(accidentalDrivingVo.getRiskCode());
-            boHaiQuoteAccidentVo.setCopies(String.valueOf(accidentalDrivingVo.getQuantity()));
+            JSONObject boHaiQuoteAccidentVo = new JSONObject();
+            boHaiQuoteAccidentVo.put("comboCode",accidentalDrivingVo.getProjectCode());
+            boHaiQuoteAccidentVo.put("comboName",accidentalDrivingVo.getProjectName());
+            boHaiQuoteAccidentVo.put("count",String.valueOf(accidentalDrivingVo.getQuantity()));
             bohaiBaseQuoteVo.setAccidentalDrivingVo(Collections.singletonList(boHaiQuoteAccidentVo));
             return bohaiBaseQuoteVo;
         } else if (baseQuoteVo.getCompanyId().equals("CHAC1000000")) {
@@ -2194,6 +2211,16 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
             jsonObject.put("rideRiskCode", accidentObject.getString("riskCode"));
             ziJinYangBaseQuoteVo.setAccidentalDrivingVo(jsonObject);
             return ziJinYangBaseQuoteVo;
+        } else if (baseQuoteVo.getCompanyId().equals("CCIC1000000")){
+            BaseQuoteVo<Object> daDiBaseQuoteVo = new BaseQuoteVo<>();
+            BeanUtils.copyProperties(baseQuoteVo, daDiBaseQuoteVo);
+            JSONObject accidentObject = JSONObject.parseObject(JSONObject.toJSONString(daDiBaseQuoteVo.getAccidentalDrivingVo()));
+            JSONObject jsonObject = new JSONObject();
+            jsonObject.put("formulaGroupCode", accidentObject.getString("riskCode"));
+            jsonObject.put("formulaCode", accidentObject.getString("projectCode"));
+            jsonObject.put("count", accidentObject.getString("quantity"));
+            daDiBaseQuoteVo.setAccidentalDrivingVo(jsonObject);
+            return daDiBaseQuoteVo;
         }
 
         return null;

+ 56 - 8
src/main/java/com/ydtech/modules/order/service/impl/YangGuangOrderApiServiceImpl.java

@@ -141,7 +141,8 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
         //报价
         InsOrders insOrders = insOrdersService.getById(quoteInfoVo.getOrderNo());
         quoteInfoVo.setProductId(insOrders.getProductid());
-
+        // 获取非车列表
+        getNonVehicleList(seatCount,insOrders, ygConfigureParameters);
         YangGuangAccuracyCalculateRequest yangGuangAccuracyCalculateRequest = new YangGuangAccuracyCalculateRequest(quoteInfoVo, purchasePrice, carModelList1, riskList.get(0),startDate,ygConfigureParameters,quoteVo,false,null,null);
         yangGuangAccuracyCalculateRequest.setInfotransNo(yangGuangQueryVehicleModelResponse.getInfotransNo());
         YangGuangAccuracyCalculateResponse yangGuangAccuracyCalculateResponse = yangGuangRequestApiComponents.accuracyCalculaye(yangGuangAccuracyCalculateRequest);
@@ -155,6 +156,8 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
                 String newDateStr = dateTime.format(outputFormatter);
                 String remarkCi = yangGuangAccuracyCalculateResponse.getRemarkCi();
                 String remarkBi = yangGuangAccuracyCalculateResponse.getRemarkBi();
+                // 获取非车列表
+                getNonVehicleList(seatCount,insOrders, ygConfigureParameters);
                 YangGuangAccuracyCalculateRequest yangGuangAccuracyCalculateRequestRe = new YangGuangAccuracyCalculateRequest(quoteInfoVo, purchasePrice, carModelList1, riskList.get(0),newDateStr,ygConfigureParameters,quoteVo,true,remarkCi,remarkBi);
                 yangGuangAccuracyCalculateRequestRe.setInfotransNo(yangGuangQueryVehicleModelResponse.getInfotransNo());
                 maxQuoteNum--;
@@ -174,6 +177,8 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
                         String actualValue = itemcar.getActualValue();
                         String remarkCi1 = yangGuangAccuracyCalculateResponseRe.getRemarkCi();
                         String remarkBi1 = yangGuangAccuracyCalculateResponseRe.getRemarkBi();
+                        // 获取非车列表
+                        getNonVehicleList(seatCount,insOrders, ygConfigureParameters);
                         YangGuangAccuracyCalculateRequest yangGuangAccuracyCalculateRequest1 = new YangGuangAccuracyCalculateRequest(quoteInfoVo, actualValue, carModelList1, riskList.get(0),newDateStr,ygConfigureParameters,quoteVo,true,remarkCi1,remarkBi1);
                         yangGuangAccuracyCalculateRequest1.setInfotransNo(yangGuangQueryVehicleModelResponse.getInfotransNo());
                         maxQuoteNum--;
@@ -285,6 +290,8 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
                 YangGuangAccuracyCalculateResponse.itemcar itemcar = yangGuangAccuracyCalculateResponse.getItemcar();
                 String actualValue = itemcar.getActualValue();
                 String remarkBI = yangGuangAccuracyCalculateResponse.getRemarkBi();
+                // 获取非车列表
+                getNonVehicleList(seatCount,insOrders, ygConfigureParameters);
                 YangGuangAccuracyCalculateRequest yangGuangAccuracyCalculateRequest1 = new YangGuangAccuracyCalculateRequest(quoteInfoVo, actualValue, carModelList1, riskList.get(0),startDate,ygConfigureParameters,quoteVo,false,null,remarkBI);
                 yangGuangAccuracyCalculateRequest1.setInfotransNo(yangGuangQueryVehicleModelResponse.getInfotransNo());
                 YangGuangAccuracyCalculateResponse yangGuangAccuracyCalculateResponse1 = yangGuangRequestApiComponents.accuracyCalculaye(yangGuangAccuracyCalculateRequest1);
@@ -468,7 +475,9 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
                 insAreaCompanyService.updateCompanyAndOrdersMessage(insAreaCompany, message);
                 return HttpResult.error("自核转人工,原因:" + message);
             }
-            return HttpResult.error("交强险自核失败,原因:" + yangGuangSubmitResponse.getCiUnderWriteMsg());
+            if (yangGuangSubmitResponse.getCiUnderWriteFlag().equals("2")) {
+                return HttpResult.error("交强险自核失败,原因:" + yangGuangSubmitResponse.getCiUnderWriteMsg());
+            }
         }
         if (yangGuangSubmitResponse.getBiUnderWriteFlag() != null && !yangGuangSubmitResponse.getBiUnderWriteFlag().equals("1")) {
             if (yangGuangSubmitResponse.getBiUnderWriteFlag().equals("3")) {
@@ -480,8 +489,11 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
                 insAreaCompanyService.updateCompanyAndOrdersMessage(insAreaCompany, message);
                 return HttpResult.error("自核转人工,原因:" + message);
             }
-            return HttpResult.error("商业险自核失败,原因:" + yangGuangSubmitResponse.getBiUnderWriteMsg());
+            if (yangGuangSubmitResponse.getBiUnderWriteFlag().equals("2")) {
+                return HttpResult.error("商业险自核失败,原因:" + yangGuangSubmitResponse.getBiUnderWriteMsg());
+            }
         }
+
         // 投保单号
         insAreaCompany.setJqapplyno(yangGuangSubmitResponse.getCiProposalNo() != null ? yangGuangSubmitResponse.getCiProposalNo() :"");
         insAreaCompany.setSyapplyno(yangGuangSubmitResponse.getBiProposalNo() != null ? yangGuangSubmitResponse.getBiProposalNo() :"");
@@ -604,6 +616,12 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
         }
         return HttpResult.ok(yangGuangGetNonVehicleProductsResponse.getNonVehicleProducts());
     }
+    public YangGuangGetNonVehicleProductsResponse getNonVehicleList(String seatCount, InsOrders insOrders, YangGuangConfigureParameters ygConfigureParameters) throws JsonProcessingException {
+        // 获取非车列表
+        YangGuangGetNonVehicleProductsRequest yangGuangGetNonVehicleProductsRequest = new YangGuangGetNonVehicleProductsRequest(seatCount,insOrders,ygConfigureParameters);
+        return yangGuangRequestApiComponents.getNonVehicleProducts(yangGuangGetNonVehicleProductsRequest);
+    }
+
 
     @Override
     public HttpResult<Object> proposalStatusQuery(String companyId) throws JsonProcessingException {
@@ -617,11 +635,11 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
         YangGuangProposalStatusQueryRequest yangGuangProposalStatusQueryRequest = new YangGuangProposalStatusQueryRequest(insAreaCompany,yangGuangConfigureParameters);
         YangGuangProposalStatusQueryResponse yangGuangProposalStatusQueryResponse = yangGuangRequestApiComponents.proposalStatusQuery(yangGuangProposalStatusQueryRequest);
         if (yangGuangProposalStatusQueryResponse.getErrorCode().equals("0")) {
-            if (yangGuangProposalStatusQueryResponse.getBiUnderWriteFlag().equals("3")) {
-                return HttpResult.error("商业险核失败,原因:" + yangGuangProposalStatusQueryResponse.getBiUnderWriteMsg());
+            if (yangGuangProposalStatusQueryResponse.getBiUnderWriteFlag().equals("3") || yangGuangProposalStatusQueryResponse.getBiUnderWriteFlag().equals("2")) {
+                return HttpResult.error("商业险核失败,原因:" + yangGuangProposalStatusQueryResponse.getBiUnderWriteMsg());
             }
-            if (yangGuangProposalStatusQueryResponse.getCiUnderWriteFlag().equals("3")) {
-                return HttpResult.error("交强险核失败,原因:" + yangGuangProposalStatusQueryResponse.getCiUnderWriteMsg());
+            if (yangGuangProposalStatusQueryResponse.getCiUnderWriteFlag().equals("3") || yangGuangProposalStatusQueryResponse.getCiUnderWriteFlag().equals("2")) {
+                return HttpResult.error("交强险核失败,原因:" + yangGuangProposalStatusQueryResponse.getCiUnderWriteMsg());
             }
             insSubOrderUpdateDetailService.insertData(insAreaCompany, insAreaCompany.getOrderstatus(), InsOrderStatusEnum.WAIT_PAY.getCode(), "1");
             insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
@@ -917,7 +935,10 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
         quoteRespVo.setSeriesTypeActualName(yangGuangAccuracyCalculateResponse.getSeriesTypeActualName() != null ? yangGuangAccuracyCalculateResponse.getSeriesTypeActualName() : "");
         // 向阳花标识
         quoteRespVo.setXyhGrade(yangGuangAccuracyCalculateResponse.getXYHGrade() != null ? "1" : "0");
-
+        // 自主定价系数
+        quoteRespVo.setPricingCoefficient(yangGuangAccuracyCalculateResponse.getDiscount().getActualautoundwrtfactor() != null ? yangGuangAccuracyCalculateResponse.getDiscount().getActualautoundwrtfactor() : "");
+        quoteRespVo.setPricingCoefficientUpper(yangGuangAccuracyCalculateResponse.getDiscount().getAdjustrateUpper() != null ? yangGuangAccuracyCalculateResponse.getDiscount().getAdjustrateUpper() : "");
+        quoteRespVo.setPricingCoefficientLower(yangGuangAccuracyCalculateResponse.getDiscount().getAdjustrateLower() != null ? yangGuangAccuracyCalculateResponse.getDiscount().getAdjustrateLower() : "");
         List<QuoteKindRespVo> kindList1 = new ArrayList<>();
         List<RiskInfoVo> riskList = yaQuoteInfoVo.getRiskList();
         //  报价险种放入保费
@@ -961,6 +982,32 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
             BigDecimal bigDecimal = YangGuangAccuracyCalculateResponse.PtptNonVehicleProductInformationList.sumPremium(notCarList);
             jyPremium = bigDecimal.doubleValue();
         }
+        if (yangGuangAccuracyCalculateResponse.getNewAndRenewalFlagCI() != null) {
+            switch (yangGuangAccuracyCalculateResponse.getNewAndRenewalFlagCI()) {
+                case "1":
+                case "3":
+                    quoteRespVo.setJqRenewal("0");
+                    break;
+                case "2":
+                case "4":
+                case "5":
+                    quoteRespVo.setJqRenewal("1");
+                    break;
+            }
+        }
+        if (yangGuangAccuracyCalculateResponse.getNewAndRenewalFlagBI() != null) {
+            switch (yangGuangAccuracyCalculateResponse.getNewAndRenewalFlagBI()) {
+                case "1":
+                case "3":
+                    quoteRespVo.setSyRenewal("0");
+                    break;
+                case "2":
+                case "4":
+                case "5":
+                    quoteRespVo.setSyRenewal("1");
+                    break;
+            }
+        }
 
         quoteRespVo.setRiskList(riskList1);
         quoteRespVo.setKindList(kindList1);
@@ -999,6 +1046,7 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
         insAreaCompany.setMergeCostRate(quoteRespVo.getMergeCostRate());
         insAreaCompany.setSeriesTypeActualName(quoteRespVo.getSeriesTypeActualName());
         insAreaCompany.setXyhGrade(quoteRespVo.getXyhGrade());
+        insAreaCompany.setPricingCoefficient(quoteRespVo.getPricingCoefficient());
         InsOrders insOrders = insOrdersService.getById(orderId);
         //车船税
         if (!insOrders.getProductid().equals("034001") && !insOrders.getProductid().equals("034002")) {

+ 11 - 0
src/main/java/com/ydtech/modules/order/service/impl/ZijinOrderApiServiceImpl.java

@@ -3,6 +3,7 @@ package com.ydtech.modules.order.service.impl;
 import cn.hutool.core.util.ArrayUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.ydtech.constants.enums.InsuranceOrderPdf;
 import com.ydtech.constants.enums.InsuranceRisk;
@@ -52,6 +53,7 @@ import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 @Service
 @Slf4j
@@ -161,6 +163,15 @@ public class ZijinOrderApiServiceImpl implements ZijinOrderApiService {
         CalculatePremiumResponse calculatePremiumResponse = zijinRequestApiComponents.calculatePremium(calculatePremiumRequest,
                 httpHeaders, modelQueryRequest, message, queryActualValueRequest, REPEAT_NUMBER, RETRY_NUMBER);
 
+        if (CollectionUtils.isNotEmpty(calculatePremiumResponse.getCarInfoList()) && calculatePremiumResponse.getCarInfoList().size() > 1) {
+            List<CalculatePremiumResponse.CarInfoListDTO> collect = calculatePremiumResponse.getCarInfoList().stream().sorted(Comparator.comparing(CalculatePremiumResponse.CarInfoListDTO::getCarValue).reversed()).collect(Collectors.toList());
+
+            calculatePremiumRequest.getVehicleInfo().setVehicleStyleUniqueId(collect.get(0).getVehicleStyleUniqueId());
+            calculatePremiumResponse = zijinRequestApiComponents.calculatePremium(calculatePremiumRequest,
+                    httpHeaders, modelQueryRequest, message, queryActualValueRequest, REPEAT_NUMBER, RETRY_NUMBER);
+        }
+
+
         if(!calculatePremiumResponse.getRtnCode().equals(ResultEnum.C_0000)){
             QuoteRespVo resp  = new QuoteRespVo();
             InsOrders order = insOrdersService.getById(quoteVo.getOrderNo());

+ 5 - 0
src/main/java/com/ydtech/modules/protocol/entity/dto/PtlAgreementAttributionDto.java

@@ -18,6 +18,8 @@ public class PtlAgreementAttributionDto implements Serializable {
 
     private static final long serialVersionUID = 5438498729372152816L;
 
+    private String id;
+
     /**
      * 模板id
      */
@@ -48,6 +50,9 @@ public class PtlAgreementAttributionDto implements Serializable {
     @ApiModelProperty("保险公司密码")
     private String password;
 
+    @ApiModelProperty("手机号 用于验证码登录")
+    private String phone;
+
     @ApiModelProperty("环境?")
     private String check;
 }

+ 1 - 1
src/main/java/com/ydtech/modules/protocols/service/impl/PtlAgreementProductCostsNewServiceImpl.java

@@ -2451,7 +2451,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
                     item.setJqCostsProportion(null);
                 }
             }
-            if (StringUtils.isBlank(item.getNoCarCostsProportion()) || item.getNoCarCostsProportion().equals("0")) {
+            if (StringUtils.isBlank(item.getNoCostsProportion()) || item.getNoCostsProportion().equals("0")) {
                 item.setNoCostsProportion(null);
             }
         });

+ 2 - 1
src/main/java/com/ydtech/modules/scheme/service/impl/RuleFilteringServiceImpl.java

@@ -79,7 +79,8 @@ public class RuleFilteringServiceImpl implements RuleFilteringService {
         if(Objects.isNull(value)){
             PtlAgreementUndwrtRulesAttr one = ptlAgreementUndwrtRulesAttrService.getOne(new LambdaQueryWrapper<PtlAgreementUndwrtRulesAttr>()
                     .eq(PtlAgreementUndwrtRulesAttr::getAttrCode, attrLink.getAttrCode()));
-            throw new SystemException(one.getAttrName() + "规则校验失败,请检查");
+            return false;
+//            throw new SystemException(one.getAttrName() + "规则校验失败,请检查");
         }
         if (rulesAttr.getAttrType().equals("checkbox")) {
             return checkBoxEqual(attrLink, value);

+ 1 - 1
src/main/resources/mapper/modules/order/InsAreaCompanyMapper.xml

@@ -239,7 +239,7 @@
             AND json_extract(io.insureinfo, '$.name') = #{params.insuredName}
         </if>
         <if test="params.companyId != null and params.companyId != ''">
-            AND io.company_id = #{params.companyId}
+            AND iac.company_id = #{params.companyId}
         </if>
         <if test="params.engineNo != null and params.engineNo != ''">
             and JSON_EXTRACT( io.carinfo, '$.engineNo' ) = #{params.engineNo}

+ 10 - 1
src/main/resources/mapper/modules/order/InsOrdersMapper.xml

@@ -134,7 +134,8 @@
         <result property="payDate" column="payDate" jdbcType="TIMESTAMP"/>
         <result property="partnerCompaniesName" column="partnerCompaniesName" jdbcType="VARCHAR"/>
         <result property="equityType" column="equityType" jdbcType="INTEGER"/>
-        <result property="mergecostrate" column="mergecostrate" jdbcType="DOUBLE"/>
+        <result property="mergeCostRate" column="mergeCostRate" jdbcType="DOUBLE"/>
+        <result property="seriesTypeActualName" column="seriesTypeActualName" jdbcType="VARCHAR"/>
 
     </resultMap>
 
@@ -249,6 +250,8 @@
                iac.cross_insurance,
                iac.ubi_predicted_info_score,
                iac.merge_cost_rate,
+               iac.series_type_actual_name,
+               iac.xyh_grade,
                iac.signing_time as signingTime,
                iac.pay_date  as payDate,
                iac.agreement_id,
@@ -1608,6 +1611,9 @@
             ifo.jq_dept_premiums_level_3 + ifo.sy_dept_premiums_level_3 + ifo.no_dept_premiums_level_3 as dept_premiums_level_3,
             ifo.jq_dept_premiums_level_4 + ifo.sy_dept_premiums_level_4 + ifo.no_dept_premiums_level_4 as dept_premiums_level_4,
             ifo.jq_dept_premiums_level_5 + ifo.sy_dept_premiums_level_5 + ifo.no_dept_premiums_level_5 as dept_premiums_level_5,
+            ifo.first_level_user_id,
+            ifo.two_level_user_id,
+            ifo.three_level_user_id,
             ifo.first_detail_premiums,
             ifo.second_detail_premiums,
             ifo.third_detail_premiums,
@@ -1685,6 +1691,9 @@
             ifo.no_dept_premiums_level_3,
             ifo.no_dept_premiums_level_4,
             ifo.no_dept_premiums_level_5,
+            ifo.first_level_user_id,
+            ifo.two_level_user_id,
+            ifo.three_level_user_id,
             ifo.first_detail_premiums,
             ifo.second_detail_premiums,
             ifo.third_detail_premiums,