|
|
@@ -2,6 +2,7 @@ package com.ydtech.modules.order.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
+import com.ydtech.constants.enums.InsuranceRisk;
|
|
|
import com.ydtech.constants.enums.dict.InsOrderStatusEnum;
|
|
|
import com.ydtech.core.page.HttpResult;
|
|
|
import com.ydtech.exception.SystemException;
|
|
|
@@ -143,7 +144,13 @@ public class BoHaiOrderApiServiceImpl implements BoHaiOrderApiService {
|
|
|
QuotationResponse response = boHaiRequestApiComponent.quotation(quotationRequest, parameters.getSysSourceCode());
|
|
|
//商业险重复投保 重复投保保单信息 :保单号:314042303060007485车牌号:晋A881SR车架号:LMGAC1381K1535834发动机号:F699317保险公司代码:YAIC签单日期:20230414起保日期:202305030000
|
|
|
// 终保日期:202405030000险别:机动车第三者责任保险,附加医保外用药责任险(机动车第三者责任保险)
|
|
|
- response = getQuotationResponse(response, quotationRequest, parameters.getSysSourceCode());
|
|
|
+
|
|
|
+ List<RiskInfoVo> collect =
|
|
|
+ quoteInfoVo.getRiskList().stream().filter(x -> InsuranceRisk.BUSINESS.getCode().equals(x.getRiskCode())).collect(Collectors.toList());
|
|
|
+
|
|
|
+ if (!collect.isEmpty()) {
|
|
|
+ response = getQuotationResponse(response, quotationRequest, parameters.getSysSourceCode());
|
|
|
+ }
|
|
|
|
|
|
//response = getQuotationResponseNew(quoteInfoVo, quoteVo, parameters, orderNo, carInfo, currentValue, response);
|
|
|
//add by 2024-04-03 会发生重复投保 算费微服务返回报错信息_保信返回错误信息:
|
|
|
@@ -169,8 +176,9 @@ public class BoHaiOrderApiServiceImpl implements BoHaiOrderApiService {
|
|
|
quotationRequest.setTrafficPolicy(trafficPolicy);
|
|
|
response = boHaiRequestApiComponent.quotation(quotationRequest, parameters.getSysSourceCode());
|
|
|
// 判断是否商业险重复投保
|
|
|
- response = getQuotationResponse(response, quotationRequest, parameters.getSysSourceCode());
|
|
|
-
|
|
|
+ if (!collect.isEmpty()) {
|
|
|
+ response = getQuotationResponse(response, quotationRequest, parameters.getSysSourceCode());
|
|
|
+ }
|
|
|
if (!ResponseCode.R_Z00001.getCode().equals(response.getResponseCode())) {
|
|
|
throw new SystemException(response.getResponseMsg());
|
|
|
}
|
|
|
@@ -232,7 +240,7 @@ public class BoHaiOrderApiServiceImpl implements BoHaiOrderApiService {
|
|
|
if (errorMsg.contains("重复投保")) {
|
|
|
//重新给商业险的开始和结束时间赋值赋值重新填报
|
|
|
String businessPolicyEndDateStr = StringSubStringUtils.subjectStringContentByBusinessPolicyEndDate(errorMsg, "终保日期:");
|
|
|
- if (!"".equals(businessPolicyEndDateStr) && !"".equals(businessPolicyEndDateStr)) {
|
|
|
+ if (!StringUtils.isEmpty(businessPolicyEndDateStr) && !StringUtils.isEmpty((businessPolicyEndDateStr))) {
|
|
|
//结束投保日期为开始日期,结束日期为结束投保日期后一年的日期
|
|
|
businessPolicyEndDateStr = businessPolicyEndDateStr + "00";
|
|
|
String beginDateStr = DateUtil_N.strAllToDateToStr(businessPolicyEndDateStr, "yyyyMMddHHmmss", "yyyy-MM-dd HH:mm:ss");
|
|
|
@@ -343,9 +351,8 @@ public class BoHaiOrderApiServiceImpl implements BoHaiOrderApiService {
|
|
|
List<UnderwritingResponse.DataDTO.UnAutoPolicyDTO> propertyPolicies = data.getPropertyPolicies();
|
|
|
policyDTOS.addAll(propertyPolicies);
|
|
|
|
|
|
- List<DrivingInsuranceDto> collect = policyDTOS.stream()
|
|
|
- .map(UnderwritingResponse.DataDTO.UnAutoPolicyDTO::toDrivingInsuranceDto)
|
|
|
- .collect(Collectors.toList());
|
|
|
+ List<DrivingInsuranceDto> collect =
|
|
|
+ policyDTOS.stream().map(UnderwritingResponse.DataDTO.UnAutoPolicyDTO::toDrivingInsuranceDto).collect(Collectors.toList());
|
|
|
|
|
|
JSONArray objects = JSON.parseArray(JSON.toJSONString(collect));
|
|
|
insAreaCompany.setCrossInsurance(objects);
|
|
|
@@ -542,11 +549,9 @@ public class BoHaiOrderApiServiceImpl implements BoHaiOrderApiService {
|
|
|
return response.getData().getDocumentList();
|
|
|
}
|
|
|
|
|
|
- public HttpResult<QuoteRespVo> getQuoteRespVo(QuotationResponse response,
|
|
|
- BaseQuoteInfoVo yaQuoteInfoVo,
|
|
|
+ public HttpResult<QuoteRespVo> getQuoteRespVo(QuotationResponse response, BaseQuoteInfoVo yaQuoteInfoVo,
|
|
|
VehicleTypeQueryResponse.DataDTO.VehicleModelsDTO vehicleModelsDTO,
|
|
|
- PtlAgreementAttribution ptlAgreementAttribution,
|
|
|
- String orderNo,
|
|
|
+ PtlAgreementAttribution ptlAgreementAttribution, String orderNo,
|
|
|
List<BoHaiQuoteAccidentVo> accidentalDrivingVo) {
|
|
|
|
|
|
double sumPayTax = 0;
|
|
|
@@ -626,10 +631,8 @@ public class BoHaiOrderApiServiceImpl implements BoHaiOrderApiService {
|
|
|
return responseOrder(response, quoteRespVo, ptlAgreementAttribution, orderNo, accidentalDrivingVo);
|
|
|
}
|
|
|
|
|
|
- public HttpResult<QuoteRespVo> responseOrder(QuotationResponse response,
|
|
|
- QuoteRespVo quoteRespVo,
|
|
|
- PtlAgreementAttribution ptlAgreementAttribution,
|
|
|
- String orderId,
|
|
|
+ public HttpResult<QuoteRespVo> responseOrder(QuotationResponse response, QuoteRespVo quoteRespVo,
|
|
|
+ PtlAgreementAttribution ptlAgreementAttribution, String orderId,
|
|
|
List<BoHaiQuoteAccidentVo> accidentalDrivingVo) {
|
|
|
// 保存订单信息
|
|
|
InsAreaCompany insAreaCompany = new InsAreaCompany(quoteRespVo, ptlAgreementAttribution);
|
|
|
@@ -644,11 +647,8 @@ public class BoHaiOrderApiServiceImpl implements BoHaiOrderApiService {
|
|
|
insAreaCompany.setAccidentInfo(JSON.parseArray(JSON.toJSONString(accidentalDrivingVo)));
|
|
|
|
|
|
// 车船税
|
|
|
- TaxArrears taxArrears = Optional.ofNullable(response.getData().getTrafficPolicy())
|
|
|
- .map(QuotationResponse.DataDTO.TrafficPolicyDTO::getVehicleTax)
|
|
|
- .map(x -> new TaxArrears("往年欠税", Double.parseDouble(x.getOverdueTaxAmount()),
|
|
|
- Double.parseDouble(x.getLateFee())))
|
|
|
- .orElse(new TaxArrears());
|
|
|
+ TaxArrears taxArrears =
|
|
|
+ Optional.ofNullable(response.getData().getTrafficPolicy()).map(QuotationResponse.DataDTO.TrafficPolicyDTO::getVehicleTax).map(x -> new TaxArrears("往年欠税", Double.parseDouble(x.getOverdueTaxAmount()), Double.parseDouble(x.getLateFee()))).orElse(new TaxArrears());
|
|
|
|
|
|
List<TaxArrears> taxArrearsList = Collections.singletonList(taxArrears);
|
|
|
insAreaCompany.setTaxArrears(JSON.parseArray(JSON.toJSONString(taxArrearsList)));
|