wks 1 год назад
Родитель
Сommit
ba33a514e6

+ 70 - 0
src/main/java/com/ydtech/modules/order/entity/api/yangguang/constants/YangGuangCarType.java

@@ -0,0 +1,70 @@
+package com.ydtech.modules.order.entity.api.yangguang.constants;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@AllArgsConstructor
+@Getter
+public enum YangGuangCarType {
+    H11("H0", "重型普通货车", 38, 0),
+    H12("H3", "重型厢式货车", 39, 0),
+    H13("H0", "重型封闭货车", 40, 0),
+    H14("T11", "重型罐式货车", 41, 0),
+    H15("H0", "重型平板货车", 42, 0),
+    H16("H3", "重型集装厢车", 43, 0),
+    H17("H6", "重型自卸货车", 44, 0),
+    H18("TA", "重型特殊结构货车", 45, 0),
+    H21("H0", "中型普通货车", 46, 0),
+    H22("H3", "中型厢式货车", 47, 0),
+    H23("H0", "中型封闭货车", 48, 0),
+    H24("T11", "中型罐式货车", 49, 0),
+    H25("H0", "中型平板货车", 50, 0),
+    H26("H3", "中型集装厢车", 51, 0),
+    H27("H6", "中型自卸货车", 52, 0),
+    H28("TA", "中型特殊结构货车", 53, 0),
+    H31("H0", "轻型普通货车", 54, 0),
+    H32("H3", "轻型厢式货车", 55, 0),
+    H33("H0", "轻型封闭货车", 56, 0),
+    H34("T11", "轻型罐式货车", 57, 0),
+    H35("H0", "轻型平板货车", 58, 0),
+    H37("H6", "轻型自卸货车", 59, 0),
+    H38("TA", "轻型特殊结构货车", 60, 0),
+    H39("H0", "轻型仓栅式货车", 60, 0),
+    H41("H0", "微型普通货车", 61, 0),
+    H42("H3", "微型厢式货车", 62, 0),
+    H43("H0", "微型封闭货车", 63, 0),
+    H44("T11", "微型罐式货车", 64, 0),
+    H45("H6", "微型自卸货车", 65, 0),
+    H46("TA", "微型特殊结构货车", 66, 0),
+    H51("H1", "低速普通货车", 67, 0),
+    H52("H3", "低速厢式货车", 68, 0),
+    H53("G1", "罐式低速货车", 69, 0),
+    H54("H6", "低速自卸货车", 70, 0),
+
+    J11("J11", "轮式装载机械", 71, 0),
+    J12("J12", "轮式挖掘机械", 72, 0),
+    J13("J13", "轮式平地机械", 73, 0),
+    K11("A0", "大型普通客车", 74, 0),
+    K12("A0", "大型双层客车", 75, 0),
+    K13("A0", "大型卧铺客车", 76, 0),
+    K14("A0", "大型铰接客车", 77, 0),
+    K15("A0", "大型越野客车", 78, 0),
+    K21("A0", "中型普通客车", 79, 0),
+    K22("A0", "中型双层客车", 80, 0),
+    K23("A0", "中型卧铺客车", 81, 0),
+    K24("A0", "中型铰接客车", 82, 0),
+    K25("A0", "中型越野客车", 83, 0),
+    K31("A0", "小型普通客车", 84, 0),
+    K32("A0", "小型越野客车", 85, 0),
+    K33("A0", "轿车", 86, 0),
+    K41("A0", "微型普通客车", 87, 0),
+    K42("A0", "微型越野客车", 88, 0),
+    K43("A0", "微型轿车", 89, 0);
+    private final String code;
+
+    private final String desc;
+
+    private final Integer sort;
+    // 状态  0 启用  1 不启用
+    private final Integer status;
+}

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

@@ -10,6 +10,7 @@ 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.yangguang.constants.KindListEnum;
+import com.ydtech.modules.order.entity.api.yangguang.constants.YangGuangCarType;
 import com.ydtech.modules.order.entity.api.yangguang.response.YangGuangQueryVehicleModelResponse;
 import com.ydtech.modules.order.entity.api.yangguang.constants.YgUseNatureCode;
 import com.ydtech.modules.order.entity.config.YangGuangConfigureParameters;
