|
|
@@ -0,0 +1,555 @@
|
|
|
+package com.jzg.quote.zhongmei.api.entity.request;
|
|
|
+
|
|
|
+import cn.hutool.core.util.ArrayUtil;
|
|
|
+import com.fasterxml.jackson.annotation.JsonProperty;
|
|
|
+import com.jzg.commons.constants.InsuranceRisk;
|
|
|
+import com.jzg.commons.util.AssertionUtils;
|
|
|
+import com.jzg.commons.util.StringUtils;
|
|
|
+import com.jzg.quotation.commons.constant.InsuranceTypeCorrespondence;
|
|
|
+import com.jzg.quote.zhongmei.api.constant.enums.ContractEnum;
|
|
|
+import com.jzg.quotation.commons.entity.vo.quote.AccidentalDrivingVo;
|
|
|
+import com.jzg.quotation.commons.entity.vo.quote.CarInfoVo;
|
|
|
+import com.jzg.quotation.commons.entity.vo.quote.KindInfoVo;
|
|
|
+import com.jzg.quote.zhongmei.api.constant.enums.CarUseTypeEnum;
|
|
|
+import com.jzg.quote.zhongmei.api.constant.enums.MotorMainTypeEnum;
|
|
|
+import com.jzg.quote.zhongmei.api.constant.TimeConstants;
|
|
|
+import com.jzg.quote.zhongmei.api.constant.TransCode;
|
|
|
+import com.jzg.quote.zhongmei.api.constant.enums.MotorSubTypeEnum;
|
|
|
+import com.jzg.quote.zhongmei.api.entity.BaseRequestHead;
|
|
|
+import com.jzg.quote.zhongmei.api.entity.ZmApiConfigureParameters;
|
|
|
+import com.jzg.quote.zhongmei.api.entity.response.ModelsQueryResponse;
|
|
|
+import com.jzg.quote.zhongmei.api.entity.vo.BaseQuoteInfoVo;
|
|
|
+import com.jzg.quote.zhongmei.api.entity.vo.CustomerInfoVo;
|
|
|
+import com.jzg.quote.zhongmei.api.entity.vo.RiskInfoVo;
|
|
|
+import lombok.AllArgsConstructor;
|
|
|
+import lombok.Data;
|
|
|
+import lombok.EqualsAndHashCode;
|
|
|
+import lombok.NoArgsConstructor;
|
|
|
+
|
|
|
+import java.io.Serial;
|
|
|
+import java.io.Serializable;
|
|
|
+import java.time.LocalDate;
|
|
|
+import java.time.LocalDateTime;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.Collections;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @description: todo
|
|
|
+ * @author: shenweidong
|
|
|
+ * @date:2025/2/24 15:28
|
|
|
+ **/
|
|
|
+@EqualsAndHashCode(callSuper = true)
|
|
|
+@NoArgsConstructor
|
|
|
+@Data
|
|
|
+public class QuotedPriceRequest extends BaseRequest {
|
|
|
+ @Serial
|
|
|
+ private static final long serialVersionUID = -3077461186461876856L;
|
|
|
+
|
|
|
+ @JsonProperty("businessData")
|
|
|
+ private BusinessDataDTO businessData;
|
|
|
+
|
|
|
+ public QuotedPriceRequest(BaseQuoteInfoVo baseQuoteInfoVo, ModelsQueryResponse.SimpleStadarCarDTO simpleStadarCarDTO,
|
|
|
+ AccidentalDrivingVo accidentalDrivingVo, ZmApiConfigureParameters zmConfigureParameters) {
|
|
|
+ //调整非车出单流程是后台写死的非车产品,后续可删除
|
|
|
+ /*accidentalDrivingVo.setQuantity(1);
|
|
|
+ accidentalDrivingVo.setRideRiskCode("52");*/
|
|
|
+ this.businessData = new BusinessDataDTO(baseQuoteInfoVo, simpleStadarCarDTO, accidentalDrivingVo, zmConfigureParameters);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void setHead(BaseRequestHead head) {
|
|
|
+ super.setHead(head);
|
|
|
+ super.getHead().setTransCode(TransCode.QUOTE_PRICE);
|
|
|
+ }
|
|
|
+
|
|
|
+ @AllArgsConstructor
|
|
|
+ @NoArgsConstructor
|
|
|
+ @Data
|
|
|
+ public static class BusinessDataDTO implements Serializable {
|
|
|
+
|
|
|
+ private static final long serialVersionUID = 6724538360514954885L;
|
|
|
+
|
|
|
+ // 保单归属地
|
|
|
+ @JsonProperty("policyLocation")
|
|
|
+ private PolicyLocationDTO policyLocation;
|
|
|
+
|
|
|
+ // 车辆信息
|
|
|
+ @JsonProperty("insuredObject")
|
|
|
+ private InsuredObjectDTO insuredObject;
|
|
|
+
|
|
|
+ // 保险信息
|
|
|
+ @JsonProperty("contract")
|
|
|
+ private List<ContractDTO> contract;
|
|
|
+
|
|
|
+ // 客户信息
|
|
|
+ @JsonProperty("customer")
|
|
|
+ private List<CustomerDTO> customer;
|
|
|
+
|
|
|
+ // 驾意险
|
|
|
+ @JsonProperty("accident")
|
|
|
+ private List<AccidentDTO> accident;
|
|
|
+
|
|
|
+ //产品代码
|
|
|
+ @JsonProperty("productPlan")
|
|
|
+ private String productPlan;
|
|
|
+
|
|
|
+ public BusinessDataDTO(BaseQuoteInfoVo baseQuoteInfoVo, ModelsQueryResponse.SimpleStadarCarDTO simpleStadarCarDTO,
|
|
|
+ AccidentalDrivingVo accidentalDrivingVo, ZmApiConfigureParameters zmConfigureParameters) {
|
|
|
+ CarInfoVo carInfo = baseQuoteInfoVo.getCarInfo();
|
|
|
+ List<RiskInfoVo> riskList = baseQuoteInfoVo.getRiskList();
|
|
|
+ List<KindInfoVo> kindList = baseQuoteInfoVo.getKindList();
|
|
|
+ CustomerInfoVo ownerInfo = baseQuoteInfoVo.getOwnerInfo();
|
|
|
+ CustomerInfoVo policyHolderInfo = baseQuoteInfoVo.getPolicyHolderInfo();
|
|
|
+ CustomerInfoVo insuredPersonInfo = baseQuoteInfoVo.getInsuredPersonInfo();
|
|
|
+ int i = Integer.parseInt(carInfo.getSeatCount());
|
|
|
+ //产品编码
|
|
|
+ this.productPlan = InsuranceTypeCorrespondence.getZhongMei_PRODUCT().get(simpleStadarCarDTO.getEnergyTypes());
|
|
|
+ // 保单归属地
|
|
|
+ this.policyLocation = new PolicyLocationDTO(zmConfigureParameters);
|
|
|
+ // 车辆信息
|
|
|
+ this.insuredObject = new InsuredObjectDTO(carInfo, simpleStadarCarDTO);
|
|
|
+ // 保险信息
|
|
|
+ this.contract = new ContractDTO().getContract(riskList, kindList, i - 1, carInfo.getEnergyTypeCode());
|
|
|
+ // 客户信息
|
|
|
+ this.customer = new CustomerDTO().getCustomers(ownerInfo, policyHolderInfo, insuredPersonInfo);
|
|
|
+ // 驾意险
|
|
|
+ if (accidentalDrivingVo != null) {
|
|
|
+ this.accident = Collections.singletonList(new AccidentDTO(accidentalDrivingVo.getRideRiskCode(),
|
|
|
+ accidentalDrivingVo.getQuantity(),"",""));
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @AllArgsConstructor
|
|
|
+ @NoArgsConstructor
|
|
|
+ @Data
|
|
|
+ public static class AccidentDTO implements Serializable {
|
|
|
+ private static final long serialVersionUID = -8335832893055836433L;
|
|
|
+ // 方案代码
|
|
|
+ @JsonProperty("rideRiskCode")
|
|
|
+ private String rideRiskCode;
|
|
|
+ // 投保份数
|
|
|
+ @JsonProperty("quantity")
|
|
|
+ private int quantity;
|
|
|
+ // 标的房屋结构 家财险必传房屋结构
|
|
|
+ //百万医疗险必传是否有社保(0-无社保 1-有社保)
|
|
|
+ @JsonProperty("attribute3")
|
|
|
+ private String attribute3;
|
|
|
+ // 标的详细地址 家财险和组合险必传
|
|
|
+ @JsonProperty("attribute4")
|
|
|
+ private String attribute4;
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @AllArgsConstructor
|
|
|
+ @NoArgsConstructor
|
|
|
+ @Data
|
|
|
+ public static class PolicyLocationDTO implements Serializable {
|
|
|
+ private static final long serialVersionUID = -4868884351793208747L;
|
|
|
+ @JsonProperty("province")
|
|
|
+ private String province;
|
|
|
+ @JsonProperty("city")
|
|
|
+ private String city;
|
|
|
+ @JsonProperty("district")
|
|
|
+ private String district;
|
|
|
+ //2023-08-29 lig 添加 解决统计字段无法传入问题
|
|
|
+ @JsonProperty("accountUser")
|
|
|
+ private String accountUser;
|
|
|
+
|
|
|
+ public PolicyLocationDTO(ZmApiConfigureParameters zmConfigureParameters) {
|
|
|
+ this.province = zmConfigureParameters.getProvince();
|
|
|
+ this.city = zmConfigureParameters.getCity();
|
|
|
+ this.district = zmConfigureParameters.getDistrict();
|
|
|
+ this.accountUser = zmConfigureParameters.getAccountUser();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @NoArgsConstructor
|
|
|
+ @Data
|
|
|
+ public static class InsuredObjectDTO implements Serializable {
|
|
|
+
|
|
|
+ private static final long serialVersionUID = -7398031787228945507L;
|
|
|
+ @JsonProperty("policyCar")
|
|
|
+ private PolicyCarDTO policyCar;
|
|
|
+
|
|
|
+ @JsonProperty("simpleStadarCar")
|
|
|
+ private ModelsQueryResponse.SimpleStadarCarDTO simpleStadarCar;
|
|
|
+
|
|
|
+ public InsuredObjectDTO(CarInfoVo carInfo, ModelsQueryResponse.SimpleStadarCarDTO simpleStadarCarDTO) {
|
|
|
+ this.policyCar = new PolicyCarDTO(carInfo);
|
|
|
+ this.simpleStadarCar = simpleStadarCarDTO;
|
|
|
+ }
|
|
|
+
|
|
|
+ @NoArgsConstructor
|
|
|
+ @Data
|
|
|
+ public static class PolicyCarDTO implements Serializable {
|
|
|
+ private static final long serialVersionUID = -6802193456312684016L;
|
|
|
+ // 发动机号
|
|
|
+ @JsonProperty("engine")
|
|
|
+ private String engine;
|
|
|
+ // 新车标志
|
|
|
+ @JsonProperty("newCarSign")
|
|
|
+ private Boolean newCarSign;
|
|
|
+ // 车牌号
|
|
|
+ @JsonProperty("plateNo")
|
|
|
+ private String plateNo;
|
|
|
+ // VIN/车架号
|
|
|
+ @JsonProperty("VIN")
|
|
|
+ private String vin;
|
|
|
+ /**
|
|
|
+ * 过户标志
|
|
|
+ * 0 未过户
|
|
|
+ * 01 过户
|
|
|
+ */
|
|
|
+ @JsonProperty("chgOwnerFlag")
|
|
|
+ private String chgOwnerFlag;
|
|
|
+ // 行驶证注册登记日期(初登日期)
|
|
|
+ @JsonProperty("registerDate")
|
|
|
+ private String registerDate;
|
|
|
+ // 转移登记日期(过户日期)
|
|
|
+ @JsonProperty("transferDate")
|
|
|
+ private String transferDate;
|
|
|
+ // 外地车标志
|
|
|
+ @JsonProperty("ecdemicVehicleFlag")
|
|
|
+ private Boolean ecdemicVehicleFlag;
|
|
|
+ // 发证日期(行驶证)
|
|
|
+ @JsonProperty("issueDate")
|
|
|
+ private String issueDate;
|
|
|
+ /**
|
|
|
+ * 号牌底色
|
|
|
+ * 01 蓝
|
|
|
+ * 02 黄
|
|
|
+ * 03 黑
|
|
|
+ * 04 白
|
|
|
+ * 05 绿
|
|
|
+ * 06 白蓝
|
|
|
+ */
|
|
|
+ @JsonProperty("plateColorCode")
|
|
|
+ private String plateColorCode;
|
|
|
+ /**
|
|
|
+ * 验车状态
|
|
|
+ * 2 其他免验车
|
|
|
+ * 3 已验车
|
|
|
+ * 4 补验车
|
|
|
+ */
|
|
|
+ @JsonProperty("carCheckStatus")
|
|
|
+ private String carCheckStatus;
|
|
|
+ /**
|
|
|
+ * 车辆用途
|
|
|
+ * 01 家庭自用
|
|
|
+ * 02 非营业党政机关,事业团体
|
|
|
+ * 03 非营业企业
|
|
|
+ */
|
|
|
+ @JsonProperty("carUseType")
|
|
|
+ private String carUseType;
|
|
|
+ /**
|
|
|
+ * 使用性质
|
|
|
+ * 01 营业
|
|
|
+ * 02 非营业
|
|
|
+ */
|
|
|
+ @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.isEmpty(carInfoVo.getLicenseNo())) {
|
|
|
+ this.newCarSign = true;
|
|
|
+ } else {
|
|
|
+ this.newCarSign = false;
|
|
|
+ }
|
|
|
+ this.plateNo = carInfoVo.getLicenseNo();
|
|
|
+ this.vin = carInfoVo.getVinNo();
|
|
|
+ if (carInfoVo.isTransfer()) {
|
|
|
+ this.chgOwnerFlag = "01";
|
|
|
+ this.transferDate = carInfoVo.getTransferDate() + " " + TimeConstants.START_TIME;
|
|
|
+ } else {
|
|
|
+ this.chgOwnerFlag = "0";
|
|
|
+ }
|
|
|
+ this.ecdemicVehicleFlag = false;
|
|
|
+ this.registerDate = carInfoVo.getRegisterDate() + " " + TimeConstants.START_TIME;
|
|
|
+ this.issueDate = carInfoVo.getIssueDate() + " " + TimeConstants.START_TIME;
|
|
|
+ this.plateColorCode = "01";
|
|
|
+ this.carCheckStatus = null;
|
|
|
+
|
|
|
+ MotorMainTypeEnum motorMainTypeEnum = MotorMainTypeEnum.valueOf("MM_" + carInfoVo.getCarKindCode());
|
|
|
+ AssertionUtils.isEmpty(motorMainTypeEnum, "车辆种类输入错误");
|
|
|
+ this.motorMainType = motorMainTypeEnum.getCode();
|
|
|
+
|
|
|
+ MotorSubTypeEnum motorSubTypeEnum = MotorSubTypeEnum.valueOf(carInfoVo.getCarTypeCode());
|
|
|
+ AssertionUtils.isEmpty(motorMainTypeEnum, "车辆类型输入错误");
|
|
|
+ this.motorSubType = motorSubTypeEnum.getCode();
|
|
|
+
|
|
|
+ CarUseTypeEnum carUseTypeEnum = CarUseTypeEnum.valueOf("C_" + carInfoVo.getVehicleUseCode());
|
|
|
+ AssertionUtils.isEmpty(carUseTypeEnum, "车辆用途输入错误");
|
|
|
+ this.carUseType = carUseTypeEnum.getCode();
|
|
|
+
|
|
|
+ this.motorUsageTypeCode = InsuranceTypeCorrespondence.getZM_CAR_MotorUsageTypeCode().get(carInfoVo.getCarNatureCode());
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @NoArgsConstructor
|
|
|
+ @Data
|
|
|
+ public static class ContractDTO implements Serializable {
|
|
|
+
|
|
|
+ private static final long serialVersionUID = -4583284662908149711L;
|
|
|
+ @JsonProperty("contractMain")
|
|
|
+ private ContractMainDTO contractMain;
|
|
|
+
|
|
|
+ @JsonProperty("coverage")
|
|
|
+ private List<CoverageDTO> coverage;
|
|
|
+
|
|
|
+ public List<ContractDTO> getContract(List<RiskInfoVo> riskInfoVos, List<KindInfoVo> kindInfoVos, Integer quantity,
|
|
|
+ String energyTypes) {
|
|
|
+ List<ContractDTO> contractDTOS = new ArrayList<>();
|
|
|
+ for (RiskInfoVo riskInfoVo : riskInfoVos) {
|
|
|
+ ContractDTO contractDTO = new ContractDTO();
|
|
|
+ contractDTO.contractMain = new ContractMainDTO(riskInfoVo, energyTypes);
|
|
|
+ if (InsuranceRisk.TRAFFIC.getCode().equals(riskInfoVo.getRiskCode())) {
|
|
|
+ contractDTO.coverage = Collections.singletonList(new CoverageDTO().fetchTraffic());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (InsuranceRisk.BUSINESS.getCode().equals(riskInfoVo.getRiskCode())) {
|
|
|
+ contractDTO.coverage = new CoverageDTO().getBusiness(kindInfoVos, quantity);
|
|
|
+ }
|
|
|
+ contractDTOS.add(contractDTO);
|
|
|
+ }
|
|
|
+ return contractDTOS;
|
|
|
+ }
|
|
|
+
|
|
|
+ @NoArgsConstructor
|
|
|
+ @Data
|
|
|
+ public static class ContractMainDTO implements Serializable {
|
|
|
+ private static final long serialVersionUID = 1931505160644020807L;
|
|
|
+ // 失效日期(终保日期)
|
|
|
+ @JsonProperty("expiryDate")
|
|
|
+ private String expiryDate;
|
|
|
+ /**
|
|
|
+ * 险种代码
|
|
|
+ * 0330 机动车交通事故责任强制保险
|
|
|
+ * 0361 机动车商业保险
|
|
|
+ */
|
|
|
+ @JsonProperty("riskCode")
|
|
|
+ private String riskCode;
|
|
|
+ // 生效日期(起保日期)
|
|
|
+ @JsonProperty("validDate")
|
|
|
+ private String validDate;
|
|
|
+ // 即时生效标志 1:是 0:否
|
|
|
+ @JsonProperty("reinsuranceFlag")
|
|
|
+ private String reinsuranceFlag;
|
|
|
+
|
|
|
+ public ContractMainDTO(RiskInfoVo riskInfoVo, String energyTypes) {
|
|
|
+ this.riskCode = InsuranceTypeCorrespondence.getZhongMei_RISK().get(energyTypes).get(riskInfoVo.getRiskCode());
|
|
|
+ String startDate = riskInfoVo.getStartDate();
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
+ LocalDate localDate = LocalDate.parse(startDate, formatter);
|
|
|
+ LocalDate nextYears = localDate.plusYears(1);
|
|
|
+ if (startDate.contains(TimeConstants.START_TIME)) {
|
|
|
+ LocalDate expiry = nextYears.minusDays(1);
|
|
|
+ this.validDate = riskInfoVo.getStartDate();
|
|
|
+ this.expiryDate = expiry + " " + TimeConstants.END_TIME;
|
|
|
+ this.reinsuranceFlag = "0";
|
|
|
+ } else {
|
|
|
+ // 及时
|
|
|
+ LocalDateTime localDateTime = LocalDateTime.parse(startDate, formatter);
|
|
|
+ LocalDateTime expiryDateTime = localDateTime.plusYears(1);
|
|
|
+ this.validDate = startDate;
|
|
|
+ this.expiryDate = expiryDateTime.format(formatter);
|
|
|
+ this.reinsuranceFlag = "1";
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @NoArgsConstructor
|
|
|
+ @Data
|
|
|
+ public static class CoverageDTO implements Serializable {
|
|
|
+ private static final long serialVersionUID = -7935060830529629416L;
|
|
|
+
|
|
|
+ // 单位限额
|
|
|
+ @JsonProperty("unitAmount")
|
|
|
+ private Integer unitAmount;
|
|
|
+ // 数量
|
|
|
+ @JsonProperty("quantity")
|
|
|
+ private Integer quantity;
|
|
|
+ // 保额
|
|
|
+ @JsonProperty("amount")
|
|
|
+ private Integer amount;
|
|
|
+ // 险别代码
|
|
|
+ @JsonProperty("kindCode")
|
|
|
+ private String kindCode;
|
|
|
+ // 险别名称
|
|
|
+ @JsonProperty("kindName")
|
|
|
+ private String kindName;
|
|
|
+ // 绝对免赔率
|
|
|
+ @JsonProperty("deductibleRate")
|
|
|
+ private String deductibleRate;
|
|
|
+ // 绝对免赔额
|
|
|
+ @JsonProperty("deductible")
|
|
|
+ private String deductible;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 商业险
|
|
|
+ *
|
|
|
+ * @param kindInfoVos 商业险
|
|
|
+ * @param quantity 乘客数
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<CoverageDTO> getBusiness(List<KindInfoVo> kindInfoVos, int quantity) {
|
|
|
+ List<CoverageDTO> list = new ArrayList<>();
|
|
|
+ for (KindInfoVo kindInfoVo : kindInfoVos) {
|
|
|
+ CoverageDTO coverageDTO = new CoverageDTO();
|
|
|
+ String code = kindInfoVo.getKindCode();
|
|
|
+ //后续根据调整映射修改
|
|
|
+ int i = ArrayUtil.indexOf(InsuranceTypeCorrespondence.getJinZhangGuiType(), code);
|
|
|
+ String s = InsuranceTypeCorrespondence.getZmConnectInsuranceType()[i];
|
|
|
+ ContractEnum contractEnum = Enum.valueOf(ContractEnum.class, "C_" + s);
|
|
|
+ coverageDTO.kindName = contractEnum.getKindName();
|
|
|
+ coverageDTO.kindCode = contractEnum.getKindCode();
|
|
|
+ coverageDTO.amount = Integer.parseInt(kindInfoVo.getAmount());
|
|
|
+ coverageDTO.unitAmount = Integer.parseInt(kindInfoVo.getUnitAmount());
|
|
|
+ // 车损
|
|
|
+ if ("A".equals(code)) {//中煤特殊处理
|
|
|
+ //车损险保额,第三方若有实际价值判断逻辑,可按照第三方规则送保额,中煤会校验保额是否在新车购置价浮动范围期间内;
|
|
|
+ //若第三方无实际价值判断逻辑,可保额直接送0,中煤会按照中煤实际价值逻辑自动覆盖;
|
|
|
+ coverageDTO.amount = 0;
|
|
|
+ }
|
|
|
+ // 司机
|
|
|
+ if (ArrayUtil.indexOf(InsuranceTypeCorrespondence.getDriver(), code) >= 0) {
|
|
|
+ coverageDTO.quantity = 1;
|
|
|
+ coverageDTO.unitAmount = Integer.parseInt(kindInfoVo.getAmount());
|
|
|
+ }
|
|
|
+ // 乘客
|
|
|
+ if (ArrayUtil.indexOf(InsuranceTypeCorrespondence.getPassenger(), code) >= 0) {
|
|
|
+ coverageDTO.quantity = quantity;
|
|
|
+ coverageDTO.amount = Integer.parseInt(kindInfoVo.getUnitAmount()) * quantity;
|
|
|
+ }
|
|
|
+ // 绝对免赔
|
|
|
+ if (ArrayUtil.indexOf(InsuranceTypeCorrespondence.getAbsoluteDeductible(), code) >= 0) {
|
|
|
+ coverageDTO.deductible = "-" + kindInfoVo.getDeductibleRate();
|
|
|
+ }
|
|
|
+ // 增值服务
|
|
|
+ if (ArrayUtil.indexOf(InsuranceTypeCorrespondence.getSpecialContractClause(), code) >= 0) {
|
|
|
+ coverageDTO.quantity = Integer.parseInt(kindInfoVo.getServiceTimes());
|
|
|
+ }
|
|
|
+ list.add(coverageDTO);
|
|
|
+
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 交强险
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public CoverageDTO fetchTraffic() {
|
|
|
+ this.amount = 200000;
|
|
|
+ this.kindName = ContractEnum.C_BZ.getKindName();
|
|
|
+ this.kindCode = ContractEnum.C_BZ.getKindCode();
|
|
|
+ return this;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @AllArgsConstructor
|
|
|
+ @NoArgsConstructor
|
|
|
+ @Data
|
|
|
+ public static class CustomerDTO implements Serializable {
|
|
|
+ private static final long serialVersionUID = -2139900793333349385L;
|
|
|
+ // 名称
|
|
|
+ @JsonProperty("name")
|
|
|
+ private String name;
|
|
|
+ /**
|
|
|
+ * 证件类型
|
|
|
+ * 01 身份证
|
|
|
+ * 3 组织机构代码
|
|
|
+ * 4 统一社会信用代码
|
|
|
+ */
|
|
|
+ @JsonProperty("identifyType")
|
|
|
+ private String identifyType;
|
|
|
+ // 证件号码
|
|
|
+ @JsonProperty("identifyNumber")
|
|
|
+ private String identifyNumber;
|
|
|
+ // 地址
|
|
|
+ @JsonProperty("addr")
|
|
|
+ private String addr;
|
|
|
+ // 移动电话
|
|
|
+ @JsonProperty("mobile")
|
|
|
+ private String mobile;
|
|
|
+ // 电子保单接收邮箱
|
|
|
+ @JsonProperty("emailPolicy")
|
|
|
+ private String emailPolicy;
|
|
|
+ // 客户类型 1-个人,2-法人
|
|
|
+ @JsonProperty("type")
|
|
|
+ private String type;
|
|
|
+ // 客户角色
|
|
|
+ @JsonProperty("role")
|
|
|
+ private String role;
|
|
|
+ /**
|
|
|
+ * 发票种类
|
|
|
+ * 026 电子发票
|
|
|
+ * 007 普通发票
|
|
|
+ * 004 专用发票
|
|
|
+ */
|
|
|
+ @JsonProperty("invocieType")
|
|
|
+ private String invocieType;
|
|
|
+ // 投保人是否从事以下行业:银行、证券、期货、保险、律师、会计师、房地产、拍卖
|
|
|
+ @JsonProperty("jobRisk")
|
|
|
+ private String jobRisk;
|
|
|
+ // 证件有效起期
|
|
|
+ @JsonProperty("identifyValidDate")
|
|
|
+ private String identifyValidDate;
|
|
|
+ // identifyValidEndDate
|
|
|
+ @JsonProperty("identifyValidEndDate")
|
|
|
+ private String identifyValidEndDate;
|
|
|
+
|
|
|
+ public CustomerDTO(CustomerInfoVo customerInfoVo, String role) {
|
|
|
+ this.name = customerInfoVo.getName();
|
|
|
+ this.identifyType = "01";
|
|
|
+ this.identifyNumber = customerInfoVo.getIdentifyNumber();
|
|
|
+ this.addr = customerInfoVo.getAddr();
|
|
|
+ this.mobile = customerInfoVo.getMobile();
|
|
|
+ this.emailPolicy = customerInfoVo.getEmail();
|
|
|
+ this.type = "1";
|
|
|
+ this.role = role;
|
|
|
+ this.invocieType = "026";
|
|
|
+ this.jobRisk = "1";
|
|
|
+ this.identifyValidDate = customerInfoVo.getIdentifyValidDate() + " " + TimeConstants.START_TIME;
|
|
|
+ this.identifyValidEndDate = customerInfoVo.getIdentifyValidEndDate() + " " + TimeConstants.END_TIME;
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<CustomerDTO> getCustomers(CustomerInfoVo ownerInfo, CustomerInfoVo policyHolderInfo, CustomerInfoVo insuredPersonInfo) {
|
|
|
+ return Arrays.asList(new CustomerDTO(ownerInfo, "3"), new CustomerDTO(policyHolderInfo, "1"),
|
|
|
+ new CustomerDTO(insuredPersonInfo, "2"));
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+}
|