|
|
@@ -3,6 +3,7 @@ package com.jzg.quotation.chengtai.api.entity.request;
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.util.ArrayUtil;
|
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
|
+import com.jzg.commons.entity.orders.po.InsOrdersCarUserInfo;
|
|
|
import com.jzg.commons.entity.quote.vo.*;
|
|
|
import com.jzg.commons.exception.SystemException;
|
|
|
import com.jzg.commons.util.IDCardUtils;
|
|
|
@@ -19,6 +20,7 @@ import lombok.Data;
|
|
|
import lombok.NoArgsConstructor;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
|
|
@@ -70,6 +72,11 @@ public class InsurePremiumRequest extends BaseRequest {
|
|
|
@JsonProperty("handlerCode")
|
|
|
private String handlerCode;
|
|
|
|
|
|
+ @JsonProperty("applicant")
|
|
|
+ private ApplicantDTO applicant;
|
|
|
+ @JsonProperty("insured")
|
|
|
+ private InsuredDTO insured;
|
|
|
+
|
|
|
public InsurePremiumRequest(CarInfoResponse.CarModelListDTO carModelListDTO,
|
|
|
QueryCarActualValueResponse carActualValueResponse,
|
|
|
ChengTaiApiConfigureParameters parameters,
|
|
|
@@ -113,6 +120,164 @@ public class InsurePremiumRequest extends BaseRequest {
|
|
|
}
|
|
|
this.handlerCode = parameters.getUserId();
|
|
|
|
|
|
+ // 获取投保人被保人信息
|
|
|
+ CustomerInfoVo insuredHolder = quoteVo.getInsuredPersonInfo();
|
|
|
+ InsuredDTO insured = new InsuredDTO(insuredHolder);
|
|
|
+ this.insured = insured;
|
|
|
+ CustomerInfoVo policyHolder = quoteVo.getPolicyHolderInfo();
|
|
|
+ ApplicantDTO applicant = new ApplicantDTO(policyHolder);
|
|
|
+ this.applicant = applicant;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Data
|
|
|
+ @NoArgsConstructor
|
|
|
+ public static class InsuredDTO {
|
|
|
+ @JsonProperty("type")
|
|
|
+ private String type;
|
|
|
+ @JsonProperty("name")
|
|
|
+ private String name;
|
|
|
+ @JsonProperty("identifyTypeCode")
|
|
|
+ private String identifyTypeCode;
|
|
|
+ @JsonProperty("identifyNumber")
|
|
|
+ private String identifyNumber;
|
|
|
+ @JsonProperty("identifyValidDate")
|
|
|
+ private String identifyValidDate;
|
|
|
+ @JsonProperty("identifyValidEndDate")
|
|
|
+ private String identifyValidEndDate;
|
|
|
+ @JsonProperty("identifyTypeName")
|
|
|
+ private String identifyTypeName;
|
|
|
+ @JsonProperty("sex")
|
|
|
+ private String sex;
|
|
|
+ @JsonProperty("age")
|
|
|
+ private Integer age;
|
|
|
+ @JsonProperty("birthday")
|
|
|
+ private String birthday;
|
|
|
+ @JsonProperty("longTerm")
|
|
|
+ private String longTerm;
|
|
|
+ @JsonProperty("province")
|
|
|
+ private String province;
|
|
|
+ @JsonProperty("city")
|
|
|
+ private String city;
|
|
|
+ @JsonProperty("district")
|
|
|
+ private String district;
|
|
|
+ @JsonProperty("addr")
|
|
|
+ private String addr;
|
|
|
+ @JsonProperty("mobile")
|
|
|
+ private String mobile;
|
|
|
+ @JsonProperty("relationWithInsured")
|
|
|
+ private String relationWithInsured;
|
|
|
+ @JsonProperty("relationWithCar")
|
|
|
+ private String relationWithCar;
|
|
|
+ @JsonProperty("organizationCode")
|
|
|
+ private String organizationCode;
|
|
|
+ @JsonProperty("tel")
|
|
|
+ private String tel;
|
|
|
+ @JsonProperty("linkerName")
|
|
|
+ private String linkerName;
|
|
|
+ @JsonProperty("unitTypeCode")
|
|
|
+ private String unitTypeCode;
|
|
|
+
|
|
|
+ public InsuredDTO(CustomerInfoVo insuredHolder) {
|
|
|
+ if (insuredHolder.getPersonType().equals(1)) {
|
|
|
+ this.type = "1";
|
|
|
+ this.identifyTypeCode = "01";
|
|
|
+ this.identifyNumber = insuredHolder.getIdentifyNumber();
|
|
|
+ this.sex = insuredHolder.getGender();
|
|
|
+ this.birthday = IDCardUtils.GetBirthday(insuredHolder.getIdentifyNumber());
|
|
|
+ this.relationWithInsured = "0";
|
|
|
+ this.relationWithCar = "1";
|
|
|
+ } else {
|
|
|
+ this.type = "2";
|
|
|
+ this.identifyTypeCode = "4";
|
|
|
+ this.identifyNumber = insuredHolder.getIdentifyNumber();
|
|
|
+ this.organizationCode = insuredHolder.getIdentifyNumber();
|
|
|
+ this.tel = insuredHolder.getTelephone();
|
|
|
+// this.linkerName = insuredHolder.getContact();
|
|
|
+ this.unitTypeCode = "900"; // 单位性质 900:其他
|
|
|
+ }
|
|
|
+ this.name = insuredHolder.getName();
|
|
|
+ this.province = insuredHolder.getProvinceCode();
|
|
|
+ this.city = insuredHolder.getCityCode();
|
|
|
+ this.district = insuredHolder.getCountyCode();
|
|
|
+ this.addr = insuredHolder.getAddr();
|
|
|
+ this.mobile = insuredHolder.getMobile();
|
|
|
+ this.identifyValidDate = insuredHolder.getIdentifyValidDate();
|
|
|
+ this.identifyValidEndDate = insuredHolder.getIdentifyValidEndDate();
|
|
|
+ this.longTerm = "0";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Data
|
|
|
+ @NoArgsConstructor
|
|
|
+ public static class ApplicantDTO {
|
|
|
+ @JsonProperty("type")
|
|
|
+ private String type;
|
|
|
+ @JsonProperty("name")
|
|
|
+ private String name;
|
|
|
+ @JsonProperty("identifyTypeCode")
|
|
|
+ private String identifyTypeCode;
|
|
|
+ @JsonProperty("identifyNumber")
|
|
|
+ private String identifyNumber;
|
|
|
+ @JsonProperty("identifyValidDate")
|
|
|
+ private String identifyValidDate;
|
|
|
+ @JsonProperty("identifyValidEndDate")
|
|
|
+ private String identifyValidEndDate;
|
|
|
+ @JsonProperty("identifyTypeName")
|
|
|
+ private String identifyTypeName;
|
|
|
+ @JsonProperty("sex")
|
|
|
+ private String sex;
|
|
|
+ @JsonProperty("age")
|
|
|
+ private Integer age;
|
|
|
+ @JsonProperty("birthday")
|
|
|
+ private String birthday;
|
|
|
+ @JsonProperty("longTerm")
|
|
|
+ private String longTerm;
|
|
|
+ @JsonProperty("province")
|
|
|
+ private String province;
|
|
|
+ @JsonProperty("city")
|
|
|
+ private String city;
|
|
|
+ @JsonProperty("district")
|
|
|
+ private String district;
|
|
|
+ @JsonProperty("addr")
|
|
|
+ private String addr;
|
|
|
+ @JsonProperty("mobile")
|
|
|
+ private String mobile;
|
|
|
+ @JsonProperty("organizationCode")
|
|
|
+ private String organizationCode;
|
|
|
+ @JsonProperty("tel")
|
|
|
+ private String tel;
|
|
|
+ @JsonProperty("linkerName")
|
|
|
+ private String linkerName;
|
|
|
+ @JsonProperty("unitTypeCode")
|
|
|
+ private String unitTypeCode;
|
|
|
+
|
|
|
+
|
|
|
+ public ApplicantDTO(CustomerInfoVo policyHolder){
|
|
|
+ if(policyHolder.getPersonType().equals(1)){
|
|
|
+ this.type = "1";
|
|
|
+ this.identifyTypeCode = "01";
|
|
|
+ this.identifyNumber = policyHolder.getIdentifyNumber();
|
|
|
+ this.sex = policyHolder.getGender();
|
|
|
+ this.birthday = IDCardUtils.GetBirthday(policyHolder.getIdentifyNumber());
|
|
|
+ }else{
|
|
|
+ this.type = "2";
|
|
|
+ this.identifyTypeCode = "4";
|
|
|
+ this.identifyNumber = policyHolder.getIdentifyNumber();
|
|
|
+ this.organizationCode = policyHolder.getIdentifyNumber();
|
|
|
+ this.tel = policyHolder.getTelephone();
|
|
|
+// this.linkerName = policyHolder.getContact();
|
|
|
+ this.unitTypeCode = "900"; // 单位性质 900:其他
|
|
|
+ }
|
|
|
+ this.name = policyHolder.getName();
|
|
|
+ this.province = policyHolder.getProvinceCode();
|
|
|
+ this.city = policyHolder.getCityCode();
|
|
|
+ this.district = policyHolder.getCountyCode();
|
|
|
+ this.addr = policyHolder.getAddr();
|
|
|
+ this.mobile = policyHolder.getMobile();
|
|
|
+ this.identifyValidDate = policyHolder.getIdentifyValidDate();
|
|
|
+ this.identifyValidEndDate = policyHolder.getIdentifyValidEndDate();
|
|
|
+ this.longTerm = "0";
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@NoArgsConstructor
|