|
|
@@ -1,27 +1,22 @@
|
|
|
package com.ydtech.modules.fee.dto.vo;
|
|
|
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.baomidou.mybatisplus.annotation.TableField;
|
|
|
import com.ydtech.constants.enums.InsurKind;
|
|
|
import com.ydtech.constants.enums.dict.insurance.VehicleType;
|
|
|
-import com.ydtech.modules.ins.model.vo.*;
|
|
|
+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.InsAreaCompany;
|
|
|
import com.ydtech.modules.order.entity.InsOrders;
|
|
|
import com.ydtech.modules.order.entity.api.dajia.constants.TypeVehicleMapping;
|
|
|
-import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
|
|
|
-import com.ydtech.modules.order.service.InsOrdersService;
|
|
|
import com.ydtech.modules.protocol.entity.po.PtlNewCarJudgeRules;
|
|
|
import com.ydtech.modules.protocols.entity.po.PtlAgreementUndwrtRulesAttr;
|
|
|
import io.swagger.annotations.ApiModelProperty;
|
|
|
import lombok.Data;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
import java.time.LocalDate;
|
|
|
-import java.time.Period;
|
|
|
import java.time.temporal.ChronoUnit;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
-import java.util.Objects;
|
|
|
import java.util.regex.Pattern;
|
|
|
|
|
|
/**
|
|
|
@@ -43,7 +38,8 @@ public class RuleAttrMappingVo {
|
|
|
}
|
|
|
|
|
|
public static List<RuleAttrMappingVo> getRuleAttrMappingVoList(InsAreaCompany insAreaCompany, InsOrders insOrders,
|
|
|
- List<PtlAgreementUndwrtRulesAttr> undwrtRulesAttrList, PtlNewCarJudgeRules carJudgeRule) {
|
|
|
+ List<PtlAgreementUndwrtRulesAttr> undwrtRulesAttrList,
|
|
|
+ PtlNewCarJudgeRules carJudgeRule) {
|
|
|
List<RuleAttrMappingVo> ruleAttrMappingVoList = new ArrayList<>();
|
|
|
CarInfoVo carInfo = insOrders.getCarinfo().toJavaObject(CarInfoVo.class);
|
|
|
//车牌号
|
|
|
@@ -72,21 +68,18 @@ public class RuleAttrMappingVo {
|
|
|
//使用注册日期算出自然月 然后判断是否是新旧车
|
|
|
LocalDate registrationDate = LocalDate.parse(carInfo.getRegisterDate());
|
|
|
LocalDate currentDate = LocalDate.now();
|
|
|
- PtlAgreementUndwrtRulesAttr ptlAgreementUndwrtRulesAttr = undwrtRulesAttrList.stream().filter(x -> x.getAttrCode().equals("NewAndOldCars")).findFirst().get();
|
|
|
+
|
|
|
boolean isNoLicenseFlag = false;
|
|
|
- if(carJudgeRule != null)
|
|
|
- {
|
|
|
- if(carJudgeRule.getUnitTypeCode().equals("天")){
|
|
|
+ if (carJudgeRule != null) {
|
|
|
+ if (carJudgeRule.getUnitTypeCode().equals("天")) {
|
|
|
long days = ChronoUnit.DAYS.between(registrationDate, currentDate);
|
|
|
- if(days < Integer.parseInt(carJudgeRule.getUnitTypeValue()))
|
|
|
- {
|
|
|
+ if (days < Integer.parseInt(carJudgeRule.getUnitTypeValue())) {
|
|
|
isNoLicenseFlag = true;
|
|
|
}
|
|
|
}
|
|
|
- if(carJudgeRule.getUnitTypeCode().equals("月")){
|
|
|
+ if (carJudgeRule.getUnitTypeCode().equals("月")) {
|
|
|
long months = ChronoUnit.MONTHS.between(registrationDate, currentDate);
|
|
|
- if(months < Integer.parseInt(carJudgeRule.getUnitTypeValue()))
|
|
|
- {
|
|
|
+ if (months < Integer.parseInt(carJudgeRule.getUnitTypeValue())) {
|
|
|
isNoLicenseFlag = true;
|
|
|
}
|
|
|
}
|
|
|
@@ -138,7 +131,8 @@ public class RuleAttrMappingVo {
|
|
|
ruleAttrMappingVoList.add(new RuleAttrMappingVo("MotorVehicleDamageInsurance", String.valueOf(kindInfoVo.getAmount())));
|
|
|
//第三者责任险
|
|
|
if (InsurKind.B.getCode().equals(kindInfoVo.getKindCode()))
|
|
|
- ruleAttrMappingVoList.add(new RuleAttrMappingVo("ThirdPartyLiabilityInsurance", String.valueOf(Double.valueOf(kindInfoVo.getAmount()).intValue())));
|
|
|
+ ruleAttrMappingVoList.add(new RuleAttrMappingVo("ThirdPartyLiabilityInsurance",
|
|
|
+ String.valueOf(Double.valueOf(kindInfoVo.getAmount()).intValue())));
|
|
|
//司机责任险
|
|
|
if (InsurKind.D3.getCode().equals(kindInfoVo.getKindCode()))
|
|
|
ruleAttrMappingVoList.add(new RuleAttrMappingVo("DriverLiabilityInsurance", String.valueOf(kindInfoVo.getAmount())));
|
|
|
@@ -251,25 +245,27 @@ public class RuleAttrMappingVo {
|
|
|
ruleAttrMappingVoList.add(new RuleAttrMappingVo("CommercialPayoutRate", String.valueOf(insAreaCompany.getSyLossRation())));
|
|
|
//总赔付率
|
|
|
ruleAttrMappingVoList.add(new RuleAttrMappingVo("TotalPayoutRate", String.valueOf(insAreaCompany.getLossRation())));
|
|
|
- //真假单交
|
|
|
-// ruleAttrMappingVoList.add(new RuleAttrMappingVo("AuthenticAndFakeOrdersExchange", insAreaCompany.getIszdj()));
|
|
|
- //出险次数
|
|
|
-// ruleAttrMappingVoList.add(new RuleAttrMappingVo("NumberOfClaims", insAreaCompany.getAccidentInfoStr()));
|
|
|
- //太平的分区
|
|
|
-// ruleAttrMappingVoList.add(new RuleAttrMappingVo("PeacefulDistrict", quoteRespVo.getExtendInfo()));
|
|
|
//太平绿黄红区
|
|
|
ruleAttrMappingVoList.add(new RuleAttrMappingVo("GreenYellowAndRedAreas", insAreaCompany.getTpColorScore()));
|
|
|
- if(insAreaCompany.getAccidentalDriving() != null) {
|
|
|
+ if (insAreaCompany.getAccidentalDriving() != null) {
|
|
|
//非车名称
|
|
|
ruleAttrMappingVoList.add(new RuleAttrMappingVo("NonCarName", insAreaCompany.getAccidentalDriving().getRideRiskName()));
|
|
|
//非车份数
|
|
|
- ruleAttrMappingVoList.add(new RuleAttrMappingVo("NonCarQuantity", String.valueOf(insAreaCompany.getAccidentalDriving().getQuantity())));
|
|
|
+ ruleAttrMappingVoList.add(new RuleAttrMappingVo("NonCarQuantity",
|
|
|
+ String.valueOf(insAreaCompany.getAccidentalDriving().getQuantity())));
|
|
|
}
|
|
|
//真假单交
|
|
|
- ruleAttrMappingVoList.add(new RuleAttrMappingVo("IsDJQ",insAreaCompany.getIsDjq()));
|
|
|
+ ruleAttrMappingVoList.add(new RuleAttrMappingVo("IsDJQ", insAreaCompany.getIsDjq()));
|
|
|
//紫金鼎然评分
|
|
|
- ruleAttrMappingVoList.add(new RuleAttrMappingVo("UbiPredictedInfoScore",insAreaCompany.getUbiPredictedInfoScore()));
|
|
|
-
|
|
|
+ ruleAttrMappingVoList.add(new RuleAttrMappingVo("UbiPredictedInfoScore", insAreaCompany.getUbiPredictedInfoScore()));
|
|
|
+ //交强续保
|
|
|
+ ruleAttrMappingVoList.add(new RuleAttrMappingVo("JqRenewal", insAreaCompany.getJqRenewal()));
|
|
|
+ //商业续保
|
|
|
+ ruleAttrMappingVoList.add(new RuleAttrMappingVo("SyRenewal", insAreaCompany.getSyRenewal()));
|
|
|
+ // 交强出险次数
|
|
|
+ ruleAttrMappingVoList.add(new RuleAttrMappingVo("JqNumberOfClaims", insAreaCompany.getJqClaims()));
|
|
|
+ // 商业出险次数
|
|
|
+ ruleAttrMappingVoList.add(new RuleAttrMappingVo("SyNumberOfClaims", insAreaCompany.getSyClaims()));
|
|
|
return ruleAttrMappingVoList;
|
|
|
}
|
|
|
}
|