@@ -224,69 +225,69 @@ public class YangGuangAccuracyCalculateRequest extends YangGuangBaseRequest{
                                              RiskInfoVo riskInfoVo, String startDate,
                                              YangGuangConfigureParameters ygConfigureParameters,
                                              BaseQuoteVo<List<YgQuoteAccidentVo>> quoteVo) {
-    DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
-    this.RequestNo = "accuracyCalculate";
-    this.UnderWritingRate = quoteVo.getCoefficient();
-    this.ComCode = ygConfigureParameters.getComCode();
-    this.HandlerCode = ygConfigureParameters.getHandlerCode();
-    this.TongxinNo = ygConfigureParameters.getTongxinNo() == null ? "" : ygConfigureParameters.getTongxinNo();
-    this.InfotransNo = getInfotransNo();
-    this.Modelinfoid = carmodellist.getModelinfoid();
-    LocalDateTime startTime = LocalDateTime.parse(startDate, formatter);
-    LocalDateTime endTime = startTime.plusYears(1).with(LocalTime.MIDNIGHT).minusSeconds(1);
-
-    if (quoteInfoVo.getProductId().equals("034001")) {
-        this.BiStartDate = startTime.format(formatter);
-        this.BiEndDate = endTime.format(formatter);
-        this.CiStartDate = "";
-        this.CiEndDate = "";
-        this.PolicyType = "1";
-        this.CiImmediateFlag = "0";
-        if (riskInfoVo.getInstantFlag().equals("1")) {
-            this.BiImmediateFlag = "1";
-        } else {
-            this.BiImmediateFlag = "0";
-        }
-    } else if (quoteInfoVo.getProductId().equals("0330")) {
-        this.CiStartDate = startTime.format(formatter);
-        this.CiEndDate = endTime.format(formatter);
-        this.BiStartDate = "";
-        this.BiEndDate = "";
-        this.PolicyType = "2";
-        this.BiImmediateFlag = "0";
-        if (riskInfoVo.getInstantFlag().equals("1")) {
-            this.CiImmediateFlag = "1";
-        } else {
-            this.CiImmediateFlag = "0";
-        }
-    } else {
-        this.CiStartDate = startTime.format(formatter);
-        this.CiEndDate = endTime.format(formatter);
-        this.BiStartDate = startTime.toString();
-        this.BiEndDate = endTime.toString();
-        this.PolicyType = "3";
-        if (riskInfoVo.getInstantFlag().equals("1")) {
-            this.CiImmediateFlag = "1";
-            this.BiImmediateFlag = "1";
-        } else {
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+        this.RequestNo = "accuracyCalculate";
+        this.UnderWritingRate = quoteVo.getCoefficient();
+        this.ComCode = ygConfigureParameters.getComCode();
+        this.HandlerCode = ygConfigureParameters.getHandlerCode();
+        this.TongxinNo = ygConfigureParameters.getTongxinNo() == null ? "" : ygConfigureParameters.getTongxinNo();
+        this.InfotransNo = getInfotransNo();
+        this.Modelinfoid = carmodellist.getModelinfoid();
+        LocalDateTime startTime = LocalDateTime.parse(startDate, formatter);
+        LocalDateTime endTime = startTime.plusYears(1).with(LocalTime.MIDNIGHT).minusSeconds(1);
+
+        if (quoteInfoVo.getProductId().equals("034001")) {
+            this.BiStartDate = startTime.format(formatter);
+            this.BiEndDate = endTime.format(formatter);
+            this.CiStartDate = "";
+            this.CiEndDate = "";
+            this.PolicyType = "1";
             this.CiImmediateFlag = "0";
+            if (riskInfoVo.getInstantFlag().equals("1")) {
+                this.BiImmediateFlag = "1";
+            } else {
+                this.BiImmediateFlag = "0";
+            }
+        } else if (quoteInfoVo.getProductId().equals("0330")) {
+            this.CiStartDate = startTime.format(formatter);
+            this.CiEndDate = endTime.format(formatter);
+            this.BiStartDate = "";
+            this.BiEndDate = "";
+            this.PolicyType = "2";
             this.BiImmediateFlag = "0";
+            if (riskInfoVo.getInstantFlag().equals("1")) {
+                this.CiImmediateFlag = "1";
+            } else {
+                this.CiImmediateFlag = "0";
+            }
+        } else {
+            this.CiStartDate = startTime.format(formatter);
+            this.CiEndDate = endTime.format(formatter);
+            this.BiStartDate = startTime.toString();
+            this.BiEndDate = endTime.toString();
+            this.PolicyType = "3";
+            if (riskInfoVo.getInstantFlag().equals("1")) {
+                this.CiImmediateFlag = "1";
+                this.BiImmediateFlag = "1";
+            } else {
+                this.CiImmediateFlag = "0";
+                this.BiImmediateFlag = "0";
+            }
         }
-    }
-    this.IsCreateEpolicyJQ = "1";
-    this.ArgueSolution = "1";
-    this.NoDamageYears = "";
-    this.RequestDate = LocalDateTime.now().format(formatter);
-    this.insuredList = YangGuangAccuracyCalculateRequest.InsuredListDTO.toInsuredListDTOList(quoteInfoVo.getPolicyHolderInfo(), quoteInfoVo.getInsuredPersonInfo());
-    this.carowner = new CarOwnerInfoDTO(quoteInfoVo.getOwnerInfo(),quoteInfoVo.getCarInfo());
-    this.itemcar = new ItemCarInfoDTO(quoteInfoVo.getCarInfo(),carmodellist);
-    this.kindList = ItemKindListDTO.toItemKindListDTOList(actualValue, quoteInfoVo.getKindList(),
+        this.IsCreateEpolicyJQ = "1";
+        this.ArgueSolution = "1";
+        this.NoDamageYears = "";
+        this.RequestDate = LocalDateTime.now().format(formatter);
+        this.insuredList = YangGuangAccuracyCalculateRequest.InsuredListDTO.toInsuredListDTOList(quoteInfoVo.getPolicyHolderInfo(), quoteInfoVo.getInsuredPersonInfo());
+        this.carowner = new CarOwnerInfoDTO(quoteInfoVo.getOwnerInfo(),quoteInfoVo.getCarInfo());
+        this.itemcar = new ItemCarInfoDTO(quoteInfoVo.getCarInfo(),carmodellist);
+        this.kindList = ItemKindListDTO.toItemKindListDTOList(actualValue, quoteInfoVo.getKindList(),
                 Integer.parseInt(quoteInfoVo.getCarInfo().getSeatCount()) - 1, quoteInfoVo.getCarInfo().isNewEnergy());
-    if (ArrayUtil.isNotEmpty(quoteVo.getAccidentalDrivingVo()) && quoteVo.getAccidentalDrivingVo().size() > 0) {
-        this.NonVehicleProductInformationList = quoteVo.getAccidentalDrivingVo().stream().map(NonVehicleProductInformationListDTO::new).collect(Collectors.toList());
-        this.CasualtyFlag = "1";
-    }
-    this.carshipyTaxInfo = new CarshipyTaxInfoDTO(quoteInfoVo.getVehicleAndVesselTax(),riskInfoVo);
+        if (ArrayUtil.isNotEmpty(quoteVo.getAccidentalDrivingVo()) && quoteVo.getAccidentalDrivingVo().size() > 0) {
+            this.NonVehicleProductInformationList = quoteVo.getAccidentalDrivingVo().stream().map(NonVehicleProductInformationListDTO::new).collect(Collectors.toList());
+            this.CasualtyFlag = "1";
+        }
+        this.carshipyTaxInfo = new CarshipyTaxInfoDTO(quoteInfoVo.getVehicleAndVesselTax(),riskInfoVo,quoteInfoVo.getOwnerInfo());
     }
 
     public static List<NonVehicleProductInformationListDTO> toCarPolicySubInfoListDTO(List<YgQuoteAccidentVo> ygQuoteAccidentVos) {
@@ -397,7 +398,6 @@ public class YangGuangAccuracyCalculateRequest extends YangGuangBaseRequest{
             this.Name = policyHolderInfo.getName();
             this.Mobile = policyHolderInfo.getMobile();
             this.PostAddress = policyHolderInfo.getAddr();
-            this.IdentifyUseFullifeStart = policyHolderInfo.getIdentifyValidDate();
             this.IdentifyUseFullife = policyHolderInfo.getIdentifyValidEndDate();
             if (policyHolderInfo.getProperty() != null && policyHolderInfo.getProperty().equals("1")) {
                 this.InsuredType = "1";
@@ -405,13 +405,10 @@ public class YangGuangAccuracyCalculateRequest extends YangGuangBaseRequest{
                 this.IdentifyNumber = policyHolderInfo.getIdentifyNumber();
                 int sex = IdcardUtil.getGenderByIdCard(policyHolderInfo.getIdentifyNumber());
                 this.Gender = sex == 1 ? "1" : "2";
+                this.IdentifyUseFullifeStart = policyHolderInfo.getIdentifyValidDate();
             } else if (policyHolderInfo.getProperty() != null && policyHolderInfo.getProperty().equals("0")) {
-                this.IdentifyType = "09";
-                this.InsuredType = "2";
-                this.IdentifyNumber = policyHolderInfo.getOrganizationCode();
-            } else if (policyHolderInfo.getProperty() != null && policyHolderInfo.getProperty().equals("2")) {
                 this.InsuredType = "2";
-                this.IdentifyType = "99";
+                this.IdentifyType = "09";
                 this.IdentifyNumber = policyHolderInfo.getOrganizationCode();
             }
         }
@@ -508,11 +505,6 @@ public class YangGuangAccuracyCalculateRequest extends YangGuangBaseRequest{
                 this.InsuredType = "2";
                 this.CarInsuredRelation = "1";
                 this.IdentifyNumber = customerInfoVo.getOrganizationCode();
-            } else if (customerInfoVo.getProperty() != null && customerInfoVo.getProperty().equals("2")) {
-                this.InsuredType = "1";
-                this.IdentifyType = "99";
-                this.CarInsuredRelation = "3";
-                this.IdentifyNumber = customerInfoVo.getOrganizationCode();
             }
         }
     }
@@ -732,11 +724,14 @@ public class YangGuangAccuracyCalculateRequest extends YangGuangBaseRequest{
 //            this.CompleteKerbmass = carInfoVo.getVehicleweight();
 //            this.TonCount = String.valueOf(carInfoVo.limitLoadTon());
             this.LicenseType = carInfoVo.getLicenseTypeCode();
-            if (carInfoVo.getCimodelclass().equals("A1")) {
-                this.VehicleType = "H0";
-            } else {
-                this.VehicleType = carInfoVo.getCimodelclass();
-            }
+//            if (carInfoVo.getCimodelclass().equals("A1")) {
+//                this.VehicleType = "H0";
+//            } else {
+//                this.VehicleType = carInfoVo.getCimodelclass();
+//            }
+            //车辆种类
+            YangGuangCarType yangGuangCarType = Enum.valueOf(YangGuangCarType.class,carInfoVo.getCartype());
+            this.VehicleType = yangGuangCarType.getCode();
             // 车辆使用性质代码
             YgUseNatureCode ygUseNatureCode1 = Enum.valueOf(YgUseNatureCode.class, YgUseNatureCode.TITLE + carInfoVo.getVehicleUse());
             this.UseNatureCode = ygUseNatureCode1.getCode();
@@ -1129,7 +1124,7 @@ public class YangGuangAccuracyCalculateRequest extends YangGuangBaseRequest{
         //不征
         private static final String TAX_NOT_CHARGE = "9";
 
-        public CarshipyTaxInfoDTO(VehicleAndVesselTax vehicleAndVesselTax,RiskInfoVo riskInfoVo) {
+        public CarshipyTaxInfoDTO(VehicleAndVesselTax vehicleAndVesselTax,RiskInfoVo riskInfoVo,CustomerInfoVo customerInfoVo) {
             String flag = vehicleAndVesselTax.getTaxRelifFlag();
             switch (flag) {
                 case TAX_EXEMPTION:
@@ -1147,8 +1142,15 @@ public class YangGuangAccuracyCalculateRequest extends YangGuangBaseRequest{
             }
             this.TaxRelifFlag = vehicleAndVesselTax.getTaxRelifFlag();
             this.TaxpayerName = vehicleAndVesselTax.getTaxpayerName();
-            this.IdentifyType = vehicleAndVesselTax.getTaxpayerIdentifier();
-            this.Taxpayeridentifier = vehicleAndVesselTax.getIdentifyNumber();
+            if (customerInfoVo.getProperty() != null && customerInfoVo.getProperty().equals("1")) {
+                this.IdentifyType = "01";
+                this.Taxpayeridentifier = vehicleAndVesselTax.getIdentifyNumber();
+            }
+            if (customerInfoVo.getProperty() != null && customerInfoVo.getProperty().equals("0")) {
+                this.IdentifyType = "09";
+                this.Taxpayeridentifier = customerInfoVo.getOrganizationCode();
+            }
+
             this.PaystartDate = riskInfoVo.getStartDate();
             this.PayendDate = riskInfoVo.getEndDate();
         }

+ 6 - 2
src/main/java/com/ydtech/modules/order/service/impl/YangGuangOrderApiServiceImpl.java

@@ -837,9 +837,13 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
     private String extractEndDate(YangGuangAccuracyCalculateResponse response) {
         String targetText = response.getErrorMessage();
         if (!targetText.contains("重复投保")) {
-            targetText = response.getRemarkCi();
+            if (response.getRemarkCi() != null) {
+                targetText = response.getRemarkCi();
+            }
             if (!targetText.contains("重复投保")) {
-                targetText = response.getRemarkBi();
+                if (response.getRemarkBi() !=null) {
+                    targetText = response.getRemarkBi();
+                }
             }
         }
         Pattern pattern = Pattern.compile("终保日期 (\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2})");