|
|
@@ -1,13 +1,30 @@
|
|
|
package com.ydtech.modules.order.entity.api.zm.request;
|
|
|
|
|
|
+import cn.hutool.core.util.ArrayUtil;
|
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
|
+import com.ydtech.modules.ins.vo.CarInfoVo;
|
|
|
import com.ydtech.modules.ins.vo.CustomerInfoVo;
|
|
|
+import com.ydtech.modules.ins.vo.KindInfoVo;
|
|
|
+import com.ydtech.modules.ins.vo.RiskInfoVo;
|
|
|
import com.ydtech.modules.order.entity.api.zm.BaseRequest;
|
|
|
+import com.ydtech.modules.order.entity.api.zm.constants.InsuranceTypeCorrespondence;
|
|
|
+import com.ydtech.modules.order.entity.api.zm.constants.TimeConstants;
|
|
|
+import com.ydtech.modules.order.entity.api.zm.constants.enums.ContractEnum;
|
|
|
+import com.ydtech.modules.order.entity.api.zm.response.ModelsQueryResponse;
|
|
|
+import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
|
|
|
+import com.ydtech.utils.StringUtils;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import lombok.Data;
|
|
|
import lombok.EqualsAndHashCode;
|
|
|
import lombok.NoArgsConstructor;
|
|
|
|
|
|
+import java.time.LocalDate;
|
|
|
+import java.time.LocalDateTime;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
+import java.time.temporal.ChronoUnit;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.Collections;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
@@ -26,6 +43,11 @@ public class QuotedPriceRequest extends BaseRequest {
|
|
|
@JsonProperty("businessData")
|
|
|
private BusinessDataDTO businessData;
|
|
|
|
|
|
+ public QuotedPriceRequest(BaseQuoteInfoVo baseQuoteInfoVo, ModelsQueryResponse.SimpleStadarCarDTO simpleStadarCarDTO) {
|
|
|
+ this.businessData = new BusinessDataDTO(baseQuoteInfoVo, simpleStadarCarDTO);
|
|
|
+ }
|
|
|
+
|
|
|
+ @AllArgsConstructor
|
|
|
@NoArgsConstructor
|
|
|
@Data
|
|
|
public static class BusinessDataDTO {
|
|
|
@@ -34,8 +56,11 @@ public class QuotedPriceRequest extends BaseRequest {
|
|
|
@JsonProperty("policyLocation")
|
|
|
private PolicyLocationDTO policyLocation;
|
|
|
|
|
|
+ // 车辆信息
|
|
|
@JsonProperty("insuredObject")
|
|
|
private InsuredObjectDTO insuredObject;
|
|
|
+
|
|
|
+ // 保险信息
|
|
|
@JsonProperty("contract")
|
|
|
private List<ContractDTO> contract;
|
|
|
|
|
|
@@ -43,9 +68,30 @@ public class QuotedPriceRequest extends BaseRequest {
|
|
|
@JsonProperty("customer")
|
|
|
private List<CustomerDTO> customer;
|
|
|
|
|
|
+ // 驾意险
|
|
|
@JsonProperty("accident")
|
|
|
private List<Object> accident;
|
|
|
|
|
|
+ public BusinessDataDTO(BaseQuoteInfoVo baseQuoteInfoVo, ModelsQueryResponse.SimpleStadarCarDTO simpleStadarCarDTO) {
|
|
|
+ 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.policyLocation = new PolicyLocationDTO("", "", "");
|
|
|
+ // 车辆信息
|
|
|
+ this.insuredObject = new InsuredObjectDTO(carInfo, simpleStadarCarDTO);
|
|
|
+ // 保险信息
|
|
|
+ this.contract = new ContractDTO().getContract(riskList, kindList, i - 1);
|
|
|
+ // 客户信息
|
|
|
+ this.customer = new CustomerDTO().getCustomers(ownerInfo, policyHolderInfo, insuredPersonInfo);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@AllArgsConstructor
|
|
|
@NoArgsConstructor
|
|
|
@Data
|
|
|
@@ -66,181 +112,333 @@ public class QuotedPriceRequest extends BaseRequest {
|
|
|
private PolicyCarDTO policyCar;
|
|
|
|
|
|
@JsonProperty("simpleStadarCar")
|
|
|
- private SimpleStadarCarDTO 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 {
|
|
|
+ // 发动机号
|
|
|
@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("carCheckStatus")
|
|
|
+ private String carUseType;
|
|
|
+ /**
|
|
|
+ * 使用性质
|
|
|
+ * 01 营业
|
|
|
+ * 02 非营业
|
|
|
+ */
|
|
|
+ @JsonProperty("carCheckStatus")
|
|
|
+ private String motorUsageTypeCode;
|
|
|
|
|
|
+ public PolicyCarDTO(CarInfoVo carInfoVo) {
|
|
|
+ this.engine = carInfoVo.getEngineNo();
|
|
|
+ if (StringUtils.isNullOrEmpty(carInfoVo.getLicenseNo())) {
|
|
|
+ this.newCarSign = true;
|
|
|
+ }
|
|
|
+ this.plateNo = carInfoVo.getLicenseNo();
|
|
|
+ this.vin = carInfoVo.getFrameNo();
|
|
|
+ if (carInfoVo.isTransferFlag()) {
|
|
|
+ this.chgOwnerFlag = "01";
|
|
|
+ this.transferDate = carInfoVo.getTransferDate() + " " + TimeConstants.START_TIME;
|
|
|
+ } else {
|
|
|
+ this.chgOwnerFlag = "0";
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
+ this.registerDate = carInfoVo.getRegisterDate();
|
|
|
+ this.issueDate = carInfoVo.getIssueDate();
|
|
|
+ this.plateColorCode = "01";
|
|
|
+ this.carCheckStatus = "3";
|
|
|
+ this.carUseType = "01";
|
|
|
+ this.motorUsageTypeCode = "02";
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- @NoArgsConstructor
|
|
|
- @Data
|
|
|
- public static class SimpleStadarCarDTO {
|
|
|
- @JsonProperty("localModelCode")
|
|
|
- private String localModelCode;
|
|
|
- @JsonProperty("modelCode")
|
|
|
- private String modelCode;
|
|
|
- @JsonProperty("approvedLoad")
|
|
|
- private String approvedLoad;
|
|
|
- @JsonProperty("approvedPassengersCapacity")
|
|
|
- private Integer approvedPassengersCapacity;
|
|
|
- @JsonProperty("displacement")
|
|
|
- private Double displacement;
|
|
|
- @JsonProperty("purchasePrice")
|
|
|
- private Integer purchasePrice;
|
|
|
- @JsonProperty("energyTypes")
|
|
|
- private String energyTypes;
|
|
|
- @JsonProperty("brand")
|
|
|
- private String brand;
|
|
|
- @JsonProperty("brandCode")
|
|
|
- private String brandCode;
|
|
|
- @JsonProperty("series")
|
|
|
- private String series;
|
|
|
- @JsonProperty("seriesCode")
|
|
|
- private String seriesCode;
|
|
|
- @JsonProperty("power")
|
|
|
- private Integer power;
|
|
|
- @JsonProperty("unladenMass")
|
|
|
- private Double unladenMass;
|
|
|
- @JsonProperty("grossMass")
|
|
|
- private Integer grossMass;
|
|
|
- @JsonProperty("tractionMass")
|
|
|
- private Integer tractionMass;
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @NoArgsConstructor
|
|
|
+ @Data
|
|
|
+ public static class ContractDTO {
|
|
|
+
|
|
|
+ @JsonProperty("contractMain")
|
|
|
+ private ContractMainDTO contractMain;
|
|
|
+
|
|
|
+ @JsonProperty("coverage")
|
|
|
+ private List<CoverageDTO> coverage;
|
|
|
+
|
|
|
+ public List<ContractDTO> getContract(List<RiskInfoVo> riskInfoVos, List<KindInfoVo> kindInfoVos, Integer quantity) {
|
|
|
+ List<ContractDTO> contractDTOS = new ArrayList<>();
|
|
|
+ for (RiskInfoVo riskInfoVo : riskInfoVos) {
|
|
|
+ ContractDTO contractDTO = new ContractDTO();
|
|
|
+ contractDTO.contractMain = new ContractMainDTO(riskInfoVo);
|
|
|
+ if (InsuranceTypeCorrespondence.TRAFFIC.equals(riskInfoVo.getRiskCode())) {
|
|
|
+ contractDTO.coverage = Collections.singletonList(new CoverageDTO().getTraffic());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (InsuranceTypeCorrespondence.BUSINESS.equals(riskInfoVo.getRiskCode())) {
|
|
|
+ contractDTO.coverage = new CoverageDTO().getBusiness(kindInfoVos, quantity);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
+ return contractDTOS;
|
|
|
}
|
|
|
|
|
|
@NoArgsConstructor
|
|
|
@Data
|
|
|
- public static class ContractDTO {
|
|
|
- @JsonProperty("contractMain")
|
|
|
- private ContractMainDTO contractMain;
|
|
|
- @JsonProperty("coverage")
|
|
|
- private List<CoverageDTO> coverage;
|
|
|
+ public static class ContractMainDTO {
|
|
|
+ // 失效日期(终保日期)
|
|
|
+ @JsonProperty("expiryDate")
|
|
|
+ private String expiryDate;
|
|
|
+ /**
|
|
|
+ * 险种代码
|
|
|
+ * 0330 机动车交通事故责任强制保险
|
|
|
+ * 0361 机动车商业保险
|
|
|
+ */
|
|
|
+ @JsonProperty("riskCode")
|
|
|
+ private String riskCode;
|
|
|
+ // 生效日期(起保日期)
|
|
|
+ @JsonProperty("validDate")
|
|
|
+ private String validDate;
|
|
|
+ // 即时生效标志 1:是 0:否
|
|
|
+ @JsonProperty("reinsuranceFlag")
|
|
|
+ private String reinsuranceFlag;
|
|
|
|
|
|
- @NoArgsConstructor
|
|
|
- @Data
|
|
|
- public static class ContractMainDTO {
|
|
|
- @JsonProperty("expiryDate")
|
|
|
- private String expiryDate;
|
|
|
- @JsonProperty("riskCode")
|
|
|
- private String riskCode;
|
|
|
- @JsonProperty("validDate")
|
|
|
- private String validDate;
|
|
|
- }
|
|
|
+ public ContractMainDTO(RiskInfoVo riskInfoVo) {
|
|
|
+ this.riskCode = InsuranceTypeCorrespondence.RISK.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.plus(1, ChronoUnit.YEARS);
|
|
|
+ if (startDate.indexOf(TimeConstants.START_TIME) > 0) {
|
|
|
+ LocalDate expiryDate = nextYears.minus(1, ChronoUnit.DAYS);
|
|
|
+ this.validDate = riskInfoVo.getStartDate();
|
|
|
+ this.expiryDate = expiryDate + " " + TimeConstants.END_TIME;
|
|
|
+ this.reinsuranceFlag = "0";
|
|
|
+ } else {
|
|
|
+ // 及时
|
|
|
+ LocalDateTime localDateTime = LocalDateTime.parse(startDate, formatter);
|
|
|
+ LocalDateTime expiryDateTime = localDateTime.plus(1, ChronoUnit.YEARS);
|
|
|
+ this.validDate = startDate;
|
|
|
+ this.expiryDate = expiryDateTime.toString();
|
|
|
+ this.reinsuranceFlag = "1";
|
|
|
+ }
|
|
|
|
|
|
- @NoArgsConstructor
|
|
|
- @Data
|
|
|
- public static class CoverageDTO {
|
|
|
- @JsonProperty("unitAmount")
|
|
|
- private Integer unitAmount;
|
|
|
- @JsonProperty("quantity")
|
|
|
- private Integer quantity;
|
|
|
- @JsonProperty("amount")
|
|
|
- private Integer amount;
|
|
|
- @JsonProperty("relatedInd")
|
|
|
- private String relatedInd;
|
|
|
- @JsonProperty("kindCode")
|
|
|
- private String kindCode;
|
|
|
- @JsonProperty("kindName")
|
|
|
- private String kindName;
|
|
|
- @JsonProperty("deductibleRate")
|
|
|
- private String deductibleRate;
|
|
|
- @JsonProperty("deductible")
|
|
|
- private String deductible;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @AllArgsConstructor
|
|
|
@NoArgsConstructor
|
|
|
@Data
|
|
|
- public static class CustomerDTO {
|
|
|
- // 名称
|
|
|
- @JsonProperty("name")
|
|
|
- private String name;
|
|
|
+ public static class CoverageDTO {
|
|
|
+ // 单位限额
|
|
|
+ @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;
|
|
|
+
|
|
|
/**
|
|
|
- * 证件类型
|
|
|
- * 01 身份证
|
|
|
- * 3 组织机构代码
|
|
|
- * 4 统一社会信用代码
|
|
|
+ * 商业险
|
|
|
+ *
|
|
|
+ * @param kindInfoVos 商业险
|
|
|
+ * @param quantity 乘客数
|
|
|
+ * @return
|
|
|
*/
|
|
|
- @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;
|
|
|
+ public List<CoverageDTO> getBusiness(List<KindInfoVo> kindInfoVos, Integer quantity) {
|
|
|
+ List<CoverageDTO> list = new ArrayList<>();
|
|
|
+ for (KindInfoVo kindInfoVo : kindInfoVos) {
|
|
|
+ CoverageDTO coverageDTO = new CoverageDTO();
|
|
|
+ String code = kindInfoVo.getKindCode();
|
|
|
+ int i = ArrayUtil.indexOf(InsuranceTypeCorrespondence.JINZHANGGUI_TYPE, code);
|
|
|
+ String s = InsuranceTypeCorrespondence.CONNECT_INSURANCE_TYPE[i];
|
|
|
+ ContractEnum contractEnum = Enum.valueOf(ContractEnum.class, "C_" + s);
|
|
|
+ coverageDTO.kindName = contractEnum.getKindName();
|
|
|
+ coverageDTO.kindCode = contractEnum.getKindName();
|
|
|
+ coverageDTO.amount = (int) kindInfoVo.getAmount();
|
|
|
+ coverageDTO.unitAmount = (int) kindInfoVo.getUnitAmount();
|
|
|
+ // 司机
|
|
|
+ if (ArrayUtil.indexOf(InsuranceTypeCorrespondence.DRIVER, code) > 0) {
|
|
|
+ coverageDTO.quantity = 1;
|
|
|
+ coverageDTO.amount = (int) kindInfoVo.getUnitAmount();
|
|
|
+ }
|
|
|
+
|
|
|
+ if (ArrayUtil.indexOf(InsuranceTypeCorrespondence.PASSENGER, code) > 0) {
|
|
|
+ coverageDTO.quantity = quantity;
|
|
|
+ coverageDTO.amount = (int) kindInfoVo.getUnitAmount() * quantity;
|
|
|
+ }
|
|
|
+ // 绝对免赔
|
|
|
+ if (ArrayUtil.indexOf(InsuranceTypeCorrespondence.ABSOLUTE_DEDUCTIBLE, code) > 0) {
|
|
|
+ coverageDTO.deductible = "-" + kindInfoVo.getDeductibleRate();
|
|
|
+ }
|
|
|
+ list.add(coverageDTO);
|
|
|
+
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
- * 发票种类
|
|
|
- * 026 电子发票
|
|
|
- * 007 普通发票
|
|
|
- * 004 专用发票
|
|
|
+ * 交强险
|
|
|
+ *
|
|
|
+ * @return
|
|
|
*/
|
|
|
- @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();
|
|
|
- this.identifyValidEndDate = customerInfoVo.getIdentifyValidEndDate();
|
|
|
+ public CoverageDTO getTraffic() {
|
|
|
+ this.amount = 200000;
|
|
|
+ this.kindName = ContractEnum.C_BZ.getKindCode();
|
|
|
+ this.kindCode = ContractEnum.C_BZ.getKindName();
|
|
|
+ return this;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @AllArgsConstructor
|
|
|
+ @NoArgsConstructor
|
|
|
+ @Data
|
|
|
+ public static class CustomerDTO {
|
|
|
+ // 名称
|
|
|
+ @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();
|
|
|
+ this.identifyValidEndDate = customerInfoVo.getIdentifyValidEndDate();
|
|
|
+ }
|
|
|
+
|
|
|
+ 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"));
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+
|