|
@@ -238,11 +238,16 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
|
|
|
*/
|
|
*/
|
|
|
private String extractEndDate(PremiumCalculationResponse response) {
|
|
private String extractEndDate(PremiumCalculationResponse response) {
|
|
|
String targetText = response.getHead().getErrorMessage();
|
|
String targetText = response.getHead().getErrorMessage();
|
|
|
- Pattern pattern = Pattern.compile("终保日期 (\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2})");
|
|
|
|
|
|
|
+ Pattern pattern = Pattern.compile("终保日期[:\\s]+(\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}(?::\\d{2})?)");
|
|
|
Matcher matcher = pattern.matcher(targetText);
|
|
Matcher matcher = pattern.matcher(targetText);
|
|
|
if (matcher.find()) {
|
|
if (matcher.find()) {
|
|
|
String dateStr = matcher.group(1);
|
|
String dateStr = matcher.group(1);
|
|
|
- return dateStr + ":00";
|
|
|
|
|
|
|
+ // 已经包含秒(以 :数字数字 结尾),不拼接
|
|
|
|
|
+ if (dateStr.length() == 16) {
|
|
|
|
|
+ return dateStr + ":00";
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return dateStr;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
@@ -273,8 +278,15 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
|
|
|
}
|
|
}
|
|
|
final String formatStartDate = startDate;
|
|
final String formatStartDate = startDate;
|
|
|
final String formatEndDate = endDate;
|
|
final String formatEndDate = endDate;
|
|
|
|
|
+ PremiumCalculationResponse finalPremiumCalculationResponse = premiumCalculationResponse;
|
|
|
quoteInfoVo.getRiskList().forEach(riskInfoVo -> {
|
|
quoteInfoVo.getRiskList().forEach(riskInfoVo -> {
|
|
|
String start, end = "";
|
|
String start, end = "";
|
|
|
|
|
+
|
|
|
|
|
+ if (riskInfoVo.getRiskCode().equals("0507") && finalPremiumCalculationResponse.getHead().getErrorMessage().contains("交强")){
|
|
|
|
|
+ riskInfoVo.setStartDate(formatStartDate);
|
|
|
|
|
+ riskInfoVo.setEndDate(formatEndDate);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 处理商业险的即时起保
|
|
// 处理商业险的即时起保
|
|
|
if (riskInfoVo.getRiskCode().equals("0510")) {
|
|
if (riskInfoVo.getRiskCode().equals("0510")) {
|
|
|
if (!formatStartDate.endsWith("00:00:00")) {
|
|
if (!formatStartDate.endsWith("00:00:00")) {
|
|
@@ -286,9 +298,6 @@ public class ChengTaiOrderApiServiceImpl implements ChengTaiOrderApiService {
|
|
|
riskInfoVo.setStartDate(formatStartDate);
|
|
riskInfoVo.setStartDate(formatStartDate);
|
|
|
riskInfoVo.setEndDate(formatEndDate);
|
|
riskInfoVo.setEndDate(formatEndDate);
|
|
|
}
|
|
}
|
|
|
- } else {
|
|
|
|
|
- riskInfoVo.setStartDate(formatStartDate);
|
|
|
|
|
- riskInfoVo.setEndDate(formatEndDate);
|
|
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
premiumCalculationRequest = new PremiumCalculationRequest(quoteInfoVo, carActualValue, parameters, vehicle, quoteVo, quoteInfoVo.getRiskList(), null);
|
|
premiumCalculationRequest = new PremiumCalculationRequest(quoteInfoVo, carActualValue, parameters, vehicle, quoteVo, quoteInfoVo.getRiskList(), null);
|