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

增加字段和 修改紫金报价

wks 1 год назад
Родитель
Сommit
5741826ca5
12 измененных файлов с 521 добавлено и 20 удалено
  1. 12 1
      tenant/insurance/quotation-commons/src/main/java/com/jzg/quotation/commons/entity/vo/quote/CarInfoVo.java
  2. 16 8
      tenant/insurance/quotation-commons/src/main/java/com/jzg/quotation/commons/entity/vo/quote/CustomerInfoVo.java
  3. 4 4
      tenant/insurance/quotation-commons/src/main/java/com/jzg/quotation/commons/entity/vo/quote/KindInfoVo.java
  4. 10 0
      tenant/insurance/quotation-commons/src/main/java/com/jzg/quotation/commons/filter/CarModelsFilter.java
  5. 47 0
      tenant/insurance/quotation-commons/src/main/java/com/jzg/quotation/commons/filter/CarModelsFilterUtils.java
  6. 35 0
      tenant/insurance/quotation-zijin/src/main/java/com/jzg/quotation/zijin/api/constant/enums/RiskCodeEnum.java
  7. 248 0
      tenant/insurance/quotation-zijin/src/main/java/com/jzg/quotation/zijin/api/entity/request/CalculatePremiumRequest.java
  8. 8 0
      tenant/insurance/quotation-zijin/src/main/java/com/jzg/quotation/zijin/api/entity/request/ModelQueryRequest.java
  9. 17 0
      tenant/insurance/quotation-zijin/src/main/java/com/jzg/quotation/zijin/api/entity/request/QueryActualValueRequest.java
  10. 3 2
      tenant/insurance/quotation-zijin/src/main/java/com/jzg/quotation/zijin/api/entity/response/ModelQueryResponse.java
  11. 12 5
      tenant/insurance/quotation-zijin/src/main/java/com/jzg/quotation/zijin/api/service/Impl/ZiJinApiRequestImpl.java
  12. 109 0
      tenant/insurance/quotation-zijin/src/main/java/com/jzg/quotation/zijin/api/utils/InsuranceTimeProcessing.java

+ 12 - 1
tenant/insurance/quotation-commons/src/main/java/com/jzg/quotation/commons/entity/vo/quote/CarInfoVo.java

@@ -123,7 +123,18 @@ public class CarInfoVo implements Serializable {
      * 发证日期
      */
     private String issueDate;
-
+    /**
+     * 过户车(如果存在交强险商业险分开的情况是转为交强险过户)
+     */
+    private boolean transfer;
+    /**
+     * 商业险过户
+     */
+    private boolean ciTransfer;
+    /**
+     * 新能源标志 true 新能源
+     */
+    private boolean newEnergyMark;
     /**
      * 获取 吨位数/核定载质量
      *

+ 16 - 8
tenant/insurance/quotation-commons/src/main/java/com/jzg/quotation/commons/entity/vo/quote/CustomerInfoVo.java

@@ -25,45 +25,53 @@ public class CustomerInfoVo implements Serializable {
      * 姓名
      */
     private String name;
-
     /**
      * 身份证号
      */
     private String identifyNumber;
-
     /**
      * 身份证有效起期
      */
     private String identifyValidDate;
-
     /**
      * 身份证有效止期
      */
     private String identifyValidEndDate;
-
     /**
      * 证件类型代码
      */
     private String documentsTypeCode;
-
     /**
      * 组织机构代码
      */
     private String organizationCode;
-
     /**
      * 地址
      */
     private String addr;
-
     /**
      * 邮箱
      */
     private String email;
-
     /**
      * 手机号
      */
     private String mobile;
+    /**
+     * 客户类型
+     */
+    private String property;
+    /**
+     * 法人
+     */
+    private String legalPerson;
+    /**
+     * 法人身份证号
+     */
+    private String leaderIdentifyNumber;
+    /**
+     * 法人身份证止期
+     */
+    private String leaderOtherEffectiveDate;
 
 }

+ 4 - 4
tenant/insurance/quotation-commons/src/main/java/com/jzg/quotation/commons/entity/vo/quote/KindInfoVo.java

