wks 2 лет назад
Родитель
Сommit
18d6b18548

+ 17 - 5
src/main/java/com/ydtech/components/OrderComponents.java

@@ -1,6 +1,7 @@
 package com.ydtech.components;
 
 
+import com.ydtech.constants.enums.dict.insurance.VehicleType;
 import com.ydtech.exception.SystemException;
 import com.ydtech.modules.admin.service.SysDeptService;
 import com.ydtech.modules.admin.service.SysUserService;
@@ -9,14 +10,14 @@ import com.ydtech.modules.esm.service.EsmAgreementProdfeeService;
 import com.ydtech.modules.esm.service.EsmAgreementService;
 import com.ydtech.modules.esm.service.EsmRetailService;
 import com.ydtech.modules.ins.model.InsOrder;
+import com.ydtech.modules.ins.model.vo.CarInfoVo;
 import com.ydtech.modules.ins.model.vo.RiskInfoVo;
 import com.ydtech.modules.ins.model.ya.YaQuoteInfoVo;
 import com.ydtech.modules.ins.service.InsCommissionService;
 import com.ydtech.modules.ins.service.InsDeptFeeService;
 import com.ydtech.modules.ins.service.InsFeeDetailService;
 import com.ydtech.modules.ins.service.InsOrderService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.redis.core.StringRedisTemplate;
+import com.ydtech.modules.protocol.utils.AssertionUtils;
 import org.springframework.stereotype.Component;
 import org.springframework.util.ObjectUtils;
 import org.springframework.util.StringUtils;
