Przeglądaj źródła

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

haoyu 2 lat temu
rodzic
commit
566f02c06d
18 zmienionych plików z 569 dodań i 111 usunięć
  1. 13 13
      src/main/java/com/ydtech/aop/GlobalExceptionHandler.java
  2. 8 0
      src/main/java/com/ydtech/constants/enums/dict/insurance/VehicleType.java
  3. 42 10
      src/main/java/com/ydtech/modules/fee/dto/vo/RuleAttrMappingVo.java
  4. 119 58
      src/main/java/com/ydtech/modules/fee/service/impl/FeeRuleSchemeServiceNewImpl.java
  5. 17 4
      src/main/java/com/ydtech/modules/ins/model/CardUserInfo.java
  6. 1 0
      src/main/java/com/ydtech/modules/inv/service/impl/InvAccountOperateServiceImpl.java
  7. 11 0
      src/main/java/com/ydtech/modules/order/components/bohai/BoHaiRequestApiComponent.java
  8. 38 1
      src/main/java/com/ydtech/modules/order/entity/api/bohai/request/QuotationRequest.java
  9. 49 0
      src/main/java/com/ydtech/modules/order/entity/api/bohai/request/VehicleCheckCodeRequest.java
  10. 3 2
      src/main/java/com/ydtech/modules/order/entity/api/bohai/response/QuotationResponse.java
  11. 39 0
      src/main/java/com/ydtech/modules/order/entity/api/bohai/response/VehicleCheckCodeResponse.java
  12. 8 0
      src/main/java/com/ydtech/modules/order/entity/api/dajia/constants/TypeVehicleMapping.java
  13. 37 0
      src/main/java/com/ydtech/modules/order/entity/api/zijin/response/CalculatePremiumResponse.java
  14. 72 8
      src/main/java/com/ydtech/modules/order/service/impl/BoHaiOrderApiServiceImpl.java
  15. 29 4
      src/main/java/com/ydtech/modules/order/utils/StringSubStringUtils.java
  16. 15 0
      src/main/java/com/ydtech/modules/protocols/service/impl/PtlAgreementProductCostsNewServiceImpl.java
  17. 57 0
      src/main/java/com/ydtech/utils/DateUtil_N.java
  18. 11 11
      src/main/resources/application-pre.yml

+ 13 - 13
src/main/java/com/ydtech/aop/GlobalExceptionHandler.java

