|
|
@@ -1,235 +0,0 @@
|
|
|
-package com.ydtech.modules.order.entity.bo;
|
|
|
-
|
|
|
-
|
|
|
-import cn.hutool.core.util.IdcardUtil;
|
|
|
-import com.alibaba.fastjson.annotation.JSONField;
|
|
|
-import com.ydtech.constants.enums.InsurKind;
|
|
|
-import com.ydtech.modules.ins.model.vo.CarInfoVo;
|
|
|
-import com.ydtech.modules.ins.model.vo.CustomerInfoVo;
|
|
|
-import com.ydtech.modules.ins.model.vo.KindInfoVo;
|
|
|
-import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
|
|
|
-import lombok.Data;
|
|
|
-import lombok.NoArgsConstructor;
|
|
|
-
|
|
|
-import java.io.Serializable;
|
|
|
-import java.util.List;
|
|
|
-
|
|
|
-@NoArgsConstructor
|
|
|
-@Data
|
|
|
-public class UnderwritingRulesBo implements Serializable {
|
|
|
-
|
|
|
- private static final long serialVersionUID = -9105463448498221619L;
|
|
|
- /**
|
|
|
- * 车牌号
|
|
|
- */
|
|
|
- @JSONField(name = "LicenseNo")
|
|
|
- private String licenseNo;
|
|
|
- /**
|
|
|
- * 新车购置价
|
|
|
- */
|
|
|
- @JSONField(name = "CarPrice")
|
|
|
- private Integer carPrice;
|
|
|
- /**
|
|
|
- * 车龄
|
|
|
- */
|
|
|
- @JSONField(name = "CarAge")
|
|
|
- private Integer carAge;
|
|
|
- /**
|
|
|
- * 投保人女年龄
|
|
|
- */
|
|
|
- @JSONField(name = "ApplicantWage")
|
|
|
- private Integer applicantWage;
|
|
|
- /**
|
|
|
- * 投保人男年龄
|
|
|
- */
|
|
|
- @JSONField(name = "ApplicantMage")
|
|
|
- private Integer applicantMage;
|
|
|
- /**
|
|
|
- * 投保人类型
|
|
|
- */
|
|
|
- @JSONField(name = "ApplicantType")
|
|
|
- private String applicantType;
|
|
|
- /**
|
|
|
- * 投保人证件号前六位
|
|
|
- */
|
|
|
- @JSONField(name = "ApplicantId")
|
|
|
- private String applicantId;
|
|
|
- /**
|
|
|
- * 投保人性别
|
|
|
- */
|
|
|
- @JSONField(name = "ApplicantSex")
|
|
|
- private String applicantSex;
|
|
|
- /**
|
|
|
- * 被保人性别
|
|
|
- */
|
|
|
- @JSONField(name = "InsureSex")
|
|
|
- private String insureSex;
|
|
|
- /**
|
|
|
- * 被保人证件号前六位
|
|
|
- */
|
|
|
- @JSONField(name = "InsureId")
|
|
|
- private String insureId;
|
|
|
- /**
|
|
|
- * 被保人男年龄
|
|
|
- */
|
|
|
- @JSONField(name = "InsureMage")
|
|
|
- private Integer insureMage;
|
|
|
- /**
|
|
|
- * 保人女年龄
|
|
|
- */
|
|
|
- @JSONField(name = "InsureWage")
|
|
|
- private Integer insureWage;
|
|
|
- /**
|
|
|
- * 被保人类型
|
|
|
- */
|
|
|
- @JSONField(name = "InsureType")
|
|
|
- private String insureType;
|
|
|
- /**
|
|
|
- * 车主性别
|
|
|
- */
|
|
|
- @JSONField(name = "OwnerSex")
|
|
|
- private String ownerSex;
|
|
|
- /**
|
|
|
- * 车主类型
|
|
|
- */
|
|
|
- @JSONField(name = "OwnerType")
|
|
|
- private String ownerType;
|
|
|
- /**
|
|
|
- * 车主证件号前六位
|
|
|
- */
|
|
|
- @JSONField(name = "OwnerId")
|
|
|
- private String ownerId;
|
|
|
- /**
|
|
|
- * 车主女年龄
|
|
|
- */
|
|
|
- @JSONField(name = "OwnerWage")
|
|
|
- private Integer ownerWage;
|
|
|
- /**
|
|
|
- * 车主男年龄
|
|
|
- */
|
|
|
- @JSONField(name = "OwnerMage")
|
|
|
- private Integer ownerMage;
|
|
|
- /**
|
|
|
- * 医保外乘客
|
|
|
- */
|
|
|
- @JSONField(name = "MedicalPassenger")
|
|
|
- private Integer medicalPassenger;
|
|
|
- /**
|
|
|
- * 医保外司机
|
|
|
- */
|
|
|
- @JSONField(name = "MedicalDriver")
|
|
|
- private Integer medicalDriver;
|
|
|
- /**
|
|
|
- * 司机
|
|
|
- */
|
|
|
- @JSONField(name = "Driver")
|
|
|
- private Integer driver;
|
|
|
- /**
|
|
|
- * 三者险
|
|
|
- */
|
|
|
- @JSONField(name = "ThInsurance")
|
|
|
- private Integer thInsurance;
|
|
|
- /**
|
|
|
- * 乘客
|
|
|
- */
|
|
|
- @JSONField(name = "Passenger")
|
|
|
- private Integer passenger;
|
|
|
- /**
|
|
|
- * 医保外三者
|
|
|
- */
|
|
|
- @JSONField(name = "MedicalTh")
|
|
|
- private Integer medicalTh;
|
|
|
-
|
|
|
- public UnderwritingRulesBo(BaseQuoteInfoVo baseQuoteInfoVo) {
|
|
|
- // 车辆因子
|
|
|
- CarInfoVo carInfo = baseQuoteInfoVo.getCarInfo();
|
|
|
- this.setTheVehicleFactor(carInfo);
|
|
|
- // 投保人
|
|
|
- CustomerInfoVo policyHolderInfo = baseQuoteInfoVo.getPolicyHolderInfo();
|
|
|
- this.setPolicyHolderInfo(policyHolderInfo);
|
|
|
- // 被保人
|
|
|
- CustomerInfoVo insuredPersonInfo = baseQuoteInfoVo.getInsuredPersonInfo();
|
|
|
- this.setInsuredPersonInfo(insuredPersonInfo);
|
|
|
- // 车主
|
|
|
- CustomerInfoVo ownerInfo = baseQuoteInfoVo.getOwnerInfo();
|
|
|
- this.setOwnerInfo(ownerInfo);
|
|
|
- // 车险
|
|
|
- List<KindInfoVo> kindList = baseQuoteInfoVo.getKindList();
|
|
|
- this.setInsurance(kindList);
|
|
|
- }
|
|
|
-
|
|
|
- private void setTheVehicleFactor(CarInfoVo carInfo) {
|
|
|
- if(carInfo.isNoLicenseFlag()){
|
|
|
- this.licenseNo = carInfo.getLicenseNo().substring(0, 2);
|
|
|
- }
|
|
|
- this.carPrice = Integer.valueOf(carInfo.getPurchasePrice());
|
|
|
-// this.carAge = carAge;
|
|
|
- }
|
|
|
-
|
|
|
- private void setPolicyHolderInfo(CustomerInfoVo policyHolderInfo) {
|
|
|
- String identifyNumber = policyHolderInfo.getIdentifyNumber();
|
|
|
- int ageByIdCard = IdcardUtil.getAgeByIdCard(identifyNumber);
|
|
|
- int genderByIdCard = IdcardUtil.getGenderByIdCard(identifyNumber);
|
|
|
- this.applicantId = identifyNumber.substring(0, 6);
|
|
|
- if (genderByIdCard == 0) {
|
|
|
- this.applicantSex = "女";
|
|
|
- this.applicantWage = ageByIdCard;
|
|
|
- } else {
|
|
|
- this.applicantSex = "男";
|
|
|
- this.applicantMage = ageByIdCard;
|
|
|
- }
|
|
|
-// this.applicantType = applicantType;
|
|
|
- }
|
|
|
-
|
|
|
- private void setInsuredPersonInfo(CustomerInfoVo insuredPersonInfo) {
|
|
|
- String identifyNumber = insuredPersonInfo.getIdentifyNumber();
|
|
|
- int ageByIdCard = IdcardUtil.getAgeByIdCard(identifyNumber);
|
|
|
- int genderByIdCard = IdcardUtil.getGenderByIdCard(identifyNumber);
|
|
|
- this.insureId = identifyNumber.substring(0, 6);
|
|
|
- if (genderByIdCard == 0) {
|
|
|
- this.insureSex = "女";
|
|
|
- this.insureWage = ageByIdCard;
|
|
|
- } else {
|
|
|
- this.insureSex = "男";
|
|
|
- this.insureMage = ageByIdCard;
|
|
|
- }
|
|
|
-// this.insureType = insureType;
|
|
|
- }
|
|
|
-
|
|
|
- private void setOwnerInfo(CustomerInfoVo ownerInfo) {
|
|
|
- String identifyNumber = ownerInfo.getIdentifyNumber();
|
|
|
- int ageByIdCard = IdcardUtil.getAgeByIdCard(identifyNumber);
|
|
|
- int genderByIdCard = IdcardUtil.getGenderByIdCard(identifyNumber);
|
|
|
- this.ownerId = identifyNumber.substring(0, 6);
|
|
|
-
|
|
|
- if (genderByIdCard == 0) {
|
|
|
- this.ownerSex = "女";
|
|
|
- this.ownerWage = ageByIdCard;
|
|
|
- } else {
|
|
|
- this.ownerSex = "男";
|
|
|
- this.ownerMage = ageByIdCard;
|
|
|
- }
|
|
|
-// this.ownerType = ownerType;
|
|
|
- }
|
|
|
-
|
|
|
- private void setInsurance(List<KindInfoVo> kindList) {
|
|
|
-
|
|
|
- for (KindInfoVo kindInfoVo : kindList) {
|
|
|
- if (kindInfoVo.getKindCode().equals(InsurKind.SY_FJ_YBW2.getCode())) {
|
|
|
- this.medicalPassenger = (int) kindInfoVo.getAmount();
|
|
|
- } else if (kindInfoVo.getKindCode().equals(InsurKind.SY_FJ_YBW3.getCode())) {
|
|
|
- this.medicalDriver = (int) kindInfoVo.getAmount();
|
|
|
- } else if (kindInfoVo.getKindCode().equals(InsurKind.D3.getCode())) {
|
|
|
- this.driver = (int) kindInfoVo.getAmount();
|
|
|
- } else if (kindInfoVo.getKindCode().equals(InsurKind.B.getCode())) {
|
|
|
- this.thInsurance = (int) kindInfoVo.getAmount();
|
|
|
- } else if (kindInfoVo.getKindCode().equals(InsurKind.D4.getCode())) {
|
|
|
- this.passenger = (int) kindInfoVo.getAmount();
|
|
|
- } else if (kindInfoVo.getKindCode().equals(InsurKind.SY_FJ_YBW1.getCode())) {
|
|
|
- this.medicalTh = (int) kindInfoVo.getAmount();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-}
|