|
|
@@ -39,11 +39,6 @@ public class HuaTaiRepeatInsuranceComponents {
|
|
|
public boolean compulsoryInsurance(HuaTaiQuotedPriceRequest huaTaiQuotedPriceRequest,
|
|
|
HuaTaiQuotedPriceResponse quotedPriceResponse,
|
|
|
List<String> warnMessageList) {
|
|
|
- HuaTaiBaseResponseHead head = quotedPriceResponse.getHead();
|
|
|
- if ("0".equals(head.getReturnCode())) {
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
String returnMessage = quotedPriceResponse.getHead().getReturnMessage();
|
|
|
InsuranceLog.infoLog(InsuranceEnum.ZMBX.getPinyin(), "\n\t---------> {}\n\t---------> {}", "华泰财险重复投保处理",
|
|
|
returnMessage);
|
|
|
@@ -54,15 +49,31 @@ public class HuaTaiRepeatInsuranceComponents {
|
|
|
|
|
|
HashMap<String, HuaTaiQuotedPriceRequest.ContractDto> map = getStringContractDtoHashMap(contractDTOList);
|
|
|
HuaTaiQuotedPriceRequest.ContractDto contractDto = map.get(HuaTaiRiskCode.R_1002.getCode());
|
|
|
+
|
|
|
+ if (ObjectUtils.isEmpty(contractDto)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
HuaTaiQuotedPriceRequest.ContractDto.ContractMainDto contractMain = contractDto.getContractMain();
|
|
|
- List<HuaTaiQuotedPriceRequest.ContractDto.CoverageDto> coverage = contractDto.getCoverage();
|
|
|
+
|
|
|
+ // 响应内容
|
|
|
+ HashMap<String, HuaTaiQuotedPriceResponse.ContractDto> mapResponse =
|
|
|
+ HuaTaiReinsuranceComponents.getStringPlatFormMessageDtoHashMap(quotedPriceResponse);
|
|
|
+ HuaTaiQuotedPriceResponse.ContractDto contractResponse = mapResponse.get(HuaTaiRiskCode.R_1251.getCode());
|
|
|
+ HuaTaiQuotedPriceResponse.ContractDto.PlatFormMessageDto platFormMessage =
|
|
|
+ contractResponse.getPlatFormMessage();
|
|
|
+ String reInsureMsg = platFormMessage.getReInsureMsg();
|
|
|
+
|
|
|
+ if(!StringUtils.isEmpty(reInsureMsg)){
|
|
|
+ returnMessage = reInsureMsg;
|
|
|
+ }
|
|
|
|
|
|
// 交强险重复投保
|
|
|
if (StringUtils.isNotEmpty(returnMessage) && returnMessage.contains("重复投保")) {
|
|
|
String jqEndDate = GuorenDuplicateInsuranceComponent.getEndDate(returnMessage,
|
|
|
GuorenDuplicateInsuranceComponent.THE_FIRST_REGEX);
|
|
|
warnMessageList.add(returnMessage);
|
|
|
- getPeriodDate(jqEndDate, contractMain, coverage);
|
|
|
+ getPeriodDate(jqEndDate, contractMain);
|
|
|
return true;
|
|
|
}
|
|
|
return false;
|
|
|
@@ -90,12 +101,11 @@ public class HuaTaiRepeatInsuranceComponents {
|
|
|
huaTaiQuotedPriceRequest.getBusinessData().getContract();
|
|
|
HashMap<String, HuaTaiQuotedPriceRequest.ContractDto> map = getStringContractDtoHashMap(contractDTOList);
|
|
|
HuaTaiQuotedPriceRequest.ContractDto contractDto = map.get(HuaTaiRiskCode.R_1251.getCode());
|
|
|
+
|
|
|
if (ObjectUtils.isEmpty(contractDto)) {
|
|
|
return false;
|
|
|
}
|
|
|
-
|
|
|
HuaTaiQuotedPriceRequest.ContractDto.ContractMainDto contractMain = contractDto.getContractMain();
|
|
|
- List<HuaTaiQuotedPriceRequest.ContractDto.CoverageDto> coverage = contractDto.getCoverage();
|
|
|
|
|
|
// 响应内容
|
|
|
HashMap<String, HuaTaiQuotedPriceResponse.ContractDto> mapResponse =
|
|
|
@@ -110,9 +120,10 @@ public class HuaTaiRepeatInsuranceComponents {
|
|
|
String syEndDate = GuorenDuplicateInsuranceComponent.getEndDate(reInsureMsg,
|
|
|
GuorenDuplicateInsuranceComponent.THE_FIRST_REGEX);
|
|
|
warnMessageList.add(reInsureMsg);
|
|
|
- getPeriodDate(syEndDate, contractMain, coverage);
|
|
|
+ getPeriodDate(syEndDate, contractMain);
|
|
|
return true;
|
|
|
}
|
|
|
+
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
@@ -127,9 +138,7 @@ public class HuaTaiRepeatInsuranceComponents {
|
|
|
|
|
|
|
|
|
private void getPeriodDate(String startDate,
|
|
|
- HuaTaiQuotedPriceRequest.ContractDto.ContractMainDto contractMainDto,
|
|
|
- List<HuaTaiQuotedPriceRequest.ContractDto.CoverageDto> coverage
|
|
|
- ) {
|
|
|
+ HuaTaiQuotedPriceRequest.ContractDto.ContractMainDto contractMainDto) {
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
LocalDate localDate = LocalDate.parse(startDate, formatter);
|
|
|
LocalDate nextYears = localDate.plusYears(1);
|
|
|
@@ -144,10 +153,5 @@ public class HuaTaiRepeatInsuranceComponents {
|
|
|
contractMainDto.setValidDate(startDate);
|
|
|
contractMainDto.setExpiryDate(expiryDateTime.format(formatter));
|
|
|
}
|
|
|
-
|
|
|
- coverage.forEach(x-> {
|
|
|
- x.setValidDate(contractMainDto.getValidDate());
|
|
|
- x.setExpiryDate(contractMainDto.getExpiryDate());
|
|
|
- });
|
|
|
}
|
|
|
}
|