@@ -36,19 +36,19 @@ public class GlobalExceptionHandler {
     @ResponseBody
     public HttpResult exceptionGet(Exception e) {
         LOGGER.error("【系统异常】{}", e);
-        if (e.getStackTrace() != null && e.getStackTrace().length > 0) {
-            StackTraceElement element = e.getStackTrace()[0];
-            ErrorInfo errorInfo = new ErrorInfo(
-                    element.getClassName(),
-                    element.getFileName(),
-                    element.getMethodName(),
-                    String.valueOf(element.getLineNumber())
-            );
-
-            return HttpResult.error(-9999, errorInfo.toString());
-        }
-
-        return HttpResult.error(-1, "发生错误,请与管理员联系");
+//        if (e.getStackTrace() != null && e.getStackTrace().length > 0) {
+//            StackTraceElement element = e.getStackTrace()[0];
+//            ErrorInfo errorInfo = new ErrorInfo(
+//                    element.getClassName(),
+//                    element.getFileName(),
+//                    element.getMethodName(),
+//                    String.valueOf(element.getLineNumber())
+//            );
+//
+//            return HttpResult.error(-9999, errorInfo.toString());
+//        }
+
+        return HttpResult.error(-9999, "程序异常,请联系管理员");
     }
 
     @ExceptionHandler(value = DescribeException.class)

+ 8 - 0
src/main/java/com/ydtech/constants/enums/dict/insurance/VehicleType.java

@@ -29,5 +29,13 @@ public enum VehicleType implements IBaseEnum {
     // 状态  0 启用  1 不启用
     private final Integer status;
 
+    public static String getByCode(String code) {
+        for (VehicleType vehicleType : values()) {
+            if (vehicleType.getCode().equals(code)) {
+                return vehicleType.getDesc();
+            }
+        }
+        return null;
+    }
 
 }

+ 42 - 10
src/main/java/com/ydtech/modules/fee/dto/vo/RuleAttrMappingVo.java

@@ -3,15 +3,22 @@ package com.ydtech.modules.fee.dto.vo;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.ydtech.constants.enums.InsurKind;
+import com.ydtech.constants.enums.dict.insurance.VehicleType;
 import com.ydtech.modules.ins.model.vo.*;
 import com.ydtech.modules.order.entity.InsAreaCompany;
 import com.ydtech.modules.order.entity.InsOrders;
+import com.ydtech.modules.order.entity.api.dajia.constants.TypeVehicleMapping;
 import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
 import com.ydtech.modules.order.service.InsOrdersService;
+import com.ydtech.modules.protocol.entity.po.PtlNewCarJudgeRules;
+import com.ydtech.modules.protocols.entity.po.PtlAgreementUndwrtRulesAttr;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import org.springframework.beans.factory.annotation.Autowired;
 
+import java.time.LocalDate;
+import java.time.Period;
+import java.time.temporal.ChronoUnit;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Objects;
@@ -35,7 +42,8 @@ public class RuleAttrMappingVo {
         this.value = value;
     }
 
-    public static List<RuleAttrMappingVo> getRuleAttrMappingVoList(InsAreaCompany insAreaCompany, InsOrders insOrders) {
+    public static List<RuleAttrMappingVo> getRuleAttrMappingVoList(InsAreaCompany insAreaCompany, InsOrders insOrders,
+                                                                   List<PtlAgreementUndwrtRulesAttr> undwrtRulesAttrList, PtlNewCarJudgeRules carJudgeRule) {
         List<RuleAttrMappingVo> ruleAttrMappingVoList = new ArrayList<>();
         CarInfoVo carInfo = insOrders.getCarinfo().toJavaObject(CarInfoVo.class);
         //车牌号
@@ -47,9 +55,9 @@ public class RuleAttrMappingVo {
         //新车购置价
         ruleAttrMappingVoList.add(new RuleAttrMappingVo("PurchasePriceofNewVehicle", carInfo.getPurchasePrice()));
         //车辆用途
-        ruleAttrMappingVoList.add(new RuleAttrMappingVo("NatureOfUse", carInfo.getVehicleUse()));
+        ruleAttrMappingVoList.add(new RuleAttrMappingVo("NatureOfUse", TypeVehicleMapping.getByCode(carInfo.getVehicleUse())));
         //车辆种类
-        ruleAttrMappingVoList.add(new RuleAttrMappingVo("CarType", carInfo.getCimodelclass()));
+        ruleAttrMappingVoList.add(new RuleAttrMappingVo("CarType", VehicleType.getByCode(carInfo.getCimodelclass())));
         //核定载质量
         ruleAttrMappingVoList.add(new RuleAttrMappingVo("AuthorizedLoadWeight", carInfo.getLimitLoad()));
         //整备质量
@@ -61,7 +69,31 @@ public class RuleAttrMappingVo {
         //是否过户
         ruleAttrMappingVoList.add(new RuleAttrMappingVo("TransferVehicle", carInfo.isTransferFlag() ? "1" : "0"));
         //是否新车
-        ruleAttrMappingVoList.add(new RuleAttrMappingVo("NewAndOldCars", carInfo.isNoLicenseFlag() ? "1" : "0"));
+        //使用注册日期算出自然月 然后判断是否是新旧车
+        LocalDate registrationDate = LocalDate.parse(carInfo.getIssueDate());
+        LocalDate currentDate = LocalDate.now();
+        PtlAgreementUndwrtRulesAttr ptlAgreementUndwrtRulesAttr = undwrtRulesAttrList.stream().filter(x -> x.getAttrCode().equals("NewAndOldCars")).findFirst().get();
+        boolean isNoLicenseFlag = false;
+        if(carJudgeRule != null)
+        {
+            if(carJudgeRule.getUnitTypeCode().equals("天")){
+                long days = ChronoUnit.DAYS.between(registrationDate, currentDate);
+                if(days < Integer.parseInt(carJudgeRule.getUnitTypeValue()))
+                {
+                    isNoLicenseFlag = true;
+                }
+            }
+            if(carJudgeRule.getUnitTypeCode().equals("月")){
+                long months = ChronoUnit.MONTHS.between(registrationDate, currentDate);
+                if(months < Integer.parseInt(carJudgeRule.getUnitTypeValue()))
+                {
+                    isNoLicenseFlag = true;
+                }
+            }
+        }
+
+        ruleAttrMappingVoList.add(new RuleAttrMappingVo("NewAndOldCars", isNoLicenseFlag ? "1" : "0"));
+
         //发证日期
         ruleAttrMappingVoList.add(new RuleAttrMappingVo("DateofIssuance", carInfo.getIssueDate()));
         //车长
@@ -76,7 +108,7 @@ public class RuleAttrMappingVo {
         //车主 年龄
         ruleAttrMappingVoList.add(new RuleAttrMappingVo("CarOwnersAge", ownerInfo.getAge()));
         //车主 性别
-        ruleAttrMappingVoList.add(new RuleAttrMappingVo("CarOwnersSex", ownerInfo.getGender()));
+        ruleAttrMappingVoList.add(new RuleAttrMappingVo("CarOwnersSex", ownerInfo.getGender().equals("男") ? "1" : "2"));
         //车主 姓名
         ruleAttrMappingVoList.add(new RuleAttrMappingVo("CarOwnerName", ownerInfo.getName()));
 
@@ -86,7 +118,7 @@ public class RuleAttrMappingVo {
         //投保人 年龄
         ruleAttrMappingVoList.add(new RuleAttrMappingVo("ApplicantAge", policyHolderInfo.getAge()));
         //投保人 性别
-        ruleAttrMappingVoList.add(new RuleAttrMappingVo("ApplicantSex", policyHolderInfo.getGender()));
+        ruleAttrMappingVoList.add(new RuleAttrMappingVo("ApplicantSex", policyHolderInfo.getGender().equals("男") ? "1" : "2"));
 
         CustomerInfoVo insuredPersonInfo = insOrders.getInsureinfo().toJavaObject(CustomerInfoVo.class);
         //被保人 证件号码(前6位)
@@ -94,7 +126,7 @@ public class RuleAttrMappingVo {
         //被保人 年龄
         ruleAttrMappingVoList.add(new RuleAttrMappingVo("InsuredAge", insuredPersonInfo.getAge()));
         //被保人 性别
-        ruleAttrMappingVoList.add(new RuleAttrMappingVo("InsuredSex", insuredPersonInfo.getGender()));
+        ruleAttrMappingVoList.add(new RuleAttrMappingVo("InsuredSex", insuredPersonInfo.getGender().equals("男") ? "1" : "2"));
 
         List<KindInfoVo> kindInfoVos = insOrders.getKing().toJavaList(KindInfoVo.class);
         //险别信息
@@ -172,11 +204,11 @@ public class RuleAttrMappingVo {
         //非车险
         ruleAttrMappingVoList.add(new RuleAttrMappingVo("NonMotorInsurance", String.valueOf(insAreaCompany.getJypremium())));
         //总折扣率
-//        ruleAttrMappingVoList.add(new RuleAttrMappingVo("TotalDiscountRate", String.valueOf(insAreaCompany.())));
+        ruleAttrMappingVoList.add(new RuleAttrMappingVo("TotalDiscountRate", String.valueOf(insAreaCompany.getTotalAdjustRate())));
         //交强折扣
-//        ruleAttrMappingVoList.add(new RuleAttrMappingVo("CompulsoryInsuranceDiscount", String.valueOf(quoteRespVo.getJqAdjustRate())));
+        ruleAttrMappingVoList.add(new RuleAttrMappingVo("CompulsoryInsuranceDiscount", String.valueOf(insAreaCompany.getJqAdjustRate())));
         //商业折扣
-//        ruleAttrMappingVoList.add(new RuleAttrMappingVo("CommercialDiscount", String.valueOf(quoteRespVo.getSyAdjustRate())));
+        ruleAttrMappingVoList.add(new RuleAttrMappingVo("CommercialDiscount", String.valueOf(insAreaCompany.getSyAdjustRate())));
         //数值型总评分
         Pattern pattern = Pattern.compile("[0-9]*");
         if (insAreaCompany.getScore() != null) {

+ 119 - 58
src/main/java/com/ydtech/modules/fee/service/impl/FeeRuleSchemeServiceNewImpl.java

@@ -19,13 +19,14 @@ import com.ydtech.modules.order.entity.InsAreaCompany;
 import com.ydtech.modules.order.entity.InsOrders;
 import com.ydtech.modules.order.entity.vo.*;
 import com.ydtech.modules.order.service.InsOrdersService;
-import com.ydtech.modules.protocol.service.*;
+import com.ydtech.modules.protocol.entity.po.PtlNewCarJudgeRules;
+import com.ydtech.modules.protocol.service.PtlNewCarJudgeRulesService;
 import com.ydtech.modules.protocols.entity.po.*;
 import com.ydtech.modules.protocols.entity.vo.AgreementProductCosts;
 import com.ydtech.modules.protocols.service.*;
-import com.ydtech.utils.StringUtils;
 import com.ydtech.utils.idgen.IdGenerate;
-import org.apache.commons.lang3.ObjectUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -73,6 +74,9 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
     @Autowired
     private SysUserAccountService  sysUserAccountService;
 
+    @Autowired
+    private PtlNewCarJudgeRulesService ptlNewCarJudgeRulesService;
+
 
     @Override
     public QueryOrderFeeVo queryFeeOrderInfo(String companyId) {
@@ -89,6 +93,8 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
 
     }
 
+    private static final Logger log = LoggerFactory.getLogger("FeeRules");
+
     /**
      * 校验费用因子
      */
@@ -112,6 +118,7 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
             String costsId = verificationCosts(agreementProductCosts, insAreaCompany, insOrders);
             if(costsId != null) {
                 calcCosts(costsId, insAreaCompany);
+                log.debug("费用因子校验通过,子订单id:" + insAreaCompany.getId() + ",费用id:" + costsId);
             }
         }
     }
@@ -430,42 +437,53 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
         //匹配费用因子
         //获取所有费用属性
         List<PtlAgreementUndwrtRulesAttr> undwrtRulesAttrList = ptlAgreementUndwrtRulesAttrService.getUndwrtRulesAttrList();
+        //获取新旧车信息
+        PtlNewCarJudgeRules carJudgeRule = getCarJudgeRule(insAreaCompany.getCompanyId());
         //获取所有费用属性关联
-        List<RuleAttrMappingVo> ruleAttrMappingVoList = RuleAttrMappingVo.getRuleAttrMappingVoList(insAreaCompany, insOrders);
-
-        List<AgreementProductCosts> filterAgreementProductCosts = new ArrayList<>();
-
-        boolean isNoCar = false;
-        //查找是否有强制非车因子
-        for(int i=0;i<agreementProductCosts.size();i++) {
-            PtlAgreementProductCostsAttrLink ptlAgreementProductCostsAttrLink =
-                    agreementProductCosts.get(i).getCostsAttrLinks().stream().filter(x -> x.getAttrCode().equals("IsNonMotorInsurance")).findFirst().orElse(null);
-
-            if(!Objects.isNull(ptlAgreementProductCostsAttrLink)){
-                if(ptlAgreementProductCostsAttrLink.getMin().equals("1")){
-                    //只走强制非车的费用因子
-                    AgreementProductCosts productCosts = agreementProductCosts.get(i);
-                    filterAgreementProductCosts.add(productCosts);
-                    isNoCar = true;
-                }
-
-            }
-        }
-        if(filterAgreementProductCosts.isEmpty()){
-            filterAgreementProductCosts = agreementProductCosts;
-        }
+        List<RuleAttrMappingVo> ruleAttrMappingVoList = RuleAttrMappingVo.getRuleAttrMappingVoList(insAreaCompany, insOrders, undwrtRulesAttrList, carJudgeRule);
+
+//        List<AgreementProductCosts> filterAgreementProductCosts = new ArrayList<>();
+
+//        boolean isNoCar = false;
+//        //查找是否有强制非车因子
+//        for(int i=0;i<agreementProductCosts.size();i++) {
+//            PtlAgreementProductCostsAttrLink ptlAgreementProductCostsAttrLink =
+//                    agreementProductCosts.get(i).getCostsAttrLinks().stream().filter(x -> x.getAttrCode().equals("IsNonMotorInsurance")).findFirst().orElse(null);
+//
+//            if(!Objects.isNull(ptlAgreementProductCostsAttrLink)){
+//                if(ptlAgreementProductCostsAttrLink.getMin().equals("1")){
+//                    //只走强制非车的费用因子
+//                    AgreementProductCosts productCosts = agreementProductCosts.get(i);
+//                    filterAgreementProductCosts.add(productCosts);
+//                    isNoCar = true;
+//                }
+//
+//            }
+//        }
+//        if(filterAgreementProductCosts.isEmpty()){
+//            filterAgreementProductCosts = agreementProductCosts;
+//        }
         //是否强制走非车
-        if(isNoCar) {
-            if(judgementsIsNoCar(filterAgreementProductCosts.get(0).getCostsAttrLinks(),undwrtRulesAttrList,ruleAttrMappingVoList)){
-                return filterAgreementProductCosts.get(0).getId();
-            }
-        }else{
-            for (int i = 0; i < filterAgreementProductCosts.size(); i++) {
-                //判断是否匹配
-                if (judgements(filterAgreementProductCosts.get(i).getCostsAttrLinks(), undwrtRulesAttrList, ruleAttrMappingVoList)) {
-                    //返回 费用id   如果需要匹配非车的情况  将返回值返回list 后赛选
-                    return filterAgreementProductCosts.get(i).getId();
-                }
+//        if(isNoCar) {
+//            for(int i=0;i<filterAgreementProductCosts.size();i++) {
+//                if (judgementsIsNoCar(filterAgreementProductCosts.get(i).getCostsAttrLinks(), undwrtRulesAttrList, ruleAttrMappingVoList)) {
+//                    return filterAgreementProductCosts.get(i).getId();
+//                }
+//            }
+//        }else{
+//            for (int i = 0; i < filterAgreementProductCosts.size(); i++) {
+//                //判断是否匹配
+//                if (judgements(filterAgreementProductCosts.get(i).getCostsAttrLinks(), undwrtRulesAttrList, ruleAttrMappingVoList)) {
+//                    //返回 费用id   如果需要匹配非车的情况  将返回值返回list 后赛选
+//                    return filterAgreementProductCosts.get(i).getId();
+//                }
+//            }
+//        }
+        for (int i = 0; i < agreementProductCosts.size(); i++) {
+            //判断是否匹配
+            if (judgements(agreementProductCosts.get(i).getCostsAttrLinks(), undwrtRulesAttrList, ruleAttrMappingVoList)) {
+                //返回 费用id   如果需要匹配非车的情况  将返回值返回list 后赛选
+                return agreementProductCosts.get(i).getId();
             }
         }
         return null;
@@ -478,7 +496,7 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
         //获取所有承保规则属性
         List<PtlAgreementUndwrtRulesAttr> undwrtRulesAttrList = ptlAgreementUndwrtRulesAttrService.getUndwrtRulesAttrList();
         //获取所有费用属性关联
-        List<RuleAttrMappingVo> ruleAttrMappingVoList = RuleAttrMappingVo.getRuleAttrMappingVoList(insAreaCompany, insOrders);
+        List<RuleAttrMappingVo> ruleAttrMappingVoList = RuleAttrMappingVo.getRuleAttrMappingVoList(insAreaCompany, insOrders, undwrtRulesAttrList,getCarJudgeRule(insAreaCompany.getCompanyId()));
 
 
         for (int i = 0; i < ptlAgreementUndwrtRulesNews.size(); i++) {
@@ -507,30 +525,29 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
 
             //查找规则中的 传值属性
             RuleAttrMappingVo ruleAttrMappingVo = ruleAttrMappingVoList.stream().filter(x -> x.getAttrCode().equals(ptlAgreementProductCostsAttrLinks.get(finalI).getAttrCode())).findFirst().orElse(null);
+
+            //先跳过强制非车的检测
+            if(ptlAgreementProductCostsAttrLinks.get(i).getAttrCode().equals("IsNonMotorInsurance"))
+                continue;
+
             //如果查找不到 传值属性 直接费用对比失败
-            if(ruleAttrMappingVo == null)
+            if(ruleAttrMappingVo == null){
+                log.debug("规则匹配失败:" + ptlAgreementProductCostsAttrLinks.get(i).getAttrCode());
+                log.debug("传入的值找不到该属性:" + ptlAgreementProductCostsAttrLinks.get(finalI).getAttrCode());
                 return false;
+            }
+
             //查找 费用因子规则
             PtlAgreementUndwrtRulesAttr ptlAgreementUndwrtRulesAttr = rulesAttrs.stream().filter(x -> x.getAttrCode().equals(ptlAgreementProductCostsAttrLinks.get(finalI).getAttrCode())).findFirst().get();
-            //如果是多选 对value进行转换
-            if(ptlAgreementUndwrtRulesAttr.getAttrType().equals("checkbox")) {
-                PtlAgreementUndwrtRulesDictLabal ptlAgreementUndwrtRulesDictLabal = ptlAgreementUndwrtRulesAttr.getDictLabal().stream().filter(x ->
-                        x.getCode().equals(ruleAttrMappingVo.getValue())).findFirst().orElse(null);
-                ruleAttrMappingVo.setValue(ptlAgreementUndwrtRulesDictLabal.getName());
-            }
-            //如果是单选 并且是 性别的话 转换为code
-            if(ptlAgreementUndwrtRulesAttr.getAttrType().equals("radio"))
-            {
-                if("CarOwnersSex".equals(ptlAgreementUndwrtRulesAttr.getAttrCode()) || "ApplicantSex".equals(ptlAgreementUndwrtRulesAttr.getAttrCode()) ||
-                        "InsuredSex".equals(ptlAgreementUndwrtRulesAttr.getAttrCode())){
-                    PtlAgreementUndwrtRulesDictLabal ptlAgreementUndwrtRulesDictLabal = ptlAgreementUndwrtRulesAttr.getDictLabal().stream().filter(x ->
-                            x.getName().equals(ruleAttrMappingVo.getValue())).findFirst().orElse(null);
-                    ruleAttrMappingVo.setValue(ptlAgreementUndwrtRulesDictLabal.getCode());
-                }
-            }
+
             useFlag = attrEqual(ptlAgreementProductCostsAttrLinks.get(i), ptlAgreementUndwrtRulesAttr, ruleAttrMappingVo.getValue());
-            if(!useFlag)
+            if(!useFlag){
+                log.debug("规则匹配失败:" + ptlAgreementProductCostsAttrLinks.get(i).getAttrCode());
+                log.debug("检验的值:" + ptlAgreementProductCostsAttrLinks.get(i).getMin());
+                log.debug("传入的值:" + ruleAttrMappingVo.getValue());
                 return false;
+            }
+
         }
         return useFlag;
     }
@@ -605,9 +622,27 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
                 return false;
             //查找 费用因子规则
             PtlAgreementUndwrtRulesAttr ptlAgreementUndwrtRulesAttr = rulesAttrs.stream().filter(x -> x.getAttrCode().equals(ptlAgreementProductCostsAttrLinks.get(finalI).getAttrCode())).findFirst().get();
+            //如果是多选 对value进行转换
+            if(ptlAgreementUndwrtRulesAttr.getAttrType().equals("checkbox")) {
+                PtlAgreementUndwrtRulesDictLabal ptlAgreementUndwrtRulesDictLabal = ptlAgreementUndwrtRulesAttr.getDictLabal().stream().filter(x ->
+                        x.getCode().equals(ruleAttrMappingVo.getValue())).findFirst().orElse(null);
+                ruleAttrMappingVo.setValue(ptlAgreementUndwrtRulesDictLabal.getName());
+            }
+            //如果是单选 并且是 性别的话 转换为code
+            if(ptlAgreementUndwrtRulesAttr.getAttrType().equals("radio"))
+            {
+                if("CarOwnersSex".equals(ptlAgreementUndwrtRulesAttr.getAttrCode()) || "ApplicantSex".equals(ptlAgreementUndwrtRulesAttr.getAttrCode()) ||
+                        "InsuredSex".equals(ptlAgreementUndwrtRulesAttr.getAttrCode())){
+                    PtlAgreementUndwrtRulesDictLabal ptlAgreementUndwrtRulesDictLabal = ptlAgreementUndwrtRulesAttr.getDictLabal().stream().filter(x ->
+                            x.getName().equals(ruleAttrMappingVo.getValue())).findFirst().orElse(null);
+                    ruleAttrMappingVo.setValue(ptlAgreementUndwrtRulesDictLabal.getCode());
+                }
+            }
             useFlag = attrEqual(ptlAgreementProductCostsAttrLinks.get(i), ptlAgreementUndwrtRulesAttr, ruleAttrMappingVo.getValue());
-            if(!useFlag)
+            if(!useFlag) {
+                System.out.printf("规则匹配失败:" + ptlAgreementProductCostsAttrLinks.get(i).getAttrCode());
                 return false;
+            }
         }
         return useFlag;
     }
@@ -773,12 +808,18 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
      * @return
      */
     private boolean selectEqual(PtlAgreementProductCostsAttrLink ptlAgreementProductCostsAttrLink, String value){
-        if(ptlAgreementProductCostsAttrLink.getMin().contains(value)){
+        if(ptlAgreementProductCostsAttrLink.getMin() != null && ptlAgreementProductCostsAttrLink.getMin().contains(value)){
             return true;
         }
         return false;
     }
 
+    /**
+     * 属性为选择框判断
+     * @param ptlAgreementUndwrtRulesAttrLink
+     * @param value
+     * @return
+     */
     private boolean selectEqual(PtlAgreementUndwrtRulesAttrLink ptlAgreementUndwrtRulesAttrLink, String value){
         if(ptlAgreementUndwrtRulesAttrLink.getMin() != null && ptlAgreementUndwrtRulesAttrLink.getMin().contains(value)){
             return false;
@@ -786,6 +827,12 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
         return true;
     }
 
+    /**
+     * 属性为单选框判断
+     * @param ptlAgreementProductCostsAttrLink
+     * @param value
+     * @return
+     */
     private boolean radioEqual(PtlAgreementProductCostsAttrLink ptlAgreementProductCostsAttrLink, String value){
         //新能源判断
         if("NewEnergy".equals(ptlAgreementProductCostsAttrLink.getAttrCode())){
@@ -820,4 +867,18 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
         }
         return true;
     }
+
+    /**
+     * 获取车辆新旧车信息
+     * @param companyId
+     * @return
+     */
+    private PtlNewCarJudgeRules getCarJudgeRule(String companyId){
+        //获取车辆新旧车信息
+        List<PtlNewCarJudgeRules> list = ptlNewCarJudgeRulesService.list(new LambdaQueryWrapper<PtlNewCarJudgeRules>().eq(PtlNewCarJudgeRules::getCompanyId, companyId));
+        if(list.size()>0){
+            return list.get(0);
+        }
+        return null;
+    }
 }

+ 17 - 4
src/main/java/com/ydtech/modules/ins/model/CardUserInfo.java

@@ -13,8 +13,10 @@ import lombok.Data;
 @Data
 @ApiModel(value = "行驶证用户信息")
 public class CardUserInfo {
+    @ApiModelProperty("总质量")
     private String grossMass;
     private String approvedLoad;
+    @ApiModelProperty("车牌号")
     private String plateNo;
     private String plateType;
     private String remark;
@@ -31,19 +33,30 @@ public class CardUserInfo {
     private String approvedPassengersCapacity;
     private String backOcrID;
     private String motorTypeCode;
+
     private String motorUsageTypeCode;
+
+    @ApiModelProperty("车辆识别代号")
     private String vIN;
+
+    @ApiModelProperty("发证日期")
     private String issueDate;
+
     private String tractionMass;
+
+    @ApiModelProperty("注册日期")
     private String registerDate;
 
-    //新增 核定载质量
+    @ApiModelProperty("核定载质量")
     private String limitLoad;
-    //新增 使用性质
+
+    @ApiModelProperty("使用性质")
     private String useNature;
-    //新增 车辆类型
+
+    @ApiModelProperty("车辆类型")
     private String category;
-    //新增 车辆用途
+
+    @ApiModelProperty("车辆用途")
     private String vehicleUse;
 
     //add 车主 lig 2023-09-21

+ 1 - 0
src/main/java/com/ydtech/modules/inv/service/impl/InvAccountOperateServiceImpl.java

@@ -266,6 +266,7 @@ public class InvAccountOperateServiceImpl extends ServiceImpl<InvAccountOperateM
 
                 byId.setPayoutMoney(new BigDecimal(byId.getPayoutMoney()).subtract(new BigDecimal(invAccountOperate.getApplyAmount())).toString());
                 byId.setNotPayoutMoney(new BigDecimal(byId.getNotPayoutMoney()).add(new BigDecimal(invAccountOperate.getApplyAmount())).toString());
+                byId.setClearFlag("0");
                 invAccountIncoiceService.updateById(byId);
             }
 

+ 11 - 0
src/main/java/com/ydtech/modules/order/components/bohai/BoHaiRequestApiComponent.java

@@ -242,4 +242,15 @@ public class BoHaiRequestApiComponent {
         return stringStringMap.get("content");
     }
 
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/4/7 10:01
+     *  @param request  请求
+     *  @param sysSourceCode  编码
+     *  @Description: 获取交管查询校验码接口  请求 3.17
+     */
+    public VehicleCheckCodeResponse getVehicleCheckCode(VehicleCheckCodeRequest request, String sysSourceCode) throws Exception {
+        return verificationResponse(request, properties.getUrl(), VehicleCheckCodeResponse.class, sysSourceCode, RequestType.Z00003);
+    }
 }

+ 38 - 1
src/main/java/com/ydtech/modules/order/entity/api/bohai/request/QuotationRequest.java

@@ -10,7 +10,6 @@ import com.ydtech.modules.ins.model.vo.KindInfoVo;
 import com.ydtech.modules.ins.model.vo.RiskInfoVo;
 import com.ydtech.modules.order.constants.InsuranceTypeCorrespondence;
 import com.ydtech.modules.order.entity.api.bohai.constants.Coverages;
-import com.ydtech.modules.order.entity.api.bohai.constants.RequestType;
 import com.ydtech.modules.order.entity.config.BoHaiConfigureParameters;
 import com.ydtech.modules.order.entity.vo.bohai.BoHaiQuoteAccidentVo;
 import com.ydtech.utils.StringUtils;
@@ -51,6 +50,9 @@ public class QuotationRequest extends BoHaiBaseRequest {
     @JsonProperty("unAutos")
     private List<UnAutoDTO> unAutos;
 
+    //@JsonProperty("checkInfoList")
+    //private List<CheckInfoDTO> checkInfoList=null;
+
     public QuotationRequest(BoHaiConfigureParameters parameters,
                             List<RiskInfoVo> riskList,
                             List<KindInfoVo> kindList,
@@ -246,4 +248,39 @@ public class QuotationRequest extends BoHaiBaseRequest {
         @JsonProperty("busSrePhone")
         private String busSrePhone;
     }
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/4/7 10:25
+     *  @Description:  交管验证码信息
+     */
+    @NoArgsConstructor
+    @Data
+    public static class CheckInfoDTO implements Serializable {
+
+        private static final long serialVersionUID = 422012236525748899L;
+        /***
+         *   Y	1:问题形式,2:图形验证码形式
+         */
+        @JsonProperty("answerFlag")
+        private String answerFlag;
+        /***
+         *   Y	问题类型为1时为回答问题的答案,
+         * 问题类型为2时为图形验证码值
+         */
+        @JsonProperty("answer")
+        private String answer;
+        /***
+         *  Y	返回值原样送请求
+         * Y:交强险,N:商业险
+         */
+        @JsonProperty("isTrafficQuestion")
+        private String isTrafficQuestion;
+
+        public CheckInfoDTO(String answerFlag, String answer, String isTrafficQuestion) {
+            this.answerFlag = answerFlag;
+            this.answer = answer;
+            this.isTrafficQuestion = isTrafficQuestion;
+        }
+    }
 }

+ 49 - 0
src/main/java/com/ydtech/modules/order/entity/api/bohai/request/VehicleCheckCodeRequest.java

@@ -0,0 +1,49 @@
+package com.ydtech.modules.order.entity.api.bohai.request;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.ydtech.modules.order.entity.config.BoHaiConfigureParameters;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+
+/**
+ *  @version  获取交管查询校验码接口  入参参数封装
+ *  @author: hxl
+ *  @Date: 2024/4/7 9:44
+ *  @Description:
+ */ 
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+@Data
+public class VehicleCheckCodeRequest extends BoHaiBaseRequest {
+
+    private static final long serialVersionUID = 895674542981964966L;
+
+    /**
+     * 车架号
+     */
+    @JsonProperty("vin")
+    private String vin;
+
+    /**
+     * 发动机号
+     */
+    @JsonProperty("engineNo")
+    private String engineNo;
+
+    /**
+     * 号牌号码
+     */
+    @JsonProperty("plateNo")
+    private String plateNo;
+
+
+    public VehicleCheckCodeRequest(BoHaiConfigureParameters parameters, String orderNo, String vin,String engineNo,String plateNo) {
+        this.setBaseParam(parameters, orderNo);
+        this.vin = vin;
+        this.engineNo = engineNo;
+        this.plateNo = plateNo;
+    }
+
+}

+ 3 - 2
src/main/java/com/ydtech/modules/order/entity/api/bohai/response/QuotationResponse.java

@@ -1,11 +1,9 @@
 package com.ydtech.modules.order.entity.api.bohai.response;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
-import com.ydtech.utils.StringUtils;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NoArgsConstructor;
-import org.apache.commons.lang3.ObjectUtils;
 
 import java.io.Serializable;
 import java.util.List;
@@ -178,6 +176,9 @@ public class QuotationResponse extends BoHaiBaseResponse {
             private String startDate;
             @JsonProperty("endDate")
             private String endDate;
+            //  add by hxl  2024-04-07
+            @JsonProperty("errorMsg")
+            private String errorMsg;
 
             @NoArgsConstructor
             @Data

+ 39 - 0
src/main/java/com/ydtech/modules/order/entity/api/bohai/response/VehicleCheckCodeResponse.java

@@ -0,0 +1,39 @@
+package com.ydtech.modules.order.entity.api.bohai.response;
+
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+
+/**
+ *  @version   获取交管查询校验码接口  出参参数封装
+ *  @author: hxl
+ *  @Date: 2024/4/7 9:52
+ *  @Description:
+ */
+@NoArgsConstructor
+@Data
+public class VehicleCheckCodeResponse extends BoHaiBaseResponse {
+
+    private static final long serialVersionUID = -6468400287877400921L;
+
+
+    @JsonProperty("data")
+    private DataDTO data;
+
+    @NoArgsConstructor
+    @Data
+    public static class DataDTO {
+        /***
+         * 图形校验码字
+         */
+        @JsonProperty("checkCode")
+        private String checkCode;
+        /***
+         * 查询码
+         */
+        @JsonProperty("checkNo")
+        private String checkNo;
+    }
+}

+ 8 - 0
src/main/java/com/ydtech/modules/order/entity/api/dajia/constants/TypeVehicleMapping.java

@@ -27,4 +27,12 @@ public enum TypeVehicleMapping {
     // 商业
     private final String cUsageCdeSy;
 
+    public static String getByCode(String code){
+        for (TypeVehicleMapping typeVehicleMapping : values()) {
+            if (typeVehicleMapping.getCode().equals(code)) {
+                return typeVehicleMapping.getDesc();
+            }
+        }
+        return null;
+    }
 }

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

@@ -887,10 +887,47 @@ public class CalculatePremiumResponse extends BaseResponse implements Serializab
         @JsonProperty("zjPrornk")
         private String zjPrornk;
 
+        @JsonProperty("ubiPredictedInfo")
+        private UbiPredictedInfoDTO ubiPredictedInfo;
+
         @JsonProperty("zjRate")
         private String zjRate;
 
         @JsonProperty("zjStatus")
         private String zjStatus;
+
+        @Data
+        public static class UbiPredictedInfoDTO implements Serializable{
+
+            private static final long serialVersionUID = -3821813924645067621L;
+
+            private  String id;
+
+            private  String vin;
+
+            private  String resultFlag;
+
+            private  String score;
+
+            private  String vehCheck;
+
+            private  String proba;
+
+            private  String dwlPurePremium;
+
+            private  String tplPurePremium;
+
+            private  String clpPurePremium;
+
+            private  String dwlLossRate;
+
+            private  String tplLossRate;
+
+            private  String clpLossRate;
+
+            private  String vehicleLossRate;
+
+        }
+
     }
 }

+ 72 - 8
src/main/java/com/ydtech/modules/order/service/impl/BoHaiOrderApiServiceImpl.java

@@ -137,11 +137,14 @@ public class BoHaiOrderApiServiceImpl implements BoHaiOrderApiService {
 
         // 车辆实际价值
         String currentValue = vehicleConfirmationResponse.getData().getVehicleModels().get(0).getCurrentValue();
-
         // 4. 报价接口
         QuotationRequest quotationRequest = new QuotationRequest(parameters, quoteInfoVo.getRiskList(), quoteInfoVo.getKindList(),
                 currentValue, orderNo, carInfo, quoteVo.getAccidentalDrivingVo());
         QuotationResponse response = boHaiRequestApiComponent.quotation(quotationRequest, parameters.getSysSourceCode());
+        //商业险重复投保  重复投保保单信息 :保单号:314042303060007485车牌号:晋A881SR车架号:LMGAC1381K1535834发动机号:F699317保险公司代码:YAIC签单日期:20230414起保日期:202305030000终保日期:202405030000险别:机动车第三者责任保险,附加医保外用药责任险(机动车第三者责任保险)
+        response = getQuotationResponse(response,quotationRequest,parameters.getSysSourceCode());
+
+        //response = getQuotationResponseNew(quoteInfoVo, quoteVo, parameters, orderNo, carInfo, currentValue, response);
         //add by  2024-04-03  会发生重复投保   算费微服务返回报错信息_保信返回错误信息:
         // 平台返回错误信息号牌号码“晋J60L55”的保单发生重复投保,与其重复投保的其它公司的保单信息如下:投保确认码 02PAIC140023031919549498257741;保单号 13312993901973801278;起保日期 2023-04-11 00:00;终保日期 2024-04-11 00:00;号牌号码 晋J60L55;号牌种类 02;车架号 LZWADAGA5LG477030;发动机号 8LB1921291;地区 山西。
         //重新赋值交强的投保开始日期
@@ -156,18 +159,22 @@ public class BoHaiOrderApiServiceImpl implements BoHaiOrderApiService {
                     trafficPolicyDTOEndDateStr=trafficPolicyDTOEndDateStr+":00";
                     // 结束日期为59:59:59
                     String endDateStr = DateUtil_N.getNextYearDateStr(trafficPolicyDTOEndDateStr);
-                    QuotationRequest quotationRequestNew = new QuotationRequest(parameters, quoteInfoVo.getRiskList(), quoteInfoVo.getKindList(),
-                            currentValue, orderNo, carInfo, quoteVo.getAccidentalDrivingVo());
-                    QuotationRequest.TrafficPolicyDTO trafficPolicy = quotationRequestNew.getTrafficPolicy();
+                    QuotationRequest.TrafficPolicyDTO trafficPolicy = quotationRequest.getTrafficPolicy();
                     trafficPolicy.setStartDate(trafficPolicyDTOEndDateStr);
                     trafficPolicy.setEndDate(endDateStr);
-                    quotationRequestNew.setTrafficPolicy(trafficPolicy);
-                    response = boHaiRequestApiComponent.quotation(quotationRequestNew, parameters.getSysSourceCode());
+                    quotationRequest.setTrafficPolicy(trafficPolicy);
+                    response = boHaiRequestApiComponent.quotation(quotationRequest, parameters.getSysSourceCode());
+                    // 判断是否商业险重复投保
+                    response = getQuotationResponse(response,quotationRequest,parameters.getSysSourceCode());
+
                     if (!ResponseCode.R_Z00001.getCode().equals(response.getResponseCode())) {
-                        throw new SystemException(responseMsg);
+                        throw new SystemException(response.getResponseMsg());
                     }
                 }
-                //商业重复投保
+                // add by hxl  2024-04-07  报价接口报错  算费微服务返回报错信息_保信返回错误信息:录入的校验码有误
+                // 需要调用 获取交管查询校验码接口   传入到报价参数中  暂未复现不处理 注释掉
+            }else if(responseMsg.contains("录入的校验码有误")){
+                //response = getQuotationResponseNew(quoteInfoVo, quoteVo, parameters, orderNo, carInfo, currentValue, response);
             }else{
                 throw new SystemException(responseMsg);
             }
@@ -176,6 +183,63 @@ public class BoHaiOrderApiServiceImpl implements BoHaiOrderApiService {
 
         return getQuoteRespVo(response, quoteInfoVo, vehicleModelsDTO, ptlAgreementAttribution, orderNo, accidentalDrivingVo);
     }
+    /**
+     *  @version  报价传递获取交管查询校验码 报错  未知异常,请联系管理员
+     *  @author: hxl
+     *  @Date: 2024/4/7 16:50
+     *  @Description:
+     */
+    private QuotationResponse getQuotationResponseNew(BaseQuoteInfoVo quoteInfoVo, BaseQuoteVo<List<BoHaiQuoteAccidentVo>> quoteVo, BoHaiConfigureParameters parameters, String orderNo, CarInfoVo carInfo, String currentValue, QuotationResponse response) throws Exception {
+        VehicleCheckCodeRequest vehicleCheckCodeRequest = new VehicleCheckCodeRequest(parameters, orderNo, carInfo.getVinNo(), carInfo.getEngineNo(), carInfo.getLicenseNo());
+        VehicleCheckCodeResponse vehicleCheckCodeResponse = boHaiRequestApiComponent.getVehicleCheckCode(vehicleCheckCodeRequest, parameters.getSysSourceCode());
+        if(ResponseCode.R_Z00001.getCode().equals(vehicleCheckCodeResponse.getResponseCode())){
+            String checkCode = vehicleCheckCodeResponse.getData().getCheckCode();
+            //重新报价
+            QuotationRequest quotationRequestNew = new QuotationRequest(parameters, quoteInfoVo.getRiskList(), quoteInfoVo.getKindList(),
+                    currentValue, orderNo, carInfo, quoteVo.getAccidentalDrivingVo());
+            List<QuotationRequest.CheckInfoDTO> checkInfoList=new ArrayList<QuotationRequest.CheckInfoDTO>();
+            QuotationRequest.CheckInfoDTO  checkInfo=new QuotationRequest.CheckInfoDTO("2",checkCode,"N");
+            checkInfoList.add(checkInfo);
+            //quotationRequestNew.setCheckInfoList(checkInfoList);
+            response = boHaiRequestApiComponent.quotation(quotationRequestNew, parameters.getSysSourceCode());
+            if (!ResponseCode.R_Z00001.getCode().equals(response.getResponseCode())) {
+                throw new SystemException(response.getResponseMsg());
+            }
+        }
+        return response;
+    }
+
+    /**
+     *  @version  商业险发生重复投保
+     *  @author: hxl
+     *  @Date: 2024/4/7 16:07
+     *  @Description:
+     */
+    private QuotationResponse getQuotationResponse(QuotationResponse response, QuotationRequest quotationRequest,String sysSourCode) throws Exception {
+        if(ResponseCode.R_Z00001.getCode().equals(response.getResponseCode()) && response.getData().getBusinessPolicy().getErrorMsg()!=null){
+            String errorMsg = response.getData().getBusinessPolicy().getErrorMsg();
+            if(errorMsg.contains("重复投保")){
+                //重新给商业险的开始和结束时间赋值赋值重新填报
+                String businessPolicyEndDateStr = StringSubStringUtils.subjectStringContentByBusinessPolicyEndDate(errorMsg,"终保日期:");
+                if(!"".equals(businessPolicyEndDateStr) && !"".equals(businessPolicyEndDateStr)){
+                    //结束投保日期为开始日期,结束日期为结束投保日期后一年的日期
+                    businessPolicyEndDateStr=businessPolicyEndDateStr+"00";
+                    String beginDateStr = DateUtil_N.strAllToDateToStr(businessPolicyEndDateStr, "yyyyMMddHHmmss", "yyyy-MM-dd HH:mm:ss");
+                    // 结束日期为59:59:59
+                    String endDateStr = DateUtil_N.getNextYearDateStrTranfer(businessPolicyEndDateStr);
+                    QuotationRequest.BusinessPolicyDTO businessPolicy = quotationRequest.getBusinessPolicy();
+                    businessPolicy.setStartDate(beginDateStr);
+                    businessPolicy.setEndDate(endDateStr);
+                    quotationRequest.setBusinessPolicy(businessPolicy);
+                    response = boHaiRequestApiComponent.quotation(quotationRequest, sysSourCode);
+                    if (!ResponseCode.R_Z00001.getCode().equals(response.getResponseCode())) {
+                        throw new SystemException(response.getResponseMsg());
+                    }
+                }
+            }
+        }
+        return response;
+    }
 
     /**
      * @version 调用车型查询和车辆确认

+ 29 - 4
src/main/java/com/ydtech/modules/order/utils/StringSubStringUtils.java

@@ -13,10 +13,13 @@ public class StringSubStringUtils {
     public static void main(String[] args) {
        // String input = "ESB车型及纯风险保费查询服务返回错误信息_选择车辆的行业车型编码(BBWABBUA0005)在平台不存在!请使用正确的行业车型编码(BBWABBUB0007)";
        // String result = extractLastParenthesesContent(input);
-        String input="算费微服务返回报错信息_保信返回错误信息:平台返回错误信息号牌号码“晋J60L55”的保单发生重复投保,与其重复投保的其它公司的保单信息如下:投保确认码 02PAIC140023031919549498257741;保单号 13312993901973801278;起保日期 2023-04-11 00:00;终保日期 2024-04-11 00:00;号牌号码 晋J60L55;号牌种类 02;车架号 LZWADAGA5LG477030;发动机号 8LB1921291;地区 山西。";
-        String keywords=":";
-        String key="起保日期";
-        String result = subjectStringContentByTrafficPolicyDTOBenginDate(input,keywords,key);
+       // String input="算费微服务返回报错信息_保信返回错误信息:平台返回错误信息号牌号码“晋J60L55”的保单发生重复投保,与其重复投保的其它公司的保单信息如下:投保确认码 02PAIC140023031919549498257741;保单号 13312993901973801278;起保日期 2023-04-11 00:00;终保日期 2024-04-11 00:00;号牌号码 晋J60L55;号牌种类 02;车架号 LZWADAGA5LG477030;发动机号 8LB1921291;地区 山西。";
+       // String keywords=":";
+      //  String key="起保日期";
+       // String result = subjectStringContentByTrafficPolicyDTOBenginDate(input,keywords,key);
+         String input="重复投保保单信息 :保单号:314042303060007485车牌号:晋A881SR车架号:LMGAC1381K1535834发动机号:F699317保险公司代码:YAIC签单日期:20230414起保日期:202305030000终保日期:202405030000险别:机动车第三者责任保险,附加医保外用药责任险(机动车第三者责任保险)";
+         String keywords="终保日期:";
+        String result = subjectStringContentByBusinessPolicyEndDate(input, keywords);
         System.out.println(result);
     }
     /**
@@ -65,4 +68,26 @@ public class StringSubStringUtils {
         }
         return returnStr;
     }
+    /**
+    * @Description  截取商业险报错信息
+     * 重复投保保单信息 :保单号:314042303060007485车牌号:晋A881SR车架号:LMGAC1381K1535834发动机号:F699317保险公司代码:YAIC签单日期:20230414起保日期:202305030000终保日期:202405030000险别:机动车第三者责任保险,附加医保外用药责任险(机动车第三者责任保险)
+    * @Author  hxl
+    * @Date   2024/4/7 15:20
+    * @Param
+    * @Return
+    * @Exception
+    *
+    */
+    public static String subjectStringContentByBusinessPolicyEndDate(String allStr,String keywords) {
+        int startIndex = allStr.indexOf(keywords);
+        String returnStr="";
+        if (startIndex != -1) {
+            //截取与其重复投保的其它公司的保单信息如下:之后的字符串
+             allStr = allStr.substring(startIndex + keywords.length());
+            //202405030000险别:机动车第三者责任保险,附加医保外用药责任险(机动车第三者责任保险)
+            //截取前12为日期为终保日期
+            returnStr = allStr.substring(0, 11);
+        }
+        return returnStr;
+    }
 }

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

@@ -317,6 +317,11 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
         List<PtlAgreementProductCostsAttrLink> costsAttrLink = new ArrayList<>();
         costsAttrLinks.forEach(x -> {
             PtlAgreementProductCostsAttrLinkHistory costsAttrLinkHistory = new PtlAgreementProductCostsAttrLinkHistory();
+            //处理中文逗号
+            if(x.getMin() != null && x.getMin().contains(","))
+            {
+                x.setMin(x.getMin().replace(",",","));
+            }
 
             //单独处理车牌号
             if ("LicenseNo".equals(x.getAttrCode()) && (x.getMin() != null && !x.getMin().equals(""))) {
@@ -409,6 +414,16 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
         List<PtlAgreementProductCostsAttrLink> costsAttrLinks = agreementProductCosts.getCostsAttrLinks();
         List<PtlAgreementProductCostsAttrLink> costsAttrLink = new ArrayList<>();
         costsAttrLinks.forEach(x -> {
+            //转换数组
+            if(x.getMinArray() != null && x.getMinArray().length > 0){
+                x.setMin(String.join(",",x.getMinArray()));
+            }
+
+            //处理中文逗号
+            if(x.getMin() != null && x.getMin().contains(","))
+            {
+                x.setMin(x.getMin().replace(",",","));
+            }
             //单独处理车牌号
             if ("LicenseNo".equals(x.getAttrCode()) && (x.getMin() != null && x.getMin() != "")) {
                 x.setOperator(x.getDictLabal().getJSONObject(0).getString("parentNumber"));

+ 57 - 0
src/main/java/com/ydtech/utils/DateUtil_N.java

@@ -25,6 +25,8 @@ public class DateUtil_N {
     private static final String DATEFORMAT = "yyyy-MM-dd";
 
     private static final String DATEFORMATALL = "yyyy-MM-dd HH:mm:ss";
+
+    private static final String DATEFORMATALLSHORT = "yyyyMMddHHmmss";
     public static Date getNextNDate;
 
     private DateUtil_N() {
@@ -766,4 +768,59 @@ public class DateUtil_N {
         String newDateStr = formatDate(newDate, "yyyy-MM-dd HH:mm:ss");
         return newDateStr;
     }
+    /**
+     *  @version  商业险字符串计算下一年的时间
+     *  @author: hxl
+     *  @Date: 2024/4/7 15:36
+     *  @Description:
+     */
+    public static String getNextYearDateStrTranfer(String str) {
+
+        Date beginDate = strAllToDateT(str,DATEFORMATALLSHORT);
+        Date nextYear = getNextYear(beginDate);
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(nextYear);
+        // 减去一秒
+        calendar.add(Calendar.SECOND, -1);
+        Date newDate = calendar.getTime();
+        String newDateStr = formatDate(newDate, "yyyy-MM-dd HH:mm:ss");
+        return newDateStr;
+    }
+
+   /**
+    *  @version  字符串转换格式 yyyyMMddHHmmss
+    *  @author: hxl
+    *  @Date: 2024/4/7 15:38
+    *  @Description:
+    */
+    public static Date strAllToDateT(String str,String formatStr) {
+
+        SimpleDateFormat format = new SimpleDateFormat(formatStr);
+        Date date = null;
+        try {
+            date = format.parse(str);
+        } catch (ParseException e) {
+            logger.info(e.getMessage());
+        }
+        return date;
+    }
+    /**
+     *  @version  格式化字符串
+     *  @author: hxl
+     *  @Date: 2024/4/7 16:40
+     *  @Description:
+     */
+    public static String strAllToDateToStr(String dateString,String formatStrOld,String formatStrNew) {
+
+        SimpleDateFormat inputFormat = new SimpleDateFormat(formatStrOld);
+        SimpleDateFormat outputFormat = new SimpleDateFormat(formatStrNew);
+        String formattedDate="";
+        try {
+            Date date = inputFormat.parse(dateString);
+            formattedDate = outputFormat.format(date);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return formattedDate;
+    }
 }

+ 11 - 11
src/main/resources/application-pre.yml

@@ -95,9 +95,9 @@ spring:
   datasource:
     driver-class-name: com.mysql.cj.jdbc.Driver
     druid:
-      password: 'Iy$@$koH@oURxyvw'
-      url: jdbc:mysql://rm-8vbaejxof1xh06o9r.mysql.zhangbei.rds.aliyuncs.com:3306/agent?serverTimezone=Asia/Shanghai&allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true
-      username: sxzgkj
+      url: jdbc:mysql://47.92.254.66:3306/agent-pro?serverTimezone=Asia/Shanghai&allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true
+      username: root
+      password: '@RqGHG#KZ*C9ytkQ'
       # 连接池配置
       initial-size: 5                                #连接池的初始化连接数。
       max-active: 20                                 #连接池的最大活跃连接数。
@@ -177,7 +177,7 @@ yc:
   #api方式
   api:
     # 回调地址
-    payCallBack: http://sxzgkj.baoxianzhanggui.com/web-api/api/yongCheng/callBack
+    payCallBack: https://sxzgkj.baoxianzhanggui.com/web-api/api/yongCheng/callBack
     url: http://www.yongcheng.com:17002/
   #    url: http://140.206.189.151:17000/
 
@@ -186,7 +186,7 @@ zm:
     url: ${zm.domain}/ascription
   audit:
     url: ${zm.domain}/audit
-  domain: http://sxzgkj.baoxianzhanggui.com/zm/zm
+  domain: https://sxzgkj.baoxianzhanggui.com/zm/zm
   getPolicyPrint:
     url: ${zm.domain}/getPolicyPrint
   image:
@@ -212,14 +212,14 @@ zhongmei:
     imageUrl: https://www.echinacoal.com/singlePlatform/others/
     smsUrl: https://www.echinacoal.com/singlePlatform/prpall/
     pageUrl: http://www.baidu.com
-    callbackDomain: http://sxzgkj.baoxianzhanggui.com/web-api
+    callbackDomain: https://sxzgkj.baoxianzhanggui.com/web-api
     callbackUrl: /order/zhongMeiApi/underwritingCallback
     passMsgUrl: /order/zhongMeiApi/auditCallback
     sessionKey: 3788034787907281
 
 image:
   # 验证码识别
-  identificationUrl: http://sxzgkj.baoxianzhanggui.com/zm/images/recognition
+  identificationUrl: https://sxzgkj.baoxianzhanggui.com/zm/images/recognition
 
 # 紫金财险
 zijin:
@@ -253,7 +253,7 @@ huatai:
 
 # api url
 api:
-  url: http://sxzgkj.baoxianzhanggui.com/web-api
+  url: https://sxzgkj.baoxianzhanggui.com/web-api
 
 
 # 国任财险生产
@@ -261,7 +261,7 @@ guoren:
   api:
     baseUrl: https://rbt.guorenpcic.com/api/grchannel-interface/httpCurrency/httpJsonCommonEntrance
     uploadUrl: https://rbt.guorenpcic.com/api/grecar/photo/upload
-    redirectUrl: http://sxzgkj.baoxianzhanggui.com/web-api/api/guoRen/callBack
+    redirectUrl: https://sxzgkj.baoxianzhanggui.com/web-api/api/guoRen/callBack
     policyUrl: https://rbt.guorenpcic.com/api/grsavecarcore/savecarcore/getElePolicyForGrecar?certiNo=
     policyFlagUrl: https://rbt.guorenpcic.com/api/grsavecarcore/savecarcore/getElePolicyFlagForGrecar?certiNo=
     serveCode: GR0002
@@ -271,7 +271,7 @@ guoren:
     iftest: N
 
 qrcode:
-  genAddress: http://sxzgkj.baoxianzhanggui.com/web-api/order/qrCode/index
+  genAddress: https://sxzgkj.baoxianzhanggui.com/web-api/order/qrCode/index
 
 #大家财险api
 dajia:
@@ -305,7 +305,7 @@ xxl:
   job:
     admin:
       # 调度中心部署跟地址 [选填]:如调度中心集群部署存在多个地址则用逗号分隔。
-      addresses: http://sxzgkj.baoxianzhanggui.com/xxl-job-admin
+      addresses: https://sxzgkj.baoxianzhanggui.com/xxl-job-admin
       # 执行器通讯TOKEN [选填]:非空时启用 系统默认 default_token
       accessToken:
     executor: