|
|
@@ -7,13 +7,13 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
|
import com.ydtech.constants.enums.InsurKind;
|
|
|
import com.ydtech.constants.enums.InsurKindGuoRen;
|
|
|
-import com.ydtech.modules.ins.model.dto.CarInsDateDto;
|
|
|
+import com.ydtech.constants.enums.InsuranceRisk;
|
|
|
import com.ydtech.modules.ins.model.vo.CustomerInfoVo;
|
|
|
import com.ydtech.modules.ins.model.vo.KindInfoVo;
|
|
|
import com.ydtech.modules.ins.model.vo.RiskInfoVo;
|
|
|
import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
|
|
|
+import com.ydtech.modules.order.entity.vo.guoren.GuoRenSpecialAgreementVo;
|
|
|
import com.ydtech.utils.DateTimeUtil;
|
|
|
-import com.ydtech.utils.InsUtils;
|
|
|
import com.ydtech.utils.StringUtils;
|
|
|
import lombok.Data;
|
|
|
import lombok.NoArgsConstructor;
|
|
|
@@ -23,6 +23,7 @@ import java.time.LocalDateTime;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
/**
|
|
|
@@ -60,7 +61,9 @@ public class PremiumReq {
|
|
|
*/
|
|
|
@JsonIgnore
|
|
|
public static PremiumReq buildQuoteParam(BaseQuoteInfoVo yaQuoteInfoVo, CarPriceResp.DataDTO carPriceResult,
|
|
|
- VinQueryResp.DataDTO vinQ, boolean isNoCar) {
|
|
|
+ VinQueryResp.DataDTO vinQ, boolean isNoCar,
|
|
|
+ List<GuoRenSpecialAgreementVo> specialAgreementVo) {
|
|
|
+
|
|
|
CustomerInfoVo ownerInfo = yaQuoteInfoVo.getOwnerInfo();
|
|
|
|
|
|
List<RiskInfoVo> riskList = yaQuoteInfoVo.getRiskList();
|
|
|
@@ -69,13 +72,17 @@ public class PremiumReq {
|
|
|
PremiumReq quoteReq = new PremiumReq();
|
|
|
|
|
|
riskList.forEach(a -> {
|
|
|
- if (a.getRiskCode().equals("0507")) {
|
|
|
- CiDTO ciDto = buildCiDto(ownerInfo, a, isNoCar);
|
|
|
+ if (a.getRiskCode().equals(InsuranceRisk.TRAFFIC_CODE)) {
|
|
|
+ List<GuoRenSpecialAgreementVo> trafficSpecialAgreement =
|
|
|
+ specialAgreementVo.stream().filter(x -> InsuranceRisk.TRAFFIC_CODE.equals(x.getRiskCode())).collect(Collectors.toList());
|
|
|
+ CiDTO ciDto = buildCiDto(ownerInfo, a, isNoCar, trafficSpecialAgreement);
|
|
|
ciDto.setTrafficTime(a.getStartDate());
|
|
|
quoteReq.setCi(ciDto);
|
|
|
}
|
|
|
- if (a.getRiskCode().equals("0510")) {
|
|
|
- BiDTO biDto = buildBiDto(ownerInfo, a, kindInfoVList, carPriceResult, vinQ, isNoCar);
|
|
|
+ if (a.getRiskCode().equals(InsuranceRisk.BUSINESS_CODE)) {
|
|
|
+ List<GuoRenSpecialAgreementVo> businessSpecialAgreement =
|
|
|
+ specialAgreementVo.stream().filter(x -> InsuranceRisk.BUSINESS_CODE.equals(x.getRiskCode())).collect(Collectors.toList());
|
|
|
+ BiDTO biDto = buildBiDto(ownerInfo, a, kindInfoVList, carPriceResult, vinQ, isNoCar, businessSpecialAgreement);
|
|
|
biDto.setBusinessTime(a.getStartDate());
|
|
|
quoteReq.setBi(biDto);
|
|
|
}
|
|
|
@@ -83,12 +90,12 @@ public class PremiumReq {
|
|
|
|
|
|
//未投保交强
|
|
|
if (null == quoteReq.getCi()) {
|
|
|
- CiDTO ciDto = buildCiDto(ownerInfo, null, false);
|
|
|
+ CiDTO ciDto = buildCiDto(ownerInfo, null, false, new ArrayList<>());
|
|
|
quoteReq.setCi(ciDto);
|
|
|
}
|
|
|
//未投保商业
|
|
|
if (null == quoteReq.getBi()) {
|
|
|
- BiDTO biDto = buildBiDto(ownerInfo, null, null, null, null, false);
|
|
|
+ BiDTO biDto = buildBiDto(ownerInfo, null, null, null, null, false, new ArrayList<>());
|
|
|
quoteReq.setBi(biDto);
|
|
|
}
|
|
|
|
|
|
@@ -108,7 +115,8 @@ public class PremiumReq {
|
|
|
* @date: 2023-08-15
|
|
|
*/
|
|
|
@JsonIgnore
|
|
|
- public static CiDTO buildCiDto(CustomerInfoVo ownerInfo, RiskInfoVo ciRiskInfo, boolean isNoCar) {
|
|
|
+ public static CiDTO buildCiDto(CustomerInfoVo ownerInfo, RiskInfoVo ciRiskInfo, boolean isNoCar,
|
|
|
+ List<GuoRenSpecialAgreementVo> specialAgreementVo) {
|
|
|
CiDTO ciDto = new CiDTO();
|
|
|
ciDto.setPrpTrenewal(new ArrayList<>());
|
|
|
ciDto.setPrpTmainRate(new CiDTO.PrpTmainRateDTO());
|
|
|
@@ -137,16 +145,6 @@ public class PremiumReq {
|
|
|
//构造保险日期
|
|
|
ciDto.setInputRisk("1");
|
|
|
|
|
|
-// CarInsDateDto cidd = InsUtils.buildCiInsDate(ciRiskInfo.getStartDate(), ciRiskInfo.getEndDate());
|
|
|
-// ciPrpTmain.setStartDate(cidd.getStartDate());
|
|
|
-// ciPrpTmain.setEndDate(cidd.getEndDate());
|
|
|
-// //即时起保标识 immeValiFlag 字符串 N 即时起保必传1
|
|
|
-// ciPrpTmain.setImmeValiFlag(cidd.isForthwith() ? "1" : "");
|
|
|
-// //即时终保时间 immeValidEndDate 字符串 N 即时起保必传
|
|
|
-// ciPrpTmain.setImmeValidStartDate(cidd.isForthwith() ? cidd.getStartDate() : "");
|
|
|
-// //即时终保时间 immeValidEndDate 字符串 N 即时起保必传 (YYYY-MM-DD HH:MM:SS)
|
|
|
-// ciPrpTmain.setImmeValidEndDate(cidd.isForthwith() ? cidd.getEndDate() : "");
|
|
|
-
|
|
|
//转保验证码
|
|
|
ciPrpTmain.setAnswer("");
|
|
|
if (isNoCar) {
|
|
|
@@ -186,11 +184,10 @@ public class PremiumReq {
|
|
|
ciDto.setPrpTitemCar(ciPrpTitemCar);
|
|
|
ciDto.setPrptitemkindList(prptitemkindList);
|
|
|
ciDto.setPrpTmain(ciPrpTmain);
|
|
|
-// /**
|
|
|
-// * 特别约定
|
|
|
-// */
|
|
|
-// CiDTO.PrptengageListDTO prptengageList = new CiDTO.PrptengageListDTO();
|
|
|
|
|
|
+ // 特别约定
|
|
|
+ List<PrptengageListDTO> prptengageListDTO = GuoRenSpecialAgreementVo.toPrptengageListDTO(specialAgreementVo);
|
|
|
+ ciDto.setPrptengageList(prptengageListDTO);
|
|
|
|
|
|
return ciDto;
|
|
|
}
|
|
|
@@ -203,7 +200,9 @@ public class PremiumReq {
|
|
|
*/
|
|
|
@JsonIgnore
|
|
|
public static BiDTO buildBiDto(CustomerInfoVo ownerInfo, RiskInfoVo biRiskInfo, List<KindInfoVo> kindInfoVList,
|
|
|
- CarPriceResp.DataDTO carPriceResult, VinQueryResp.DataDTO vinQ, boolean isNoCar) {
|
|
|
+ CarPriceResp.DataDTO carPriceResult, VinQueryResp.DataDTO vinQ, boolean isNoCar,
|
|
|
+ List<GuoRenSpecialAgreementVo> specialAgreementVo) {
|
|
|
+
|
|
|
BiDTO biDto = new BiDTO();
|
|
|
biDto.setPrpTmainRate(new BiDTO.PrpTmainRateDTO());
|
|
|
biDto.setPrpTChargingPostDataList(new ArrayList<>());
|
|
|
@@ -213,7 +212,9 @@ public class PremiumReq {
|
|
|
biDto.setCiInsureDemandPay(new ArrayList<>());
|
|
|
biDto.setCiInsureDemandWarningClaim(new ArrayList<>());
|
|
|
biDto.setPrpTrenewal(new ArrayList<>());
|
|
|
- biDto.setPrptengageList(new ArrayList<>());
|
|
|
+
|
|
|
+ List<PrptengageListDTO> prptengageListDTO = GuoRenSpecialAgreementVo.toPrptengageListDTO(specialAgreementVo);
|
|
|
+ biDto.setPrptengageList(prptengageListDTO);
|
|
|
|
|
|
/**
|
|
|
* 主信息
|
|
|
@@ -227,11 +228,9 @@ public class PremiumReq {
|
|
|
|
|
|
biPrpTitemCar.setTermsSystem("04");
|
|
|
biPrpTitemCar.setClauseType("F54");
|
|
|
-
|
|
|
biPrpTitemCar.setCarOwner(ownerInfo.getName());
|
|
|
biPrpTitemCar.setCarOwnerIdentifyNumber(ownerInfo.getIdentifyNumber());
|
|
|
biPrpTitemCar.setOtherNature("0");
|
|
|
-
|
|
|
biPrpTitemCar.setCiInsureDemandPay(new ArrayList<>());
|
|
|
biPrpTitemCar.setCiInsureDemandWarningClaim(new ArrayList<>());
|
|
|
biPrpTitemCar.setPrpTrenewal("");
|
|
|
@@ -252,11 +251,6 @@ public class PremiumReq {
|
|
|
biPrpTmain.setInputDate(DateUtil.formatDate(new Date()));
|
|
|
biPrpTmain.setSignDate(DateUtil.formatDate(new Date()));
|
|
|
|
|
|
-// CarInsDateDto biCidd = InsUtils.buildBiInsDate(biRiskInfo.getStartDate(), biRiskInfo.getEndDate());
|
|
|
-//
|
|
|
-// biPrpTmain.setStartDate(biCidd.getStartDate());
|
|
|
-// biPrpTmain.setEndDate(biCidd.getEndDate());
|
|
|
-
|
|
|
if (isNoCar) {
|
|
|
// 非车标识 车+非车必传:1
|
|
|
biPrpTmain.setNoCarFlag("1");
|
|
|
@@ -267,7 +261,6 @@ public class PremiumReq {
|
|
|
List<BiDTO.PrptitemkindListDTO> prptitemkindList = buildBiKindList(kindInfoVList, carPriceResult, biRiskInfo, vinQ);
|
|
|
biDto.setPrptitemkindList(prptitemkindList);
|
|
|
|
|
|
-
|
|
|
} else {
|
|
|
biPrpTmain.setStartDate("");
|
|
|
biPrpTmain.setEndDate("");
|
|
|
@@ -310,10 +303,10 @@ public class PremiumReq {
|
|
|
BigDecimal passengerNum = BigDecimal.valueOf(StringUtils.toInt(vinQ.getSeatCountBC()) - 1);
|
|
|
|
|
|
boolean isEnergy = false;
|
|
|
- if("1,2,3,".contains(vinQ.getFuelType()+",")) {//纯电动 燃料电池 插电式混合动力 归属为新能源产品
|
|
|
+ if ("1,2,3,".contains(vinQ.getFuelType() + ",")) {//纯电动 燃料电池 插电式混合动力 归属为新能源产品
|
|
|
isEnergy = true;
|
|
|
}
|
|
|
- ;
|
|
|
+
|
|
|
//起保时间
|
|
|
prptitemkind.setStartDate(biRiskInfo.getStartDate());
|
|
|
prptitemkind.setEndDate(biRiskInfo.getEndDate());
|
|
|
@@ -326,12 +319,12 @@ public class PremiumReq {
|
|
|
|
|
|
//第三者责任险
|
|
|
if (k.getKindCode().equals(InsurKind.B.getCode())) {
|
|
|
- if(isEnergy){
|
|
|
+ if (isEnergy) {
|
|
|
prptitemkind.setKindCode(InsurKindGuoRen.B_N.getCode());
|
|
|
prptitemkind.setKindName(InsurKindGuoRen.B_N.getDesc());
|
|
|
prptitemkind.setItemKindNo(InsurKindGuoRen.B_N.getItemKindNo());
|
|
|
prptitemkind.setFlag(InsurKindGuoRen.B_N.getFlag());
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
prptitemkind.setKindCode(InsurKindGuoRen.B.getCode());
|
|
|
prptitemkind.setKindName(InsurKindGuoRen.B.getDesc());
|
|
|
prptitemkind.setItemKindNo(InsurKindGuoRen.B.getItemKindNo());
|
|
|
@@ -343,12 +336,12 @@ public class PremiumReq {
|
|
|
}
|
|
|
//乘客责任险
|
|
|
if (k.getKindCode().equals(InsurKind.D4.getCode())) {
|
|
|
- if(isEnergy){
|
|
|
+ if (isEnergy) {
|
|
|
prptitemkind.setKindCode(InsurKindGuoRen.D4_N.getCode());
|
|
|
prptitemkind.setKindName(InsurKindGuoRen.D4_N.getDesc());
|
|
|
prptitemkind.setItemKindNo(InsurKindGuoRen.D4_N.getItemKindNo());
|
|
|
prptitemkind.setFlag(InsurKindGuoRen.D4_N.getFlag());
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
prptitemkind.setKindCode(InsurKindGuoRen.D4.getCode());
|
|
|
prptitemkind.setKindName(InsurKindGuoRen.D4.getDesc());
|
|
|
prptitemkind.setItemKindNo(InsurKindGuoRen.D4.getItemKindNo());
|
|
|
@@ -362,12 +355,12 @@ public class PremiumReq {
|
|
|
}
|
|
|
//机动车损失险
|
|
|
if (k.getKindCode().equals(InsurKind.A.getCode())) {
|
|
|
- if(isEnergy){
|
|
|
+ if (isEnergy) {
|
|
|
prptitemkind.setKindCode(InsurKindGuoRen.A_N.getCode());
|
|
|
prptitemkind.setKindName(InsurKindGuoRen.A_N.getDesc());
|
|
|
prptitemkind.setItemKindNo(InsurKindGuoRen.A_N.getItemKindNo());
|
|
|
prptitemkind.setFlag(InsurKindGuoRen.A_N.getFlag());
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
prptitemkind.setKindCode(InsurKindGuoRen.A.getCode());
|
|
|
prptitemkind.setKindName(InsurKindGuoRen.A.getDesc());
|
|
|
prptitemkind.setItemKindNo(InsurKindGuoRen.A.getItemKindNo());
|
|
|
@@ -382,12 +375,12 @@ public class PremiumReq {
|
|
|
}
|
|
|
//司机责任险
|
|
|
if (k.getKindCode().equals(InsurKind.D3.getCode())) {
|
|
|
- if(isEnergy){
|
|
|
+ if (isEnergy) {
|
|
|
prptitemkind.setKindCode(InsurKindGuoRen.D3_N.getCode());
|
|
|
prptitemkind.setKindName(InsurKindGuoRen.D3_N.getDesc());
|
|
|
prptitemkind.setItemKindNo(InsurKindGuoRen.D3_N.getItemKindNo());
|
|
|
prptitemkind.setFlag(InsurKindGuoRen.D3_N.getFlag());
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
prptitemkind.setKindCode(InsurKindGuoRen.D3.getCode());
|
|
|
prptitemkind.setKindName(InsurKindGuoRen.D3.getDesc());
|
|
|
prptitemkind.setItemKindNo(InsurKindGuoRen.D3.getItemKindNo());
|
|
|
@@ -543,6 +536,13 @@ public class PremiumReq {
|
|
|
@JSONField(name = "prpTitemCar")
|
|
|
private PrpTitemCarDTO prpTitemCar;
|
|
|
|
|
|
+ /**
|
|
|
+ * 特别约定
|
|
|
+ */
|
|
|
+ @JsonProperty(value = "prptengageList")
|
|
|
+ @JSONField(name = "prptengageList")
|
|
|
+ private List<PrptengageListDTO> prptengageList;
|
|
|
+
|
|
|
@JsonProperty(value = "prpTmain")
|
|
|
@JSONField(name = "prpTmain")
|
|
|
private PrpTmainDTO prpTmain;
|
|
|
@@ -768,6 +768,54 @@ public class PremiumReq {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @NoArgsConstructor
|
|
|
+ @Data
|
|
|
+ public static class PrptengageListDTO {
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 序号
|
|
|
+ */
|
|
|
+ @JsonProperty(value = "serialNo")
|
|
|
+ @JSONField(name = "serialNo")
|
|
|
+ private String serialNo;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 特约编码
|
|
|
+ */
|
|
|
+ @JsonProperty(value = "clauseCode")
|
|
|
+ @JSONField(name = "clauseCode")
|
|
|
+ private String clauseCode;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 特约名
|
|
|
+ */
|
|
|
+ @JsonProperty(value = "clauses")
|
|
|
+ @JSONField(name = "clauses")
|
|
|
+ private String clauses;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 特约内容
|
|
|
+ */
|
|
|
+ @JsonProperty(value = "clausesContext")
|
|
|
+ @JSONField(name = "clausesContext")
|
|
|
+ private String clausesContext;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 投保单号
|
|
|
+ */
|
|
|
+ @JsonProperty(value = "proposalNo")
|
|
|
+ @JSONField(name = "proposalNo")
|
|
|
+ private String proposalNo;
|
|
|
+
|
|
|
+ public PrptengageListDTO(GuoRenSpecialAgreementVo guoRenSpecialAgreementVo, int i) {
|
|
|
+ this.serialNo = String.valueOf(i);
|
|
|
+ this.clauseCode = guoRenSpecialAgreementVo.getClauseCode();
|
|
|
+ this.clauses = guoRenSpecialAgreementVo.getClauses();
|
|
|
+ this.clausesContext = guoRenSpecialAgreementVo.getClausesContext();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
@NoArgsConstructor
|
|
|
@Data
|
|
|
public static class BiDTO {
|
|
|
@@ -778,7 +826,7 @@ public class PremiumReq {
|
|
|
|
|
|
@JsonProperty(value = "prptengageList")
|
|
|
@JSONField(name = "prptengageList")
|
|
|
- private List<?> prptengageList;
|
|
|
+ private List<PrptengageListDTO> prptengageList;
|
|
|
|
|
|
@JsonProperty(value = "prpTitemCar")
|
|
|
@JSONField(name = "prpTitemCar")
|
|
|
@@ -852,6 +900,7 @@ public class PremiumReq {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@NoArgsConstructor
|
|
|
@Data
|
|
|
public static class PrpTitemCarDTO {
|