|
|
@@ -981,162 +981,161 @@ public class TKSimpleService {
|
|
|
String fromId = session.getFromid();
|
|
|
|
|
|
// 险种选中标志
|
|
|
- {
|
|
|
- TKFlag flag = preciseInitParam.getFlag();
|
|
|
- if (flag == null) {
|
|
|
- flag = new TKFlag();
|
|
|
- preciseInitParam.setFlag(flag);
|
|
|
- }
|
|
|
- flag.setVipWeekFlag("0");
|
|
|
- flag.setQuoteLinkageFlag("0");
|
|
|
|
|
|
- // 无商业险
|
|
|
- if (CollectionUtils.isEmpty(commonQuoteVo.getKindInfoVo())) {
|
|
|
- flag.setCiFlag("0");
|
|
|
- }
|
|
|
- // 无驾意险,经测试这个值无驾意险的时候请求还是传1,不用改变
|
|
|
- if (CollectionUtils.isEmpty(commonQuoteVo.getAccidentalDrivings())) {
|
|
|
- flag.setIsAccidentInsureFlag("0");
|
|
|
- }
|
|
|
+ TKFlag flag = preciseInitParam.getFlag();
|
|
|
+ if (flag == null) {
|
|
|
+ flag = new TKFlag();
|
|
|
+ preciseInitParam.setFlag(flag);
|
|
|
+ }
|
|
|
+ flag.setVipWeekFlag("0");
|
|
|
+ flag.setQuoteLinkageFlag("0");
|
|
|
+ flag.setInstantInsureBZAllowed("0");
|
|
|
+ flag.setPriceDifferFlag("0");
|
|
|
+
|
|
|
+ // 无商业险
|
|
|
+ if (CollectionUtils.isEmpty(commonQuoteVo.getKindInfoVo())) {
|
|
|
+ flag.setCiFlag("0");
|
|
|
}
|
|
|
+ // 无驾意险,经测试这个值无驾意险的时候请求还是传1,不用改变
|
|
|
+ // if (CollectionUtils.isEmpty(commonQuoteVo.getAccidentalDrivings())) {
|
|
|
+ // flag.setIsAccidentInsureFlag("0");
|
|
|
+ // }
|
|
|
+
|
|
|
|
|
|
// 其他参数
|
|
|
- {
|
|
|
- TKOther other = preciseInitParam.getOther();
|
|
|
- if (other == null) {
|
|
|
- other = new TKOther();
|
|
|
- preciseInitParam.setOther(other);
|
|
|
- }
|
|
|
- other.setFromID(fromId);
|
|
|
- other.setChannelCode("OffWeb");
|
|
|
+
|
|
|
+ TKOther other = preciseInitParam.getOther();
|
|
|
+ if (other == null) {
|
|
|
+ other = new TKOther();
|
|
|
+ preciseInitParam.setOther(other);
|
|
|
}
|
|
|
+ other.setFromID(fromId);
|
|
|
+ other.setChannelCode("OffWeb");
|
|
|
|
|
|
// 时间参数
|
|
|
TKDateInfo date = preciseInitParam.getDate();
|
|
|
- {
|
|
|
- // 同步交强险
|
|
|
- TKBzKindVo bzKindVo = preciseInitParam.getBzKindVo();
|
|
|
- if (bzKindVo == null) {
|
|
|
- bzKindVo = new TKBzKindVo();
|
|
|
- preciseInitParam.setBzKindVo(bzKindVo);
|
|
|
- }
|
|
|
- bzKindVo.setIsSelect("1"); // 选择交纳交强险
|
|
|
-
|
|
|
- // 同步交强险时间信息,从前端参数获取
|
|
|
- RiskInfoVo commonCiRiskInfoVo = commonQuoteVo.getCiRiskInfoVo();
|
|
|
- if (commonCiRiskInfoVo != null) {
|
|
|
- // 交强险的时间
|
|
|
- date.setStartDateBZ(commonCiRiskInfoVo.getStartDate());
|
|
|
- date.setEndDateBZ(commonCiRiskInfoVo.getEndDate());
|
|
|
- }
|
|
|
|
|
|
- // 同步车船税
|
|
|
- TKCarTaxInfo carTaxInfo = preciseInitParam.getCarTaxInfo();
|
|
|
- if (carTaxInfo == null) {
|
|
|
- carTaxInfo = new TKCarTaxInfo();
|
|
|
- preciseInitParam.setCarTaxInfo(carTaxInfo);
|
|
|
- }
|
|
|
+ // 同步交强险
|
|
|
+ TKBzKindVo bzKindVo = preciseInitParam.getBzKindVo();
|
|
|
+ if (bzKindVo == null) {
|
|
|
+ bzKindVo = new TKBzKindVo();
|
|
|
+ preciseInitParam.setBzKindVo(bzKindVo);
|
|
|
+ }
|
|
|
+ bzKindVo.setIsSelect("1"); // 选择交纳交强险
|
|
|
+
|
|
|
+ // 同步交强险时间信息,从前端参数获取
|
|
|
+ RiskInfoVo commonCiRiskInfoVo = commonQuoteVo.getCiRiskInfoVo();
|
|
|
+ if (commonCiRiskInfoVo != null) {
|
|
|
+ // 交强险的时间
|
|
|
+ date.setStartDateBZ(commonCiRiskInfoVo.getStartDate());
|
|
|
+ date.setEndDateBZ(commonCiRiskInfoVo.getEndDate());
|
|
|
+ }
|
|
|
|
|
|
- // 同步车船税信息,从前端参数获取
|
|
|
- VehicleAndVesselTaxVo vehicleAndVesselTax = commonQuoteVo.getVehicleAndVesselTaxVo();
|
|
|
- if (vehicleAndVesselTax != null) {
|
|
|
- // 车船税标志
|
|
|
- String taxRelifFlag = vehicleAndVesselTax.getTaxRelifFlag();
|
|
|
- // 转换为保司的参数
|
|
|
- if (taxRelifFlag.equals("1")) {
|
|
|
- carTaxInfo.setTaxFlag("T");
|
|
|
- } else if (taxRelifFlag.equals("2")) {
|
|
|
- carTaxInfo.setTaxFlag("E");
|
|
|
- } else if (taxRelifFlag.equals("3")) {
|
|
|
- carTaxInfo.setTaxFlag("C");
|
|
|
- } else if (taxRelifFlag.equals("4")) {
|
|
|
- carTaxInfo.setTaxFlag("P");
|
|
|
- }
|
|
|
+ // 同步车船税
|
|
|
+ TKCarTaxInfo carTaxInfo = preciseInitParam.getCarTaxInfo();
|
|
|
+ if (carTaxInfo == null) {
|
|
|
+ carTaxInfo = new TKCarTaxInfo();
|
|
|
+ preciseInitParam.setCarTaxInfo(carTaxInfo);
|
|
|
+ }
|
|
|
+ // 同步车船税信息,从前端参数获取
|
|
|
+ VehicleAndVesselTaxVo vehicleAndVesselTax = commonQuoteVo.getVehicleAndVesselTaxVo();
|
|
|
+ if (vehicleAndVesselTax != null) {
|
|
|
+ // 车船税标志
|
|
|
+ String taxRelifFlag = vehicleAndVesselTax.getTaxRelifFlag();
|
|
|
+ // 转换为保司的参数
|
|
|
+ if (taxRelifFlag.equals("1")) {
|
|
|
+ carTaxInfo.setTaxFlag("T");
|
|
|
+ } else if (taxRelifFlag.equals("2")) {
|
|
|
+ carTaxInfo.setTaxFlag("E");
|
|
|
+ } else if (taxRelifFlag.equals("3")) {
|
|
|
+ carTaxInfo.setTaxFlag("C");
|
|
|
+ } else if (taxRelifFlag.equals("4")) {
|
|
|
+ carTaxInfo.setTaxFlag("P");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
- {
|
|
|
- // 同步商业险时间信息,从前端参数获取
|
|
|
- RiskInfoVo commonBiRiskInfoVo = commonQuoteVo.getBiRiskInfoVo();
|
|
|
- if (commonBiRiskInfoVo != null) {
|
|
|
- date.setStartDateCI(commonBiRiskInfoVo.getStartDate());
|
|
|
- date.setEndDateCI(commonBiRiskInfoVo.getEndDate());
|
|
|
- } else {
|
|
|
- date.setStartDateCI(date.getStartDateCI());
|
|
|
- date.setEndDateCI(date.getEndDateCI());
|
|
|
- }
|
|
|
-
|
|
|
- // 获取保司默认选中的商险信息
|
|
|
- Map<String, TKCiKindsVo> tkCiKindsVoMap = new HashMap<>();
|
|
|
- for (TKCiKindsVo tkCiKindVo : preciseInitParam.getCiKindsVo()) {
|
|
|
- String isSelect = tkCiKindVo.getIsSelect();
|
|
|
- BigDecimal premium = tkCiKindVo.getPremium();
|
|
|
+ // 同步商业险时间信息,从前端参数获取
|
|
|
+ RiskInfoVo commonBiRiskInfoVo = commonQuoteVo.getBiRiskInfoVo();
|
|
|
+ if (commonBiRiskInfoVo != null) {
|
|
|
+ date.setStartDateCI(commonBiRiskInfoVo.getStartDate());
|
|
|
+ date.setEndDateCI(commonBiRiskInfoVo.getEndDate());
|
|
|
+ } else {
|
|
|
+ date.setStartDateCI(date.getStartDateCI());
|
|
|
+ date.setEndDateCI(date.getEndDateCI());
|
|
|
+ }
|
|
|
|
|
|
- if (isSelect != null && isSelect.equals("1") && premium != null && premium.compareTo(BigDecimal.ZERO) == 0) {
|
|
|
- continue;
|
|
|
- }
|
|
|
+ // 获取保司默认选中的商险信息
|
|
|
+ Map<String, TKCiKindsVo> tkCiKindsVoMap = new HashMap<>();
|
|
|
+ for (TKCiKindsVo tkCiKindVo : preciseInitParam.getCiKindsVo()) {
|
|
|
+ String isSelect = tkCiKindVo.getIsSelect();
|
|
|
+ BigDecimal premium = tkCiKindVo.getPremium();
|
|
|
|
|
|
- tkCiKindVo.setIsSelect("0");
|
|
|
- tkCiKindVo.setQuoteAmount(BigDecimal.ZERO);
|
|
|
- tkCiKindVo.setQuoteAmountCN("不投保");
|
|
|
- tkCiKindVo.setPremium(BigDecimal.ZERO);
|
|
|
- tkCiKindVo.setTotalPremium(BigDecimal.ZERO);
|
|
|
- tkCiKindsVoMap.put(tkCiKindVo.getKindCode(), tkCiKindVo);
|
|
|
+ if (isSelect != null && isSelect.equals("1") && premium != null && premium.compareTo(BigDecimal.ZERO) == 0) {
|
|
|
+ continue;
|
|
|
}
|
|
|
|
|
|
- // 根据公司系统选择的险种进行覆盖
|
|
|
- List<KindInfoVo> commonBiKindInfoVos = commonQuoteVo.getKindInfoVo();
|
|
|
- if (CollectionUtils.isNotEmpty(commonBiKindInfoVos)) {
|
|
|
- for (KindInfoVo commonBiKindInfoVo : commonBiKindInfoVos) {
|
|
|
- if (tkCiKindsVoMap.isEmpty() || tkCiKindsVoMap.get(commonBiKindInfoVo.getKindCode()) == null) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- TKCiKindsVo tkCiKindVo = tkCiKindsVoMap.get(commonBiKindInfoVo.getKindCode());
|
|
|
- tkCiKindVo.setIsSelect("1");
|
|
|
- tkCiKindVo.setQuoteAmount(new BigDecimal(commonBiKindInfoVo.getAmount()));
|
|
|
- tkCiKindVo.setQuoteAmountCN(commonBiKindInfoVo.getAmount());
|
|
|
- tkCiKindVo.setUnitAmount(new BigDecimal(commonBiKindInfoVo.getUnitAmount()));
|
|
|
- tkCiKindVo.setUnitAmountCN(commonBiKindInfoVo.getUnitAmount());
|
|
|
- String quantity = commonBiKindInfoVo.getQuantity();
|
|
|
- String serviceTimes = commonBiKindInfoVo.getServiceTimes();
|
|
|
- if (StringUtils.isNotBlank(quantity)) {
|
|
|
- tkCiKindVo.setQuantity(quantity);
|
|
|
- } else if (StringUtils.isNotBlank(serviceTimes)) {
|
|
|
- tkCiKindVo.setQuantity(serviceTimes);
|
|
|
- }
|
|
|
+ tkCiKindVo.setBjSelect("0");
|
|
|
+ tkCiKindVo.setDeductibleAmount(BigDecimal.ZERO);
|
|
|
+ tkCiKindVo.setIsSelect("0");
|
|
|
+ tkCiKindVo.setQuantity(0);
|
|
|
+ tkCiKindVo.setQuoteAmountCN("不投保");
|
|
|
+ // tkCiKindVo.setQuoteAmount(BigDecimal.ZERO); // 不用管
|
|
|
+ // tkCiKindVo.setPremium(BigDecimal.ZERO); // 不用管
|
|
|
+ // tkCiKindVo.setTotalPremium(BigDecimal.ZERO);// 不用管
|
|
|
+ tkCiKindsVoMap.put(tkCiKindVo.getKindCode(), tkCiKindVo);
|
|
|
+ }
|
|
|
|
|
|
- String deductibleRate = commonBiKindInfoVo.getDeductibleRate();
|
|
|
- tkCiKindVo.setDeductibleAmount(null); // todo
|
|
|
+ // 根据公司系统选择的险种进行覆盖
|
|
|
+ List<KindInfoVo> commonBiKindInfoVos = commonQuoteVo.getKindInfoVo();
|
|
|
+ if (CollectionUtils.isNotEmpty(commonBiKindInfoVos)) {
|
|
|
+ for (KindInfoVo commonBiKindInfoVo : commonBiKindInfoVos) {
|
|
|
+ if (tkCiKindsVoMap.isEmpty() || tkCiKindsVoMap.get(commonBiKindInfoVo.getKindCode()) == null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ TKCiKindsVo tkCiKindVo = tkCiKindsVoMap.get(commonBiKindInfoVo.getKindCode());
|
|
|
+ tkCiKindVo.setIsSelect("1");
|
|
|
+ tkCiKindVo.setQuoteAmount(commonBiKindInfoVo.getAmount());
|
|
|
+ tkCiKindVo.setQuoteAmountCN(commonBiKindInfoVo.getAmount());
|
|
|
+ // tkCiKindVo.setUnitAmount(new BigDecimal(commonBiKindInfoVo.getUnitAmount()));
|
|
|
+ // tkCiKindVo.setUnitAmountCN(commonBiKindInfoVo.getUnitAmount());
|
|
|
+
|
|
|
+
|
|
|
+ String quantity = commonBiKindInfoVo.getQuantity();
|
|
|
+ String serviceTimes = commonBiKindInfoVo.getServiceTimes();
|
|
|
+ if (StringUtils.isNotBlank(quantity)) {
|
|
|
+ tkCiKindVo.setQuantity(Integer.parseInt(quantity));
|
|
|
+ } else if (StringUtils.isNotBlank(serviceTimes)) {
|
|
|
+ tkCiKindVo.setQuantity(Integer.parseInt(serviceTimes));
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- {
|
|
|
- // 同步驾意险, 系统有选择驾意险进行匹配覆盖(泰康要求必须有驾意险)
|
|
|
- Map<String, TKCarPlanInfo> carPlanInfoMap = Optional.ofNullable(preciseInitParam.getDriverAccidentVo().getCarPlanInfoList()).orElseGet(Collections::emptyList).stream().collect(Collectors.toMap(TKCarPlanInfo::getPlanCode, Function.identity()));
|
|
|
- TKDriverAccidentVo driverAccidentVo = preciseInitParam.getDriverAccidentVo();// 泰康系统默认的驾意险信息
|
|
|
- List<AccidentalDrivingVo> accidentalDrivings = commonQuoteVo.getAccidentalDrivings(); // 公司系统的驾意险参数
|
|
|
- // 公司系统的驾意险参数为空证明没有选择驾意险
|
|
|
- if (CollectionUtils.isNotEmpty(accidentalDrivings)) {
|
|
|
- for (AccidentalDrivingVo accidentalDriving : accidentalDrivings) {
|
|
|
- if (carPlanInfoMap.isEmpty() || accidentalDriving.getRiskCode() == null) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- TKCarPlanInfo tkCarPlanInfo = carPlanInfoMap.get(accidentalDriving.getProductCode());
|
|
|
- driverAccidentVo.setIsSelect("1");
|
|
|
- driverAccidentVo.setSelectPlanCode(tkCarPlanInfo.getPlanCode());
|
|
|
- driverAccidentVo.setQuoteAmountCN(tkCarPlanInfo.getPlanName());
|
|
|
- driverAccidentVo.setPremium(new BigDecimal(tkCarPlanInfo.getSumPremium()));
|
|
|
+
|
|
|
+ // 同步驾意险, 系统有选择驾意险进行匹配覆盖(泰康要求必须有驾意险)
|
|
|
+ Map<String, TKCarPlanInfo> carPlanInfoMap = Optional.ofNullable(preciseInitParam.getDriverAccidentVo().getCarPlanInfoList()).orElseGet(Collections::emptyList).stream().collect(Collectors.toMap(TKCarPlanInfo::getPlanCode, Function.identity()));
|
|
|
+ TKDriverAccidentVo driverAccidentVo = preciseInitParam.getDriverAccidentVo();// 泰康系统默认的驾意险信息
|
|
|
+ List<AccidentalDrivingVo> accidentalDrivings = commonQuoteVo.getAccidentalDrivings(); // 公司系统的驾意险参数
|
|
|
+ // 公司系统的驾意险参数为空证明没有选择驾意险
|
|
|
+ if (CollectionUtils.isNotEmpty(accidentalDrivings)) {
|
|
|
+ for (AccidentalDrivingVo accidentalDriving : accidentalDrivings) {
|
|
|
+ if (carPlanInfoMap.isEmpty() || accidentalDriving.getRiskCode() == null) {
|
|
|
+ continue;
|
|
|
}
|
|
|
- } else {
|
|
|
- driverAccidentVo.setIsSelect("0");
|
|
|
- driverAccidentVo.setQuantity(0);
|
|
|
- driverAccidentVo.setQuantityCname("不投保");
|
|
|
- driverAccidentVo.setPremium(BigDecimal.ZERO);
|
|
|
- driverAccidentVo.setNonCarStartDate(null);
|
|
|
- driverAccidentVo.setNonCarEndDate(null);
|
|
|
+ TKCarPlanInfo tkCarPlanInfo = carPlanInfoMap.get(accidentalDriving.getProductCode());
|
|
|
+ driverAccidentVo.setIsSelect("1");
|
|
|
+ driverAccidentVo.setSelectPlanCode(tkCarPlanInfo.getPlanCode());
|
|
|
+ driverAccidentVo.setQuoteAmountCN(tkCarPlanInfo.getPlanName());
|
|
|
+ driverAccidentVo.setPremium(new BigDecimal(tkCarPlanInfo.getSumPremium()));
|
|
|
}
|
|
|
+ } else {
|
|
|
+ driverAccidentVo.setIsSelect("0");
|
|
|
+ driverAccidentVo.setQuantity(0);
|
|
|
+ driverAccidentVo.setQuantityCname("不投保");
|
|
|
+ driverAccidentVo.setPremium(BigDecimal.ZERO);
|
|
|
+ driverAccidentVo.setNonCarStartDate(null);
|
|
|
+ driverAccidentVo.setNonCarEndDate(null);
|
|
|
}
|
|
|
|
|
|
// 泰乐途, 默认不投保
|