@@ -29,11 +29,11 @@ public class KindInfoVo implements Serializable {
     /**
      * 保额
      */
-    private BigDecimal amount;
+    private String amount;
     /**
      * 每座保额
      */
-    private BigDecimal unitAmount;
+    private String unitAmount;
     /**
      * 座位数
      */
@@ -41,7 +41,7 @@ public class KindInfoVo implements Serializable {
     /**
      * 保费
      */
-    private BigDecimal premium;
+    private String premium;
     /**
      * 附加绝对免赔率
      */
@@ -49,6 +49,6 @@ public class KindInfoVo implements Serializable {
     /**
      * 服务次数
      */
-    private int serviceTimes;
+    private String serviceTimes;
 
 }

+ 10 - 0
tenant/insurance/quotation-commons/src/main/java/com/jzg/quotation/commons/filter/CarModelsFilter.java

@@ -0,0 +1,10 @@
+package com.jzg.quotation.commons.filter;
+
+
+public interface CarModelsFilter {
+
+    String getCarYear();
+
+    String getPurchasePrice();
+
+}

+ 47 - 0
tenant/insurance/quotation-commons/src/main/java/com/jzg/quotation/commons/filter/CarModelsFilterUtils.java

@@ -0,0 +1,47 @@
+package com.jzg.quotation.commons.filter;
+
+import com.jzg.commons.exception.SystemException;
+import com.jzg.quotation.commons.entity.vo.quote.CarInfoVo;
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * @description: 过滤车型
+ * @author: wenks
+ * @date: 2023/8/22 9:54
+ **/
+public class CarModelsFilterUtils {
+
+    public static <T extends CarModelsFilter> T to(List<T> carModelsFilterList, CarInfoVo carInfo) {
+        if (carModelsFilterList.isEmpty()) {
+            throw new SystemException("核心查询车型失败 请联系业务人员处理");
+        }
+
+        List<T> stadarCarDTOS = new ArrayList<>();
+        if (!StringUtils.isEmpty(carInfo.getCaryear())) {
+            stadarCarDTOS = carModelsFilterList.stream()
+                    .filter(car -> carInfo.getCaryear().equals(car.getCarYear()))
+                    .collect(Collectors.toList());
+        }
+
+        if (!stadarCarDTOS.isEmpty()) {
+            carModelsFilterList = stadarCarDTOS;
+        } else {
+            stadarCarDTOS = carModelsFilterList;
+        }
+
+        carModelsFilterList = carModelsFilterList.stream()
+                .filter(car -> carInfo.getPurchasePrice().equals(String.valueOf(car.getPurchasePrice())))
+                .collect(Collectors.toList());
+
+        if (carModelsFilterList.isEmpty()) {
+            return stadarCarDTOS.get(0);
+        }
+
+        return carModelsFilterList.get(0);
+    }
+
+}

+ 35 - 0
tenant/insurance/quotation-zijin/src/main/java/com/jzg/quotation/zijin/api/constant/enums/RiskCodeEnum.java

@@ -0,0 +1,35 @@
+package com.jzg.quotation.zijin.api.constant.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @description: 险种代码
+ * @author: wenks
+ * @date: 2023/8/11 20:08
+ **/
+@Getter
+@AllArgsConstructor
+public enum RiskCodeEnum {
+
+
+    RC_0590("0590", "交强险"),
+
+    RC_050A("050A", "商业险");
+
+    public static final String TRAFFIC_CODE = "0590";
+
+    public static final String BUSINESS_CODE = "050A";
+
+    // 车船税
+    public static final String ACCIDENT_CODE = "CSTax";
+
+    private final String code;
+
+    private final String desc;
+
+    public static String[] getRiskCode() {
+        return new String[]{RiskCodeEnum.RC_0590.getCode(), RiskCodeEnum.RC_050A.getCode()};
+    }
+
+}

+ 248 - 0
tenant/insurance/quotation-zijin/src/main/java/com/jzg/quotation/zijin/api/entity/request/CalculatePremiumRequest.java

@@ -1,14 +1,29 @@
 package com.jzg.quotation.zijin.api.entity.request;
 
+import cn.hutool.core.util.IdcardUtil;
 import com.fasterxml.jackson.annotation.JsonProperty;
+import com.jzg.quotation.commons.entity.vo.aggregated.QuoteVo;
+import com.jzg.quotation.commons.entity.vo.quote.CarInfoVo;
+import com.jzg.quotation.commons.entity.vo.quote.CustomerInfoVo;
+import com.jzg.quotation.commons.entity.vo.quote.KindInfoVo;
+import com.jzg.quotation.commons.entity.vo.quote.RiskInfoVo;
+import com.jzg.quotation.zijin.api.constant.enums.CalculateFlagEnum;
+import com.jzg.quotation.zijin.api.constant.enums.RiskCodeEnum;
+import com.jzg.quotation.zijin.api.entity.ZiJinApiConfigureParameters;
+import com.jzg.quotation.zijin.api.entity.response.ModelQueryResponse;
+import com.jzg.quotation.zijin.api.utils.InsuranceTimeProcessing;
 import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.Getter;
 import lombok.NoArgsConstructor;
+import org.springframework.util.StringUtils;
 
 import java.io.Serial;
 import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.ArrayList;
 import java.util.List;
+import java.util.Optional;
 
 /**
  * @description: 紫金财险 保费计算 入参实体
@@ -96,6 +111,35 @@ public class CalculatePremiumRequest implements Serializable {
     @JsonProperty("demandNoCheckFlag")
     private String demandNoCheckFlag = "1";
 
+    public CalculatePremiumRequest(QuoteVo quoteVo, ModelQueryResponse.VehicleModelInfosDTO vehicleModelInfosDTO, String actualValue, ZiJinApiConfigureParameters parameters, ModelQueryResponse modelQueryResponse) {
+//        List<ZjQuoteAccidentVo> accidentalDrivingVo = quoteVo.getAccidentalDrivingVo();
+        // 基本信息
+        this.baseInfo = new BaseInfoDTO(quoteVo.getCiRiskInfoVo(), quoteVo.getBiRiskInfoVo());
+        // 车主信息
+        this.carOwnerInfo = new CarOwnerInfoDTO(quoteVo.getOwnersInfo());
+        // 投被保人信息
+        this.insuredList = InsuredListDTO.toInsuredListDTOList(quoteVo.getPolicyHolderInfo(), quoteVo.getInsuredPersonInfo());
+        // 险别信息
+        this.itemKindList = ItemKindListDTO.toItemKindListDTOList(actualValue, quoteVo.getKindInfoVo());
+        // 浮动因子信息
+//        this.profitDataList = ProfitDataListDTO.toCoefficient(quoteVo.getCoefficient());
+        // 驾意险
+//        this.carPolicySubInfoList = CarPolicySubInfoListDTO.toCarPolicySubInfoListDTO(accidentalDrivingVo);
+        // 交强险
+        if (!"1".equals(this.baseInfo.calculateFlag)) {
+            itemKindList.add(ItemKindListDTO.getCompulsoryInsurance());
+        }
+        // 车辆信息
+        this.vehicleInfo = new VehicleInfoDTO(quoteVo.getCarInfoVo(), vehicleModelInfosDTO, actualValue);
+        this.orderId = modelQueryResponse.getOrderId();
+        this.orderNo = modelQueryResponse.getOrderNo();
+        this.orderOrigin = parameters.getAppKey();
+        this.proposalAreaCode = parameters.getProposalAreaCode();
+        this.proposalCityCode = parameters.getProposalCityCode();
+        //
+//        this.taxRelifInfo = new TaxRelifInfoDTO(quoteInfoVo.getVehicleAndVesselTax());
+    }
+
     /**
      * 基本信息
      */
@@ -200,6 +244,109 @@ public class CalculatePremiumRequest implements Serializable {
         @JsonProperty("startMinuteCI")
         private String startMinuteCI;
 
+        /**
+         * 商业险
+         *
+         * @param startDate 起保时间
+         */
+        public void setBusinessTime(String startDate) {
+            if (!startDate.isEmpty()) {
+                setStrengthTime(startDate);
+            }
+        }
+
+
+        /**
+         * 交强险
+         *
+         * @param startDate 起保时间
+         */
+        public void setTrafficTime(String startDate) {
+            if (!startDate.isEmpty()) {
+                setCommerceTime(startDate);
+            }
+        }
+
+        /**
+         * 商业险
+         *
+         * @param startDate 起保时间
+         */
+        private void setStrengthTime(String startDate) {
+            if (!StringUtils.hasLength(startDate)) {
+                return;
+            }
+
+            if (startDate.contains(InsuranceTimeProcessing.START_TIME)) {
+                InsuranceTimeProcessing.UntimelyInsurancePeriod untimely = InsuranceTimeProcessing.untimely(startDate);
+                this.endDate = untimely.getEndDate();
+                this.endHour = InsuranceTimeProcessing.END_HOUR;
+                this.endMinute = InsuranceTimeProcessing.MINUTE;
+                this.startDate = untimely.getStartDate();
+                this.startHour = InsuranceTimeProcessing.START_HOUR;
+                this.startMinute = InsuranceTimeProcessing.MINUTE;
+            } else {
+                // 及时
+                InsuranceTimeProcessing.TimelyInsurancePeriod timely = InsuranceTimeProcessing.timely(startDate);
+                this.endDate = timely.getEndDate();
+                this.endHour = timely.getEndHour();
+                this.endMinute = timely.getEndMinute();
+                this.startDate = timely.getStartDate();
+                this.startHour = timely.getStartHour();
+                this.startMinute = timely.getStartMinute();
+            }
+        }
+
+        /**
+         * 交强险
+         *
+         * @param startDate 起保时间
+         */
+        private void setCommerceTime(String startDate) {
+            if (!StringUtils.hasLength(startDate)) {
+                return;
+            }
+            if (startDate.contains(InsuranceTimeProcessing.START_TIME)) {
+                InsuranceTimeProcessing.UntimelyInsurancePeriod untimely = InsuranceTimeProcessing.untimely(startDate);
+                this.endDateCI = untimely.getEndDate();
+                this.endHourCI = InsuranceTimeProcessing.END_HOUR;
+                this.endMinuteCI = InsuranceTimeProcessing.MINUTE;
+                this.startDateCI = untimely.getStartDate();
+                this.startHourCI = InsuranceTimeProcessing.START_HOUR;
+                this.startMinuteCI = InsuranceTimeProcessing.MINUTE;
+            } else {
+                // 及时
+                InsuranceTimeProcessing.TimelyInsurancePeriod timely = InsuranceTimeProcessing.timely(startDate);
+                this.endDateCI = timely.getEndDate();
+                this.endHourCI = timely.getEndHour();
+                this.endMinuteCI = timely.getEndMinute();
+                this.startDateCI = timely.getStartDate();
+                this.startHourCI = timely.getStartHour();
+                this.startMinuteCI = timely.getStartMinute();
+            }
+        }
+
+        public BaseInfoDTO(RiskInfoVo ciRiskInfoVo, RiskInfoVo biRiskInfoVo) {
+            // 交强险
+            String ciStartDate = Optional.ofNullable(ciRiskInfoVo)
+                    .map(RiskInfoVo::getStartDate)
+                    .orElse("");
+            setCommerceTime(ciStartDate);
+            // 商业险
+            String biStartDate = Optional.ofNullable(biRiskInfoVo)
+                    .map(RiskInfoVo::getStartDate)
+                    .orElse("");
+            setStrengthTime(biStartDate);
+
+            if (!StringUtils.hasLength(ciStartDate)) {
+                this.calculateFlag = CalculateFlagEnum.CF_1.getCode();
+            } else if (!StringUtils.hasLength(biStartDate)) {
+                this.calculateFlag = CalculateFlagEnum.CF_2.getCode();
+            } else {
+                this.calculateFlag = CalculateFlagEnum.CF_0.getCode();
+            }
+
+        }
     }
 
     /**
@@ -248,6 +395,32 @@ public class CalculatePremiumRequest implements Serializable {
         @JsonProperty("vehicleOwnerNature")
         private String vehicleOwnerNature;
 
+        @AllArgsConstructor
+        @Getter
+        public enum VehicleOwnerNature {
+
+            VEHICLE_OWNER_NATURE_1("1"),
+            VEHICLE_OWNER_NATURE_2("2"),
+            VEHICLE_OWNER_NATURE_3("3");
+            // 编号
+            private final String code;
+        }
+
+        public CarOwnerInfoDTO(CustomerInfoVo customerInfoVo) {
+            if (VehicleOwnerNature.VEHICLE_OWNER_NATURE_1.getCode().equals(customerInfoVo.getProperty())) {
+                this.ownerIdentifyNumber = customerInfoVo.getIdentifyNumber();
+                this.ownerIdentifyType = "01";
+                this.vehicleOwnerNature = "1";
+            } else {
+                this.ownerIdentifyNumber = customerInfoVo.getOrganizationCode();
+                this.ownerIdentifyType = "73";
+                this.vehicleOwnerNature = "3";
+            }
+            this.carOwner = customerInfoVo.getName();
+            this.mobile = customerInfoVo.getMobile();
+            this.ownerAddress = customerInfoVo.getAddr();
+        }
+
     }
 
     /**
@@ -670,6 +843,10 @@ public class CalculatePremiumRequest implements Serializable {
         @JsonProperty("makeDateJQ")
         private String makeDateJQ;
 
+        public VehicleInfoDTO(CarInfoVo carInfoVo, ModelQueryResponse.VehicleModelInfosDTO vehicleModelInfosDTO, String actualValue) {
+
+
+        }
     }
 
     /**
@@ -802,6 +979,48 @@ public class CalculatePremiumRequest implements Serializable {
         @JsonProperty("businessSort")
         private String businessSort;
 
+        public InsuredListDTO(CustomerInfoVo customerInfoVo, String insuredFlag) {
+            this.occupation = "030199";
+            this.address = customerInfoVo.getAddr();
+
+            if ("".equals(insuredFlag)) {
+                this.identifyNumber = customerInfoVo.getIdentifyNumber();
+                this.identifyType = "01";
+                this.insuredNature = "3";
+                this.insuredType = "1";
+                int gender = IdcardUtil.getGenderByIdCard(customerInfoVo.getIdentifyNumber());
+                this.sex = gender == 1 ? "1" : "2";
+            } else {
+                this.businessSort = "900";
+                this.identifyNumber = customerInfoVo.getOrganizationCode();
+                this.identifyType = "73";
+                this.insuredNature = "4";
+                this.insuredType = "2";
+                this.sex = "9";
+                this.certigierName = customerInfoVo.getLegalPerson();
+                this.certigierType = "01";
+                this.certigierNumber = customerInfoVo.getLeaderIdentifyNumber();
+                this.certigierNumValidDate = customerInfoVo.getLeaderOtherEffectiveDate();
+                this.chiefName = customerInfoVo.getLegalPerson();
+                this.chiefType = "01";
+                this.chiefNumber = customerInfoVo.getLeaderIdentifyNumber();
+                this.chiefNumValidDate = customerInfoVo.getLeaderOtherEffectiveDate();
+            }
+            this.insuredFlag = insuredFlag;
+            this.insuredName = customerInfoVo.getName();
+            this.longAddress = customerInfoVo.getAddr();
+            this.mobile = customerInfoVo.getMobile();
+            this.validDate = customerInfoVo.getIdentifyValidEndDate();
+        }
+
+        public static List<InsuredListDTO> toInsuredListDTOList(CustomerInfoVo policyHolderInfo, CustomerInfoVo insuredPersonInfo) {
+            List<InsuredListDTO> insuredListDTOS = new ArrayList<>();
+            InsuredListDTO policyHolder = new InsuredListDTO(policyHolderInfo, "2");
+            InsuredListDTO insuredPerson = new InsuredListDTO(insuredPersonInfo, "1");
+            insuredListDTOS.add(policyHolder);
+            insuredListDTOS.add(insuredPerson);
+            return insuredListDTOS;
+        }
     }
 
     /**
@@ -858,6 +1077,35 @@ public class CalculatePremiumRequest implements Serializable {
         @JsonProperty("serviceTimes")
         private String serviceTimes;
 
+        public static ItemKindListDTO getCompulsoryInsurance() {
+            ItemKindListDTO insuredListDTO = new ItemKindListDTO();
+            insuredListDTO.setKindCode("BZ");
+            insuredListDTO.setKindName("机动车交通事故责任强制保险");
+            insuredListDTO.setRiskCode(RiskCodeEnum.RC_0590.getCode());
+            insuredListDTO.setAmount("200000");
+            return insuredListDTO;
+        }
+
+        public static List<ItemKindListDTO> toItemKindListDTOList(String actualValue, List<KindInfoVo> kindList) {
+            List<ItemKindListDTO> list = new ArrayList<>();
+            for (KindInfoVo kindInfoVo : kindList) {
+                ItemKindListDTO itemKindListDTO = new ItemKindListDTO();
+                itemKindListDTO.kindCode = kindInfoVo.getKindCode();
+                itemKindListDTO.kindName = kindInfoVo.getKindName();
+                itemKindListDTO.riskCode = RiskCodeEnum.RC_050A.getCode();
+                itemKindListDTO.quantity = kindInfoVo.getQuantity();
+                itemKindListDTO.unitAmount = kindInfoVo.getAmount();
+                itemKindListDTO.amount = kindInfoVo.getAmount();
+                // 车损险
+                if ("A".equals(itemKindListDTO.kindCode)) {
+                    itemKindListDTO.amount = actualValue;
+                }
+                itemKindListDTO.deductibleRate = kindInfoVo.getDeductibleRate();
+                itemKindListDTO.serviceTimes = kindInfoVo.getServiceTimes();
+                list.add(itemKindListDTO);
+            }
+            return list;
+        }
     }
 
     /**

+ 8 - 0
tenant/insurance/quotation-zijin/src/main/java/com/jzg/quotation/zijin/api/entity/request/ModelQueryRequest.java

@@ -94,4 +94,12 @@ public class ModelQueryRequest implements Serializable {
     @JsonProperty("modelCode")
     private String modelCode;
 
+    public ModelQueryRequest(ZiJinApiConfigureParameters parameters, String vinNo, String brandName) {
+        this.orderOrigin = parameters.getAppKey();
+        this.proposalAreaCode = parameters.getProposalAreaCode();
+        this.proposalCityCode = parameters.getProposalCityCode();
+        this.vinNo = vinNo;
+        this.brandName = brandName;
+    }
+
 }

+ 17 - 0
tenant/insurance/quotation-zijin/src/main/java/com/jzg/quotation/zijin/api/entity/request/QueryActualValueRequest.java

@@ -2,6 +2,8 @@ package com.jzg.quotation.zijin.api.entity.request;
 
 
 import com.fasterxml.jackson.annotation.JsonProperty;
+import com.jzg.quotation.commons.entity.vo.quote.CarInfoVo;
+import com.jzg.quotation.zijin.api.entity.response.ModelQueryResponse;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 
@@ -45,4 +47,19 @@ public class QueryActualValueRequest implements Serializable {
     @JsonProperty("useNatureCode")
     private String useNatureCode;
 
+    /**
+     * @param carInfoVo     车辆信息
+     * @param purchasePrice 新车购置价格
+     * @param startDate     起保时间
+     */
+    public QueryActualValueRequest(CarInfoVo carInfoVo, String purchasePrice, String startDate) {
+        this.carKindCode = carInfoVo.getCarKindCode();
+//        this.certificateDate = certificateDate;
+        this.enrollDate = carInfoVo.getRegisterDate();
+        this.purchasePrice = purchasePrice;
+        this.seatCount = carInfoVo.getSeatCount();
+        this.startDate = startDate;
+        this.tonCount = carInfoVo.getTonCount();
+        this.useNatureCode = carInfoVo.getVehicleUseCode();
+    }
 }

+ 3 - 2
tenant/insurance/quotation-zijin/src/main/java/com/jzg/quotation/zijin/api/entity/response/ModelQueryResponse.java

@@ -1,6 +1,7 @@
 package com.jzg.quotation.zijin.api.entity.response;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
+import com.jzg.quotation.commons.filter.CarModelsFilter;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.NoArgsConstructor;
@@ -44,7 +45,7 @@ public class ModelQueryResponse extends BaseResponse implements Serializable {
 
     @NoArgsConstructor
     @Data
-    public static class VehicleModelInfosDTO implements Serializable {
+    public static class VehicleModelInfosDTO implements Serializable, CarModelsFilter {
 
         @Serial
         private static final long serialVersionUID = -7781619063783117252L;
@@ -224,7 +225,7 @@ public class ModelQueryResponse extends BaseResponse implements Serializable {
         @JsonProperty("productStatus")
         private String productStatus;
         /**
-         *
+         * 新车购置价
          */
         @JsonProperty("purchasePrice")
         private String purchasePrice;

+ 12 - 5
tenant/insurance/quotation-zijin/src/main/java/com/jzg/quotation/zijin/api/service/Impl/ZiJinApiRequestImpl.java

@@ -5,11 +5,14 @@ import com.jzg.quotation.commons.entity.vo.aggregated.QuoteVo;
 import com.jzg.quotation.commons.entity.vo.base.OrderBase;
 import com.jzg.quotation.commons.entity.vo.quote.AttributionInformationVo;
 import com.jzg.quotation.commons.entity.vo.quote.CarInfoVo;
+import com.jzg.quotation.commons.filter.CarModelsFilterUtils;
 import com.jzg.quotation.commons.standard.conversion.ConfigureParametersConversion;
 import com.jzg.quotation.zijin.api.component.ZiJinApiRequestComponent;
 import com.jzg.quotation.zijin.api.entity.ZiJinApiConfigureParameters;
+import com.jzg.quotation.zijin.api.entity.request.CalculatePremiumRequest;
 import com.jzg.quotation.zijin.api.entity.request.ModelQueryRequest;
 import com.jzg.quotation.zijin.api.entity.request.QueryActualValueRequest;
+import com.jzg.quotation.zijin.api.entity.response.CalculatePremiumResponse;
 import com.jzg.quotation.zijin.api.entity.response.ModelQueryResponse;
 import com.jzg.quotation.zijin.api.entity.response.QueryActualValueResponse;
 import com.jzg.quotation.zijin.api.service.ZiJinApiRequest;
@@ -37,13 +40,17 @@ public class ZiJinApiRequestImpl implements ZiJinApiRequest {
         HttpHeaders httpHeaders = ziJinApiRequestComponent.getHttpHeaders(parameters);
         // 车型查询
         CarInfoVo carInfoVo = quoteVo.getCarInfoVo();
-//        ModelQueryRequest modelQueryRequest = ZiJinQuotationProcessConstruction.buildModelQueryRequest(parameters, carInfoVo.getVinNo(), carInfoVo.getBrandName());
-//        ModelQueryResponse modelQueryResponse = ziJinApiRequestComponent.modelQuery(modelQueryRequest, httpHeaders);
-//        ModelQueryResponse.VehicleModelInfosDTO vehicleModelInfosDTO = modelQueryResponse.getVehicleModelInfos().get(0);
+        ModelQueryRequest modelQueryRequest = new ModelQueryRequest(parameters, carInfoVo.getVinNo(), carInfoVo.getBrandName());
+        ModelQueryResponse modelQueryResponse = ziJinApiRequestComponent.modelQuery(modelQueryRequest, httpHeaders);
+        // 过滤车型
+        ModelQueryResponse.VehicleModelInfosDTO vehicleModelInfosDTO = CarModelsFilterUtils.to(modelQueryResponse.getVehicleModelInfos(), carInfoVo);
         // 计算车辆价格
-//        QueryActualValueRequest queryActualValueRequest = ZiJinQuotationProcessConstruction.buildQueryActualValueRequest(carInfoVo, vehicleModelInfosDTO, "");
-//        QueryActualValueResponse queryActualValueResponse = ziJinApiRequestComponent.queryActualValue(queryActualValueRequest, httpHeaders);
+        QueryActualValueRequest queryActualValueRequest = new QueryActualValueRequest(carInfoVo, vehicleModelInfosDTO.getPurchasePrice(), "");
+        QueryActualValueResponse queryActualValueResponse = ziJinApiRequestComponent.queryActualValue(queryActualValueRequest, httpHeaders);
         // 报价
+        CalculatePremiumRequest calculatePremiumRequest = new CalculatePremiumRequest(quoteVo, vehicleModelInfosDTO, queryActualValueResponse.getActualValue(), parameters, modelQueryResponse);
+        CalculatePremiumResponse calculatePremiumResponse = ziJinApiRequestComponent.calculatePremium(calculatePremiumRequest, httpHeaders);
+
 
         return null;
     }

+ 109 - 0
tenant/insurance/quotation-zijin/src/main/java/com/jzg/quotation/zijin/api/utils/InsuranceTimeProcessing.java

@@ -0,0 +1,109 @@
+package com.jzg.quotation.zijin.api.utils;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+
+public class InsuranceTimeProcessing {
+
+    public static final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+
+    private InsuranceTimeProcessing() {
+        throw new IllegalStateException("Utility class");
+    }
+
+    public static final String START_HOUR = "00";
+
+    public static final String END_HOUR = "24";
+
+    public static final String MINUTE = "00";
+
+    public static final String START_TIME = "00:00:00";
+
+    public static final String END_TIME = "23:59:59";
+
+    public static UntimelyInsurancePeriod untimely(String startDate) {
+        LocalDate localDate = LocalDate.parse(startDate, formatter);
+        LocalDate nextYears = localDate.plusYears(1);
+        LocalDate expiry = nextYears.minusDays(1);
+        return new UntimelyInsurancePeriod(localDate.toString(), expiry.toString());
+    }
+
+    public static TimelyInsurancePeriod timely(String startDate) {
+        LocalDateTime parse = LocalDateTime.parse(startDate, formatter);
+        String format = parse.plusYears(1).format(formatter);
+        return new TimelyInsurancePeriod(parse.toString(), format);
+    }
+
+    /**
+     * 获取日期 yyyy-MM-dd
+     *
+     * @param dateTime 格式 yyyy-MM-dd HH:mm:ss
+     * @return yyyy-MM-dd
+     */
+    public static String getDate(String dateTime) {
+        return dateTime.substring(0, 10);
+    }
+
+
+    /**
+     * 获取小时
+     *
+     * @param dateTime 格式 yyyy-MM-dd HH:mm:ss
+     * @return HH
+     */
+    public static String getHour(String dateTime) {
+        return dateTime.substring(11, 13);
+    }
+
+    /**
+     * 获取分钟
+     *
+     * @param dateTime 格式 yyyy-MM-dd HH:mm:ss
+     * @return mm
+     */
+    public static String getMinute(String dateTime) {
+        return dateTime.substring(14, 16);
+    }
+
+    @AllArgsConstructor
+    @Data
+    public static class UntimelyInsurancePeriod {
+
+        private String startDate;
+
+        private String endDate;
+
+    }
+
+    @AllArgsConstructor
+    @Data
+    public static class TimelyInsurancePeriod {
+
+        private String startDate;
+
+        private String startHour;
+
+        private String startMinute;
+
+        private String endDate;
+
+        private String endHour;
+
+        private String endMinute;
+
+        public TimelyInsurancePeriod(String startDateTime, String endDateTime) {
+            this.startDate = getDate(startDateTime);
+            this.startHour = getHour(startDateTime);
+            this.startMinute = getMinute(startDateTime);
+            this.endDate = getDate(endDateTime);
+            this.endHour = getHour(startDateTime);
+            this.endMinute = getMinute(endDateTime);
+        }
+    }
+
+
+}