@@ -114,7 +115,8 @@ public class OrderComponents {
 //        deptFee.setAgreeprodid(order.getProductid());
 //        deptFee.setAuditstatus("0");
 //        deptFee.setSettlestatus("0");
-//        List<EsmAgreementProdfee> prodfees = esmAgreementProdfeeService.selectList(" where agreeprodid=?", new Object[]{order.getProductid()});
+//        List<EsmAgreementProdfee> prodfees = esmAgreementProdfeeService.selectList(" where agreeprodid=?", new Object[]{order
+//        .getProductid()});
 //        for (EsmAgreementProdfee prodfee : prodfees) {
 //            deptFee.setKeeprate(prodfee.getKeeprate() * 0.01);
 //            BigDecimal amount = new BigDecimal((order.getJqpremium() + order.getSypremium()) * prodfee.getKeeprate() * 0.01);
@@ -293,6 +295,13 @@ public class OrderComponents {
             throw new SystemException("投保信息 不能为空!");
         }
 
+        CarInfoVo carInfo = yaQuoteInfoVo.getCarInfo();
+        if (VehicleType.VT_A1.getCode().equals(carInfo.getCimodelclass())) {
+            String limitLoad = carInfo.getLimitLoad();
+            AssertionUtils.isFail(StringUtils.isEmpty(limitLoad), "车辆种类为货车时,核定载质量必传");
+        }
+
+
         for (RiskInfoVo riskInfoVo : yaQuoteInfoVo.getRiskList()) {
             if (riskInfoVo.getStartDate() == null || riskInfoVo.getEndDate() == null) {
                 throw new SystemException("投保信息 起保日期 或 终保日期 不能为空!");
@@ -326,7 +335,8 @@ public class OrderComponents {
 //        insOrder.setCarinfo(JSONObject.parseObject(JSONObject.toJSONString(record.getCarInfo())));
 //
 //        // 关闭订单 不含当前报价号
-//        InsOrder orderObj = insOrderService.queryQuoteno(new Object[]{record.getUserId(), record.getCarInfo().getFrameNo(), record.getQuoteno()});
+//        InsOrder orderObj = insOrderService.queryQuoteno(new Object[]{record.getUserId(), record.getCarInfo().getFrameNo(), record
+//        .getQuoteno()});
 //        if (orderObj != null) {
 //            List<InsOrder> listo = insOrderService.selectList(" where quoteno=?", new Object[]{orderObj.getQuoteno()});
 //            String status = "0";
@@ -373,7 +383,9 @@ public class OrderComponents {
 //        String productId = "";
 //        String productname = "";
 //
-//        List<EsmAgreement> agreements = esmAgreementService.selectList(" where t.agreestatus='1' and t.insure1 like ? " + "and exists (select 1 from esm_agreement_prod t2 where t.id=t2.agreeid and t2.authcomcode like ?)", new Object[]{authComCode + "%", "%" + user.getDeptId() + "%"});
+//        List<EsmAgreement> agreements = esmAgreementService.selectList(" where t.agreestatus='1' and t.insure1 like ? " + "and exists
+//        (select 1 from esm_agreement_prod t2 where t.id=t2.agreeid and t2.authcomcode like ?)", new Object[]{authComCode + "%", "%" +
+//        user.getDeptId() + "%"});
 //        if (agreements.size() == 0) {
 //            throw new SystemException("不存在有效协议或机构" + user.getDeptId() + "未授权");
 //        }

+ 2 - 0
src/main/java/com/ydtech/modules/ins/model/vo/CarInfoVo.java

@@ -67,8 +67,10 @@ public class CarInfoVo {
 
     @ApiModelProperty(value = "总质量")
     private String vehicleweight;
+
     @ApiModelProperty(value = "核定载质量")
     private String limitLoad;
+
     @ApiModelProperty(value = "年款")
     private String caryear;
 

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

@@ -5,6 +5,7 @@ import cn.hutool.core.util.IdcardUtil;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.ydtech.constants.enums.InsurKind;
 import com.ydtech.constants.enums.InsuranceRisk;
+import com.ydtech.constants.enums.dict.insurance.VehicleType;
 import com.ydtech.modules.ins.model.vo.CarInfoVo;
 import com.ydtech.modules.ins.model.vo.CustomerInfoVo;
 import com.ydtech.modules.ins.model.vo.KindInfoVo;
@@ -728,13 +729,13 @@ public class CalculatePremiumRequest implements Serializable {
          */
         @JsonProperty("platVehicleCode")
         private String platVehicleCode;
-//        /**
-//         * 吨位数/吨
-//         * 车辆类型为货车时,必传
-//         */
-//
-//        @JsonProperty("tonCount")
-//        private String tonCount;
+
+        /**
+         * 吨位数/吨
+         * 车辆类型为货车时,必传
+         */
+        @JsonProperty("tonCount")
+        private String tonCount;
 
 //        /**
 //         * 0-非网约车 1-预约出租租赁 2-预约出租客运
@@ -743,12 +744,6 @@ public class CalculatePremiumRequest implements Serializable {
 //        @JsonProperty("zlFlag")
 //        private String zlFlag;
 
-//        /**
-//         * 新能源车标志
-//         * 新能源车必传1-是;0-否
-//         */
-//        @JsonProperty("newEnergyFlag")
-//        private String newEnergyFlag;
 //
 //        /**
 //         * 纯电续航里程(公里)
@@ -789,13 +784,13 @@ public class CalculatePremiumRequest implements Serializable {
 //        @JsonProperty("saleCompany")
 //        private String saleCompany;
 
-//        /**
-//         * 打印使用性质类型(货车必传)
-//         * 0003 货车
-//         * 0004 危货
-//         */
-//        @JsonProperty("printUseNatureCode")
-//        private String printUseNatureCode;
+        /**
+         * 打印使用性质类型(货车必传)
+         * 0003 货车
+         * 0004 危货
+         */
+        @JsonProperty("printUseNatureCode")
+        private String printUseNatureCode;
 //        /**
 //         * 车队协议号
 //         */
@@ -905,6 +900,13 @@ public class CalculatePremiumRequest implements Serializable {
             this.brandName = vehicleModelInfosDTO.getModelName();
             this.carInsuredRelation = "1";
 
+            String limitLoad = carInfo.getLimitLoad();
+            if (VehicleType.VT_A1.getCode().equals(carInfo.getCimodelclass())) {
+                double v = Double.parseDouble(limitLoad) / 1000;
+                this.tonCount = String.valueOf(v);
+                this.printUseNatureCode = "0003";
+            }
+
             // 车辆种类代码
             CarKindCode carKindCode1 = Enum.valueOf(CarKindCode.class, CarKindCode.TITLE + carInfo.getCimodelclass());
             this.carKindCode = carKindCode1.getCode();