Просмотр исходного кода

中煤修改货车报价参数

wks 2 лет назад
Родитель
Сommit
19134677ca

+ 7 - 1
src/main/java/com/ydtech/modules/order/controller/DrivingInsuranceController.java

@@ -13,6 +13,8 @@ import com.ydtech.modules.order.entity.vo.InsDrivingIntentionInsuranceVo;
 import com.ydtech.modules.order.entity.vo.NoCarInsuranceQueryVo;
 import com.ydtech.modules.order.service.InsDrivingIntentionInsuranceService;
 import com.ydtech.modules.order.service.PtlAgreementNonCarProductRuleService;
+import com.ydtech.modules.protocol.entity.po.PtlAgreementAttribution;
+import com.ydtech.modules.protocol.service.PtlAgreementAttributionService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
@@ -34,10 +36,14 @@ public class DrivingInsuranceController extends BaseController {
     @Autowired
     private PtlAgreementNonCarProductRuleService ptlAgreementNonCarProductRuleService;
 
+    @Autowired
+    private PtlAgreementAttributionService ptlAgreementAttributionService;
+
     @ApiOperation(value = "获取驾意险信息")
     @PostMapping("/getDrivingInsurance")
     public HttpResult<List<InsDrivingIntentionInsuranceVo>> getDrivingInsurance(@RequestBody NoCarInsuranceQueryVo insuranceQueryVo) {
-        List<InsDrivingIntentionInsuranceVo> insDrivingIntentionInsuranceVo = insDrivingIntentionInsuranceService.getInsDrivingIntentionInsuranceVo(insuranceQueryVo);
+        PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(insuranceQueryVo.getAgreementId());
+        List<InsDrivingIntentionInsuranceVo> insDrivingIntentionInsuranceVo = insDrivingIntentionInsuranceService.getInsDrivingIntentionInsuranceVo(insuranceQueryVo , ptlAgreementAttribution.getApiType());
         return HttpResult.ok(insDrivingIntentionInsuranceVo);
     }
 

+ 7 - 0
src/main/java/com/ydtech/modules/order/entity/InsDrivingIntentionInsurance.java

@@ -31,6 +31,13 @@ public class InsDrivingIntentionInsurance implements Serializable {
     @TableField(value = "parent_id")
     private Integer parentId;
 
+    /**
+     * api类型(1、api对接,2、python对接)
+     */
+    @TableField(value = "api_type")
+    private Integer apiType;
+
+
     @TableField(value = "company_id")
     private String companyId;
 

+ 38 - 0
src/main/java/com/ydtech/modules/order/entity/api/zhongmei/constants/enums/CarUseTypeEnum.java

@@ -0,0 +1,38 @@
+package com.ydtech.modules.order.entity.api.zhongmei.constants.enums;
+
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 中煤财险 车辆用途
+ * 01	家庭自用	客车
+ * 02	非营业党政机关、事业团体	客车/货车
+ * 03	非营业企业	客车/货车
+ * 04	营业出租	货车
+ * 05	营业租赁	客车
+ * 06	营业城市公交	客车
+ * 07	营业公路客运	客车
+ * 08	非营业个人	货车
+ * 09	营业货运	货车
+ * 11	营业旅游客运	客车
+ * 12	预约出租客运	客车
+ */
+@Getter
+@AllArgsConstructor
+public enum CarUseTypeEnum {
+
+    C_01("04", "营业出租"),
+    C_02("06", "营业城市公交"),
+    C_03("07", "非营业企业"),
+    C_04("09", "营业出租"),
+    C_05("01", "家庭自用"),
+    C_06("02", "非营业党政机关、事业团体"),
+    C_07("03", "非营业企业"),
+    C_08("08", "非营业个人");
+
+    private final String code;
+
+    private final String meaning;
+
+}

+ 19 - 0
src/main/java/com/ydtech/modules/order/entity/api/zhongmei/constants/enums/MotorMainTypeEnum.java

@@ -0,0 +1,19 @@
+package com.ydtech.modules.order.entity.api.zhongmei.constants.enums;
+
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor
+public enum MotorMainTypeEnum {
+
+
+    MM_A0("100", "客车"),
+    MM_A1("200","货车");
+
+    private final String code;
+
+    private final String meaning;
+
+}

+ 68 - 0
src/main/java/com/ydtech/modules/order/entity/api/zhongmei/constants/enums/MotorSubTypeEnum.java

@@ -0,0 +1,68 @@
+package com.ydtech.modules.order.entity.api.zhongmei.constants.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor
+public enum MotorSubTypeEnum {
+
+    H11("208", "重型普通货车"),
+    H12("204", "重型厢式货车"),
+    H13("208", "重型封闭货车"),
+    H14("206", "重型罐式货车"),
+    H15("201", "重型平板货车"),
+    H16("208", "重型集装厢车"),
+    H17("208", "重型自卸货车"),
+    H18("208", "重型特殊结构货车"),
+    H21("208", "中型普通货车"),
+    H22("204", "中型厢式货车"),
+    H23("208", "中型封闭货车"),
+    H24("206", "中型罐式货车"),
+    H25("201", "中型平板货车"),
+    H26("208", "中型集装厢车"),
+    H27("203", "中型自卸货车"),
+    H28("208", "中型特殊结构货车"),
+    H31("208", "轻型普通货车"),
+    H32("204", "轻型厢式货车"),
+    H33("208", "轻型封闭货车"),
+    H34("206", "轻型罐式货车"),
+    H35("201", "轻型平板货车"),
+    H37("203", "轻型自卸货车"),
+    H38("208", "轻型特殊结构货车"),
+    H41("208", "微型普通货车"),
+    H42("204", "微型厢式货车"),
+    H43("208", "微型封闭货车"),
+    H44("206", "微型罐式货车"),
+    H45("203", "微型自卸货车"),
+    H46("208", "微型特殊结构货车"),
+    H51("208", "低速普通货车"),
+    H52("204", "低速厢式货车"),
+    H53("206", "罐式低速货车"),
+    H54("203", "低速自卸货车"),
+    J11("208", "轮式装载机械"),
+    J12("208", "轮式挖掘机械"),
+    J13("208", "轮式平地机械"),
+
+    K11("105", "大型普通客车"),
+    K12("105", "大型双层客车"),
+    K13("105", "大型卧铺客车"),
+    K14("105", "大型铰接客车"),
+    K15("103", "大型越野客车"),
+    K21("104", "中型普通客车"),
+    K22("104", "中型双层客车"),
+    K23("104", "中型卧铺客车"),
+    K24("104", "中型铰接客车"),
+    K25("103", "中型越野客车"),
+    K31("102", "小型普通客车"),
+    K32("103", "小型越野客车"),
+    K33("101", "轿车"),
+    K41("102", "微型普通客车"),
+    K42("103", "微型越野客车"),
+    K43("101", "微型轿车");
+
+    private final String code;
+
+    private final String meaning;
+
+}

+ 32 - 1
src/main/java/com/ydtech/modules/order/entity/api/zhongmei/request/QuotedPriceRequest.java

@@ -12,11 +12,15 @@ import com.ydtech.modules.order.entity.api.zhongmei.BaseRequest;
 import com.ydtech.modules.order.entity.api.zhongmei.BaseRequestHead;
 import com.ydtech.modules.order.entity.api.zhongmei.constants.TimeConstants;
 import com.ydtech.modules.order.entity.api.zhongmei.constants.TransCode;
+import com.ydtech.modules.order.entity.api.zhongmei.constants.enums.CarUseTypeEnum;
 import com.ydtech.modules.order.entity.api.zhongmei.constants.enums.ContractEnum;
+import com.ydtech.modules.order.entity.api.zhongmei.constants.enums.MotorMainTypeEnum;
+import com.ydtech.modules.order.entity.api.zhongmei.constants.enums.MotorSubTypeEnum;
 import com.ydtech.modules.order.entity.api.zhongmei.response.ModelsQueryResponse;
 import com.ydtech.modules.order.entity.config.ZmConfigureParameters;
 import com.ydtech.modules.order.entity.vo.AccidentalDrivingVo;
 import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
+import com.ydtech.modules.protocol.utils.AssertionUtils;
 import com.ydtech.utils.StringUtils;
 import lombok.AllArgsConstructor;
 import lombok.Data;
@@ -254,6 +258,19 @@ public class QuotedPriceRequest extends BaseRequest {
                 @JsonProperty("motorUsageTypeCode")
                 private String motorUsageTypeCode;
 
+                /**
+                 * 车辆大类
+                 */
+                @JsonProperty("motorMainType")
+                private String motorMainType;
+
+                /**
+                 * 车辆细类
+                 */
+                @JsonProperty("motorSubType")
+                private String motorSubType;
+
+
                 public PolicyCarDTO(CarInfoVo carInfoVo) {
                     this.engine = carInfoVo.getEngineNo();
                     if (StringUtils.isNullOrEmpty(carInfoVo.getLicenseNo())) {
@@ -274,8 +291,22 @@ public class QuotedPriceRequest extends BaseRequest {
                     this.issueDate = carInfoVo.getIssueDate() + " " + TimeConstants.START_TIME;
                     this.plateColorCode = "01";
                     this.carCheckStatus = null;
-                    this.carUseType = "01";
+
+                    MotorMainTypeEnum motorMainTypeEnum = MotorMainTypeEnum.valueOf("MM_" + carInfoVo.getCimodelclass());
+                    AssertionUtils.isEmpty(motorMainTypeEnum, "车辆种类输入错误");
+                    this.motorMainType =  motorMainTypeEnum.getCode();
+
+                    MotorSubTypeEnum motorSubTypeEnum = MotorSubTypeEnum.valueOf(carInfoVo.getCartype());
+                    AssertionUtils.isEmpty(motorMainTypeEnum, "车辆类型输入错误");
+                    this.motorSubType = motorSubTypeEnum.getCode();
+
+                    CarUseTypeEnum carUseTypeEnum = CarUseTypeEnum.valueOf("C_" + carInfoVo.getVehicleUse());
+                    AssertionUtils.isEmpty(carUseTypeEnum, "车辆用途输入错误");
+                    this.carUseType = carUseTypeEnum.getCode();
+
                     this.motorUsageTypeCode = InsuranceTypeCorrespondence.getZM_CAR_MotorUsageTypeCode().get(carInfoVo.getCarnature());
+
+
                 }
             }
 

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

@@ -17,9 +17,10 @@ public interface InsDrivingIntentionInsuranceService extends IService<InsDriving
     /**
      * 根据查询条件获取驾意险信息
      * @param insuranceVo
+     * @param apiType
      * @return
      */
-    List<InsDrivingIntentionInsuranceVo> getInsDrivingIntentionInsuranceVo(NoCarInsuranceQueryVo insuranceVo);
+    List<InsDrivingIntentionInsuranceVo> getInsDrivingIntentionInsuranceVo(NoCarInsuranceQueryVo insuranceVo, Integer apiType);
 
     /**
      * 根据规则获取驾意险信息

+ 14 - 4
src/main/java/com/ydtech/modules/order/service/impl/InsDrivingIntentionInsuranceServiceImpl.java

@@ -17,6 +17,8 @@ import com.ydtech.modules.order.service.InsCrawlerOrderService;
 import com.ydtech.modules.order.service.InsDrivingIntentionInsuranceService;
 import com.ydtech.modules.order.service.PtlAgreementNonCarProductRuleService;
 import com.ydtech.modules.protocol.entity.po.PtlAgreement;
+import com.ydtech.modules.protocol.entity.po.PtlAgreementAttribution;
+import com.ydtech.modules.protocol.service.PtlAgreementAttributionService;
 import com.ydtech.modules.protocol.service.PtlAgreementService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -36,6 +38,9 @@ public class InsDrivingIntentionInsuranceServiceImpl extends ServiceImpl<InsDriv
     @Autowired
     private PtlAgreementService ptlAgreementService;
 
+    @Autowired
+    private PtlAgreementAttributionService ptlAgreementAttributionService;
+
     @Autowired
     private InsDrivingIntentionInsuranceSonMapper sonMapper;
 
@@ -48,8 +53,8 @@ public class InsDrivingIntentionInsuranceServiceImpl extends ServiceImpl<InsDriv
      * @return
      */
     @Override
-    public List<InsDrivingIntentionInsuranceVo> getInsDrivingIntentionInsuranceVo(NoCarInsuranceQueryVo insuranceVo) {
-        LambdaQueryWrapper<InsDrivingIntentionInsurance> query = new LambdaQueryWrapper<InsDrivingIntentionInsurance>();
+    public List<InsDrivingIntentionInsuranceVo> getInsDrivingIntentionInsuranceVo(NoCarInsuranceQueryVo insuranceVo, Integer apiType) {
+        LambdaQueryWrapper<InsDrivingIntentionInsurance> query = new LambdaQueryWrapper<>();
         String companyId = "";
         if(insuranceVo.getAgreementId() != null){
             PtlAgreement byAgreementIdNew = ptlAgreementService.getByAgreementIdNew(insuranceVo.getAgreementId());
@@ -61,9 +66,10 @@ public class InsDrivingIntentionInsuranceServiceImpl extends ServiceImpl<InsDriv
         if(insuranceVo.getSeatNum() != null) {
             query.eq(InsDrivingIntentionInsurance::getSeatNum, insuranceVo.getSeatNum());
         }
+        query.eq(InsDrivingIntentionInsurance::getApiType, apiType);
         List<InsDrivingIntentionInsurance> insDrivingIntentionInsurances = baseMapper.selectList(query);
         List<String> collect = insDrivingIntentionInsurances.stream().map(InsDrivingIntentionInsurance::getProjectCode).collect(Collectors.toList());
-        if(collect.size() == 0){
+        if(collect.isEmpty()){
             return new ArrayList<>();
         }
         List<InsDrivingIntentionInsuranceSon> insDrivingIntentionInsuranceSons = sonMapper.selectList(new LambdaQueryWrapper<InsDrivingIntentionInsuranceSon>()
@@ -121,7 +127,11 @@ public class InsDrivingIntentionInsuranceServiceImpl extends ServiceImpl<InsDriv
         }
         query.orderBy(true, true, PtlAgreementNonCarProductRule::getSort);
         List<PtlAgreementNonCarProductRule> list = ptlAgreementNonCarProductRuleService.list(query);
-        List<InsDrivingIntentionInsuranceVo> insDrivingIntentionInsuranceVo = getInsDrivingIntentionInsuranceVo(insuranceVo);
+
+        PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(insuranceVo.getAgreementId());
+        Integer apiType = ptlAgreementAttribution.getApiType();
+
+        List<InsDrivingIntentionInsuranceVo> insDrivingIntentionInsuranceVo = getInsDrivingIntentionInsuranceVo(insuranceVo, apiType);
         if(!list.isEmpty()){
             //遍历顶级
             insDrivingIntentionInsuranceVo.stream()